ffsim.apply_num_num_interaction

ffsim.apply_num_num_interaction(vec, theta, target_orbs, norb, nelec, spin=<Spin.ALPHA_AND_BETA: 3>, *, copy=True)[source]

Apply a number-number interaction gate.

The number-number interaction gate is

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

  • theta (float) – The rotation angle.

  • target_orbs (tuple[int, int]) – The orbitals (p, q) to interact.

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

  • nelec (int | tuple[int, int]) – Either a single integer representing the number of fermions for a spinless system, or a pair of integers storing the numbers of spin alpha and spin beta fermions.

  • spin (Spin) –

    Choice of spin sector(s) to act on.

    • To act on only spin alpha, pass ffsim.Spin.ALPHA.

    • To act on only spin beta, pass ffsim.Spin.BETA.

    • To act on both spin alpha and spin beta, pass ffsim.Spin.ALPHA_AND_BETA (this is the default value).

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