Search⌘ K
AI Features

Probabilities and the Qubit States

Explore the relationship between qubit states and measurement probabilities, focusing on how the Ry gate rotates qubits and alters probabilities. Gain practical skills in computing qubit measurement likelihoods and translating them into rotation angles, essential for quantum circuit design and quantum machine learning.

Let’s look at our transformation in action.

Rotating the qubit state

Javascript (babel-node)
from math import pi
# Define state |0>
initial_state = [1, 0]
# Redefine the quantum circuit
qc = QuantumCircuit(1)
# Initialise the 0th qubit in the state `initial_state`
qc.initialize(initial_state, 0)
# Rotate the state by a quarter of a half circle.
qc.ry(pi/4,0)
# Tell Qiskit how to simulate our circuit
backend = Aer.get_backend('statevector_simulator')
# execute the qc
results = execute(qc,backend).result().get_counts()
# plot the results
plot_histogram(results)

The Qiskit QuantumCircuit object provides the ry function in line 13. The ry function is for RyR_y ...