{"id":26536007,"url":"https://github.com/qecsim/qecsimext","last_synced_at":"2025-09-08T09:38:03.939Z","repository":{"id":139133000,"uuid":"336927673","full_name":"qecsim/qecsimext","owner":"qecsim","description":"qecsimext is an example Python 3 package that extends qecsim with additional components.","archived":false,"fork":false,"pushed_at":"2021-02-10T01:55:41.000Z","size":13085,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-15T16:31:56.446Z","etag":null,"topics":["python","qec","quantum-error-correction","simulation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qecsim.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-08T01:17:30.000Z","updated_at":"2021-09-18T00:36:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"165de318-635e-4947-a288-9c81573b4a17","html_url":"https://github.com/qecsim/qecsimext","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/qecsim/qecsimext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qecsim%2Fqecsimext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qecsim%2Fqecsimext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qecsim%2Fqecsimext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qecsim%2Fqecsimext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qecsim","download_url":"https://codeload.github.com/qecsim/qecsimext/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qecsim%2Fqecsimext/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274166295,"owners_count":25233952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","qec","quantum-error-correction","simulation"],"created_at":"2025-03-21T21:17:27.947Z","updated_at":"2025-09-08T09:38:03.917Z","avatar_url":"https://github.com/qecsim.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"qecsimext\n=========\n\n**qecsimext** is an example Python 3 package that extends `qecsim`_ with\nadditional components.\n\n.. _qecsim: https://github.com/qecsim/qecsim\n\nThe qecsim package is a quantum error correction simulator, which can be\nextended with new codes, error models and decoders that integrate into its\ncommand-line interface. This qecsimext package includes very basic examples of\nsuch components to provide a starting point for developing more sophisticated\ncomponents.\n\n\nInstallation\n------------\n\nSince qecsimext is intended as an example of how to develop extensions for\nqecsim, we will download the repository and install qecsimext in editable mode\nin a virtual environment.\n(Alternatively, you may choose to `clone`_ or `fork`_ the qecsimext repository\ninstead of downloading it.)\n\n.. _clone: https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository\n.. _fork: https://docs.github.com/en/github/getting-started-with-github/fork-a-repo\n\n* Download the repository: `qecsimext-0.1b9.zip`_\n\n.. _qecsimext-0.1b9.zip: https://github.com/qecsim/qecsimext/archive/0.1b9.zip\n\n* Install qecsimext in editable mode with developer dependencies:\n\n.. code-block:: text\n\n    $ unzip qecsimext-0.1b9.zip             # extract repo (Windows: tar -xf qecsimext-0.1b9.zip)\n    $ cd qecsimext-0.1b9\n    $ python3 --version                     # qecsimext requires Python 3.5+\n    Python 3.7.8\n    $ python3 -m venv venv                  # create virtual environment\n    $ source venv/bin/activate              # activate venv (Windows: venv\\Scripts\\activate)\n    (venv) $ pip install -U setuptools pip  # install / upgrade setuptools and pip\n    ...\n    Successfully installed pip-21.0.1 setuptools-52.0.0\n    (venv) $ pip install -e .[dev]          # install qecsimext with dev tools\n    ...\n    Successfully installed ... qecsimext ...\n    (venv) $ deactivate                     # deactivate venv\n    $\n\n\n* Test installation:\n\n.. code-block:: text\n\n    $ source venv/bin/activate              # activate venv (Windows: venv\\Scripts\\activate)\n    (venv) $ pytest                         # run tests\n    ...\n    ==== 3 passed in 1.34s =====\n\n* Run simulation example via console script:\n\n.. code-block:: text\n\n    $ source venv/bin/activate              # activate venv (Windows: venv\\Scripts\\activate)\n    (venv) $ qecsim run -r100 \"ext_3qubit\" \"ext_3qubit.bit_flip\" \"ext_3qubit.lookup\" 0.3\n    ...\n    [{\"code\": \"3-qubit\", \"decoder\": \"3-qubit lookup\", \"error_model\": \"3-qubit bit-flip\", \"error_probability\": 0.3, \"logical_failure_rate\": 0.22, ..., \"wall_time\": 0.043655599000000045}]\n\n* Run simulation example via module script with Python optimize flag:\n\n.. code-block:: text\n\n    $ source venv/bin/activate              # activate venv (Windows: venv\\Scripts\\activate)\n    (venv) $ python3 -O -m qecsim run -r100 \"ext_3qubit\" \"ext_3qubit.bit_flip\" \"ext_3qubit.lookup\" 0.3\n    ...\n    [{\"code\": \"3-qubit\", \"decoder\": \"3-qubit lookup\", \"error_model\": \"3-qubit bit-flip\", \"error_probability\": 0.3, \"logical_failure_rate\": 0.22, ..., \"wall_time\": 0.03045584499999965}]\n\n\nNew components\n--------------\n\nNew components can be implemented and integrated into the command-line\ninterface as described below. See also the `qecsim documentation`_.\n\n.. _qecsim documentation: https://qecsim.github.io/\n\n\nImplementation\n~~~~~~~~~~~~~~\n\nNew codes, error models or decoders are implemented by writing classes that\nextend ``qecsim.model.StabilizerCode``, ``qecsim.model.ErrorModel`` or\n``qecsim.model.Decoder``, respectively. (Fault-tolerant decoders extend\n``qecsim.model.DecoderFTP``). See `\u003c./src/qecsimext/threequbit.py\u003e`__ for\nexamples.\n\n\nCLI integration\n~~~~~~~~~~~~~~~\n\nNew codes, error models or decoders are integrated into the command-line\ninterface via entries in the ``[options.entry-points]`` section of\n`\u003c./setup.cfg\u003e`__ under the keys ``qecsim.cli.run.codes``,\n``qecsim.cli.run.error_models`` or ``qecsim.cli.run.decoders``, respectively.\n(Fault-tolerant compatible components are under ``qecsim.cli.run_ftp.*`` keys).\nThe format of entries is ``\u003cshort_name\u003e = \u003cmodule_path\u003e:\u003cclass_name\u003e``. See\n`\u003c./setup.cfg\u003e`__ for examples.\n\nOptionally, one-line descriptions for command-line interface help messages can\nbe provided by decorating implementation classes with\n``qecsim.model.cli_description``. See `\u003c./src/qecsimext/threequbit.py\u003e`__ for\nexamples.\n\n\nNotes\n~~~~~\n\n* Since we installed qecsimext in editable mode there is no need to upgrade the\n  installation after source code changes. However, after modifying\n  `\u003c./setup.cfg\u003e`__, the qecsimext installation must be upgraded:\n\n.. code-block:: text\n\n    $ source venv/bin/activate              # activate venv (Windows: venv\\Scripts\\activate)\n    (venv) $ pip install -U -e .[dev]       # upgrade qecsimext\n    ...\n    Successfully installed qecsimext\n\n\n* When developing new components, qecsimext may be used as a starting point.\n  However, if you intend to put the components in the public domain then it\n  would be good practice to use a unique repository and root package name.\n\n\nTools\n_____\n\nTasks for running tests with coverage, checking style, generating documentation\nand building source and binary distributables can be executed using tox_. See\n`\u003c./tox.ini\u003e`__ for more details.\n\n.. _tox: https://tox.readthedocs.io/\n\nFor example, distributables can be built as follows:\n\n.. code-block:: text\n\n    $ source venv/bin/activate              # activate venv (Windows: venv\\Scripts\\activate)\n    (venv) $ tox -ebuild                    # build qecsimext distributables\n    ...\n    (venv) $ ls ./dist/                     # list qecsimext distributables\n    qecsimext-0.1b9-py3-none-any.whl    qecsimext-0.1b9.tar.gz\n\n\nLicense / Citing\n----------------\n\nqecsimext is released under the BSD 3-Clause license; see `\u003cLICENSE\u003e`__.\n\nIf you use qecsim in your research, please see the `qecsim documentation`_ for\nciting details.\n\n\nLinks\n-----\n\n* Source code: https://github.com/qecsim/qecsimext\n* qecsim source code: https://github.com/qecsim/qecsim\n* qecsim documentation: https://qecsim.github.io/\n* Contact: qecsim@gmail.com\n\n----\n\nCopyright 2016 - 2021, David K. Tuckett.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqecsim%2Fqecsimext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqecsim%2Fqecsimext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqecsim%2Fqecsimext/lists"}