These samples demonstrate the use of the Quantum Development Kit for a variety of different quantum computing tasks.
Each sample is self-contained in a folder, and demonstrates how to use Q# to develop quantum applications.
A small number of the samples have additional installation requirements beyond those for the rest of the Quantum Development Kit.These are noted in the README.md files for each sample, along with complete installation instructions.
Diagnostics:These samples show how to diagnose and test Q# applications.
Error Correction:These samples show how to work with quantum error correcting codes in Q# programs.
Interoperability:These samples show how to use Q# with different host languages.
Numerics:The samples in this folder show how to use the numerics library.
Runtime:These samples show how to work with the Q# simulation runtime.
Simulation:These samples show how to simulate evolution under different Hamiltonians.
We also encourage taking a look at the unit tests used to check the correctness of the Quantum Development Kit samples.
You can use the included Dockerfile to create a docker image with all the necessary libraries to use the Quantum Development Kit to buildquantum applications in C#, Python or Jupyter.
Once you have installed Docker, you canuse the following commands to get you started:
To build the docker image and tag it iqsharp:shdocker build -t iqsharp .
To run the image in the container named iqsharp-container with interactive command-line and redirect container port 8888 to local port 8888 (needed to run jupyter):shdocker run -it --name iqsharp-container -p 8888:8888 iqsharp /bin/bash
From the corresponding container command line, you can run the C# version of the Teleportation sample using: shcd ~/Samples/src/Teleportation && dotnet run
Similarly, you can run the Python version of the Teleportation sample using: shcd ~/Samples/src/Teleportation && python host.py
Finally, to start jupyter notebook within the image for the Teleportation sample, use:shcd ~/Samples/src/Teleportation && jupyter notebook --ip=0.0.0.0 --no-browser
Once Jupyter has started, you can open in your browser the Teleportation notebook (youwill need a token generated by jupyter when it started on the previous step):
Once you're done, to remove container named iqsharp-container:shdocker rm --force iqsharp-container