ffsim.contract.contract_one_body

ffsim.contract.contract_one_body(vec, mat, norb, nelec)[source]

Contract a one-body tensor with a vector.

A one-body tensor has the form

\[\sum_{ij} M_{ij} a^\dagger_i a_j\]

where \(M\) is a complex-valued matrix.

Parameters:
  • mat (ndarray) – The one-body tensor.

  • norb (int) – The number of spatial orbitals.

  • nelec (tuple[int, int]) – The number of alpha and beta electrons.

Return type:

ndarray

Returns:

A LinearOperator that implements the action of the one-body tensor.