sfSuperfermion docs

Superfermion

High-performance quantum computing with a Python API and Rust simulation core.

pip install superfermion

Superfermion is a high-performance quantum computing framework. A fluent Python API for everything you write, a Rust simulation core for everything the computer runs. 3–5x faster than Qiskit Aer, 21–33x for MPS, up to 800x for adjoint gradients vs PennyLane.

Choose your path

What's inside

CapabilityWhat you get
SimulationStatevector (CPU/GPU), MPS (200+ qubits), Stabilizer (1000+), Density Matrix
GradientsAdjoint (O(1)), Parameter-shift, SPSA, QNG, Riemannian — 5 methods
ChemistryJordan-Wigner, Bravyi-Kitaev, UCCSD, PySCF bridge, molecular library
CompilationGate cancellation, rotation merge, SABRE routing, Pauli twirling, DD
QEC10 codes + 4 decoders: Surface, Color, Toric, MWPM, Union-Find, BP+OSD
MLQuantum layers for PyTorch, Flax/JAX, TensorFlow
ProvidersIBM Quantum, IonQ, AWS Braket, OpenQuantum
InteropQiskit, Cirq, PennyLane, OpenQASM 2/3 import/export
import superfermion as sf

# Bell state — 3 lines
qc = sf.Circuit(2).h(0).cx(0, 1)
result = sf.run(qc, shots=1024)
print(result.counts)  # {'00': ~512, '11': ~512}

# Gradient — exact, O(1) scaling
ansatz = sf.Circuit(2).ry(sf.param("t"), 0).cnot(0, 1).ry(sf.param("p"), 1)
state = sf.simulate(ansatz, params={"t": 0.5, "p": 1.2})
grads = state.grad(obs, ansatz.bind({"t": 0.5, "p": 1.2}).to_ir(), {"t": 0.5, "p": 1.2})

On this page