Curriculum / Quantum Foundations / Rotation Gate Challenge

Lesson 11 of 17Code challengeFree+150 XP

Rotation Gate Challenge

Use RX, RY, and RZ to prepare arbitrary single-qubit states.

Rotation Gate Challenge

Now that you understand rotations, let's put them into practice. Using RX, RY, and RZ gates, you can prepare any single-qubit state.

Target States

State 1: The |+⟩ state = (|0⟩ + |1⟩)/√2

  • This is an RY(π/2) rotation from |0⟩

State 2: The |i−⟩ state = (|0⟩ − i|1⟩)/√2

  • Apply RX(π/2) from |0⟩

State 3: An equator state. Note that applying RZ(π/4) first (while the qubit is still |0⟩) only adds an unobservable global phase, so RZ(π/4) then RY(π/2) lands on |+⟩ at azimuth 0°. To actually reach azimuth 45°, you would apply RY(π/2) first to get onto the equator, then RZ(π/4) to rotate the azimuth.

  • Apply RZ(π/4) then RY(π/2)

Your challenge: prepare each state and verify by measuring with and without a basis change.

How this lesson works

A hands-on coding challenge. You write Qiskit-compatible Python in the browser editor, run it instantly via WebAssembly, watch the circuit and Bloch sphere react, and pass automatic output checks. The AI tutor Qubitus gives Socratic hints if you get stuck.

Part of: Quantum Foundations

Learn the basics: qubits, gates, superposition, and measurement.

Take this lesson free

Create a free account and start this lesson in your browser. No credit card, no installation.