November 8, 2019

[Quantum Computer] Getting Started: QDK

This is just a note on installing QDK, Python, Jupyter on Windows.

QDK is Microsoft Quantum Development Kit.

Installation steps are here,

But I had some minor trouble installing it, so this is the note.

  • Win10
  • Anaconda

[1] Install .NET package, 2.2.0

First, check if you have DOT NET package installed.  Do where dotnet and see if dotnet command is available.

If not, go to this site and install 2.2.  It's Important that current QDK requires 2.2.x version.

Check if you have the right version:

> dotnet --list-sdks
2.2.402 [C:\Program Files\dotnet\sdk]
3.0.100 [C:\Program Files\dotnet\sdk]

As shown above, I have 2.2.402 installed.

Now install .NET tools:

> dotnet tool install -g Microsoft.Quantum.IQSharp
> dotnet iqsharp install

[2] Anaconda + Python + Jupyter

Run Anaconda and create environment, 'qsharp':

> conda create --name qsharp
> conda activate qsharp

Create workspace directory

> cd /d e:\dev\code\
> mkdir qsharp
> cd qhsharp

And install jupyter and qsharp

> conda install jupyter
> pip install qsharp
> conda install ipykernel

Check if qsharp kernel is installed:

> jupyter kernelspec list
Available kernels:
  python3    C:\opt\Anaconda3\envs\qsharp\share\jupyter\kernels\python3
  iqsharp    C:\ProgramData\jupyter\kernels\iqsharp

Run jupyter notebook:

> jupyter notebook

This is just to show you installing QDK with right .NET version with Jupyter.  Jupyter can be utilize the notebook, but I don't see much benefit of using Jupyter in this case.  VS or VS code would be better choice as you still have to write the code in Q#.

There are a lot of docs and examples of Q# -- this is a big plus for learning.
Next time, I'll put some notes on VS, VS code and Q#.

No comments: