page_type | languages | products | description | ||
---|---|---|---|---|---|
sample |
|
|
This sample shows how to use synthesis techniques to implement arbitrary quantum oracles in Q#. |
This sample shows the implementation of an arbitrary quantum oracle function using Hadamard gates, CNOT gates, and arbitrary Z-rotations. The algorithm is based on papers by N. Schuch and J. Siewert [Programmable networks for quantum algorithms, Phys. Rev. Lett. 91, 027902, 2003] and J. Welch, D. Greenbaum, S. Mostame, and A. Aspuru-Guzik [Efficient quantum circuits for diagonal unitaries without ancillas, New J. of Phys. 16, 033040, 2014].
- The Microsoft Quantum Development Kit.
To run the sample, use the dotnet run
command from your terminal.
- OracleSynthesis.csproj: Main Q# project for the example.
- OracleSynthesis.qs: The Q# implementation for oracle synthesis.
- Program.qs: The Q# program entry point for the example.