qml.qchem.moment_matrix¶
-
moment_matrix
(basis_functions, order, idx)[source]¶ Return a function that computes the multipole moment matrix for a set of basis functions.
- Parameters
basis_functions (list[BasisFunction]) – basis functions
order (integer) – exponent of the position component
idx (integer) – index determining the dimension of the multipole moment integral
- Returns
function that computes the multipole moment matrix
- Return type
function
Example
>>> symbols = ['H', 'H'] >>> geometry = np.array([[0.0, 0.0, 0.0], [2.0, 0.0, 0.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] >>> order, idx = 1, 0 >>> moment_matrix(mol.basis_set, order, idx)(*args) tensor([[0.0, 0.4627777], [0.4627777, 2.0]], requires_grad=True)
code/api/pennylane.qchem.moment_matrix
Download Python script
Download Notebook
View on GitHub