Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 2.11 KB

File metadata and controls

69 lines (51 loc) · 2.11 KB
page_type languages products description jupyter
sample
qsharp
python
csharp
qdk
This sample shows how to use Q# to search for a marked item with Grover's algorithm.
jupytext kernelspec
cell_markers text_representation
region,endregion
extension format_name format_version jupytext_version
.md
markdown
1.2
1.5.2
display_name language name
.NET (PowerShell)
PowerShell
.net-powershell

Database Search Sample

This sample walks through Grover's search algorithm. Oracles implementing the database are explicitly constructed together with all steps of the algorithm. This features two examples -- the first implements the steps of Grover's algorithm manually. The second applies amplitude amplification functions in the canon to automate many steps of the implementation.

Prerequisites

Running the Sample

This sample can be run in a number of different ways, depending on your preferred environment.

Python in Visual Studio Code or the Command Line

At a terminal, run the following command:

python host.py

C# in Visual Studio Code or the Command Line

At a terminal, run the following command:

dotnet run

Running the Sample in Jupyter Notebook

This sample can also be viewed using Jupyter Notebook. To do so, ensure that you have the IQ# kernel installed using the instructions in the getting started guide. Then, start a new Jupyter Notebook session from this directory:

cd Samples/src/DatabaseSearch
jupyter notebook

Manifest