From bc7c2e7e36a29fd09635f7fb0b1856eb4feea1c4 Mon Sep 17 00:00:00 2001 From: Haimeng Zhang Date: Thu, 25 Jul 2024 15:53:04 -0400 Subject: [PATCH] fix fswap docstring --- python/ffsim/gates/basic_gates.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/python/ffsim/gates/basic_gates.py b/python/ffsim/gates/basic_gates.py index 6f5ce293a..f4094e5cc 100644 --- a/python/ffsim/gates/basic_gates.py +++ b/python/ffsim/gates/basic_gates.py @@ -581,9 +581,18 @@ def apply_fswap_gate( *, copy: bool = True, ) -> np.adarray: - r"""Apply a fSWAP gate + r"""Apply a fSWAP gate that swaps target orbitals. - .. math:: + An fSwap gate is defined as + + .. math:: + f_\text{swap}(p, q) = + 1 + a^\dagger_p a_q + a^\dagger_q a_p - a_p^\dagger a_p - a_q^\dagger a_q + + Under the Jordan-Wigner transform, this gate has the following matrix when applied + to neighboring qubits: + + .. math:: \begin{pmatrix} 1 & 0 & 0 & 0 \\