Closed victor-onofre closed 1 year ago
Great work. You have a solid base on which to improve upon. The rest is mostly just adding the correct if conditions in the right places.
This new_odd
business is not elegant. Please note that if $N = 5,9,...$ then $N-1$ is divisible by 4. You should use this condition instead.
The solution is so simple with the condition N-1
being divisible by 4. I don't know how I didn't see it
@abdullahkhalids I think the way I have constructed the cat states for the 8 qubits stabilizers is correct. It follows the structure of your example but with the appropriate indices of the ancilla qubits
Hey! I took a look. Registers are correctly made. There seems to be one small error. First, please note that you can look at the circuits easily by doing
_color_codes_syndrome_measurements(5).draw('text', 'colorcirc.text')
Then open colorcirc.text
in a text editor with horizontal scrolling.
In lines 164 and 175, it should be face
instead of i
.
number = qubit_number.index(faces[face][j])
Please fix this. And we should be done.
But I will make one suggestion. In python, its not elegant to do for face in range(len(faces)):
. The better way is for face, f in enumerate(faces)
. Then face
is the list item, and f
is the index of that list item. This means, instead of writing
for face in range(len(faces)):
if len(faces[face]) == 4:
circ.append('H', (0, 1, 1, face, 0))
for j in range(len(faces[i])):
number = qubit_number.index(faces[face][j])
you write
for face, f in enumerate(faces):
if len(face) == 4:
circ.append('H', (0, 1, 1, f, 0))
for j in range(4): # you already know face is length 4
number = qubit_number.index(face[j])
...
See how much easier it is to read.
Thank you. I have accepted the pull request.
The first dirty version of the function only works for a code of distance 3. I will work on the following list of to-do's:
vertices_physical_qubits
d