qml.qchem.obs.two_particle

two_particle(matrix_elements, core=None, active=None, cutoff=1e-12)[source]

Generates the FermionOperator representing a given two-particle operator required to build many-body qubit observables.

Second quantized two-particle operators are expanded in the basis of single-particle states as

\[\begin{split}\hat{V} = \frac{1}{2} \sum_{\alpha, \beta, \gamma, \delta} \langle \alpha, \beta \vert \hat{v} \vert \gamma, \delta \rangle ~ &[& \hat{c}_{\alpha\uparrow}^\dagger \hat{c}_{\beta\uparrow}^\dagger \hat{c}_{\gamma\uparrow} \hat{c}_{\delta\uparrow} + \hat{c}_{\alpha\uparrow}^\dagger \hat{c}_{\beta\downarrow}^\dagger \hat{c}_{\gamma\downarrow} \hat{c}_{\delta\uparrow} \\ &+& \hat{c}_{\alpha\downarrow}^\dagger \hat{c}_{\beta\uparrow}^\dagger \hat{c}_{\gamma\uparrow} \hat{c}_{\delta\downarrow} + \hat{c}_{\alpha\downarrow}^\dagger \hat{c}_{\beta\downarrow}^\dagger \hat{c}_{\gamma\downarrow} \hat{c}_{\delta\downarrow}~].\end{split}\]

In the equation above the indices \(\alpha, \beta, \gamma, \delta\) run over the basis of spatial orbitals \(\phi_\alpha(r)\). Since the operator \(v\) acts only on the spatial coordinates the spin quantum numbers are indicated explicitly with the up/down arrows. The operators \(\hat{c}^\dagger\) and \(\hat{c}\) are the particle creation and annihilation operators, respectively, and \(\langle \alpha, \beta \vert \hat{v} \vert \gamma, \delta \rangle\) denotes the matrix elements of the operator \(\hat{v}\)

\[\langle \alpha, \beta \vert \hat{v} \vert \gamma, \delta \rangle = \int dr_1 \int dr_2 ~ \phi_\alpha^*(r_1) \phi_\beta^*(r_2) ~\hat{v}(r_1, r_2)~ \phi_\gamma(r_2) \phi_\delta(r_1).\]

If an active space is defined (see active_space()), the summation indices run over the active orbitals and the contribution due to core orbitals is computed as

\[\begin{split}&& \hat{V}_\mathrm{core} = v_\mathrm{core} + \sum_{\alpha, \beta \in \mathrm{active}} \sum_{i \in \mathrm{core}} (2 \langle i, \alpha \vert \hat{v} \vert \beta, i \rangle - \langle i, \alpha \vert \hat{v} \vert i, \beta \rangle)~ [\hat{c}_{\alpha\uparrow}^\dagger \hat{c}_{\beta\uparrow} + \hat{c}_{\alpha\downarrow}^\dagger \hat{c}_{\beta\downarrow}] \\ && v_\mathrm{core} = \sum_{\alpha,\beta \in \mathrm{core}} [2 \langle \alpha, \beta \vert \hat{v} \vert \beta, \alpha \rangle - \langle \alpha, \beta \vert \hat{v} \vert \alpha, \beta \rangle].\end{split}\]
Parameters
  • matrix_elements (array[float]) – 4D NumPy array with the matrix elements \(\langle \alpha, \beta \vert \hat{v} \vert \gamma, \delta \rangle\)

  • core (list) – indices of core orbitals, i.e., the orbitals that are not correlated in the many-body wave function

  • active (list) – indices of active orbitals, i.e., the orbitals used to build the correlated many-body wave function

  • cutoff (float) – Cutoff value for including matrix elements. The matrix elements with absolute value less than cutoff are neglected.

Returns

an instance of OpenFermion’s FermionOperator representing the two-particle operator \(\hat{V}\).

Return type

FermionOperator

Example

>>> matrix_elements = np.array([[[[ 6.82389533e-01, -1.45716772e-16],
...                               [-2.77555756e-17,  1.79000576e-01]],
...                              [[-2.77555756e-17,  1.79000576e-16],
...                               [ 6.70732778e-01, 0.00000000e+00]]],
...                             [[[-1.45716772e-16,  6.70732778e-16],
...                               [ 1.79000576e-01, -8.32667268e-17]],
...                              [[ 1.79000576e-16, -8.32667268e-17],
...                               [ 0.00000000e+00,  7.05105632e-01]]]])
>>> v_op = two_particle(matrix_elements)
>>> print(v_op)
0.3411947665760211 [0^ 0^ 0 0]
+ 0.08950028803070323 [0^ 0^ 2 2]
+ 0.3411947665760211 [0^ 1^ 1 0]
+ 0.08950028803070323 [0^ 1^ 3 2]
+ 0.08950028803070323 [0^ 2^ 0 2]
+ 0.3353663891543792 [0^ 2^ 2 0]
+ 0.08950028803070323 [0^ 3^ 1 2]
+ 0.3353663891543792 [0^ 3^ 3 0]
+ 0.3411947665760211 [1^ 0^ 0 1]
+ 0.08950028803070323 [1^ 0^ 2 3]
+ 0.3411947665760211 [1^ 1^ 1 1]
+ 0.08950028803070323 [1^ 1^ 3 3]
+ 0.08950028803070323 [1^ 2^ 0 3]
+ 0.3353663891543792 [1^ 2^ 2 1]
+ 0.08950028803070323 [1^ 3^ 1 3]
+ 0.3353663891543792 [1^ 3^ 3 1]
+ 0.3353663891543792 [2^ 0^ 0 2]
+ 0.08950028803070323 [2^ 0^ 2 0]
+ 0.3353663891543792 [2^ 1^ 1 2]
+ 0.08950028803070323 [2^ 1^ 3 0]
+ 0.08950028803070323 [2^ 2^ 0 0]
+ 0.352552816086392 [2^ 2^ 2 2]
+ 0.08950028803070323 [2^ 3^ 1 0]
+ 0.352552816086392 [2^ 3^ 3 2]
+ 0.3353663891543792 [3^ 0^ 0 3]
+ 0.08950028803070323 [3^ 0^ 2 1]
+ 0.3353663891543792 [3^ 1^ 1 3]
+ 0.08950028803070323 [3^ 1^ 3 1]
+ 0.08950028803070323 [3^ 2^ 0 1]
+ 0.352552816086392 [3^ 2^ 2 3]
+ 0.08950028803070323 [3^ 3^ 1 1]
+ 0.352552816086392 [3^ 3^ 3 3]