Surface code quantum computation
Surface code quantum computation
Austin Fowler
arXiv:2408.13687
Let’s talk about one qubit
Pauli matrices:
The simplest stabilizers are just operators that leave some useful state
unchanged, eg:
Pauli matrices:
The simplest stabilizers are just operators that leave some useful state
unchanged, eg:
+XXX
This state is stabilized by 3 independent stabilizers +ZZI
+IZZ
For complex states, the list of independent stabilizers can be far more compact
than the state itself. We’ll need stabilizers to talk about the surface code.
Some algebra
Here’s one example of showing a stabilizer stabilizing a state:
What about errors?
Consider the effect of errors:
+XXX
To say the same thing another way: or: -ZZI
+IZZ
Errors flip the sign of stabilizers they anticommute with (XZ = -ZX). If we can work
out how to measure the sign of a stabilizer, we can detect errors.
Let’s work out the output of this circuit
H
controlled-A
controlled-A
controlled-A
controlled-A
controlled-A
+XXX
-ZZI
+IZZ
+XXX
or -ZZI
-IZZ
What will the signs of the
stabilizers be after these errors?
+XXX
or +ZZI
-IZZ
Locating an error with stabilizers
+XXX
-ZZI
+IZZ
+XXX
-ZZI
-IZZ
+XXX
+ZZI
-IZZ
Representing stabilizers as a picture
+XXX
+ZZI
+IZZ
-XXX
+ZZI
+IZZ
applying
+IXXIIIIII
+ZIIZIIIII
+XXIXXIIII
+IZZIZZIII
+IIIZZIZZI
+IIIIXXIXX
+IIIIIZIIZ
+IIIIIIXXI
ZL
ZL
ZL ZL
ZL ZL
XL ZL
HL
ZL XL
What is this gate?
XL XL
ZL -ZL
It’s X logical
XL XL
XL
ZL -ZL
A common situation in surface code computation
X L , ZL (-1)aXL, (-1)bZL
XL
ZL
XL
XL
ZL XL
XL
XL
ZL XL
XL
XL
ZL ZL
XL
XL
ZL ZL
XL
ZL XL
ZL ZL
XL
ZL XL
ZL ZL
XL ZL
ZL XL
XL ZL
XL ZL
ZL X L
XL ZL ZL
XL ZL
ZL X L
XL
XL ZL
XL ZL X L
XL
XL ZL
ZL
XL
XL ZL
ZL
XL XL
XL ZL
ZL
ZL XL
YL
ZL
YL
YL
B D
A
C D
Byproduct operators from deforming the surface code
time
In:
Out:
Using appropriate
stabilizer
measurements,
initializations, and data
qubit measurements,
we can work out the
parity of these
surfaces.
Some abbreviations:
Some abbreviations:
Pause to take stock
Not universal,
but a good start,
let’s pause and
think about
combinations.
Let’s work on simpler notation
time?
time?
time?
Let’s work on simpler notation
time? Black nodes scatter X
and give Z a choice,
white nodes scatter Z
time? and give X a choice.
Let’s work on simpler notation
Black nodes scatter X
and give Z a choice,
white nodes scatter Z
and give X a choice.
Let’s work on simpler notation
Black nodes scatter X
and give Z a choice,
white nodes scatter Z
So we have a choice here? and give X a choice.
Let’s work on simpler notation
Black nodes scatter X
and give Z a choice,
white nodes scatter Z
So we have a choice here? and give X a choice.
Let's start by
considering this a
sequence of 2 gates,
then do better.
Manipulating structures
Convert to ZX diagram.
b b’
c c’
b’ c’
a’ b’ c’
a’
a b c b c
Let’s practice
b’ c’ b’ c’
a’
a’
a a
c b c
b
Let’s practice
b’ c’ b’ c’
a’ a’
a
a
c b c
b
Let’s practice
b’
b’ c’
a’ a’
c’
a a
c c
b b
a’ b’ c’
b’
a’
c’
a
c
b
c
a b
An easier way?
a a’ b’
b’ 3 CNOTs, two
b
spider rules
c c’
a’
a’ c’ c’
a a’
a
b a c
b’ c
b b’ b
c c’
Questions with no good answers
b’
How much time does it take to implement a
logical CNOT?
a c
b b’
a c a c
b b’ b b’
a’ c’ a’ c’
a c a c
b b’ b b’
What computation is this?
a’ c’ a’ c’
a’ c’
a c a c
a c
b b’ b b’
b b’
a’ c’ a’ c’
a c a c
b b’ b b’
a’ c’ a’ c’
a c a c
b b’ b b’
What computation is this?
a’ c’
a c
Consistency checks:
b b’
If operators on the left anticommute, their
corresponding operators on the right must
anticommute.
Craig Gidney
flows_to_matrix.py
import numpy as np
import stim
flows_to_matrix.py
(Super)humans still on top
flows_to_matrix.py
Do we really need these correlation surfaces?
a’ c’ a’ c’
a’ c’
a c a c
a c
b b’ b b’
b b’
a’ c’ a’ c’
a c a c
b b’ b b’
a’ c’ a’ c’
a c a c
b b’ b b’
Better correlation surfaces
a’ c’
a c
b b’
Better correlation surfaces
a’ c’
a c
b b’
Better correlation surfaces
a’ c’
a c
b b’
flows_to_matrix.py
Better correlation surfaces
a’ c’
a c
b b’
a c
b b’
a’
c’
a
c
b
Could we implement this on our hardware?
a’
c’
a
c
b
a c
Could we implement this on our hardware?
a b
c
Could we implement this on our hardware?
CNOT(a, b)
a b
c
Could we implement this on our hardware?
c’
Rearrange logical qubits
b’
a’
Could we implement this on our hardware?
b’
Rearrange some more a’
c’
Could we implement this on our hardware?
b’ c’
CNOT(b, c)
a’
Could we implement this on our hardware?
b’ c’
Compress
a’
Could we implement this on our hardware?
b’c’
Move output c’
a’
Could we implement this on our hardware?
c’
CNOT(a, c) a’
b’
Could we implement this on our hardware?
c’a’
b’
Extend outputs
a b
Could we implement this on our hardware?
c’a’
b’
a b
Could we implement this on our hardware?
c’a’
b’
Initialize and measure
all logical qubits in
either the X or Z basis.
Two experiments that
give you the probability
of each correlation
surface having the
wrong parity.
a b
Could we implement this on our hardware?
2) build model
3) export to .dae
4) import using pycollada
5) find abstract observables
Which SketchUp?
● Free versions of this exist:
○ https://www.sketchup.com/en/products/sketchup-for-web -> “start modeling”
○ Old windows freeware version: https://google-sketchup.en.lo4d.com/download
■ This version has export to .dae
■ Focus on this for the moment
Helping out
● https://github.com/QCHackers/tqec/issues
Need a clean template (example files in this folder)
<library_nodes> <library_visual_scenes>
<node id="ID3" name="zxz"> <visual_scene id="ID1">
... <node name="SketchUp">
</node> <node id="ID2" name="instance_0">
<node id="ID27" name="xzz"> <matrix>1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</matrix>
... <instance_node url="#ID3" />
</node> </node>
<node id="ID26" name="instance_1">
etc <matrix>1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 1</matrix>
<instance_node url="#ID27" />
</node>
etc
Parsing a .dae file
Example: the program in this folder
Better: pycollada
Listing all library node names with instance counts and matrices:
Node name: oxz, Number of instances: 1
136
Node name: zxx, Number of instances: 1
033
Node name: zox, Number of instances: 1
033
Node name: zxo, Number of instances: 7
0 0 1, 0 0 4, 0 0 7, 0 3 4, 3 3 4, 3 3 7, 3 3 1
Node name: zxz, Number of instances: 9
0 0 0, 0 0 3, 0 0 6, 0 0 9, 0 3 6, 3 3 6, 3 3 9, 3 3 0, 3 3 3
Output of example program
1 2k-1 1
Add connectors
Replace cube layers with connector layers
1 1
Add connectors
Replace cube walls with connector layers
1 2k-1 1
Two special cubes
4-way is maximum
degree.
Spotlight on central template
Putting it together
Link to detailed pdf
1 2k-1 1
Add connector
Replace cube layers with connector layers
1 1
Important to emphasize that the connector
has no spacetime extent itself, it replaces
layers within the cubes it touches.
Add connector
Replace cube layers with connector layers
2 applications of
the spider rule
2 applications of
the identity rule
And there are more rules worth knowing
Hopf law
Fun spider/multi-edge rule example
U=CliffordT(†)HT(†)HT(†)HT(†)HT(†)...
How do we achieve a T gate?
This circuit teleports arbitrary states from the top qubit to the
middle qubit (add X, H, HZ)
How do we achieve a T gate?
Basic idea: create a small logical |+> state, perform one rotation to make a small
logical |T>, expand, and discard if any errors detected.
Let’s zoom into arXiv:2302.12292 (Craig Gidney)
Let’s focus on the injection region and rewrite this as a normal circuit.
Let’s zoom into arXiv:2302.12292 (Craig Gidney)
This single gate measures the bottom X stabilizer. Let’s take a look at the
Quirk circuit, for those curious here is the Crumble version of full circuit.
Is injection the best way to get a |T> state?
This is bad.
Magic state cultivation
Errata:
“Shortly before releasing this paper, we
noticed a minor mistake in our circuits…
We intend to fix the issue in a future
version of the paper. We don’t expect the
changes to affect the final results.”
ZL
Measure X stabilizer
find Z errors
Measuring logical Y X Y Z
1 9
After the circuit, the corrected parity of these measurements will
give us a logical Y measurement. Since these are stabilizer
measurements, multiple rounds of measurements will be
required to ensure fault tolerance.
Craig Gidney, Quantum 8, 1310 (2024)
Let’s put it all together time