ffsim.contract.contract_diag_coulomb¶
- ffsim.contract.contract_diag_coulomb(vec, mat, norb, nelec, *, z_representation=False)[source]¶
Contract a diagonal Coulomb operator with a vector.
A diagonal Coulomb operator has the form
\[\begin{split}\sum_{\substack{ij \\ \sigma \tau}} Z^{(\sigma \tau)}_{ij} n_{i\sigma} n_{j\tau} / 2\end{split}\]where \(n_{i\sigma}\) denotes the number operator on orbital \(i\) with spin \(\sigma\) and \(Z^{(\sigma \tau)}\) is a real-valued matrix
- Parameters:
vec (
ndarray) – The state vector to be transformed.mat (
ndarray|tuple[ndarray|None,ndarray|None,ndarray|None]) – The diagonal Coulomb matrix \(Z\). You can pass either a single Numpy array specifying the coefficients to use for all spin interactions, or you can pass a tuple of three Numpy arrays specifying independent coefficients for alpha-alpha, alpha-beta, and beta-beta interactions (in that order). If passing a tuple, you can set a tuple element toNoneto indicate the absence of interactions of that type.norb (
int) – The number of spatial orbitals.nelec (
tuple[int,int]) – The number of alpha and beta electrons.z_representation (
bool) – Whether the input matrices are in the “Z” representation.
- Return type:
- Returns:
The result of applying the diagonal Coulomb operator on the input state vector.