Auto-Stabilizer-Check: Optimal Compilation of Syndrome Extraction Circuits for General Quantum LDPC Codes
ASAP scheduling uses the greedy algorithm, which is also similar to the Maximum Matching at each time TICK.
Coloration scheduling uses the edge coloring theorem of the bipartite graph by Kőnig, which can finish the X or Z stabilizer checks in
SMT scheduling uses the OR-Tool SMT solver to find a X/Z interleaved depth optimal and stabilizer-legal circuit, which can finish all the X and Z stabilizer checks in almost
| Method | Naive (baseline) | Coloration (others, our) | SMT (our method) |
|---|---|---|---|
| Depth |
Firstly, you should install the asc module by:
cd Auto-Stabilizer-Check
pip install -e .You can run the compiler.py, simulate.py, filter.py in Auto-Stabilizer-Check/example separately to get the scheduling result, decoding result and the circuit selection result for a specified qLDPC code.
cd Auto-Stabilizer-Check/example
python compiler.py
python simulate.py
python filter.pyAnd you will get the circuit depth, CNOT scheduling, logical error rate, word error rate of different scheduling methods.
You can change the scheduling strategies:
compiler = AutoCompiler(qecc)
schedule_asap = compiler.compile_asap()
schedule_color = compiler.compile_color()
schedule_smt = compiler.compile_smt()- For example, run the
python compiler.pyfor theSteane Codeand you will get:
================================= Compilation Information =====================================
Auto_SM_Compiler compile time : 0.04 seconds
===============================================================================================
Code Name : SteaneCode
Code Parameters : [[n, k, d]] = [[7, 1, 3]]
Max Degree Tanner Graph ∆(T) = 6
Scheduling Method : ALL
================================= Depth Comparison ==================================
===============================================================================================
Scheduling Method | Naive | Color | SMT |
-----------------------------------------------------------------------------------------------
Circuit Depth | 8 | 8 | 6 |
===============================================================================================- For example, run the
python simulate.pyfor theSteane Codeand you will get:
================================= Compilation Information =====================================
Auto_SM_Compiler compile time : 0.04 seconds
===============================================================================================
================================= Memory Experiment Finished ==================================
Code Name : SteaneCode
Code Parameters : [[n, k, d]] = [[7, 1, 3]]
Max Degree Tanner Graph ∆(T) = 6
Scheduling Method : ALL
================================= Depth Comparison ==================================
===============================================================================================
Scheduling Method | Naive | Color | SMT |
-----------------------------------------------------------------------------------------------
Circuit Depth | 8 | 8 | 6 |
===============================================================================================
================================= Accuracy Comparison ==================================
===============================================================================================
Scheduling Method | Naive | Color | SMT
-----------------------------------------------------------------------------------------------
Word Error Rate | 0.00630 ± 0.00079 | 0.00740 ± 0.00086 | 0.00310 ± 0.00056
Logical Error Rate | 0.00630 ± 0.00079 | 0.00740 ± 0.00086 | 0.00310 ± 0.00056
===============================================================================================- For example, run the
python filter.pyfor theSteane Codeand you will get:
================================= Compilation Information =====================================
Code Name : SteaneCode
Code Parameters : [[n, k, d]] = [[7, 1, 3]]
Max Degree Tanner Graph ∆(T) = 6
Scheduling Method : SMT
===============================================================================================
Step | WER | LER | Improved
-----------------------------------------------------------------------------------------------
1 | 0.00400 | 0.00400 | Yes
2 | 0.00400 | 0.00400 | No
3 | 0.00200 | 0.00200 | Yes
4 | 0.00200 | 0.00200 | No
5 | 0.00200 | 0.00200 | No
===============================================================================================
Find the best LER: 0.00200, scheduling and circuit have been saved.You just need to run the evaluation.py for the overall pipeline:
cd Auto-Stabilizer-Check/evaluation
python evaluation.pyThe evaluation.py is suitable for different modes:
- For example, run the
--listand you will get all available codes in thecodes.py
python evaluation.py --codes General/BB_Code/codes.py --list
General/BB_Code/BBCode_18_4_4: [[n, k, d]] = [[18, 4, 4]]
General/BB_Code/BBCode_36_4_6: [[n, k, d]] = [[36, 4, 6]]- For example, run the
--oneand you will evaluate one specified codes in thecodes.py
python evaluation.py --codes General/BB_Code/codes.py --one BBCode_18_4_4
================================= Compilation Information =====================================
Auto_SM_Compiler compile time : 8.40 seconds
===============================================================================================
================================= Memory Experiment Finished ==================================
Code Name : BBCode
Code Parameters : [[n, k, d]] = [[18, 4, 4]]
Max Degree Tanner Graph ∆(T) = 6
Scheduling Method : ALL
================================= Depth Comparison ==================================
===============================================================================================
Scheduling Method | Naive | Color | SMT |
-----------------------------------------------------------------------------------------------
Circuit Depth | 12 | 12 | 7 |
===============================================================================================- You can also set the end-to-end evaluation by
--simulate
python evaluation.py --codes General/BB_Code/codes.py --one BBCode_18_4_4 --simulate
================================= Compilation Information =====================================
Auto_SM_Compiler compile time : 7.50 seconds
===============================================================================================
================================= Memory Experiment Finished ==================================
Code Name : BBCode
Code Parameters : [[n, k, d]] = [[18, 4, 4]]
Max Degree Tanner Graph ∆(T) = 6
Scheduling Method : ALL
================================= Depth Comparison ==================================
===============================================================================================
Scheduling Method | Naive | Color | SMT |
-----------------------------------------------------------------------------------------------
Circuit Depth | 12 | 12 | 7 |
===============================================================================================
================================= Accuracy Comparison ==================================
===============================================================================================
Scheduling Method | Naive | Color | SMT
-----------------------------------------------------------------------------------------------
Word Error Rate | 0.01500 ± 0.00384 | 0.02100 ± 0.00453 | 0.00300 ± 0.00173
Logical Error Rate | 0.00775 ± 0.00139 | 0.01050 ± 0.00161 | 0.00075 ± 0.00043
===============================================================================================| BB Code | ASAP | Color | ASC | |
|---|---|---|---|---|
| [[72, 12, 6]] | 6 | 15 | 12 | 7 |
| [[90, 8, 10]] | 6 | 15 | 12 | 7 |
| [[108, 8, 10]] | 6 | 16 | 12 | 7 |
| [[144, 12, 12]] | 6 | 16 | 12 | 7 |
| [[288, 12, 18]] | 6 | 16 | 12 | 7 |
| [[360, 12,$\leq$ 24]] | 6 | 16 | 12 | 7 |
| [[756, 16,$\leq$ 34]] | 6 | 16 | 12 | 7 |
| Code | code param | ASAP | Color | ASC | |
|---|---|---|---|---|---|
| BB Code I | [[18, 4, 4]] | 6 | 12 | 12 | 7 |
| BB Code II | [[36, 4, 6]] | 6 | 12 | 12 | 7 |
| GB Code I | [[48, 6, 8]] | 8 | 21 | 16 | 9 |
| GB Code II | [[126, 2, 12]] | 4 | 8 | 8 | 4 |
| HGP Code I | [[52, 4, 4]] | 6 | 12 | 12 | 7 |
| HGP Code II | [[65, 9, 4]] | 6 | 12 | 12 | 7 |
| Color Code I | [[19, 1, 5]] | 6 | 12 | 12 | 6 |
| Color Code II | [[37, 1, 7]] | 6 | 12 | 12 | 6 |
The code repository also includes a lightweight version used in the initial development of ASC.
cd Auto-Stabilizer-Check/light-version
