mindquantum.core.operators.InteractionOperator

View Source On Gitee
class mindquantum.core.operators.InteractionOperator(constant, one_body_tensor, two_body_tensor)[source]

Class to store 'interaction opeartors' which are used to configure a ferinonic molecular Hamiltonian.

The Hamiltonian including one-body and two-body terms which conserve spin and parity. In this module, the stored coefficient could be represented the molecular Hamiltonians through the FermionOperator class.

Note

The operators stored in this class has the form:

\[C + \sum_{p, q} h_{[p, q]} a^\dagger_p a_q + \sum_{p, q, r, s} h_{[p, q, r, s]} a^\dagger_p a^\dagger_q a_r a_s.\]

Where \(C\) is a constant.

Parameters
  • constant (numbers.Number) – A constant term in the operator given as a float. For instance, the nuclear repulsion energy.

  • one_body_tensor (numpy.ndarray) – The coefficients of the one-body terms (h[p, q]). This is an \(n_\text{qubits}\times n_\text{qubits}\) numpy array of floats. By default we store the numpy array with keys: \(a^\dagger_p a_q\) (1,0).

  • two_body_tensor (numpy.ndarray) – The coefficients of the two-body terms (h[p, q, r, s]). This is an \(n_\text{qubits}\times n_\text{qubits}\times n_\text{qubits}\times n_\text{qubits}\) numpy array of floats.By default we store the numpy array with keys: \(a^\dagger_p a^\dagger_q a_r a_s\) (1, 1, 0, 0).

unique_iter(complex_valued=False)[source]

Iterate all terms that are not in the same symmetry group.

Four point symmetry:
  1. pq = qp.

  2. pqrs = srqp = qpsr = rspq.

Eight point symmetry(when complex_valued is False):
  1. pq = qp.

  2. pqrs = rqps = psrq = srqp = qpsr = rspq = spqr = qrsp.

Parameters

complex_valued (bool) – Whether the operator has complex coefficients. Default: False.