ffsim.contract.num_op_sum_linop

ffsim.contract.num_op_sum_linop(coeffs, norb, nelec, *, orbital_rotation=None)[source]

Convert a (rotated) linear combination of number operators to a linear operator.

A rotated linear combination of number operators has the form

\[\mathcal{U} (\sum_{i \sigma} \lambda_i n_{i\sigma}) \mathcal{U}^\dagger\]

where \(n_{i\sigma}\) denotes the number operator on orbital \(i\) with spin \(\sigma\), the \(\lambda_i\) are real numbers, and \(\mathcal{U}\) is an optional orbital rotation.

Parameters:
  • coeffs (ndarray) – The coefficients of the linear combination.

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

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

  • orbital_rotation (ndarray | None) – A unitary matrix describing the optional orbital rotation.

Return type:

LinearOperator

Returns:

A LinearOperator that implements the action of the linear combination of number operators.