Logical Operations for the Steane Code
Today, I want to discuss how to obtain a universal set of gates for the Steane code.
Previously, we discussed Gottesman's method for constructing the encoded and logical operations for stabilizer codes.
import stac
cd = stac.CommonCodes.generate_code('[[7,1,3]]')
cd.construct_logical_operators()
print('encoded X =')
stac.print_paulis(cd.logical_xs)
print('encoded Z =')
stac.print_paulis(cd.logical_zs)
encoded X =
encoded Z =
There are many other -qubit Pauli operators that can act as and . A nicer choice is
Clifford gates
Recall that the Clifford group is generated from the operations . We will first show how to find the logical
Hadamard gate
The Hadamard gate is also transversal (no two qubit gate between the qubits of a single block). It is Why do we know this works? We can check that , and that , which are the required relations that must obey.
logicalH = stac.Circuit()
for i in range(7):
logicalH.append('H', i)
logicalH.draw(output='latex',scale=0.7)
gate
The gate is also transversal and actually just made of seven gates. Let us have two logical qubits, and designate one as control and the other as target. Let the physical qubits of the control logical qubits be indexed by and those of the target logical qubit be indexed by . Then
To check that this works, we have to verify the conjgation relations that we had previously.
Exercise: check that the satisfies these conjugation relations.
logicalCX = stac.Circuit()
for i in range(7):
logicalCX.append('CX', i,7+i)
logicalCX.draw(output='latex',scale=0.7)
Logical gate
The gate is the gate, but is often defined in a nicer fashion with an overall phase factor as
Exercise: Compute the conjugacy relations of i.e. for .
Let
Exercise: Verify that the defined satisfies the conjugacy relations that should have.
The gate
The Clifford gate set does not allow us to do universal quantum computation, but the addition of the gate will. The gate is or
Magic states
For the Steane code, it's not possible to create a transversal gate on an encoded qubit. The way to obtain the gate is via magic states. The relevant magic state in our case is This state is used in the following circuit, where be some unknown state on which we want to apply the gate, i.e we want .
Let's evaluate to make sure everything works. Starting with , if we apply the gate from the first qubit to the second, we obtain, Next, we measure the second qubit in the basis. We either obtain and the first qubit is left in the state or we obtain and the first qubit is left in the state In the first case, we have obtained the desired state. In the second case, if we just apply, to the state, we obtain .
In summary, if it is possible to create a state, one can apply a gate to any state using just Clifford operations.
Creating the state
One can probabilistically create the state. The circuit for it is given below, where the second control gate is a gate.
Tstateprep = stac.Circuit()
Tstateprep.append('H', 1)
Tstateprep.append('CX', 1, 0)
Tstateprep.append('cp(pi/2)', 1, 0)
Tstateprep.append('H', 1)
Tstateprep.append('M', 1)
Tstateprep.draw()
# an iteration that yielded 0 for the measurement
Tstateprep.simulate()
basis amplitude
------- -----------
00 0.707
10 0.707j
# an iteration that yielded 1 for the measurement
Tstateprep.simulate()
basis amplitude
------- -----------
01 0.707
11 -0.707j
Exercise: Evaluate this circuit by hand to show that if the measurement outcome is , then the first qubit will be in the state.
If instead the measurement outcome is , then we apply the operator to correct the state.