MajoranaMapping
The MajoranaMapping class defines a fermion-to-qubit encoding.
It exposes the bilinear \(i\,\gamma_j\,\gamma_k\) as the unified primitive available across every encoding, and (for Majorana-atomic encodings) individual Majorana operators \(\gamma_k\) as an additional capability.
It follows QDK/Chemistry’s data-container conventions for immutable fermion-to-qubit encoding data.
Overview
Fermion-to-qubit mappings transform fermionic creation and annihilation operators into qubit (Pauli) operators.
The MajoranaMapping class encapsulates such an encoding as data, making the QubitMapper algorithm encoding-agnostic: the mapper receives the encoding as data rather than selecting it internally.
Bilinears as the unified primitive
Every fermion-to-qubit encoding can express the bilinear product \(i\,\gamma_j\,\gamma_k\) as a Pauli string. This makes the bilinear the most general building block that all encodings share.
Why bilinears? Physical (parity-conserving) fermionic operators can always be written as products of bilinears, so any Hamiltonian can be mapped through bilinears alone — even if the encoding does not assign a Pauli image to individual Majorana operators \(\gamma_k\).
For the formal foundations, see Bravyi and Kitaev (2002), which develops the Majorana-operator perspective on fermion-to-qubit encodings.
Individual Majorana operators \(\gamma_k\) have a Pauli image only in Majorana-atomic encodings (e.g. Jordan-Wigner, Bravyi-Kitaev, Parity). In bilinear-only encodings — where the number of qubits exceeds the number of fermionic modes — single Majoranas have no representation in the physical subspace; only the bilinears are observable.
The MajoranaMapping supports both forms:
bilinear()— the unified primitive available on every encoding.majorana()— the additional capability provided by Majorana-atomic encodings; gated byis_majorana_atomic.
Majorana-atomic mappings are constructed from a Pauli-string table (the constructor or factory methods).
Bilinear-only mappings are constructed via from_bilinears().
Convention
num_modesThe number of fermionic modes (spin-orbitals) in the system.
Pauli strings use little-endian qubit ordering, consistent with the rest of QDK/Chemistry’s PauliOperator layer.
majorana() and bilinear() return Pauli strings in the encoding’s native (pre-taper) qubit basis.
Built-in encodings
Factory methods construct standard encodings for a given number of modes.
Each returns a MajoranaMapping with the appropriate Pauli-string table and a descriptive name.
Jordan-Wigner
from qdk_chemistry.data import MajoranaMapping
mapping = MajoranaMapping.jordan_wigner(num_modes=12)
# Bilinear (works on every encoding):
coeff, pauli_str = mapping.bilinear(0, 1)
# Single Majorana (Majorana-atomic encodings only):
if mapping.is_majorana_atomic:
gamma_0 = mapping.majorana(0)
Encodes each fermionic mode in a single qubit. See Jordan-Wigner Jordan-Wigner1928 for a description of the encoding.
Bravyi-Kitaev
mapping = MajoranaMapping.bravyi_kitaev(num_modes=12)
Uses a binary-tree structure to reduce average Pauli-string weight. See Bravyi-Kitaev Seeley2012 for a description of the encoding.
Parity
mapping = MajoranaMapping.parity(num_modes=12)
Encodes cumulative electron-number parities. See Parity Seeley2012 for a description of the encoding.
Custom encodings
A custom Majorana-atomic encoding can be defined by providing a sparse Pauli-word table directly:
from qdk_chemistry.data import MajoranaMapping
# Provide one sparse Pauli word per Majorana operator.
# Entries are (qubit_index, operator_code), with X=1, Y=2, Z=3.
mapping = MajoranaMapping.from_table([...], name="my-custom-encoding")
Serialization
MajoranaMapping supports the same serialization formats as other QDK/Chemistry data classes:
from qdk_chemistry.data import MajoranaMapping
mapping = MajoranaMapping.jordan_wigner(num_modes=12)
# JSON round-trip
json_str = mapping.to_json()
restored = MajoranaMapping.from_json(json_str)
# HDF5 round-trip
mapping.to_hdf5_file("mapping.h5")
restored = MajoranaMapping.from_hdf5_file("mapping.h5")
Further reading
QubitMapper: The algorithm that consumes a
MajoranaMappingto perform fermion-to-qubit transformationsDesign principles: Data class design principles in QDK/Chemistry