Quantum Development Kit updates: support for macOS, Linux, plus Python and Q# interoperability


– Coming up I’ll show you the updates to the Quantum Development Kit preview, including new support for
macOS and the Linux platform. Allowing you to write quantum
applications as you begin to explore the concepts
of quantum computing on those platforms. Back in December we released
the Quantum Development Kit preview for Windows as part of our overall quantum computing strategy,
which includes a development of a topological qubit
and a quantum computer. We’d like to start by saying thank you to the tens of thousands of
you who’ve downloaded the kit and started writing Q# code. Your feedback has been very
valuable and we’re excited to announce an update that
delivers the new features that you asked for most. Not only are we bringing the
Quantum Development Kit preview to more platforms, but we’re
also excited to welcome Python programmers to the world of Q#. And remember, if you’re
new to quantum computing check out the series
on Microsoft Mechanics to learn the core concepts
before you get started. The Quantum Development Kit
preview for macOS and Linux is integrated with Visual
Studio code for those platforms. The first thing you want to
do on your Mac is make sure that you’ve got the Visual Studio code and .Net Core SDK 2.0 or later installed. You’ll need the Quantum Development Kit
extension for VS code and you can get that from the
Visual Studio marketplace Next you configure the Quantum
Development Kit for Mac in your favorite terminal
with one command, which you can see here. Then finally, you want
to clone our Q# library and samples from Github. Now you’re ready to build some Q# code. Last time, Krista showed us
calculating the ground state of hydrogen, which leveraged
Q# and C# functions, as well as graphical
output for the analysis. Let’s take a look at how
this works on the Mac. I’ve got exactly the same code on the Mac as we showed last time on Windows. Our hydrogen ground state
project opens into VS code and I have access to all the source files including Q# and C# with syntax coloring. Here is the C# driver,
calling into our Q# code, which does our quantum operations. Now I’ll run this code on my Mac. You’ll see that we get
similar graphical richness to what we had on Windows. Including the predictive plot
line and the actual analysis. This is a combination of the Q# run time talking to the quantum simulator. So you’ve got a consistent
experience from code editing to quantum simulation, to
analysis, across platforms. And you can access this same experience if you’re running on Linux. You can find details at the link shown. Now a lot of quantum research
has been done using Python. Today we’re making a preview
of Python interoperability on Windows. Let’s take a look at how it works. I’ll move to a remote
session, running Windows. In VS Code on Windows I’ve
a project open that explores quantum tomography, which
is the process of testing quantum operations that works
the same in quantum simulators as it does on actual quantum computers. The quantum operation
that I want to explore is written here in Q#. This operation takes a
qubit as a parameter, along with a range of noise
that is going to apply to a hadamard operation
that will probe from Python. Over here on my Python code
we’re calling a function single qubit process tomography
that we run 10,000 times. Now I’ll run it. So the first thing it’s gonna
do is initialize our simulator that will be used for simulating
this quantum operation. It’s now preparing a tomography
model that will be applied to that hadamard channel and
then it begins the process of running those 10,000 iterations of that probing function. Our output shows our predicted
results on the right, what we expected the noise to look like. On the left we see how the
tomography process works with the noise we injected. The artifacts appear because
we limited the number of measurements to 10,000,
but we can clearly see a trend in the quantum operation toward the predicted noise model. We could even improve the
accuracy with more iterations. Now we know that one of the
most popular places to work with scientific analysis like
this is Jupyter Notebooks. Here in my browser I have
got a Jupyter Notebook open. This Python interoperability works great from Jupyter Notebooks, allowing you to integrate
Q# results through Python into the notebooks you’re already using. So you can see here we
have the exact same results from our tomography example
embedded directly into our Jupyter Notebook. One more thing to note. We’ve also improved the
speed and efficiency of our quantum simulator which will
be especially noticeable for simulations requiring
20 or more qubits. I hope you’ve enjoyed our introduction to the latest updates to
our Quantum Development Kit which bring support for macOS
and Linux based development as well as a preview of
Python interoperability. You can get started by
downloading the latest previews for Linux and macOS at the link shown. Oh, and one last thing. We know that many of
you find the source code in our library, samples,
and tutorials really useful and you want to use that
code in your own projects, so we’ve made these fully
open source on Github to allow you to build on top of our code and contribute your ideas back
to the Q# Quantum Community. You can find out more
about quantum computing and Microsoft’s approach
at microsoft.com/quantum. Keep the feedback coming
and thanks for watching.

13 thoughts on “Quantum Development Kit updates: support for macOS, Linux, plus Python and Q# interoperability

  1. Thanks for building out this toolkit! I was wondering where I could find more information about the Python interoperability. So far, this video is the only resource I have found.

  2. Too bad they abandoned the previous F# based quantum programming language. Using a C-style syntax of course means faster adoption by more developers, but the F# syntax is simpler and far more elegant. Overall it seems like a good language and has retained some nice F# influences.

  3. Today we can simulating Hydrogen atoms, tomorrow we can simulate complex molecules and ultimately we can create new medicines to cure cancer like deadly diseases.

Leave a Reply

Your email address will not be published. Required fields are marked *