Grover’s Algo with Microsoft’s Q#

Abhishek Dubey
1 min readMay 7, 2020

--

The way Microsoft has designed their Quantum Computing framework is into 2 components

  1. Quantum Code written in Q#
  2. Familiar Host Languages interface (like C#, F#, python etc) to call the Q# Code.

Note: If we do not want a Host Language you can directly run Q# code from command line as well.

This can be more visualized as what we do in our classical computers, we write code for GPU separately & then we use the code written for CPU to run & access the results from the GPU computation. So for the comparison Q# code is like GPU code & the python/ C# wrapper code is like CPU code.

So let’s start by writing our 2 Qubit Grover Circuit for 00.

Note: If you want to know more about Grover Search Algo, please read this

Now once we have Quantum circuit/ operation ready to be run on pure Quantum Machine/ Simulator, lets see how does we call this from a Host language (python here).

Check Complete Code below

--

--