The open H-cat simulation SDK
An open-source Python SDK for simulating pieces of the H-cat encoding: cat generation from squeezed vacuum (ideal and beamsplitter-tap subtraction), single-mode cat loss curves, and an illustrative resource model. These are component simulations of small cats; the resource numbers are model values from an abstract circuit model with assumed loss heralds, not a hardware operating point.
Install
conda create -n dyber python=3.11 -y
conda activate dyber
pip install qutip numpy scipy matplotlib stim pymatching
pip install dyberforge # simulation SDK, Apache-2.0
Quickstart
import dyberforge as df
# Generate a small cat at 6 dB squeezing, single photon subtraction (component simulation)
res = df.generate_cat(s_db=6.0, k=1, N=40)
print(res["fidelity"], res["alpha"], res["parity"]) # 0.997, 1.0 (a small cat), -1.0
# Model resource estimate (illustrative). Model value: abstract circuit
# model with assumed loss heralds. Not a hardware operating point.
# At or above the 0.79% model threshold, estimate() returns
# distance None.
est = df.estimate(gamma=0.005, target_logical_err=1e-9)
print(est["distance"], est["cats_per_logical"]) # 53, 5617 (model values)
Dyber SDK: run circuits on the simulator
The dyber package is a gate-model circuit SDK with a local simulator. Write a circuit, build it, and run it on the local simulator. The hcat_qpu backend is not available. The simulator's optional noise is illustrative: pass loss_per_cycle and it applies the resource model's logical error estimate as output bit flips and reports the fraction of shots the model would flag as erasures. Its resource numbers are model values from an abstract circuit model with assumed loss heralds, not a hardware operating point.
pip install dyber # circuit SDK, Apache-2.0
from dyber import Dyber, Circuit
dy = Dyber()
c = Circuit(2, "bell")
c.h(0); c.cx(0, 1); c.measure_all()
job = dy.backend("local_simulator").run(c, shots=1000)
print(job.result().counts()) # {'00': 502, '11': 498}
print(job.result().resources) # model values: distance, cats_per_logical, regime, ...
Supported gates: h, x, y, z, s, t, cx, cz, swap, rx, ry, rz, p, measure. Backends: local_simulator (statevector, optional illustrative noise), hcat_qpu (not available). Try it in your browser.
What is inside
Cat generation
Cat generation from squeezed vacuum by photon subtraction (ideal, and a non-ideal beamsplitter tap with a photon-number-resolving herald), the pure-loss channel, and the best-fit cat fidelity, purity, mean photon number and photon-number parity (the loss flag). generate_cat() returns the QuTiP state, so you can plot its Wigner function. Component simulations of small cats.
Loss curves
Single-mode cat loss curves: how photon loss degrades one cat mode, with and without ideal parity tracking. A component result, not a loss budget for the H-cat logical qubit.
Resource model
The illustrative resource model behind the Resource Analyzer: code distance, cats per logical qubit and hardware modes (model loss threshold 0.79 to 0.898 percent per cycle). Model value: abstract circuit model with assumed loss heralds. Not a hardware operating point.
Not in the package
Dyber's other research code (cat breeding, hybrid fusion, the stim and PyMatching surface-code runs, the master-equation check, and the Meep and MPB device simulations) is internal research code and is not part of the public package.
These are component simulations and a model. They do not show that a fault-tolerant H-cat machine is buildable. No Dyber hardware exists.