title | author | ms.author | ms.date | ms.topic | ms.custom | uid |
---|---|---|---|---|---|---|
Learn how to update the Microsoft Quantum Development Kit (QDK) |
natke |
nakersha |
9/30/2019 |
article |
how-to |
microsoft.quantum.update |
Learn how to update the Microsoft Quantum Development Kit (QDK) to the latest version.
This article assumes that you already have the QDK installed. If you are installing for the first time, then please refer to the installation guide.
The update steps depend on your development environment. Choose your environment from the following sections.
-
Update the
iqsharp
kerneldotnet tool update -g Microsoft.Quantum.IQSharp dotnet iqsharp install
-
Verify the
iqsharp
versiondotnet iqsharp --version
You should see the following output:
iqsharp: 0.9.1909.3002 Jupyter Core: 1.1.14623.0
-
Update the
qsharp
packagepip install qsharp --upgrade
-
Verify the
qsharp
versionpip show qsharp
You should see the following output:
Name: qsharp Version: 0.9.1909.3002 Summary: Python client for Q#, a domain-specific quantum programming language ...
-
You can now use the updated QDK version to run your existing quantum programs.
-
Update the
iqsharp
kerneldotnet tool update -g Microsoft.Quantum.IQSharp dotnet iqsharp install
-
Verify the
iqsharp
versiondotnet iqsharp --version
You should see the following output:
iqsharp: 0.9.1909.3002 Jupyter Core: 1.1.14623.0
-
You can now open an existing Jupyter notebook and run it with the updated QDK.
-
Update the Q# Visual Studio extension
- Visual Studio prompts you to accept updates to the Quantum Visual Studio extension
- Accept the update
[!NOTE] The project templates are updated with the extension. The updated templates apply to newly created projects only. The code for your existing projects is not updated when the extension is updated.
-
Update the QDK packages
- Open an existing application
- Select Dependencies in the Solution Explorer
- Select Manage NuGet Packages
- Update the Microsoft.Quantum packages to the latest version
-
You can now run your application with the latest QDK.
-
Update the Quantum VS Code extension
- Restart VS Code
- Navigate to the Extensions tab
- Select the Microsoft Quantum Development Kit for Visual Studio Code extension
- Reload the extension
-
Update the Quantum project templates:
- Go to View -> Command Palette
- Select Q#: Install project templates
-
Open an existing application in VS Code
- Edit the .csproj file to add the new package versions
<ItemGroup> <PackageReference Include="Microsoft.Quantum.Standard" Version="0.9.1909.3002" /> <PackageReference Include="Microsoft.Quantum.Development.Kit" Version="0.9.1909.3002" /> </ItemGroup>
If you use other
Microsoft.Quantum
packages, update these too. -
You can now run your application with the updated QDK
-
Update the Quantum project templates for .NET
dotnet new -i Microsoft.Quantum.ProjectTemplates
-
Update and run an existing application
-
Update the QDK package versions in your application
dotnet add package Microsoft.Quantum.Development.Kit dotnet add package Microsoft.Quantum.Standard
If your application uses any other
Microsoft.Quantum
packages, update these too. -
Run the application
dotnet run
-
Your application will run with the new package versions
-
Now that you have updated the Quantum Development Kit in your preferred environment, you can continue to develop and run your quantum programs. If you have not written a program yet, you can get started with your first quantum program.