microsoft / Quantum
- четверг, 7 ноября 2019 г. в 00:20:31
PowerShell
Microsoft Quantum Development Kit Samples
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.
You can find instructions on how to install the Quantum Development Kit in our online documentation, which also includes an introduction to quantum programming concepts. A Docker image definition is also provided for your convenience, see below for instructions on how to build and use it.
If you're new to quantum or to the Quantum Development Kit, we recommend starting with the Getting Started samples.
As you go further with quantum development, we provide several different categories of samples for you to explore:
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 build quantum applications in C#, Python or Jupyter.
Once you have installed Docker, you can use the following commands to get you started:
To build the docker image and tag it iqsharp:
docker 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):
docker run -it --name iqsharp-container -p 8888:8888 iqsharp /bin/bashFrom the corresponding container command line, you can run the C# version of the Teleportation sample using:
cd ~/Samples/src/Teleportation && dotnet runSimilarly, you can run the Python version of the Teleportation sample using:
cd ~/Samples/src/Teleportation && python host.pyFinally, to start jupyter notebook within the image for the Teleportation sample, use:
cd ~/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 (you will need a token generated by jupyter when it started on the previous step):
Once you're done, to remove container named iqsharp-container:
docker rm --force iqsharp-container