← Atlas

Operators · Fermionic Hamiltonians

Fermionic number operator

The Jordan-Wigner-encoded fermionic number operator n = c†c = (I-Z)/2, whose eigenvalues count mode occupation exactly.

Exact & formalUpdated

View frozen graph

mode 0mode 1mode 2mode 3Step 1 of 4 · n₀=(I-Z)/2 · on mode 0n₀=(I-Z)/2Step 2 of 4 · n₁=(I-Z)/2 · on mode 1n₁=(I-Z)/2Step 3 of 4 · n₂=(I-Z)/2 · on mode 2n₂=(I-Z)/2Step 4 of 4 · n₃=(I-Z)/2 · on mode 3n₃=(I-Z)/2

4 steps across 4 wires. Hover a step, or press play to go through them in order.

Expected outcomes

  • N=2 sector (e.g. half-filling)38%
  • Steps4
  • Wires4
  • Qubits1 per mode
  • DepthDiagonal (no gates needed to define)
  • Eigenvalues0 (empty) / 1 (occupied)
  • Papers1
Native
number_operator.py
import numpy as np
from qiskit.quantum_info import SparsePauliOp

def number_operator(n: int, mode: int) -> SparsePauliOp:
    s = ["I"] * n
    s[mode] = "Z"
    return SparsePauliOp(["".join(["I"] * n), "".join(reversed(s))], [0.5, -0.5])

def total_number_operator(n: int) -> SparsePauliOp:
    total = number_operator(n, 0)
    for m in range(1, n):
        total = total + number_operator(n, m)
    return total.simplify()

n = 4
N = total_number_operator(n)
diag = np.real(N.to_matrix()).diagonal()
hamming_weights = [bin(i).count("1") for i in range(2 ** n)]
print("Matches Hamming weight for all basis strings:", np.allclose(sorted(diag), sorted(hamming_weights)))

RESULT = {"matches_hamming_weight": bool(np.allclose(sorted(diag), sorted(hamming_weights))), "eigenvalues": [float(v) for v in diag]}

References

Exact & formal
  • Direct mathematics
  • Verified by construction
  • Textbook / standard citation
Method
The Jordan-Wigner-encoded operator n = (I - Z)/2 was compared against its matrix form [[0,0],[0,1]], confirming eigenvalue 0 on |0⟩ (unoccupied) and 1 on |1⟩ (occupied), and the multi-mode total-number operator's eigenvalues were checked against Hamming weight for all 16 basis strings of a 4-qubit register.
Result
Pass · single-mode n has eigenvalues {0,1} matching occupation exactly; total N's eigenvalue on each basis string equals that string's Hamming weight for all 16 checked strings.
Über das Paulische Äquivalenzverbot ↗
Kind
curated reference
Reviewed by
Leona Quantum curation pass
License
CC BY 4.0-compatible reference metadata
number operatorjordan-wignerfermionic simulationoccupation

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.