Skip to content

iqubit-org/Auto-Stabilizer-Check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡️🤖⚡️Auto-Stabilizer-Check

Auto-Stabilizer-Check: Optimal Compilation of Syndrome Extraction Circuits for General Quantum LDPC Codes

Method

Pipeline

1. ASAP Scheduling Strategy

ASAP scheduling uses the greedy algorithm, which is also similar to the Maximum Matching at each time TICK.

2. Coloration Strategy

Coloration scheduling uses the edge coloring theorem of the bipartite graph by Kőnig, which can finish the X or Z stabilizer checks in $\Delta$ TICKs, $\Delta$ is equal to the maximum degree of the X or Z bipartite graph, therefore, the full circuit depth is $2\Delta$.

3. SMT Strategy

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 $\Delta + O(1)$ TICKs, $\Delta$ is equal to the maximum degree of the Tanner graph.

Comparison

Method Naive (baseline) Coloration (others, our) SMT (our method)
Depth $\geq 2\Delta$ $2\Delta$ $\Delta + O(1)$

Usage-Example

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.py

And 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.py for the Steane Code and 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.py for the Steane Code and 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.py for the Steane Code and 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.

Usage-Evaluation-Pipeline

You just need to run the evaluation.py for the overall pipeline:

cd Auto-Stabilizer-Check/evaluation
python evaluation.py

The evaluation.py is suitable for different modes:

  • For example, run the --list and you will get all available codes in the codes.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 --one and you will evaluate one specified codes in the codes.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  
===============================================================================================

Evaluation

IBM's BB Code

BB Code $\Delta$ 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

General qLDPC Code

Code code param $\Delta$ 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

Accuracy Experiment

accuracy

Light-Version

The code repository also includes a lightweight version used in the initial development of ASC.

cd Auto-Stabilizer-Check/light-version

About

Auto-Stabilizer-Check: Optimal Compilation of Syndrome Extraction Circuits for General Quantum LDPC Codes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages