liveBook · Manning

Rotational gate

As explained in Quantum Programming in Depth

An Ry gate is a single-qubit rotation gate that rotates a qubit state around the Y axis of the Bloch sphere.

An RY gate is a single-qubit rotation around the Y axis of the Bloch sphere. Its rotation angle is specified in radians and determines the prepared state. For amplitudes α and β, a practical state-preparation pattern computes θ = 2·ArcTan2(β, α) and applies RY(θ) to the qubit. section 2.1.3 section 4.4.1

A Q# implementation follows this sequence:

  • Allocate a qubit with use q = Qubit(). section 2.1.3
  • Set the amplitudes, compute the rotation angle with ArcTan2, and apply Ry(theta, q). section 2.1.3
  • Reset the qubit before release so it returns to |0⟩. section 2.1.3
Listing 2.2 Q# code to prepare a single-qubit state
import Std.Math.ArcTan2;    #1

@EntryPoint()                      #2
operation SingleQubitDemo() : Unit {   #3
  use q = Qubit();              #4
  let (alpha, beta) = (0.6, 0.8);
  let theta = 2.0 * ArcTan2(beta, alpha);   #5
  Ry(theta, q);                       #6
  Reset(q);                           #7
}

Inspect the complete Q# example, including amplitude values, angle calculation, RY application, and qubit reset. section 2.1.3

How Quantum Programming in Depth covers it

How deep it goes
Derives the rotation angle and demonstrates Q# execution, but does not develop the gate's matrix representation.
Examples
Uses amplitudes 0.6 and 0.8, computes 2·ArcTan2(0.8, 0.6), applies RY, and resets the qubit.
What it assumes
Assumes basic qubit and amplitude notation while refreshing angle parameterization and Q# qubit management.
What you can do after
Build it from scratch in Q# to prepare and safely release a single-qubit state.
How it connects
Connects single-qubit state preparation with Q#, qubit allocation, and qubit reset.

Also explained in

Compare how 2 books explain rotational gate →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quantum Programming in Depth. The section links point to the parts of the book it draws on.