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:
- Returns:
The result of applying the linear combination of number operators on the input state vector.