ffsim.contract.contract_num_op_sum

ffsim.contract.contract_num_op_sum(vec, coeffs, norb, nelec)[source]

Contract a linear combination of number operators with a vector.

A linear combination of number operators has the form

\[\sum_{i \sigma} \lambda_i n_{i\sigma}\]

where \(n_{i\sigma}\) denotes the number operator on orbital \(i\) with spin \(\sigma\) and the \(\lambda_i\) are real numbers.

Parameters:
  • vec (ndarray) – The state vector to be transformed.

  • 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.

Returns:

The result of applying the linear combination of number operators on the input state vector.