-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Surface code implementation #5
Surface code implementation #5
Conversation
Solutions for issue#1 Implementation of surface codes. Please let me know whether there is any mistake or adjustment required.
This is good starting work. Let me suggest some improvements. In the current form, the code is not at all taking advantage of stac's abilities for constructing such circuits. Right now, most of the code is just figuring out the indices in a convoluted manner. The whole point of geometric addressing is to avoid doing this, and going mad. Let us look at Fig 1. of the paper. By drawing the two axes I have labelled each qubit by The key is when you create the physical qubits. Right now, you have
In
Next, in the following lines inside the for loop, you are assigning the physical qubits created above to the virtual qubits of the circuit.
You want to rewrite the two loops, so you are alternatively assigning each physical qubit to either the data register or the syndrome register, as per the diagram. Once you have done the above, the rest is trivial. Iterate through all the syndrome measurement qubits, look at its coordinates and do the
This should do the job. I hope the above is clear. If not, please ask. |
Lets also try to write relatively clean code from the start.
Thank you for your work. |
Thank you for the clarification! It is very kind of you to let me know all the improvements. I will work on them right away. |
Hi, I have completed my solution with the requested improvements. Please let me know whether it suits your needs now. Thank you!
@abdullahkhalids Hi, I have uploaded the revised solution into the files changed. Please let me know whether there is any other improvements and mistake. Thank you! |
Hi, I have rewrote the part of creating the circuit. Thank you!
@abdullahkhalids Hi. The revised 2nd version of the solution is ready for review. Pls let me know whether any other change is required. Thank you! |
I finally found the time to take a look at it. The logic seems sound as far as I have checked. To finish this PR, kindly make the following minor changes:
You don't have to do the last thing. But if you do, when I write the Surface Code chapter of the book, I will be able to use this code, and identify you as a contributor to the book. |
Great! Thank you. I will make the changes accordingly, and I would be glad to let you use my code for your amazing book. |
@abdullahkhalids Thank you for the help and guidance. I have made changes according to your requests. |
Solutions for issue#1 Implementation of surface codes. Please let me know whether there is any mistake or adjustment required.