Skip to main content

Suface code simulations package

Project description

Surface-sim

example workflow Code style: black PyPI

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

surface_sim-0.4.1.tar.gz (46.1 kB view details)

Uploaded Source

Built Distribution

surface_sim-0.4.1-py3-none-any.whl (68.3 kB view details)

Uploaded Python 3

File details

Details for the file surface_sim-0.4.1.tar.gz.

File metadata

  • Download URL: surface_sim-0.4.1.tar.gz
  • Upload date:
  • Size: 46.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.13

File hashes

Hashes for surface_sim-0.4.1.tar.gz
Algorithm Hash digest
SHA256 ee66dfad495fae0068c2aa5a8a7ae50f171a048eabc0b3297b2f36d2978219c4
MD5 9b3de45e3aa68535a8706bf660273bd9
BLAKE2b-256 5859b674af7b8a5293b957d87d95d78726291e69f9e3942b3fa150080360f0ab

See more details on using hashes here.

File details

Details for the file surface_sim-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: surface_sim-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 68.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.13

File hashes

Hashes for surface_sim-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff86478e7b667b527c65387470e69d886ac1b30a22b2d6efd0fb7c37d67f571d
MD5 d37b06caa9f6bfc26563f912765b28a2
BLAKE2b-256 7bbabd722b079cd1b1cea34880bcd6bc0ac05a96d613daea8b8b9dd8294384d8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page