Quantum Development Kit 0.12 Release Highlights
Tags: qsharp, quantumcomputing
Published: 2020-07-06 09:07:29

I am so excited for this release folks, it has some features I have been wanting for a long while!

The QDK team has published [official QDK release notes for version 0.12.20070124](https://docs.microsoft.com/quantum/resources/relnotes#version-01220070124), but I wanted to walk through and highlight some of the parts that I am most excited about. So let's get to it!

## Using Q# with Python and Jupyter just got soo much better!

There is so much in this release that makes developing Q# in Jupyter Notebooks and Python so much easier.
I have also noticed [a ton more documentation on the IQ# magic commands](https://docs.microsoft.com/qsharp/api/iqsharp-magic/azure.connect), which was sorely needed.

<p style="text-align: center;">
<img src="https://sckaiser.com/public/media/blog/2020-07-02-magicdocs.png" alt="magic command api docs" style="width: 100%; display: inline;padding-top: 1em;"/>
<figcaption>You can see the new docs in the API Reference on the side of the page.</figcaption>
</p>

Let's take a look at the [official release notes](https://docs.microsoft.com/quantum/resources/relnotes#version-01220070124) to see the details of what all was added:

> IQ# now allows arguments to the [%simulate](https://docs.microsoft.com/qsharp/api/iqsharp-magic/simulate), [%estimate](https://docs.microsoft.com/en-us/qsharp/api/iqsharp-magic/estimate), and other magic commands. See the [%simulate magic command reference](https://docs.microsoft.com/qsharp/api/iqsharp-magic/simulate) for more details.

I HAVE BEEN WANTING THIS FOREVER 😻
It will be so much nicer to use Jupyter notebooks with Q# kernels now, you won't have to write stubs that would fill in the arguments you wanted.
Thanks so much to the team for getting this one implemented 💖

> New phase display options in IQ#. See the [%config magic command reference](https://docs.microsoft.com/qsharp/api/iqsharp-magic/config) for more details.

The `%config` magic command is not new, but there are [new docs for `%config`](https://docs.microsoft.com/qsharp/api/iqsharp-magic/config) and some new config options.
These options allow for configuring how the phase is displayed when running callables like [`DumpMachine`](https://docs.microsoft.com/en-us/qsharp/api/qsharp/microsoft.quantum.diagnostics.dumpmachine) and [`DumpRegister`](https://docs.microsoft.com/en-us/qsharp/api/qsharp/microsoft.quantum.diagnostics.dumpregister).

<p style="text-align: center;">
<img src="https://sckaiser.com/public/media/blog/2020-07-02-config1.png" alt="Default styling for DumpMachine" style="width: 100%; display: inline;padding-top: 1em;"/>
<figcaption><strong>Here's an example of some of the new IQ# features including arguments to simulate and showing the default <code>DumpMachine</code> behavior.</strong></figcaption>
</p>
<p style="text-align: center;">
<img src="https://sckaiser.com/public/media/blog/2020-07-02-config2.png" alt="Configured to 'ArrowAndNumber' styling for DumpMachine" style="width: 100%; display: inline;padding-top: 1em;"/>
<figcaption><strong>Using the <code>%config</code> magic command, we can change the display of the phase column in <code>DumpMachine</code>. </strong></figcaption>
</p>

I really like the ability to actually turn them off as they can add a lot of noise when trying to demonstrate something that is independent of phase.

> IQ# and the `qsharp` Python package are now provided via conda packages ([qsharp](https://anaconda.org/quantum-engineering/qsharp) and [iqsharp](https://anaconda.org/quantum-engineering/iqsharp)) to simplify local installation of Q# Jupyter and Python functionality to a conda environment. See the [Q# Jupyter Notebooks](https://docs.microsoft.com/quantum/quickstarts/install-jupyter) and [Q# with Python](https://docs.microsoft.com/quantum/quickstarts/install-python) installation guides for more details.

I pretty much only use the [Anaconda distributions](https://www.anaconda.com/) of Python, as it's great for working with scientific software.
The addition of the `qsharp` package to conda will thus make managing environments for quantum development a _lot_ easier.

In this case, `conda` envs are especially useful, as you can specify things that are not Python packages as part of an environment (like if you needed a particular version of some .NET tooling, or the IQ# kernel that powers Python ↔ Q# interoperability).
Using the new packages, it's really easy to get everything you need for working with IQ# Notebooks, or with using Q# from Python:

```
conda install -c quantum-engineering qsharp
```

> Updates to make it easier for IQ# users to consume library packages with different QDK versions, requiring only major & minor version numbers match rather than the exact same version

This one is also a general quality of life improvement, and makes maintenance tasks easier.
IQ# uses a specific version of the compiler when building and running your Jupyter notebook code.
In your notebook, you might also want to load additional packages but they each have a version of the compiler that they were built against.
Now, rather than the IQ# compiler version and the package compiler versions needing to match _exactly_, they only need match major and minor.

## Legacy, we got chemistry 😘

> New qdk-chem tool for converting legacy electronic structure problem serialization formats (e.g.: FCIDUMP) to Broombridge

Full disclaimer, I am not a chemist.
That said, I am familiar with having to manage data that is in multiple different encodings for a project and that is a nightmare.
This comes up in quantum chemistry applications as there is a step in the development loop where the chemist exports a description of the problem from their simulation software and wants to use that with the QDK. This release adds some new support for converting/using other serializations with the QDK, so that you can use the standard [Broombridge format](https://docs.microsoft.com/quantum/user-guide/libraries/chemistry/schema/broombridge) to work with your electronic structure problems.

<p style="text-align: center;">
<a href="https://docs.microsoft.com/quantum/user-guide/libraries/chemistry/schema/broombridge">
<img src="https://docs.microsoft.com/quantum/media/broombridge.png" alt="magic command api docs" style="width: 80%; display: inline;padding-top: 1em;"/></a>
<figcaption>This new conversion tool help in translating between the top box "Chemistry Modeling" and the blue box "Quantum chemistry format."</figcaption>
</p>

If you want to try it out, you can use the same `dotnet tool install` command that you use to get other .NET Core Global Tools:

```
dotnet tool install -g Microsoft.Quantum.Chemistry.Tools
qdk-chem --help
```

## New functionality for Oracle synthesis

> New functions and operations in the [Microsoft.Quantum.Synthesis namespace](https://docs.microsoft.com/qsharp/api/qsharp/microsoft.quantum.synthesis) for coherently applying classical oracles using transformation- and decomposition-based synthesis algorithms.

This is some great new functionality for those that are working on writing oracles for their algorithms.
Oracles are basically a way of representing classical functions in quantum algorithms, if you want to learn more, check out [Chapter 7.4](https://livebook.manning.com/book/learn-quantum-computing-with-python-and-q-sharp/chapter-7/v-8/84) of [_Learn Quantum Computing with Python and Q#_](bit.ly/qsharp-book)!
The new namespace provides operations that help with taking truth tables or functions and helping you create an oracle that implements the table or function.

## Quality of life/Consistency improvements

> When using the simulator, qubits no longer need to be in the \|0⟩ state upon release, but can be automatically reset if they were measured immediately before releasing.

The error messages for this before were not too bad, and always helped remind me I forgot to explicitly reset a register of qubits, but I greatly appreciate this new feature.
If you have already measured a qubit, then the the quantum device will know what _exactly_ what state it's in, so resetting it is trivial.
Thus, if it is tracking that they were already measured and it's time to release them, it can do whatever operations needed automatically to put them back in the |0⟩ state.

> Moved operations:
>    - Microsoft.Quantum.Intrinsic.Assert is now Microsoft.Quantum.Diagnostics.AssertMeasurement
>    - Microsoft.Quantum.Intrinsic.AssertProb is now Microsoft.Quantum.Diagnostics.AssertMeasurementProbability

The new names here make it much more clear what the operations are actually doing.

> Removed deprecated Microsoft.Quantum.Primitive.* namespace

I think that finally clearing out that namespace will be good for clarity and also help make the language more inclusive.
It was originally deprecated in [version 0.6](https://docs.microsoft.com/quantum/resources/relnotes#version-061905) and renamed to the more descriptive [**Microsoft.Quantum.Intrinsic** namespace](https://docs.microsoft.com/qsharp/api/qsharp/microsoft.quantum.intrinsic).

## Time to go update some code!

Anyway, I hope it was helpful to look at the release in context like this, I hope to be doing it for every release I can in the future!
If you want to learn more about getting started with Q# or maybe diving into quantum applications, check out my book [_Learn Quantum Computing with Python and Q#_](bit.ly/qsharp-book).
It's geared as a gentle introduction for developers of all levels to build up an understanding of both quantum computing and Q#.

Leave a comment below about what you are most excited about from this release or Q# in general!
Remember, quantum isn't magic but you are ✨