ffsim.apply_orbital_rotation

ffsim.apply_orbital_rotation(vec, mat, norb, nelec, *, copy=True)[source]

Apply an orbital rotation to a vector.

An orbital rotation maps creation operators as

\[a^\dagger_{i\sigma} \mapsto \sum_{j} U^{(\sigma)}_{ji} a^\dagger_{j\sigma}\]

where \(U^{(\sigma)}\) is a unitary matrix representing the action of the orbital rotation on spin sector \(\sigma\). This is equivalent to applying the transformation given by

\[\prod_{\sigma} \exp\left(\sum_{ij} \log(U^{(\sigma)})_{ij} a^\dagger_{i\sigma} a_{j\sigma}\right)\]
Parameters:
  • vec (ndarray) – The state vector to be transformed.

  • mat (ndarray | tuple[ndarray | None, ndarray | None]) – The unitary matrix \(U\) describing the orbital rotation. You can pass either a single Numpy array specifying the orbital rotation to apply to both spin sectors, or you can pass a pair of Numpy arrays specifying independent orbital rotations for spin alpha and spin beta. If passing a pair, you can use None for one of the values in the pair to indicate that no operation should be applied to that spin sector.

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

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

Return type:

ndarray

Returns:

The rotated vector.