CNOT

The control and target enter through separate Ports and leave through their corresponding outputs. Spatial merge and split geometry implements the controlled X operation without measuring either logical output.

Block graph

BLOG source

BLOG 1.0

module main {
  in control_in: data = 0
  out control_out: data = 3
  in target_in: data = 6
  out target_out: data = 9

  0: Port [0, 0, 0] <In_Control>
  1: ZXZ [0, 0, 1]
  2: ZXZ [0, 0, 2]
  3: Port [0, 0, 3] <Out_Control>
  4: ZXX [0, 1, 1]
  5: ZXZ [0, 1, 2]
  6: Port [1, 1, 0] <In_Target>
  7: ZXZ [1, 1, 1]
  8: ZXZ [1, 1, 2]
  9: Port [1, 1, 3] <Out_Target>
  0 -> +Z
  1 -> +Z
  1 -> +Y
  2 -> +Z
  4 -> +Z
  5 -> +X
  6 -> +Z
  7 -> +Z
  8 -> +Z

}

See BLOG Format for the syntax or return to all examples.