Grover’s Algorithm on Dynex
Grover’s algorithm provides a quadratic speedup for unstructured search problems. On Dynex, it is implemented as a quantum gate circuit using PennyLane and can be used for integer factorization, database search, and optimization.How it works
- Hadamard gates create superposition over all candidate states in
wires_pandwires_q(representing prime factor candidates) - Multiplication function uses the QFT and controlled phase rotations (Kfourier) to compute p × q, storing the result in
wires_solution - FlipSign operator marks the target state (the correct factorization)
- Grover operator performs amplitude amplification, iteratively increasing the probability of measuring the correct factors
- The circuit returns probabilities of each factor combination
Implementation
Results
Grover’s algorithm concentrates probability amplitude on the correct factor pairs. For N=15:| Factor pair | Expected probability |
|---|---|
| 3 × 5 | High (~0.5) |
| 5 × 3 | High (~0.5) |
| Others | Near zero |