ffsim.apply_num_op_prod_interaction¶
- ffsim.apply_num_op_prod_interaction(vec, theta, target_orbs, norb, nelec, *, copy=True)[source]¶
Apply interaction gate for product of number operators.
The gate is
\[\text{NP}(\theta, (S_\alpha, S_\beta)) = \exp\left(i \theta \prod_{p \in S_\alpha} a^\dagger_{p\alpha} a_{p\alpha} \prod_{p \in S_\beta} a^\dagger_{p\beta} a_{p\beta} \right)\]- Parameters:
vec (
ndarray) – The state vector to be transformed.theta (
float) – The rotation angle.target_orbs (
tuple[Sequence[int],Sequence[int]]) – A pair of lists of integers giving the orbitals on which to apply the interaction. The first list specifies the alpha orbitals and the second list specifies the beta orbitals.norb (
int) – The number of spatial orbitals.nelec (
tuple[int,int]) – The number of alpha and beta electrons.copy (
bool) –Whether to copy the vector before operating on it.
If
copy=Truethen this function always returns a newly allocated vector and the original vector is left untouched.If
copy=Falsethen this function may still return a newly allocated vector, but the original vector may have its data overwritten. It is also possible that the original vector is returned, modified in-place.