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.1.0.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.1.0-py3-none-any.whl (344.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tqec-0.1.0.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.1.0.tar.gz
Algorithm Hash digest
SHA256 437a2269065d868d1e4401a2346034be625fdf907924710c3502eda635793b66
MD5 10c4f697f68f776f5fcf1802d52c130b
BLAKE2b-256 5cd6d33c667f9778b2742357879dd3a994451405d64e1fbd2116b1ebe2ac543e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tqec-0.1.0-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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d16f6754229cb697db82b675ccfe09fbc4aa9a5084f739b52fb2ad42f28c1eb
MD5 08b1e40df0474a8d759167bfea149ced
BLAKE2b-256 0f361b627b3caed04a0d8e9c8add81b5ee49041c293f677d6a5edb260645c017

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