ffsim.contract.two_body_linop¶
- ffsim.contract.two_body_linop(two_body_tensor, norb, nelec, one_body_tensor=None, constant=0)[source]¶
Convert a two-body tensor to a linear operator.
A two-body tensor has the form
\[\begin{split}\frac12 \sum_{\substack{pqrs \\ \sigma \tau}} h_{pqrs} a^\dagger_{p\sigma} a^\dagger_{r\tau} a_{s\tau} a_{q\sigma}\end{split}\]where \(h_{pqrs}\) is a tensor of complex coefficients.
- Parameters:
two_body_tensor (
ndarray) – The two-body tensor.norb (
int) – The number of spatial orbitals.nelec (
tuple[int,int]) – The number of alpha and beta electrons.one_body_tensor (
ndarray|None) – Optional one-body tensor to absorb into the two-body operator. Seeone_body_linop().constant (
float) – Optional constant to add to the operator.
- Return type:
- Returns:
A LinearOperator that implements the action of the two-body tensor.