Skip to content

Commit 95d097e

Browse files
committed
refactor to graphqec. adapt readme
1 parent be14716 commit 95d097e

21 files changed

+62
-31
lines changed

.coveragerc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ omit =
88
[coverage:report]
99
show_missing = True
1010
skip_covered = True
11-
include =
12-
qec/*
11+
include =
12+
graphqec/*

README.md

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,63 @@
1-
![Logo](qec-with-code_logo.png)
1+
<!-- ![Logo](qec-with-code_logo.png) -->
2+
# Graph QEC
23

34
[![Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue)](https://opensource.org/licenses/Apache-2.0)
45

5-
This repository provides a collection of **Quantum Error Correction (QEC)** code implementations. The goal is to demonstrate how QEC works with different error thresholds and provide practical examples of implementing error correction codes on quantum circuits.
6+
**Graph QEC** is a Python package under development that provides tools for implementing **Quantum Error Correction Codes (QECC)** by constructing their **Tanner Graphs**, automatically compiling them into **[Stim](https://github.com/quantumlib/Stim)** circuits, and computing error correction thresholds. This package allows researchers and developers to explore quantum error correction techniques, simulate quantum codes under gate error models, and analyze their performance through error thresholds.
7+
8+
## Features
9+
10+
- **Tanner Graph Representation**: Visualize and analyze quantum error correction codes through Tanner graphs, a graphical representation that simplifies the understanding of code structure and error syndromes.
11+
- **Stim Circuit Compilation**: Automatically compile Tanner graphs into **Stim** circuits, enabling easy integration with simulation tools for error correction and noise analysis.
12+
- **Threshold Computation**: Compute and analyze the error threshold of a quantum code, which indicates the error rate at which the code remains fault-tolerant.
613

714
## List of Implemented QEC Codes
815

9-
- **[Repetition code](notebooks/repetition_code.ipynb)**
10-
- **[Rotated surface code](notebooks/rotated_surface_code.ipynb)**
16+
- **[Repetition Code](notebooks/repetition_code.ipynb)**
17+
- **[Shor Code](#)** (**in progress**)
18+
- **[Rotated Surface Code](notebooks/rotated_surface_code.ipynb)**
19+
- **[Bivariate Bicycle Code](#)** (**in progress**).
1120

1221
## Installation
1322

14-
This package can be installed by cloning the repository and running
23+
Since **Graph QEC** is not yet available on PyPI, you can install it by cloning the repository directly from GitHub:
24+
25+
1. Clone the repository:
26+
27+
```bash
28+
git clone https://github.com/adelshb/graphqec
29+
cd graphqec
30+
31+
2. You can then install the package by running:
32+
33+
```bash
34+
pip install .
35+
36+
This will install the package in your local environment. Once installed, you can use it to generate Tanner graphs, compile Stim circuits, and compute error thresholds.
37+
38+
## Installation
39+
40+
Since **Graph QEC** is not yet available on PyPI, you can install it by cloning the repository directly from GitHub:
41+
42+
```consoleCopy code
43+
git clone https://github.com/adelshb/graphqec
44+
cd graphqec
45+
```
46+
47+
then, this package can be then installed by running
1548

1649
```console
1750
pip install .
1851
```
1952

20-
in the root directory of this repostory.
53+
in the root directory of this repository.
2154

2255
## Basic Usage
2356

2457
### Visualizing the graph
2558

2659
```py
27-
from qec import RotatedSurfaceCode
60+
from graphqec import RotatedSurfaceCode
2861

2962
# Initializaze the graph
3063
rot = RotatedSurfaceCode(distance = 5)
@@ -37,7 +70,7 @@ rot.draw_graph()
3770
### Accessing Stim circuit
3871

3972
```py
40-
from qec import RepetitionCode
73+
from graphqec import RepetitionCode
4174

4275
# Initializaze the graph
4376
rep = RepetitionCode(
@@ -54,7 +87,7 @@ rep.memory_circuit.diagram()
5487
### Running a threshold computation
5588

5689
```py
57-
from qec import RepetitionCode, ThresholdLAB
90+
from graphqec import RepetitionCode, ThresholdLAB
5891

5992
# Initialize the Threshold LAB instance
6093
th = ThresholdLAB(
File renamed without changes.
File renamed without changes.

qec/codes/base_code.py renamed to graphqec/codes/base_code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import networkx as nx
1919
from stim import Circuit, target_rec
2020

21-
from qec.measurement import Measurement
22-
from qec.stab import X_check, Z_check
21+
from graphqec.measurement import Measurement
22+
from graphqec.stab import X_check, Z_check
2323

2424
__all__ = ["BaseCode"]
2525

qec/codes/repetition_code.py renamed to graphqec/codes/repetition_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from __future__ import annotations
1414

15-
from qec.codes.base_code import BaseCode
15+
from graphqec.codes.base_code import BaseCode
1616

1717
__all__ = ["RepetitionCode"]
1818

qec/codes/rotated_surface_code.py renamed to graphqec/codes/rotated_surface_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from __future__ import annotations
1414

15-
from qec.codes.base_code import BaseCode
15+
from graphqec.codes.base_code import BaseCode
1616

1717
__all__ = ["RotatedSurfaceCode"]
1818

File renamed without changes.
File renamed without changes.

qec/lab/threshold/threshold_lab.py renamed to graphqec/lab/threshold/threshold_lab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import matplotlib.pyplot as plt
1717
import pymatching
1818

19-
from qec.codes.base_code import BaseCode
19+
from graphqec.codes.base_code import BaseCode
2020

2121
__all__ = ["ThresholdLAB"]
2222

File renamed without changes.
File renamed without changes.

notebooks/repetition_code.ipynb

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

notebooks/rotated_surface_code.ipynb

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "qec"
2+
name = "graphqec"
33
version = "0.1.0"
44
description = "A collection of QEC implementations."
55
authors = [{ name = "Adel Sohbi", email = "[email protected]" }]
@@ -16,8 +16,6 @@ dependencies = [
1616

1717
[project.optional-dependencies]
1818
docs = [
19-
"jupyter-book>=1.0",
20-
"jupytext>1.12"
2119
]
2220
dev = [
2321
"pytest>=8.0",
@@ -32,7 +30,7 @@ requires = ["setuptools>=42", "wheel"]
3230
build-backend = "setuptools.build_meta"
3331

3432
[tool.setuptools]
35-
packages = ["qec"]
33+
packages = ["graphqec"]
3634
include-package-data = true
3735

3836
[tool.black]

qec-with-code_logo.png

-16.7 KB
Binary file not shown.

tests/codes/test_repetition_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from stim import Circuit
1616

17-
from qec import RepetitionCode
17+
from graphqec import RepetitionCode
1818

1919

2020
class TestRepetitionCode:

tests/codes/test_rotated_surface_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import stim
1616

17-
from qec import RotatedSurfaceCode, Measurement
17+
from graphqec import RotatedSurfaceCode, Measurement
1818

1919

2020
class TestRotatedSurfaceCode:

tests/lab/threshold/test_threshold_lab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import numpy as np
1616

17-
from qec import RepetitionCode, ThresholdLAB
17+
from graphqec import RepetitionCode, ThresholdLAB
1818

1919

2020
class TestRepetitionCode:

tests/test_measurement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import pytest
1414

15-
from qec import Measurement
15+
from graphqec import Measurement
1616

1717

1818
class TestMeasurement:

tests/test_stab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from stim import Circuit
1616

17-
from qec import X_check, Z_check
17+
from graphqec import X_check, Z_check
1818

1919

2020
class TestStab:

0 commit comments

Comments
 (0)