IQPS: Lab Q#
In this lab we will look at using oracles in Q#. It follows through snippets from the Microsoft Quantum Katas. These are little exercises that Microsoft released to provide a gentle introduction to Q#.
We aim to implement Grover's algorithm in Q#, you can either get started with the Katas directly, or go through the following path to work your way up to it.
You can either run this in your browser or install the Azure Quantum Development Kit in VSCode. If you choose the latter, the documentation for getting started is here and here. This will help you create a Q# file, and from there you can put the tasks directly into the file.
Suggested task order
Get to grips with allocating qubits:
Declare and make oracles:
Implement a simple oracle
Grover's Search Algorithm:
- You should now be able to follow the exercise implementing the search algorithm
General Questions
- How does the Q# implementation of oracles differ from the one from Quipper?
- In each of the exercises you have to allocate and reset qubits. One way to reset a qubit is to measure it then set its state back to |0>. How might you set a qubit's state back to |0> without measuring it?
Extension
There are two further Katas about Grover's algorithm, have a go!