A phase shift changes the angular direction of a periodic or complex-valued quantity. In a quantum circuit, a phase gate rotates selected amplitudes without changing their magnitude. section 8.2
For a geometric sequence state, qubit j receives a phase shift of 2^jθ. Interference then gives outcome k an amplitude direction of kθ. section 8.2
A practical encoding pattern is:
- Apply a Hadamard gate to every qubit to equalize amplitude magnitudes. section 8.2
- Apply a phase gate with angle 2^jθ to qubit j. section 8.2
- Read each outcome’s amplitude direction as the accumulated rotation along its tree path. section 8.2
Three-qubit encoding
With θ = π/3, phase gates use angles π/3, 2π/3, and 4π/3 on qubits 0, 1, and 2. Their combined rotations encode the geometric sequence state. section 8.2
Listing 8.1 Creating a circuit for encoding a geometric sequence state
from sim_circuit import QuantumRegister, QuantumCircuit
def geometric_sequence_circuit(n, theta):
N = 2**n
q = QuantumRegister(n)
qc = QuantumCircuit(q)
for j in range(n): #1
qc.h(q[j])
for j in range(n): #1
qc.p(2 ** j * theta, q[j])
return qc
Inspect the Python circuit that applies Hadamard gates and qubit-specific phase gates. section 8.2
