ffsim.contract.two_body_linop_unrestricted¶
- ffsim.contract.two_body_linop_unrestricted(two_body_tensors, norb, nelec, one_body_tensors=None, constant=0)[source]¶
Convert spin-unrestricted two-body tensors to a linear operator.
The operator has the form
\[\frac12 \sum_{pqrs} h^{\alpha\alpha}_{pqrs} a^\dagger_{p\alpha} a^\dagger_{r\alpha} a_{s\alpha} a_{q\alpha} + \sum_{pqrs} h^{\alpha\beta}_{pqrs} a^\dagger_{p\alpha} a^\dagger_{r\beta} a_{s\beta} a_{q\alpha} + \frac12 \sum_{pqrs} h^{\beta\beta}_{pqrs} a^\dagger_{p\beta} a^\dagger_{r\beta} a_{s\beta} a_{q\beta}\]where \(h^{\alpha\alpha}\), \(h^{\alpha\beta}\), and \(h^{\beta\beta}\) are tensors of coefficients in chemist ordering, whose spin labels refer to the two pairs of indices: in \(h^{\alpha\beta}_{pqrs}\), the indices \(pq\) belong to spin alpha and the indices \(rs\) belong to spin beta. The alpha-beta term appears with coefficient 1 rather than \(\frac12\) because the beta-alpha term, whose tensor is \(h^{\beta\alpha}_{pqrs} = h^{\alpha\beta}_{rspq}\), contributes the other half. Consequently, the alpha-beta tensor need not be symmetric under exchanging its two index pairs. See
MolecularHamiltonianUnrestricted.Each tensor is assumed to be symmetric within each of its index pairs, that is, \(h_{pqrs} = h_{qprs} = h_{pqsr}\).
- Parameters:
two_body_tensors (
ndarray) – The two-body tensors \((h^{\alpha\alpha}, h^{\alpha\beta}, h^{\beta\beta})\), as a single Numpy array of shape(3, norb, norb, norb, norb).norb (
int) – The number of spatial orbitals.nelec (
tuple[int,int]) – The number of alpha and beta electrons.one_body_tensors (
ndarray|None) – Optional one-body tensors \((h^{\alpha}, h^{\beta})\), as a single Numpy array of shape(2, norb, norb), to absorb into the two-body operator.constant (
float) – Optional constant to add to the operator.
- Return type:
- Returns:
A LinearOperator that implements the action of the two-body tensors.
- Raises:
NotImplementedError – The tensors have a complex data type. PySCF does not provide a spin-unrestricted FCI contraction for complex integrals.