Suface code simulations package
Project description
Surface-sim
This package is a wrapper around Stim that aims to help the construction of QEC-code circuits easier. The package implements model classes that help with inserting ciruit-level noise models. It uses a code layout that helps with qubit labeling, indexing and connectivity. Finally, there are a number of circuits for the rotated surface code that are implemented in the package.
For more information see the documentation in docs/
.
Installation
This package is available in PyPI, thus it can be installed using
pip install surface-sim
or alternatively, it can be installed from source using
git clone git@github.com:MarcSerraPeralta/surface-sim.git
pip install surface-sim/
Example
from surface_sim.layouts import rot_surface_code
from surface_sim.models import CircuitNoiseModel
from surface_sim.setup import CircuitNoiseSetup
from surface_sim import Detectors
from surface_sim.experiments.rot_surface_code_css import memory_experiment
# prepare the layout, model, and detectors objects
layout = rot_surface_code(distance=3)
qubit_inds = layout.qubit_inds()
anc_qubits = layout.get_qubits(role="anc")
data_qubits = layout.get_qubits(role="data")
setup = CircuitNoiseSetup()
model = CircuitNoiseModel(setup, qubit_inds)
detectors = Detectors(anc_qubits, frame="1")
# create a memory experiment
NUM_ROUNDS = 10
DATA_INIT = {q: 0 for q in data_qubits}
ROT_BASIS = True # X basis
MEAS_RESET = True # reset after ancilla measurements
PROB = 1e-5
setup.set_var_param("prob", PROB)
stim_circuit = memory_experiment(model, layout, detectors, NUM_ROUNDS, DATA_INIT, ROT_BASIS, MEAS_RESET)
For more information and examples about surface-sim
, please read the docs/
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file surface_sim-0.4.0.tar.gz
.
File metadata
- Download URL: surface_sim-0.4.0.tar.gz
- Upload date:
- Size: 45.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cc8559551586321488e1c335a518d2fc5b7ffd2c9339ab7501f686c7a198b82 |
|
MD5 | fc07dc2fe71ddd5a0604686a5909f652 |
|
BLAKE2b-256 | 59455c5cfda1871c67d6ed9f89657a060c9316d0a1332844a3710942caf58d44 |
File details
Details for the file surface_sim-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: surface_sim-0.4.0-py3-none-any.whl
- Upload date:
- Size: 67.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84792494d5cf1cd1bda2bd16841b4541e49edd3a6086b31c72287fb70da9e20a |
|
MD5 | 94c8c30c9191dcacacd7d6c72a340475 |
|
BLAKE2b-256 | 126ccfb8f8ab504c0745aea9583c1bf67a2d48de130c3464ab1f8489c055cdec |