dakk / qc64

Quantum Computing on the Commodore64
https://medium.com/@dakk/quantum-computing-on-a-commodore-64-in-200-lines-of-basic-eda7658b32a4
MIT License
150 stars 14 forks source link

X1->Y0 fall-through intended? #5

Open kajott opened 1 year ago

kajott commented 1 year ago

I have no clue at all about quantum computing, but looking at the code, the fall-through from line 428 (X1 gate) to 440 (Y0 gate) seems odd. Is that intended, or is it a bug?

ergo70 commented 1 year ago

I assume that the fallthrough is unintentional since no other gate does it?

ergo70 commented 1 year ago

I'm pretty sure now, this is not correct. This is a two QBit only system, so all gates working on a single QBit are duplicated and suffixed 0 or 1. Gates that do work on both QBits, like CNOT (CX) have no suffix, because it's obvious that they affect 0 and 1. I further assume that X is the Pauli-X and Y is the Pauli-Y gate (https://en.wikipedia.org/wiki/Quantum_logic_gate). Both work on a single QBit. So, X1 is Pauli-X on QBit 1, and Y0 is Pauli-Y on QBit 0. It makes no sense that X1 also triggers Y0. Different single QBit-Gate operations on different QBits must not directly affect each other, especially since there is no equivalent fallthrough for X0 and Y1. I have corrected this in my FORTRAN port.