Deltakit allows you to create and run quantum error correction (QEC) experiments with features including circuit generation, simulation, decoding and results analysis.
Whether you're a seasoned QEC researcher or just starting out, Deltakit supports you in exploring new ways to implement QEC logic all the way to running complex QEC circuits on QPU hardware.
Install Deltakit with pip.
pip install deltakitdeltakit provides a full pipeline to help you run quantum error correction experiments.
from deltakit.circuit.gates import PauliBasis
from deltakit.decode import PyMatchingDecoder
from deltakit.decode.analysis import run_decoding_on_circuit
from deltakit.explorer.analysis import calculate_lep_and_lep_stddev
from deltakit.explorer.codes import RotatedPlanarCode, css_code_memory_circuit
from deltakit.explorer.qpu import QPU, ToyNoise
# Creating a noisy memory circuit with the rotated planar code
d = 3
rplanar = RotatedPlanarCode(width=d, height=d)
circuit = css_code_memory_circuit(rplanar, num_rounds=d, logical_basis=PauliBasis.Z)
qpu = QPU(circuit.qubits, noise_model=ToyNoise(p=0.01))
noisy_circuit = qpu.compile_and_add_noise_to_circuit(circuit)
# Perform simulation and correct the measured observable flips with a decoder
num_shots, batch_size = 100_000, 10_000
decoder, noisy_circuit = PyMatchingDecoder.construct_decoder_and_stim_circuit(noisy_circuit)
result = run_decoding_on_circuit(
noisy_circuit, num_shots, decoder, batch_size, min_fails=100
)
# Print the results
fails = result["fails"]
lep, lep_stddev = calculate_lep_and_lep_stddev(fails, num_shots)
print(f"LEP = {lep:.5g} ± {lep_stddev:.5g}")The deltakit library also allows you to access advanced simulation capabilities that
are not yet available in the open-source local code.
To access them, you need to obtain an authentication token on the Deltakit website.
You can register your token by executing the following code once. You do not have to call
set_token again, except if you need to change your token.
from deltakit.explorer import Client
Client.set_token("<your token>")Generate a QEC experiment by calling the cloud API:
from deltakit.explorer.codes import css_code_stability_circuit, RotatedPlanarCode
from deltakit.circuit.gates import PauliBasis
from deltakit.explorer import Client
# Get a client instance. You need to register your token first.
client = Client.get_instance()
# Generate a stability experiment with the rotated planar code.
circuit = css_code_stability_circuit(
RotatedPlanarCode(3, 3),
num_rounds=3,
logical_basis=PauliBasis.X,
client=client
)
# Display the resulting circuit
print(circuit)Learn more by reading the Deltakit docs!
- Found a bug? Need a feature? File an issue.
- Usage questions? Visit our Q&A forum.
- Have a security concern? See our security policy.
Help us make Deltakit better! Check out Contributor guide
This project is distributed under the Apache 2.0 License.
If you find this toolkit useful, please consider citing it:
@software{deltakit,
author = {Prawiroatmodjo, Guen and Burton, Angela and Suau, Adrien and Nnadi, Chidi and Bracken Ziad, Abbas and Melvin, Adam and Richardson, Adam and Walayat, Adnaan and Moylett, Alex and Virbule, Alise and Safehian, AmirReza and Patterson, Andrew and Buyskikh, Anton and Ruben, Archi and Barber, Ben and Reid, Brendan and Manuel, Cai Rees and Seremet, Dan and Byfield, David and Matekole, Elisha and Gallardo, Gabriel and Geher, Gyorgy and Turner, Jack and Lal, Jatin and Camps, Joan and Majaniemi, Joonas and Yates, Joseph and Johar, Kauser and Barnes, Kenton and Caune, Laura and Zigante, Lewis and Skoric, Luka and Jastrzebski, Marcin and Ghibaudi, Marco and Turner, Mark and Haberland, Matt and Stafford, Matthew and Blunt, Nick and Gillett, Nicole and Crawford, Ophelia and McBrien, Philip and Ishtiaq, Samin and Protasov, Stanislav and Wolanski, Stasiu and Hartley, Tom},
title = {Deltakit},
month = sep,
year = 2025,
publisher = {Zenodo},
doi = {10.5281/zenodo.17145113},
url = {https://doi.org/10.5281/zenodo.17145113},
}


