CZ with a spatial Hadamard

A Hadamard on a spatial connection changes the boundary basis at the interaction. The two input wires remain available at the outputs after the controlled Z operation.

Caution

This computation contains spatial Hadamard pipes. The current construction can reduce the effective circuit distance below the requested code distance. Check the emitted circuit’s distance before relying on it. Prefer temporal Hadamards or a redesigned layout when preserving circuit distance is required. See the distance boundary.

Block graph

BLOG source

BLOG 1.0

module main {
  in a_in: data = 0
  out a_out: data = 2
  in b_in: data = 3
  out b_out: data = 5

  0: Port [0, 0, 0] <In_1>
  1: XZX [0, 0, 1]
  2: Port [0, 0, 2] <Out_1>
  3: Port [1, -1, 1] role=input <In_2>
  4: XXZ [1, 0, 1]
  5: Port [1, 1, 1] role=output <Out_2>
  0 -> +Z
  1 -> +Z
  1 -H> +X
  4 -> -Y
  4 -> +Y

}

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