Name | surface-sim JSON |
Version |
0.5.0
JSON |
| download |
home_page | None |
Summary | Suface code simulations package |
upload_time | 2024-12-18 08:38:43 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | MIT License Copyright (c) 2023 MarcSerraPeralta Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
quantum
error correction
surface code
stabilizer simulation
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Surface-sim
![example workflow](https://github.com/MarcSerraPeralta/surface-sim/actions/workflows/ci_pipeline.yaml/badge.svg)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
![PyPI](https://img.shields.io/pypi/v/surface-sim?label=pypi%20package)
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="pre-gate")
# 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/`.
Raw data
{
"_id": null,
"home_page": null,
"name": "surface-sim",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Marc Serra Peralta <marcserraperalta@gmail.com>",
"keywords": "quantum, error correction, surface code, stabilizer simulation",
"author": null,
"author_email": "Marc Serra Peralta <marcserraperalta@gmail.com>, Boris Varbanov <b.m.varbanov@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/35/f0/9d0f098ea8d0ce29b42dbd7a768314af164e9ccf1596082f43465c721cce/surface_sim-0.5.0.tar.gz",
"platform": null,
"description": "# Surface-sim\n\n![example workflow](https://github.com/MarcSerraPeralta/surface-sim/actions/workflows/ci_pipeline.yaml/badge.svg)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n![PyPI](https://img.shields.io/pypi/v/surface-sim?label=pypi%20package)\n\n\nThis 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.\n\nFor more information see the documentation in `docs/`. \n\n## Installation\n\nThis package is available in PyPI, thus it can be installed using\n```\npip install surface-sim\n```\n\nor alternatively, it can be installed from source using\n```\ngit clone git@github.com:MarcSerraPeralta/surface-sim.git\npip install surface-sim/\n```\n\n## Example\n\n```\nfrom surface_sim.layouts import rot_surface_code\nfrom surface_sim.models import CircuitNoiseModel\nfrom surface_sim.setup import CircuitNoiseSetup\nfrom surface_sim import Detectors\nfrom surface_sim.experiments.rot_surface_code_css import memory_experiment\n\n# prepare the layout, model, and detectors objects\nlayout = rot_surface_code(distance=3)\n\nqubit_inds = layout.qubit_inds()\nanc_qubits = layout.get_qubits(role=\"anc\")\ndata_qubits = layout.get_qubits(role=\"data\")\n\nsetup = CircuitNoiseSetup()\n\nmodel = CircuitNoiseModel(setup, qubit_inds)\n\ndetectors = Detectors(anc_qubits, frame=\"pre-gate\")\n\n# create a memory experiment\nNUM_ROUNDS = 10\nDATA_INIT = {q: 0 for q in data_qubits}\nROT_BASIS = True # X basis\nMEAS_RESET = True # reset after ancilla measurements\nPROB = 1e-5\n\nsetup.set_var_param(\"prob\", PROB)\nstim_circuit = memory_experiment(model, layout, detectors, NUM_ROUNDS, DATA_INIT, ROT_BASIS, MEAS_RESET)\n```\n\nFor more information and examples about `surface-sim`, please read the `docs/`.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2023 MarcSerraPeralta Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Suface code simulations package",
"version": "0.5.0",
"project_urls": null,
"split_keywords": [
"quantum",
" error correction",
" surface code",
" stabilizer simulation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a6a28bd8faf3a1329af3cd25fedbc3cab161163dca6d33e7d097baaec06427a6",
"md5": "9949d58dd623e0a54c93cd83d7d1390c",
"sha256": "ceba7a531e20877531b6951920d20feb9e28ffd00e4e3ba6c81184d92f5261ba"
},
"downloads": -1,
"filename": "surface_sim-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9949d58dd623e0a54c93cd83d7d1390c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 76612,
"upload_time": "2024-12-18T08:38:41",
"upload_time_iso_8601": "2024-12-18T08:38:41.210168Z",
"url": "https://files.pythonhosted.org/packages/a6/a2/8bd8faf3a1329af3cd25fedbc3cab161163dca6d33e7d097baaec06427a6/surface_sim-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "35f09d0f098ea8d0ce29b42dbd7a768314af164e9ccf1596082f43465c721cce",
"md5": "d814c0869b870c2ce007a9ffe27f64c3",
"sha256": "cf775d36c44a3e2b620e44d892fa2b576aaa85a28477d324950caae6c270ddaa"
},
"downloads": -1,
"filename": "surface_sim-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "d814c0869b870c2ce007a9ffe27f64c3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 53078,
"upload_time": "2024-12-18T08:38:43",
"upload_time_iso_8601": "2024-12-18T08:38:43.680999Z",
"url": "https://files.pythonhosted.org/packages/35/f0/9d0f098ea8d0ce29b42dbd7a768314af164e9ccf1596082f43465c721cce/surface_sim-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-18 08:38:43",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "surface-sim"
}