Four Years of Q#

Alan Geller

You can see all of the release notes for the year here.

Same As It Ever Was

2021 was a year like no other — expect, of course, 2020. Life was (still) dominated by the COVID-19 virus and the measures taken around the world to try and control its spread.

I, and the entire Microsoft Quantum team, hope that you and those close to you have continued to weather the pandemic safely, and wish you continued health and safety in the coming year.

Azure Quantum

Azure Quantum launched in public preview early this year. This was a huge step for our team and for the Q# language. Among other milestones, it was the first time that members of the public could run Q# programs on real quantum hardware.

Most of the team’s work this past year has been on Azure Quantum: fixing bugs, adding new features, and making it easier to use. Azure Quantum can be used from Python, Q# Jupyter notebooks, or the Azure CLI. It can also be accessed using the REST APIs from any environment that can create an HTTP request.

Most recently, we’ve added support for submitting Qiskit and Cirq quantum circuits to Azure Quantum hardware providers. This is part of our commitment to make Azure Quantum the most open and most accessible quantum computing cloud service.

You can see the end-to-end quantum software development workflow using Q#, QDK, and Azure Quantum here.

Quantum Intermediate Representation

There has been a lot of news around the compiler stack, specifically with QIR.

QIR Alliance

The biggest item is theannouncement of the new QIR Alliance, a joint effort to develop a forward-looking quantum intermediate representation with the goal to enable full interoperability within the quantum ecosystem and reduce development effort from all parties.

First QIR-Specific Compiler Pass

The QIR Alliance materials include QAT, a QIR-tailored LLVM pass. QAT itself transforms code from full QIR into a QIR profile, which is a restricted subset of QIR suitable for execution on specific hardware.

QAT is useful in itself, but to me it is even more exciting as a demonstration of the power of classical compiler tools such as LLVM in a quantum computing context. As quantum computers mature and the quantum algorithms that can be run on them become more complex, the need for compiler-driven code optimization and code transformation will become more critical, just as was the case for classical computing.

Python Tools For QIR

Also available from the QIR Alliance is pyqir, a Python toolkit for generating and consuming QIR. I’ve already started playing with using pyqir to generate QIR from the object models generated by various Python-based quantum circuit-building tools. I expect to see a lot more uses for pyqir in the future!


All this isn’t to say that we didn’t work on the Q# language itself over the past year! There were a variety of syntax clean-ups early in the year. This was followed recently by a new code formatter that can automatically update deprecated syntax.

Perhaps the most impactful change to Q# was the adoption of Hindley-Milner type inference. While this doesn’t change the language directly, it does make it easier to use today by removing some previously required type specifications. More importantly, it provides functionality that we can build upon to add new, cool language features in the future, such as lambda expressions.


This post is part of the Q# Advent Calendar 2021. Follow the calendar for other great posts!

Posted in Q#


Discussion is closed.

Feedback usabilla icon