Skip to content

Commit c6e2fe2

Browse files
committed
finished shor syndrome extraction readme section
1 parent 21f39f9 commit c6e2fe2

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,41 @@ using QuantumClifford
199199
using QuantumClifford.ECC
200200
code = Steane7();
201201
cat, scirc, _ = QuantumClifford.ECC.shor_syndrome_circuit(code);
202+
vcat(cat, scirc)
202203
```
203-
`cat` is the circuit for constructing the cat state needed for Shor syndrome extraction, and `scirc` contains the two qubit gates and measurement. We can now reindex `scirc` as in the naive case, we will simply need to reorder the cat state generation circuit to match. Moreover, for Shor syndrome circuits, we reccomend using our heuristic specific to these types of circuits, refered to Shor Syndrome Specialized Compilation (SSSC) in the paper.
204-
```
204+
![Uncompiled Shor style Steane circuit](assets/images/uncomp_steane_xchecks.png)
205+
205206

207+
`cat` is the circuit for constructing the cat state needed for Shor syndrome extraction, and `scirc` contains the two qubit gates and measurement. We can now reindex `scirc` as in the naive case, we will simply need to reorder the cat state generation circuit to match. Moreover, for Shor syndrome circuits, we reccomend using our heuristic specific to these types of circuits, refered to Shor Syndrome Specialized Compilation (SSSC) in the paper. Below we will only look at the X checks so that circuit can be visualized by `Quantikz.jl`. The `shor_cat` variable also demonstrates how to use the returned dictionary to reindex other parts of the error-correction circuit.
208+
```
209+
code = Steane7()
210+
checks = parity_checks(code)
211+
x_checks = checks[1:3]
212+
cat, scirc, _ = QuantumClifford.ECC.shor_syndrome_circuit(x_checks)
213+
shor_new_circuit, shor_order = CircuitCompilation2xn.ancil_reindex_pipeline_shor_syndrome(scirc)
214+
shor_cat = CircuitCompilation2xn.reindex_by_dict(cat, shor_order)
215+
vcat(shor_cat, shor_new_circuit)
206216
```
217+
![SSSC compiled Shor style Steane circuit](assets/images/sssc_steane_xchecks.png)
207218

219+
In this case, compiling reduces the number of shuttles from 7 to 3:
220+
```
221+
julia> CircuitCompilation2xn.calculate_shifts(scirc)
222+
7-element Vector{Vector{QuantumClifford.AbstractOperation}}:
223+
[sXCZ(4,8), sXCZ(5,9), sXCZ(6,10), sXCZ(7,11)]
224+
[sXCZ(2,12), sXCZ(3,13)]
225+
[sXCZ(6,14), sXCZ(7,15)]
226+
[sXCZ(1,16)]
227+
[sXCZ(3,17)]
228+
[sXCZ(5,18)]
229+
[sXCZ(7,19)]
230+
231+
julia> CircuitCompilation2xn.calculate_shifts(shor_new_circuit)
232+
3-element Vector{Vector{QuantumClifford.AbstractOperation}}:
233+
[sXCZ(4,11), sXCZ(5,12), sXCZ(6,13), sXCZ(7,14), sXCZ(2,9), sXCZ(3,10), sXCZ(1,8)]
234+
[sXCZ(7,16)]
235+
[sXCZ(6,18), sXCZ(7,19), sXCZ(3,15), sXCZ(5,17)]
236+
```
208237
## Nice to have functions for quick data collection
209238

210239
## How to do simulations with this software
209 KB
Loading
203 KB
Loading

0 commit comments

Comments
 (0)