qml.qchem.nuclear_energy

nuclear_energy(charges, r)[source]

Return a function that computes the nuclear-repulsion energy.

The nuclear-repulsion energy is computed as

\[\sum_{i>j}^n \frac{q_i q_j}{r_{ij}},\]

where \(q\), \(r\) and \(n\) denote the nuclear charges (atomic numbers), nuclear positions and the number of nuclei, respectively.

Parameters
  • charges (list[int]) – nuclear charges in atomic units

  • r (array[float]) – nuclear positions

Returns

function that computes the nuclear-repulsion energy

Return type

function

Example

>>> symbols  = ['H', 'F']
>>> geometry = np.array([[0.0, 0.0, 0.0], [0.0, 0.0, 2.0]], requires_grad = True)
>>> mol = qml.qchem.Molecule(symbols, geometry)
>>> args = [mol.coordinates]
>>> e = nuclear_energy(mol.nuclear_charges, mol.coordinates)(*args)
>>> print(e)
4.5