ffsim.apply_on_site_interaction

ffsim.apply_on_site_interaction(vec, theta, target_orb, norb, nelec, *, copy=True)[source]

Apply an on-site interaction gate.

The on-site interaction gate is

\[\text{OS}(\theta, p) = \exp\left(i \theta a^\dagger_{p\alpha} a_{p\alpha} a^\dagger_{p\beta} a_{p\beta}\right)\]
Parameters:
  • vec (ndarray) – The state vector to be transformed.

  • theta (float) – The rotation angle.

  • target_orb (int) – The orbital on which to apply the interaction.

  • 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=True then this function always returns a newly allocated vector and the original vector is left untouched.

    • If copy=False then 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.