Build your own gates
The Gate Lab is where you build your own gates. Line up gates on a bench, and the lab shows what they add up to: however many you use, the answer is always one rotation of the sphere.
Open it with Gate Lab at the top of the app, on a computer or a tablet held sideways: it needs a wider screen than a phone's. It keeps its bench while you go back and forth, and gates you save there show up on the sphere's gate bar.
Building a gate
- Click gates under Ingredients (X, Y, Z, H, S, T, their daggers, or a rotation by any angle). Each one lands on the bench as a tile, left to right in time order.
- The Result panel shows the gate the tiles make: its formula, its exact matrix, the single rotation it performs, and the known gate it equals, if any.
- The test sphere plays it: each tile's turn as a solid arc, then the one equivalent rotation, dashed. Pick the state to test on under Test on, and replay with ▶ Play.
For example, H, then T, then H adds up to a 45° turn about x:
The lab reports the rotation (45° about x) and the match, "≡ Rx(45°)", up to the global phase .
Taking gates apart
Under the bench, operations act on the selected tile, or on the whole bench when none is selected:
- Undo † makes the inverse, : the same turn backward. For a whole bench it reverses the order and undoes each tile, since .
- Repeat ×2, ×3, ×4 applies a gate several times: , , and .
- Fraction ½, ⅓, ¼ takes part of a turn: , the square root of X, is a quarter turn about x.
- Compare reversed order plays the tiles backward too, to show whether order matters for them.
Saving and using your gates
Give the gate a Name and a short Label (up to four characters, for its button), and choose Save to My gates. With Pin to gate bar on, it appears next to the built-in gates on the sphere. Apply takes it straight back to the sphere and plays it there. Saved gates are kept in this browser.
Try it
Each link opens the lab with these tiles on the bench:
The last one moves X's axis: turning by S† first and by S after turns the x axis a quarter turn, onto y. More on why in Gates are rotations.