Skip to main content

A design automation framework for Topological Quantum Error Correction.

Project description

This is a rapidly evolving project - documentation and materials from previous recordings may become outdated quickly. If you encounter any inconsistencies or have questions, please open an issue.


TQEC

Python build docs Stars Star History Chart Ethical Notice Licensed under the Apache 2.0 open-source license

TQEC (Topological Quantum Error Correction) is a design automation software for representing, constructing and compiling large-scale fault-tolerant quantum computations based on surface code and lattice surgery.

In the past decade, there have been significant advancements in surface code quantum computation based on lattice surgery. However, the circuits required to implement these protocols are highly complex. To combine these protocols for constructing larger-scale computation, a substantial amount of effort is needed to manually encode the circuits, and it is extremely challenging to ensure their correctness. As a result, many complex logical computations have not been practically simulated.

tqec provides numerous building blocks based on state-of-the-art protocols, with verified correct circuits implementation for each block. These blocks can then be combined to construct large-scale logical computations, enabling the automatic compilation of large-scale computational circuits.

NOTE: This project is under active development and provide no backwards compatibility at current stage.

Documentation

Documentation is available at https://tqec.github.io/tqec/index.html

Installation

Currently, you need to install tqec from source with pip or uv:

With pip:

python -m pip install git+https://github.com/tqec/tqec.git

With uv:

uv pip install git+https://github.com/tqec/tqec.git

For a more detailed installation guide and common troubleshooting tips, see the installation page in the documentation.

Basic Usage

Here we generate the circuits for a logical CNOT between two logical qubits to demonstrate how to use the tool. Refer to quick start in the documentation for more detailed explanation.

from pathlib import Path

from tqec import BlockGraph, compile_block_graph, NoiseModel

# 0. Path to the logical_cnot.dae file
cnot_dae_filepath = Path.cwd() / "assets" / "logical_cnot.dae"
if not cnot_dae_filepath.exists():
    print(f"The file '{cnot_dae_filepath}' does not exist.")

# 1. Construct the logical computation
block_graph = BlockGraph.from_dae_file(cnot_dae_filepath)

# 2. Get the correlation surfaces of interest and compile the computation
correlation_surfaces = block_graph.find_correlation_surfaces()
compiled_computation = compile_block_graph(block_graph, observables=[correlation_surfaces[1]])

# 3. Generate the `stim.Circuit` of target code distance
circuit = compiled_computation.generate_stim_circuit(
    # k = (d-1)/2 is the scale factor
    # Large values will take a lot of time.
    k=2,
    # The noise applied and noise levels can be changed.
    noise_model=NoiseModel.uniform_depolarizing(0.001),
)

See the user guide for more tutorials.

Contributing

Pull requests and issues are more than welcomed!

See the contributing page for for specific instructions to start contributing.

Community

Every Wednesday at 8:30am PST, we hold meetings to discuss project progress and conduct educational talks related to TQEC.

Here are some helpful links to learn more about the community:

  • Overview of state of the art 2D QEC: Slides/Video
  • Community questions and answers: Docs
  • Introduction to surface code quantum computation: Slides
  • Programming a quantum computer using SketchUp: Slides/Video

All the resources and group meeting recordings are available at this link.

Please join the Google group to receive more updates and information!


Ethical notice

This library is intended for academic, educational, and civilian research only, in the field of fault-tolerant quantum computing, particularly in surface code compilation and topological error correction.

It is made freely and publicly available without access restrictions, in the interest of advancing open scientific and academic collaboration.

The maintainers request that users and contributors refrain from engaging in, supporting, or facilitating military, surveillance, or dual-use applications.

Please, review the full ETHICAL_NOTICE.md for important terms regarding export control, ethical use, and contributor responsibilities.


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

tqec-0.2.0.tar.gz (264.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tqec-0.2.0-py3-none-any.whl (353.4 kB view details)

Uploaded Python 3

File details

Details for the file tqec-0.2.0.tar.gz.

File metadata

  • Download URL: tqec-0.2.0.tar.gz
  • Upload date:
  • Size: 264.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tqec-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a72af12e99c745b61c1e92e1afaf13d22adfc488a43f30f485702fbc1d220f93
MD5 c80f35672405cea3a77426c8c0fcd613
BLAKE2b-256 e7d270a9eb78cb74298bf1a0010ec4e07fe9fcd9dfe5d78d991159dbd1afd445

See more details on using hashes here.

File details

Details for the file tqec-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tqec-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 353.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tqec-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f559d1172222f1669a94537d2acea800f7d8b772b7f35b7e5b37ab51135716ca
MD5 2e1886248ef408aba96628e44ecd2108
BLAKE2b-256 43a3253be0d8a851168102f35e36f213c790a01a220e248a4fa2d04cd1fa8d57

See more details on using hashes here.

Supported by

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