Assignment
Assignment 2: Grover search
Completion requirements
Opened: Tuesday, 6 June 2023, 1:30 PM
Due: Tuesday, 13 June 2023, 11:59 PM
Create a function which implements Grover search using a quantum circuit. The function should take 3 arguments: the number of wires, the number of iterations to apply the Grover operator, and a string which gives the solution. The function should output the final probability for all the register qubits.
>>> import grover
>>> grover.run_grover(3, 2, '010')
[0.0078125 0.0078125 0.9453125 0.0078125 0.0078125 0.0078125 0.0078125 0.0078125]
>>>
The PennyLane functions qml.broadcast
(which can be used to apply single gates to many single wires) and qml.MultiControlledX
(which applies a PauliX for an arbitrary set of controls) will be useful.