Installing the Quantum Development Kit
The Quantum Development Kit can be used either with the Visual Studio 2017 integrated development environment, or with the command line and a development editor such as Visual Studio Code. We'll walk through both methods in this install guide.
The Quantum Development Kit requires a 64-bit installation of Windows 10, macOS, or Linux. Microsoft's quantum simulator, installed with the Quantum Development Kit, utilizes Advance Vector Extensions (AVX), and thus can run significantly more efficiently on an AVX-enabled CPU. The Quantum Development Kit will still run on non–AVX enabled CPUs, but may not be as efficient. Intel processors shipped in Q1 2011 (Sandy Bridge) or later support AVX.
- Installing Visual Studio 2017 (Windows only)
- Installing Visual Studio Code and the .NET Core SDK (Windows, macOS, Linux)
Microsoft Quantum Development Kit does not support Visual Studio for Mac. For development on macOS, we recommend Visual Studio Code.
If you do not have Visual Studio installed, you can download Visual Studio 2017 Community Edition for free.
- Go to the Visual Studio download page.
- Click on the Visual Studio Community Free download button.
- Navigate to your browser's download folder and double click on the executable file whose name begins with vs_community. The file name will contain a sequence of numbers that varies.
- Important! When you are presented with the option to select the tools for specific workloads, check the box for .NET Core cross-platform development. If there are any other workloads you would like to install, you can select them as well at this step.
- After selecting your workloads, click Install to complete the installation.
- Once you have installed Visual Studio 2017, download the Microsoft Quantum Development Kit for Visual Studio extension from the Visual Studio Marketplace. Double-click the VSIX once it is downloaded to install the extension.
You should now have the Quantum Development Kit installed and ready to use in your own applications and libraries.
Building the Quantum Samples and Libraries
In this section you will clone the quantum samples & libraries repository, and run a sample application to verify that your Q# environment is correctly installed and configured.
Clone and open the Microsoft Quantum Developer Kit Samples and Libraries GitHub repository.
- Open Visual Studio.
- Open the Connect view in Team Explorer (
- Select Clone under Local Git Repositories and enter
- Click Clone to clone the repo.
- The repository will be cloned on your local computer and Visual Studio will switch to the Solution Explorer on the right populated with the libraries and samples.
- Open the
- If prompted by the Install Missing Features pane, click Install to allow the installation of the necessary features. This is most often F# and tools used by some of the samples.
Validate your Q# environment by running the teleport sample program:
- Right click on the
QsharpLibrariessolution, and left click on "Set as Startup Project".
- Run the solution (F5.)
- Right click on the
If you receive a number of errors that reference NuGet packages, use the procedures in NuGet package restore to restore the packages.
If the program runs and the output is similar to the following (has 8 rounds of successful teleportation with varying values True/False sent each round), your Q# environment is ready to support Q# development.
Round 0: Sent True, got True. Teleportation successful!! Round 1: Sent False, got False. Teleportation successful!! ... Round 6: Sent True, got True. Teleportation successful!! Round 7: Sent False, got False. Teleportation successful!!
Some of the samples demonstrate using the Quantum Development Kit with other programming environments, and have additional installation requirement:
- Some samples use the Node.js Package Manager (NPM) to handle user interface dependencies. NPM can be installed manually or through a package manager.
- The Python interoperability feature has been developed for the Anaconda distribution of Python 3.6. Please see the README file provided with the Python sample for more details.
Additionally, the Quantum Development Kit is provided along with libraries for non-commercial use. These libraries may be found in the Microsoft/Quantum-NC repository on GitHub.