Contact

Contact map utilities.

Contact map utilities for protein folding simulations.

This module provides the ContactMap class that:

  • Initializes contact operators between MainBeads of a Protein’s MainChain,

  • Ensures minimum bond separation between MainBeads to consider contacts,

  • Represents contacts as qubit operators (SparsePauliOp) suitable for quantum simulations.

class contact.contact_map.ContactMap(protein)

Bases: object

Represents a contact map for a protein’s main chain.

Stores pairwise contact operators between MainBeads, using Pauli operators to encode whether contacts are present, respecting minimum bond distances and sublattice constraints.

Variables:
  • main_main_contacts (dict[int, dict[int, SparsePauliOp]]) – Contact operators between main chain beads.

  • contacts_detected (int) – Total number of contacts detected in the map.

__init__(protein)

Initializes the contact map for the given protein.

Parameters:

protein (Protein) – The Protein object that includes all information about protein.

Raises:

Exception – If contact map initialization fails.

_create_main_main_contact(upper_bead, lower_bead)

Creates a contact operator between two main chain MainBeads.

Return type:

SparsePauliOp

Parameters:
  • lower_bead (Bead) – The bead from the main chain at the lower index.

  • upper_bead (Bead) – The bead from the main chain at the upper index.

Returns:

Pauli-Z operator for the contact between the two MainBeads.

Return type:

SparsePauliOp

_initialize_contact_map()

Initializes all contact maps to empty dictionaries.

Return type:

None

Note

The minimum distance between residues for forming a contact is set by the constant MIN_DISTANCE_BETWEEN_CONTACTS = 5. This ensures that contacts are only considered between residues separated by at least five positions in the sequence, which is consistent with the geometric constraints of the tetrahedral lattice representation.