MajoranaEncoding Module
Generic fermion-to-qubit encoding via Majorana decomposition.
Every encoding in this family maps a single fermionic ladder operator
to a pair of Majorana operators (c, d) built from three index sets:
U(j, n) — update set: qubits that flip when occupation of mode j changes
P(j) — parity set: qubits encoding the parity n₀ ⊕ … ⊕ n_{j−1}
Occ(j) — occupation set: qubits encoding whether mode j is occupied
The Majorana operators are:
c_j = X_{U(j)∪{j}} · Z_{P(j)}
d_j = Y_j · X_{U(j)} · Z_{(P(j)⊕Occ(j))∖{j}}
And the ladder operators follow:
a†_j = ½(c_j − i·d_j) a_j = ½(c_j + i·d_j)
Different choices of index-set functions yield different encodings:
Jordan-Wigner : U = ∅, P = {0…j−1}, Occ = {j}
Parity : U = {j+1…n−1}, P = {j−1}?, Occ = {j−1,j}?
Bravyi-Kitaev : U, P, Occ from Fenwick tree structure
Types
| Type | Description |
|
Defines the three index-set functions that characterise an encoding. |
Functions and values
| Function or value |
Description
|
|
Bravyi-Kitaev: index sets from the Fenwick tree.
|
Full Usage:
cMajorana scheme j n
Parameters:
EncodingScheme
j : int
n : int
Returns: (int * Pauli) list
|
c Majorana: X on {j} ∪ U(j), Z on P(j).
|
Full Usage:
dMajorana scheme j n
Parameters:
EncodingScheme
j : int
n : int
Returns: (int * Pauli) list
|
d Majorana: Y on j, X on U(j), Z on (P(j) ⊕ Occ(j)) \ {j}.
|
Full Usage:
encodeOperator scheme op j n
Parameters:
EncodingScheme
op : LadderOperatorUnit
j : uint32
n : uint32
Returns: PauliRegisterSequence
|
Encode a single ladder operator using the given scheme. a†_j = ½ c_j − ½i d_j a_j = ½ c_j + ½i d_j
|
|
Jordan-Wigner: U = ∅, P = {0 … j−1}, Occ = {j}.
|
|
Parity: U = {j+1 … n−1}, P = {j−1} if j>0 else ∅, Occ = {j−1, j} if j>0 else {j}.
|
Full Usage:
parityTerms op j n
Parameters:
LadderOperatorUnit
j : uint32
n : uint32
Returns: PauliRegisterSequence
|
Encode a ladder operator using the Parity encoding.
|
|
Build a PauliRegister of width n from a sparse assignment list. Qubits not mentioned default to I.
|