Superfermion
High-performance quantum computing with a Python API and Rust simulation core.
pip install superfermionSuperfermion 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
I'm new here
Install, run a Bell state, understand the basics in 5 minutes.
I want to build circuits
Circuit construction, parameterized gates, gate library reference.
I want to run simulations
sf.run(), sf.simulate(), 4 simulation methods, noise models.
I want to compile for hardware
Gate optimization, SABRE routing, basis translation, noise suppression.
I want to do ML / VQE
Adjoint gradients, VQE, QAOA, 5 gradient methods, ML layers.
I want to run on real QPUs
IBM Quantum, IonQ, AWS Braket, OpenQuantum. Protocol-based, no registries.
I want the API reference
Every class, method, and parameter. Cross-referenced from source.
I want to see benchmarks
MPS 33x vs Qiskit Aer. Adjoint gradient 800x vs PennyLane.
What's inside
| Capability | What you get |
|---|---|
| Simulation | Statevector (CPU/GPU), MPS (200+ qubits), Stabilizer (1000+), Density Matrix |
| Gradients | Adjoint (O(1)), Parameter-shift, SPSA, QNG, Riemannian — 5 methods |
| Chemistry | Jordan-Wigner, Bravyi-Kitaev, UCCSD, PySCF bridge, molecular library |
| Compilation | Gate cancellation, rotation merge, SABRE routing, Pauli twirling, DD |
| QEC | 10 codes + 4 decoders: Surface, Color, Toric, MWPM, Union-Find, BP+OSD |
| ML | Quantum layers for PyTorch, Flax/JAX, TensorFlow |
| Providers | IBM Quantum, IonQ, AWS Braket, OpenQuantum |
| Interop | Qiskit, 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})