qml.qchem.mol_density_matrix¶
- mol_density_matrix(n_electron, c)[source]¶
Compute the molecular density matrix.
The density matrix \(P\) is computed from the molecular orbital coefficients \(C\) as
\[P_{\mu \nu} = \sum_{i=1}^{N} C_{\mu i} C_{\nu i},\]where \(N = N_{electrons} / 2\) is the number of occupied orbitals. Note that the total density matrix is the sum of the \(\alpha\) and \(\beta\) density matrices, \(P = P^{\alpha} + P^{\beta}\).
- Parameters
n_electron (integer) – number of electrons
c (array[array[float]]) – molecular orbital coefficients
- Returns
density matrix
- Return type
array[array[float]]
Example
>>> c = np.array([[-0.54828771, 1.21848441], [-0.54828771, -1.21848441]]) >>> n_electron = 2 >>> mol_density_matrix(n_electron, c) array([[0.30061941, 0.30061941], [0.30061941, 0.30061941]])
code/api/pennylane.qchem.mol_density_matrix
Download Python script
Download Notebook
View on GitHub