paddle_quantum.biocomputing.operators

various indicators used to build the protein Hamiltonian

paddle_quantum.biocomputing.operators.edge_direction_indicator(edge, affected_qubits=None, direction=None)

Calculate the direction indicate operator for a given edge at given affected qubits.

\[\begin{split}I_0(e)=(1-q_0)(1-q_1) \\ I_1(e)=(1-q_0)q_1 \\ I_2(e)=q_0(1-q_1) \\ I_3(e)=q_0q_1 \\ satisfies \sum_{k} I_k(e) == 1\end{split}\]
Parameters:
  • edge (Tuple[int]) – Edge index in protein’s directed graph.

  • affected_qubits (List[int] | None) – The indices of qubits used to encode the indicator.

  • direction (int | None) – Direction of edge in the diamond lattice, valid values 0, 1, 2, 3.

Returns:

A tuple contains the sign and indicator operator corresponds to that edge.

Return type:

Tuple[float, Dict]

paddle_quantum.biocomputing.operators.contact_indicator(qindex)

The indicator which indicates whether two nodes in the protein are contact.

\[qindex = contactor_start + index_of_contact_pair\]
Parameters:

qindex (int) – index of qubit used as indicator of whether two nodes in the protein chain contact.

Returns:

Contact indicator in QubitOperator form.

Return type:

QubitOperator

paddle_quantum.biocomputing.operators.backwalk_indicator(e0_attrs, e1_attrs)

Indicator of whether two consecutive bonds in protein overlap.

\[\sum_{a=0}^3 I_a(e_{i})I_a(e_{i+1})\]
Parameters:
  • e0_attrs (Dict) – Attributes of e0 edge.

  • e1_attrs (Dict) – Attributes of e1 (edge next to e0) edge.

Returns:

Backwalk indicator in QubitOperator form.

Return type:

QubitOperator