JordanWigner Module
The Jordan-Wigner fermion-to-qubit encoding (1928).
Maps fermionic operators to qubit Pauli operators by inserting a chain of Z operators to track the parity of all preceding modes: cⱼ → Z₀ ⊗ Z₁ ⊗ ... ⊗ Zⱼ₋₁ ⊗ Xⱼ ⊗ Iⱼ₊₁ ⊗ ... ⊗ Iₙ₋₁ dⱼ → Z₀ ⊗ Z₁ ⊗ ... ⊗ Zⱼ₋₁ ⊗ Yⱼ ⊗ Iⱼ₊₁ ⊗ ... ⊗ Iₙ₋₁ where cⱼ = a†ⱼ + aⱼ and dⱼ = i(a†ⱼ − aⱼ) are Majorana operators.
Qubit ordering. In this library the position of a Pauli in a PauliRegister string maps directly to the qubit index: mode/qubit 0 is the leftmost character. So cⱼ produces the string "Z…ZX I…I" — a Z on qubits 0…j−1, an X on qubit j, and I on the rest — read left to right. For example a†₂ (n=4) = ½·ZZXI − (i/2)·ZZYI, and the number operator nⱼ = a†ⱼaⱼ = ½(I − Zⱼ) carries its Z at string position j (n₀ = ½·IIII − ½·ZIII, n₃ = ½·IIII − ½·IIIZ).
Occupation-number basis. Occupation integers weight mode j by 2ʲ (mode 0 is the least-significant bit): the H₂ Hartree–Fock state with modes 0 and 1 occupied is the integer 3 = 0b0011. To evaluate a FockMap Pauli string in this occupation basis so that mode j maps to bit 2ʲ, reverse the string before forming the Kronecker product (mode 0, the leftmost character, becomes the least-significant bit). That same character-string reversal converts a FockMap label to a Qiskit-style Pauli-label string, where mode 0 is the rightmost character: FockMap "ZXII" (Z₀X₁I₂I₃) ≡ Qiskit-style label "IIXZ". (Prefer this concrete rule over "big/little-endian": FockMap mode 0 is leftmost; occupation integers and Qiskit-style Pauli labels put mode 0 rightmost / at bit 2⁰. OpenQASM gates use explicit indexed operands, so map qubit i to q[i] rather than relying on a string-order convention.)
The Z-chain grows linearly with mode index j, giving O(n) worst-case weight. For O(log n) alternatives, see BravyiKitaev and TreeEncoding. Reference: P. Jordan and E. Wigner, "Über das Paulische Äquivalenzverbot," Z. Phys. 47, 631 (1928).Functions and values
| Function or value |
Description
|
Full Usage:
jordanWignerTerms op j n
Parameters:
LadderOperatorUnit
-
The ladder operator (Raise, Lower, or Identity).
j : uint32
-
The qubit/mode index for this operator.
n : uint32
-
The total number of qubits in the register.
Returns: PauliRegisterSequence
A sequence of Pauli register terms representing the encoded operator.
|
Compute the Jordan-Wigner encoding of a single ladder operator. For creation (Raise) and annihilation (Lower) operators, produces X and Y terms with Z-chains on all preceding qubits. The coefficients encode the ±½ and ±i/2 factors from the Majorana decomposition. Returns empty sequence for Identity or if j >= n.
ExampleEncode a†₀ in a 2-qubit register:
|