# What do double wires mean in quantum circuits, and how do they relate to if statements?

The circuit

can be translated to the following code:

operation Teleport(msg, there) {
let register = AllocateRegister();
let here = register;
H(here);
CNOT(here, there);
CNOT(msg, here);
H(msg);
// Measure out the entanglement.
if (M(msg) == One)  { Z(there); }
if (M(here) == One) { X(there); }
}
}


How do the if-statements come about? Why are double-lines used after measurements?

• May I ask what the language is in that example? Is it Q#? – Norrius Mar 31 '18 at 14:42
• No, but it was based on Q#. I didn't want to demand Q#-familiarity from readers, so I created this pseudo-code that uses only features from widely used languages. – R. Chopin Mar 31 '18 at 14:46

The double lines are one common convention for classical bits in quantum circuit diagrams. In this case, they represent the bits arising from the measurements of the qubits msg and here.
The controlled operations involving the classical bits are just operations which are performed if those classical bits happen to have the value 1, which is what the if statements are for in the pseudocode.