dipole_integrals(mol, core=None, active=None)[source]

Return a function that computes the dipole moment integrals over the molecular orbitals.

These integrals are required to construct the dipole operator in the second-quantized form

\[\hat{D} = -\sum_{pq} d_{pq} [\hat{c}_{p\uparrow}^\dagger \hat{c}_{q\uparrow} + \hat{c}_{p\downarrow}^\dagger \hat{c}_{q\downarrow}] - \hat{D}_\mathrm{c} + \hat{D}_\mathrm{n},\]

where the coefficients \(d_{pq}\) are given by the integral of the position operator \(\hat{{\bf r}}\) over molecular orbitals \(\phi\)

\[d_{pq} = \int \phi_p^*(r) \hat{{\bf r}} \phi_q(r) dr,\]

and \(\hat{c}^{\dagger}\) and \(\hat{c}\) are the creation and annihilation operators, respectively. The contribution of the core orbitals and nuclei are denoted by \(\hat{D}_\mathrm{c}\) and \(\hat{D}_\mathrm{n}\), respectively.

The molecular orbitals are represented as a linear combination of atomic orbitals as

\[\phi_i(r) = \sum_{\nu}c_{\nu}^i \chi_{\nu}(r).\]

Using this equation the dipole moment integral \(d_{pq}\) can be written as

\[d_{pq} = \sum_{\mu \nu} C_{p \mu} d_{\mu \nu} C_{\nu q},\]

where \(d_{\mu \nu}\) is the dipole moment integral over the atomic orbitals and \(C\) is the molecular orbital expansion coefficient matrix. The contribution of the core molecular orbitals is computed as

\[\hat{D}_\mathrm{c} = 2 \sum_{i=1}^{N_\mathrm{core}} d_{ii},\]

where \(N_\mathrm{core}\) is the number of core orbitals.

  • mol (Molecule) – the molecule object

  • core (list[int]) – indices of the core orbitals

  • active (list[int]) – indices of the active orbitals


function that computes the dipole moment integrals in the molecular orbital basis

Return type



>>> symbols  = ['H', 'H']
>>> geometry = np.array([[0.0, 0.0, 0.0], [0.0, 0.0, 1.0]], requires_grad = False)
>>> alpha = np.array([[3.42525091, 0.62391373, 0.1688554],
>>>                   [3.42525091, 0.62391373, 0.1688554]], requires_grad=True)
>>> mol = qml.qchem.Molecule(symbols, geometry, alpha=alpha)
>>> args = [alpha]
>>> constants, integrals = dipole_integrals(mol)(*args)
>>> print(integrals)
(array([[0., 0.],
        [0., 0.]]),
 array([[0., 0.],
        [0., 0.]]),
 array([[ 0.5      , -0.8270995],
        [-0.8270995,  0.5      ]]))