paddle_quantum.biocomputing.protein
a class that holds all the information of the protein model
- class paddle_quantum.biocomputing.protein.Protein(aa_seqs, fixed_bond_directions=None, contact_pairs=None)
Bases:
Graph
Protein object will build a protein from given amino acides sequence. The 3D structure of the protein is build on a diamond lattice, each bond is mapped to an edge in the lattice. We can get the spatial direction of the bonds and the distance between the two amino acides from it.
- Parameters:
aa_seqs (str) – an ordered string in which each symbol represents an amino acide (aa).
fixed_bond_directions (Dict[Tuple, int] | None) – a list contains the directions of prefixed bonds, they are represented by a (edge, direction) pairs, e.g. (0, 1)->”10” means the bond between 0 and 1 is along the 2nd direction. Default is None, which means no bond is fixed a prior.
contact_pairs (List[Tuple[int]] | None) – a list of potentially contact amino acides pairs. Default is None and will use all the valid pairs generated by
_generate_valid_contact_pairs
.
- distance_operator(p, q)
Distance between p-th and q-th nodes in the protein graph.
- Parameters:
p (int) – index of node p
q (int) – index of node q
- Returns:
The operator.
- Return type:
QubitOperator
- get_protein_hamiltonian(lambda0=0.0, lambda1=0.0, energy_multiplier=0.1)
The Hamiltonian used in VQE algorithm to solve protein folding problem (will take into account the first and second neighbor interactions).
\[\begin{split}\begin{array}{rcl} \hat{H} & = &\lambda_0\hat{H}_{backward} + \sum_{i=0}^{N-1}\sum_{j}q_{ij}(\epsilon_{ij}+\lambda_1(d(i,j)-1))\\ & & +\lambda_1(4-d(i,neighbor(j)-d(neighbor(i),j)))\\ \text{where} & & \hat{H}_{backward}=\sum_{e_{i}} (-1)^{e_i[0]+e_{i+1}[0]} f_a(e_i)f_a(e_{i+1})j\in\{k|k>=i+5, (k-i)%2==1\} \end{array}\end{split}\]- Parameters:
protein – protein for which to build the Hamiltonian.
lambda0 (float) – the penalty factor for the backwalk constraint.
lambda1 (float) – the penalty factor for the contaction constraints.
- Returns:
Hamiltonian.
- Return type: