Skip to main content
SciNet
  • Home
  • All Courses
  • Calendar
  • Certificates
  • SciNet
    Main Site Documentation my.SciNet Old Education Site
  • CCDB
  • More
Close
Toggle search input
English
English Français
You are currently using guest access
Log in
Home All Courses Calendar Certificates SciNet Collapse Expand
Main Site Documentation my.SciNet Old Education Site
CCDB
  1. SCMP151 - Jun 2023
  2. Assignment 2: Grover search
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.

Contact site support
You are currently using guest access (Log in)
Data retention summary


All content on this website is made available under the Creative Commons Attribution 4.0 International licence, with the exception of all videos which are released under the Creative Commons Attribution-NoDerivatives 4.0 International licence.
Powered by Moodle