oreilly-qc / oreilly-qc.github.io

Code samples for Programming Quantum Computers, from O'Reilly Media
130 stars 59 forks source link

usage of the method of exchange #40

Open 3625365git-tx opened 3 years ago

3625365git-tx commented 3 years ago

page 56 of the book, example 3-4 how to explain the exchange process referring to "input1.exchange(input2,0x1,output.bits( ) )"?

from the docs, i learned that this method allows one or two arguments,so why three here? besides, to my understanding, the output as the control_qubit, isn't supposed to change after the filled dot, so the readout should always be 1, whether the two inputs are equal of not. could you please explain my questions? thanks a lot!

3625365git-tx commented 3 years ago

fine,solved myself