I am very new to quantum computing, so this might be a really simple question. I am coding a quantum computer simulator in python from scrach and I'm not sure how to make registers work.

I would just use a wavefunction which stored all of the qubits and when operations were needed to be made (for instance a Hadamard operator on some qubit), I would just scale the operator accordingly and apply it. This seemed to work quite fine, however now I need to implement a phase estimation algorithm, where two registers are used. At first I thought to treat them as seperate wavefunctions, but when It came to controls I had to combine seperate registers into one wavefunction. Finally, It shows to apply QFT and measure just the first register.

So my question is: how do I go about implementing seperate registers and using them? Is there a smarter way than just to have one insanely large wavefunction? I have no idea since registers seem to have to be interconnected for things like controls to work.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.