A geometric sequence state is a periodic quantum state whose amplitudes share one magnitude while their phases advance by kθ for outcome index k. The phase progression represents a signal frequency, but measurement cannot reveal it directly when all outcome probabilities are equal. section 7.2 section 8.2
Construct the state with a repeatable circuit pattern:
- Apply a Hadamard gate to every qubit to create equal-magnitude amplitudes. section 8.2
- Apply a phase gate to qubit j with angle 2^jθ; binary outcome digits combine these factors into the phase kθ. section 8.2
- Use a Hadamard gate or the QFT to convert phase differences into magnitude differences that measurement can distinguish. section 7.2
Three-qubit encoding
For n = 3 and θ = π/3, encode the state by applying H to each qubit, then phase rotations π/3, 2π/3, and 4π/3. The reusable Python pattern is: geometric_sequence_circuit(n, theta) creates the register, applies both gate loops, and returns the circuit. A single-loop version interleaves the Hadamard and phase operations for each qubit. 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 executable circuit builder and its parameterized Hadamard and phase-gate loops. section 8.2
