Skip to main content

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

  1. Hadamard gates create superposition over all candidate states in wires_p and wires_q (representing prime factor candidates)
  2. Multiplication function uses the QFT and controlled phase rotations (Kfourier) to compute p × q, storing the result in wires_solution
  3. FlipSign operator marks the target state (the correct factorization)
  4. Grover operator performs amplitude amplification, iteratively increasing the probability of measuring the correct factors
  5. The circuit returns probabilities of each factor combination

Implementation

Results

Grover’s algorithm concentrates probability amplitude on the correct factor pairs. For N=15:

Full notebook

circuit_example_grover.ipynb