ffsim.apply_tunneling_interaction¶
- ffsim.apply_tunneling_interaction(vec, theta, target_orbs, norb, nelec, spin=<Spin.ALPHA_AND_BETA: 3>, *, copy=True)[source]¶
Apply a tunneling interaction gate.
The tunneling interaction gate is
\[\text{T}(\theta, (p, q)) = \prod_\sigma \exp\left(i \theta (a^\dagger_{p\sigma} a_{q\sigma} + a^\dagger_{q\sigma} a_{p\sigma})\right)\]Under the Jordan-Wigner transform, this gate has the following matrix when applied to neighboring qubits:
\[\begin{split}\begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & \cos(\theta) & i \sin(\theta) & 0\\ 0 & i \sin(\theta) & \cos(\theta) & 0\\ 0 & 0 & 0 & 1 \\ \end{pmatrix}\end{split}\]- Parameters:
vec (
ndarray) – The state vector to be transformed.theta (
float) – The rotation angle.target_orbs (
tuple[int,int]) – The orbitals (p, q) on which to apply the interaction.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=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.
- Return type: