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.0.1.tar.gz (255.5 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.0.1-py3-none-any.whl (344.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tqec-0.0.1.tar.gz
  • Upload date:
  • Size: 255.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.8

File hashes

Hashes for tqec-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5b969093566e6e42e49420d8e6c3cff2f73d1e1ac24d758b1aa41ec2dd406dc5
MD5 8adafcce29b3c843850647cd33124e9c
BLAKE2b-256 6f2e2120a5c29bfff3429b1b9fb3de594ee37f0544f7e1c5b112b85d267b34ce

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tqec-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 344.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.8

File hashes

Hashes for tqec-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 500b80d66971a4d7aa1640174cfae3d5fbd16e796f156f4aaabf393f08ed0470
MD5 f48bf9db4f67f7d3fdf27ae8bf7b5d24
BLAKE2b-256 a64808f1c8ed43af8b4fb2f2c3ce9f09f28e649c2fa18c954d890618538c923b

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