qml.qchem.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
ˆV=12∑α,β,γ,δ⟨α,β|ˆv|γ,δ⟩ [ˆc†α↑ˆc†β↑ˆcγ↑ˆcδ↑+ˆc†α↑ˆc†β↓ˆcγ↓ˆcδ↑+ˆc†α↓ˆc†β↑ˆcγ↑ˆcδ↓+ˆc†α↓ˆc†β↓ˆcγ↓ˆcδ↓ ].In the equation above the indices α,β,γ,δ run over the basis of spatial orbitals ϕα(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 ˆc† and ˆc are the particle creation and annihilation operators, respectively, and ⟨α,β|ˆv|γ,δ⟩ denotes the matrix elements of the operator ˆv
⟨α,β|ˆv|γ,δ⟩=∫dr1∫dr2 ϕ∗α(r1)ϕ∗β(r2) ˆv(r1,r2) ϕγ(r2)ϕδ(r1).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ˆVcore=vcore+∑α,β∈active∑i∈core(2⟨i,α|ˆv|β,i⟩−⟨i,α|ˆv|i,β⟩) [ˆc†α↑ˆcβ↑+ˆc†α↓ˆcβ↓]vcore=∑α,β∈core[2⟨α,β|ˆv|β,α⟩−⟨α,β|ˆv|α,β⟩].- Parameters
matrix_elements (array[float]) – 4D NumPy array with the matrix elements ⟨α,β|ˆv|γ,δ⟩
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 ˆV.- Return type
FermionOperator
Example
>>> import numpy as np >>> 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.3411947665 [0^ 0^ 0 0] + 0.089500288 [0^ 0^ 2 2] + 0.3411947665 [0^ 1^ 1 0] + 0.089500288 [0^ 1^ 3 2] + 0.335366389 [0^ 2^ 2 0] + 0.335366389 [0^ 3^ 3 0] + 0.3411947665 [1^ 0^ 0 1] + 0.089500288 [1^ 0^ 2 3] + 0.3411947665 [1^ 1^ 1 1] + 0.089500288 [1^ 1^ 3 3] + 0.335366389 [1^ 2^ 2 1] + 0.335366389 [1^ 3^ 3 1] + 0.089500288 [2^ 0^ 2 0] + 0.089500288 [2^ 1^ 3 0] + 0.352552816 [2^ 2^ 2 2] + 0.352552816 [2^ 3^ 3 2] + 0.089500288 [3^ 0^ 2 1] + 0.089500288 [3^ 1^ 3 1] + 0.352552816 [3^ 2^ 2 3] + 0.352552816 [3^ 3^ 3 3]