{"id":18522631,"url":"https://github.com/xanaduai/flamingpy","last_synced_at":"2025-04-05T02:04:59.474Z","repository":{"id":37077192,"uuid":"471175863","full_name":"XanaduAI/flamingpy","owner":"XanaduAI","description":"FlamingPy is a cross-platform Python library with a variety of backends for efficient simulations of error correction in fault-tolerant quantum computers.","archived":false,"fork":false,"pushed_at":"2025-01-20T16:26:15.000Z","size":19383,"stargazers_count":54,"open_issues_count":0,"forks_count":18,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-29T01:04:22.479Z","etag":null,"topics":["error-correction","fault-tolerant","python","quantum-computing","quantum-optics","unitaryhack"],"latest_commit_sha":null,"homepage":"https://flamingpy.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XanaduAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":".github/code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-17T23:37:17.000Z","updated_at":"2025-02-18T00:05:58.000Z","dependencies_parsed_at":"2024-11-04T23:20:22.627Z","dependency_job_id":"a1d89c8e-3ff4-44e9-ac1e-8b40d0ac6d6a","html_url":"https://github.com/XanaduAI/flamingpy","commit_stats":{"total_commits":65,"total_committers":11,"mean_commits":5.909090909090909,"dds":0.6923076923076923,"last_synced_commit":"282e7dfcc62e79a4873efbda9a6bde15771d3f32"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XanaduAI%2Fflamingpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XanaduAI%2Fflamingpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XanaduAI%2Fflamingpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XanaduAI%2Fflamingpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XanaduAI","download_url":"https://codeload.github.com/XanaduAI/flamingpy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276163,"owners_count":20912288,"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","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":["error-correction","fault-tolerant","python","quantum-computing","quantum-optics","unitaryhack"],"created_at":"2024-11-06T17:32:23.965Z","updated_at":"2025-04-05T02:04:59.453Z","avatar_url":"https://github.com/XanaduAI.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![flamingpy_logo_light](https://user-images.githubusercontent.com/57886357/180842159-8fe780a9-8bbe-4421-ae51-c8bd9614aa91.svg#gh-light-mode-only)\n![flamingpy_logo_dark](https://user-images.githubusercontent.com/57886357/180842174-0f2785ba-b065-4a76-b288-b75645ebd67a.svg#gh-dark-mode-only)\n\n\u003cp align=\"center\"\u003e\n  \u003c!-- Tests (GitHub actions) --\u003e\n  \u003ca href=\"https://github.com/XanaduAI/flamingpy/actions/workflows/build_tests.yaml\"\u003e\n    \u003cimg src=\"https://github.com/XanaduAI/flamingpy/actions/workflows/build_tests.yaml/badge.svg\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- ReadTheDocs --\u003e\n  \u003ca href=\"https://flamingpy.readthedocs.io\"\u003e\n    \u003cimg src=\"https://img.shields.io/readthedocs/flamingpy.svg\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- CodeFactor --\u003e\n  \u003ca href=\"https://www.codefactor.io/repository/github/xanaduai/flamingpy\"\u003e\n    \u003cimg src=\"https://img.shields.io/codefactor/grade/github/XanaduAI/flamingpy/main\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- CodeCov --\u003e\n  \u003ca href=\"https://codecov.io/gh/XanaduAI/flamingpy\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/XanaduAI/flamingpy/branch/main/graph/badge.svg?token=3FUq4JZL7X\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- PyPI (Python Version) --\u003e\n  \u003ca href=\"https://pypi.org/project/flamingpy\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/pyversions/flamingpy.svg\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- PyPI --\u003e\n  \u003ca href=\"https://pypi.org/project/flamingpy\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/flamingpy.svg\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- License --\u003e\n  \u003ca href=\"https://www.apache.org/licenses/LICENSE-2.0\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/l/flamingpy.svg?logo=apache\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://flamingpy.readthedocs.io/en/latest/\"\u003eFlamingPy\u003c/a\u003e is a cross-platform Python library with a variety of backends for efficient simulations of error correction in fault-tolerant quantum computers.\n\u003c/p\u003e\n\n## Features\n\n\u003cimg src=\"https://user-images.githubusercontent.com/25132802/168440346-9e285190-9527-482e-8877-b64c348df3b5.svg\" width=\"330px\" align=\"right\"\u003e\n\n* Simulates error correction on combinations of continuous-variable (CV) and discrete-variable (DV) codes to obtain estimations of fault-tolerant thresholds.\n* Supports encoding qubits into GKP states (more precisely, combinations of GKP and squeezed states).\n* Is conveniently modularized, allowing the user to insert custom noise models, codes, decoders, backends and other features.\n* Provides a host of visualization tools for ease of verifying correctness.\n\n## Download and installation\n\nFlamingPy requires **Python 3.8 or above**. The recommended method to download and install FlamingPy, as well as all dependencies and precompiled C++ binaries, is through `pip` and our [PyPI package](https://pypi.org/project/flamingpy). In your choice of CLI (with a Python environment activated) run the following single command:\n\n```bash\npython -m pip install flamingpy\n```\n\n#### Installation from Source (advanced users)\n\nIf you are a developer and wish to manipulate and test FlamingPy source code, you can install the project from Source. First, clone FlamingPy through the Code tab above. Then, create and activate a new virtual environment (if you prefer using an existing environment, you may need to uninstall existing FlamingPy builds). If you use **Conda**, for example, you may run the following:\n\n```bash\nconda create -n flamingpy python=3.8\nconda activate flamingpy\n```\n\nFinally, change to the directory where FlamingPy was cloned and run:\n\n```bash\npython -m pip install -r dev_requirements.txt\npython setup.py develop # only installs Python libraries\npython setup.py build_cmake --inplace # [OPTIONAL] compiles CMake-based backends\n```\n\nNote you will need to remove the comments manually if you use Windows prompt. The purpose of the commands is as follows:\n- The first command installs dependencies for building the project and testing purposes, and can be skipped if already satisfied. \n- The second command (develop) installs FlamingPy Python libraries without compiling the optional backends. \n- The next optional command compiles various FlamingPy backends as required (given you have appropriate compilers pre-installed). \n\nIf you encountered **CMake** errors, you may need to (re-)install it through `conda install cmake` or other means before re-attempting the above. Furthermore, you may wish to try `conda install git` for **git**-related errors. \n\n## Getting started and basic usage\n\nThere is a vast literature available to understand the theoretical concepts behind FlamingPy. For a self-contained description, see Xanadu's [blueprint](https://quantum-journal.org/papers/q-2021-02-04-392/) for a fault-tolerant photonic quantum computer. You can also visit the documentation, which will be updated with more resources over time.\n\nTo see a sample of what FlamingPy can do, let us first import a few important objects:\n\n```\nfrom flamingpy.codes import SurfaceCode\nfrom flamingpy.noise import CVLayer\nfrom flamingpy.decoders import correct\n```\n\nNext, let us instantiate an RHG lattice -- the measurement-based version of the surface code:\n\n```\nRHG = SurfaceCode(3)\n```\n\nThe integer denotes the code distance. By default, the boundaries are set to \"open\". Now, let us define and apply a continuous-variable noise model to the code:\n\n```\nCVRHG = CVLayer(RHG, delta=0.1, p_swap=0.5)\nCVRHG.apply_noise()\n```\n\nThis had the effect of labelling half the lattice (on average) with GKP states and the other half with p-squeezed states. Then, a Gaussian random noise model was applied with a squeezing parameter of 0.1 to the states in the lattice. Finally, a syndrome measurement (sequence of homodyne measurements) was conducted on the lattice, with the outcomes translated to bit values.\n\nAt this point, we are ready to perform error correction on the code and print a message identifying success or failure:\n\n```\nc = correct(RHG)\noutcome = \"succeeded.\" * bool(c) + \"failed.\" * (1 - bool(c))\nmessage = \"Error correction {}\".format(outcome)\nprint(message)\n```\n\nSee our [documentation](https://flamingpy.readthedocs.io/en/latest/usage/tutorials.html) for more tutorials.\n\n\n\n\u003c!-- ## Performance Demos --\u003e\n\n\n## Contribution\n\nSee our contributions policy and list of contributors to FlamingPy [here](https://github.com/XanaduAI/flamingpy/blob/main/.github/CONTRIBUTING.rst).\n\n\n## Support\n\n- **Source Code:** https://github.com/XanaduAI/flamingpy\n- **Issue Tracker:** https://github.com/XanaduAI/flamingpy/issues\n- **FlamingPy Documentation:** https://flamingpy.readthedocs.io/\n- **FlamingPy Discussion Forum:** https://discuss.pennylane.ai/c/flamingpy\n\nIf you are having issues, please let us know by posting the issue on our [GitHub Issue Tracker](https://github.com/XanaduAI/flamingpy/issues).\n\nWe also have a **#flamingpy** channel on the [Xanadu Slack](https://join.slack.com/t/xanadu-quantum/shared_invite/zt-1bmpli2c0-Qjb_PvCi2ewH6xfbM6mLmw), [GitHub Discussion Pages](https://github.com/XanaduAI/flamingpy/discussions), and a [Discussion Forum](https://discuss.pennylane.ai/c/flamingpy), all great places to start a general discussion and connect with our community members.\n\n\n## Attribution for authors\n\nFlamingPy is the work of [many contributors](https://github.com/XanaduAI/flamingpy/graphs/contributors). If you are doing research using FlamingPy, please cite our paper below:\n\n\n\u003e Ilan Tzitrin, Takaya Matsuura, Rafael N. Alexander, Guillaume Dauphinais, J. Eli Bourassa, Krishna K. Sabapathy, Nicolas C. Menicucci, and Ish Dhand,\n\u003e Fault-Tolerant Quantum Computation with Static Linear Optics, PRX Quantum, Vol. 2, No. 4, 2021,\n\u003e [DOI:10.1103/prxquantum.2.040353](http://dx.doi.org/10.1103/PRXQuantum.2.040353)\n\nIn addition to the authors above, the developers would like to thank Sanchit Bapat, Ashlesha Patil, Michael Vasmer, and Trevor Vincent for their contributions to the pre-release project.\n## License\n\nFlamingPy is **free** and **open source**, and released under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanaduai%2Fflamingpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxanaduai%2Fflamingpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanaduai%2Fflamingpy/lists"}