State Preparation

Bloch Compass

Difficulty: Easy ★

No rotation gates are available today, only Clifford gates. That is still enough to point a qubit at any of the six poles of the Bloch sphere.

Objective

point_qubit(direction) takes one of "+z", "-z", "+x", "-x", "+y", "-y" and returns a one-qubit circuit preparing |0>, |1>, |+>, |->, |+i> = (|0> + i|1>)/sqrt(2) or |-i> = (|0> - i|1>)/sqrt(2).

Constraints

  • Allowed gates: h, s, sdg, x, y, z.

Entry Point

point_qubit

Checks

  • Exports point_qubit(direction).
  • Reaches all six poles up to global phase.

Your Code

Outputpending

Execution results will appear here.