surface-sim

Stim wrapper for simulations of surface code experiments

https://github.com/marcserraperalta/surface-sim

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.5%) to scientific vocabulary

Keywords

qec stim surface-code
Last synced: 6 months ago · JSON representation ·

Repository

Stim wrapper for simulations of surface code experiments

Basic Info
  • Host: GitHub
  • Owner: MarcSerraPeralta
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 778 KB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • Open Issues: 6
  • Releases: 12
Topics
qec stim surface-code
Created over 1 year ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

Surface-sim

example workflow Code style: black Documentation Status PyPI

This package is a wrapper around Stim to simplify the construction of QEC circuits. Given a circuit, it can implement the logical equivalent under different types of noise, including circuit-level noise. It uses a code layout that helps with qubit labeling, indexing and connectivity. It also defines the detectors automatically for any sequence of logical gates.

For more information see the documentation.

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

Pre-built experiment: memory experiment

``` from surfacesim.layouts import rotsurfacecode from surfacesim.models import CircuitNoiseModel from surfacesim.setups import CircuitNoiseSetup from surfacesim import Detectors from surfacesim.experiments.rotsurfacecodecss import memory_experiment

prepare the layout, model, and detectors objects

layout = rotsurfacecode(distance=3) setup = CircuitNoiseSetup() model = CircuitNoiseModel(setup, layout.qubitinds) detectors = Detectors(layout.ancqubits, frame="pre-gate")

create a memory experiment

NUMROUNDS = 10 DATAINIT = {q: 0 for q in layout.dataqubits} ROTBASIS = True # X basis MEAS_RESET = True # reset after ancilla measurements PROB = 1e-5

setup.setvarparam("prob", PROB) stimcircuit = memoryexperiment( model, layout, detectors, numrounds=NUMROUNDS, datainit=DATAINIT, rotbasis=ROTBASIS, ancreset=MEASRESET, ) ```

Arbitrary logical circuit from a given circuit

``` import stim

from surfacesim.setups import CircuitNoiseSetup from surfacesim.models import CircuitNoiseModel from surfacesim import Detectors from surfacesim.experiments import schedulefromcircuit, experimentfromschedule from surfacesim.circuitblocks.unrotsurfacecodecss import gatetoiterator from surfacesim.layouts import unrotsurfacecodes

circuit = stim.Circuit( """ R 0 1 TICK CNOT 0 1 TICK S 0 I 1 TICK S 0 H 1 TICK M 0 MX 1 """ )

layouts = unrotsurfacecodes(circuit.numqubits, distance=3) setup = CircuitNoiseSetup() model = CircuitNoiseModel.fromlayouts(setup, *layouts) detectors = Detectors.from_layouts("pre-gate", *layouts)

setup.setvarparam("prob", 1e-3)

schedule = schedulefromcircuit(circuit, layouts, gatetoiterator) stimcircuit = experimentfromschedule( schedule, model, detectors, ancreset=True ) ```

For more information and examples about surface-sim, please read the documentation.

Owner

  • Name: MarcSerraPeralta
  • Login: MarcSerraPeralta
  • Kind: user
  • Location: Spain

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: surface-sim
message: >-
  Stim wrapper for simulations of surface code experiments
type: software
authors:
  - given-names: Marc
    family-names: Serra-Peralta
    email: M.SerraPeralta@tudelft.nl
    affiliation: 'QuTech, Delft University of Technology'
    orcid: 'https://orcid.org/0000-0002-8000-8701'
repository-code: "https://github.com/MarcSerraPeralta/surface-sim"
abstract: >-
  This package is a wrapper around Stim to simplify the construction of QEC circuits. Given a circuit, it can implement the logical equivalent under different types of noise, including circuit-level noise. It uses a code layout that helps with qubit labeling, indexing and connectivity. It also defines the detectors automatically for any sequence of logical gates.
keywords:
  - quantum
  - quantum-computing
  - quantum-error-correction
  - surface-code
license: MIT

GitHub Events

Total
  • Create event: 145
  • Release event: 6
  • Issues event: 147
  • Watch event: 3
  • Delete event: 140
  • Issue comment event: 55
  • Push event: 204
  • Pull request event: 285
Last Year
  • Create event: 145
  • Release event: 6
  • Issues event: 147
  • Watch event: 3
  • Delete event: 140
  • Issue comment event: 55
  • Push event: 204
  • Pull request event: 285

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 48
  • Total pull requests: 99
  • Average time to close issues: 19 days
  • Average time to close pull requests: 25 minutes
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.03
  • Merged pull requests: 79
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 48
  • Pull requests: 99
  • Average time to close issues: 19 days
  • Average time to close pull requests: 25 minutes
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.03
  • Merged pull requests: 79
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • MarcSerraPeralta (112)
Pull Request Authors
  • MarcSerraPeralta (197)
Top Labels
Issue Labels
enhancement (57) bug (25) question (18) documentation (8) testing (8)
Pull Request Labels
enhancement (115) bug (41) documentation (15) testing (11)

Dependencies

pyproject.toml pypi
  • PyYAML >= 6.0
  • netCDF4 >= 1.5.8
  • numpy >= 1.22.4
  • qec_util @ git+ssh://git@github.com/BorisVarbanov/qec-util
  • stim >= 1.9.0
  • xarray >= 0.21
requirements.txt pypi
  • asteval ==0.9.31
  • certifi ==2023.11.17
  • cftime ==1.6.3
  • contourpy ==1.2.0
  • cycler ==0.12.1
  • fonttools ==4.47.2
  • future ==0.18.3
  • kiwisolver ==1.4.5
  • lmfit ==1.2.2
  • matplotlib ==3.8.2
  • netcdf4 ==1.6.5
  • networkx ==3.2.1
  • numpy ==1.24.4
  • packaging ==23.2
  • pandas ==2.2.0
  • pillow ==10.2.0
  • pyparsing ==3.1.1
  • python-dateutil ==2.8.2
  • pytz ==2023.4
  • pyyaml ==6.0.1
  • scipy ==1.12.0
  • six ==1.16.0
  • stim ==1.12.1
  • tzdata ==2023.4
  • uncertainties ==3.1.7
  • xarray ==0.21.1
surface_sim/setup/setup.py pypi
.github/workflows/actions.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v4 composite
requirements_dev.txt pypi
  • asteval ==1.0.2 development
  • black ==24.8.0 development
  • build ==1.2.1 development
  • certifi ==2024.7.4 development
  • cftime ==1.6.4 development
  • click ==8.1.7 development
  • contourpy ==1.2.1 development
  • cycler ==0.12.1 development
  • dill ==0.3.8 development
  • exceptiongroup ==1.2.2 development
  • fonttools ==4.53.1 development
  • iniconfig ==2.0.0 development
  • kiwisolver ==1.4.5 development
  • lmfit ==1.3.2 development
  • matplotlib ==3.9.2 development
  • mypy-extensions ==1.0.0 development
  • netcdf4 ==1.7.1.post2 development
  • networkx ==3.3 development
  • numpy ==2.1.0 development
  • packaging ==24.1 development
  • pandas ==2.2.2 development
  • pathspec ==0.12.1 development
  • pillow ==10.4.0 development
  • pip-tools ==7.4.1 development
  • platformdirs ==4.2.2 development
  • pluggy ==1.5.0 development
  • pyparsing ==3.1.2 development
  • pyproject-hooks ==1.1.0 development
  • pytest ==8.3.2 development
  • pytest-black ==0.3.12 development
  • python-dateutil ==2.9.0.post0 development
  • python-sat ==1.8.dev13 development
  • pytz ==2024.1 development
  • pyyaml ==6.0.2 development
  • qec-util ==0.1.0 development
  • scipy ==1.14.0 development
  • six ==1.16.0 development
  • stim ==1.13.0 development
  • toml ==0.10.2 development
  • tomli ==2.0.1 development
  • typing-extensions ==4.12.2 development
  • tzdata ==2024.1 development
  • uncertainties ==3.2.2 development
  • wheel ==0.44.0 development
  • xarray ==2024.7.0 development