Below are some of the highlights for the 1.20 release of the QDK.
QIR target profile selection redesign
In previous releases, the target QIR profile setting for code generation in VS Code was a global setting, and if switching between projects with different target profiles the user would need to remember to change the editor setting each time. This was cumbersome and a common source of confusion.
With this release, the target profile can be set per project. If working on a multi-file project with a qsharp.json
manifest file, the target profile can be specified in the manifest file via the "targetProfile"
property.
If working in a standalone Q# or OpenQASM file, the target profile can be specified via the @EntryPoint
attribute in Q# files, or the qdk.qir.profile
pragma in OpenQASM files. For example, to target a Q# file for base profile
code generation:
@EntryPoint(Base)
operation Main() : Result[] {
// ...
}
If submitting a job to the Azure Quantum service, upon submission the target profile will default to the capabilities of the target hardware if not otherwise specified.
See the QDK Profile Selection wiki page for more details and examples.
OpenQASM improvements
- Arrays and complex numbers can now be passed as input and output.
- Qubit aliases and array concatenation are now supported.
- In VS Code, OpenQASM files now support:
- Rename symbol (F2) for user-defined identifiers, gates, functions, etc; built-ins are not renameable.
- Go to Definition (F12) and Find All References (Shift+F12).
- The GitHub Copilot tools for the QDK now support OpenQASM (.qasm) files as well as Q#. You can simulate your program, generate a circuit diagram and generate resource estimates for Q# and OpenQASM programs right from the chat panel.
Python interop improvements
In addition to primitive types, arrays, and tuples, users can now pass Q# structs. For example, the following shows passing a python object to a Q# operation that takes struct:

Complex numbers are also supported, allowing the passing of Python complex literals and variables directly to Q# callables, e.g.
import qsharp
qsharp.eval("""
import Std.Math.Complex;
function SwapComponents(c: Complex) : Complex {
new Complex { Real = c.Imag, Imag = c.Real }
}
""")
from qsharp.code import SwapComponents
assert SwapComponents(2 + 3j) == 3 + 2j
For more details on Python and Q# interop see our wiki page.
Richer Copilot help for Q# APIs
In this release, we added a new Copilot tool that can access the documentation generated by all the APIs available in the current project (included the standard library and referenced libraries). This lets Copilot see up-to-date information on the Q# libraries available and how to use them, improving Copilot's working knowledge of Q#. From generated Q# snippets to answering questions about available APIs, Copilot can use this to provide more accurate and up-to-date information.

Language service improvements
Numerous improvements to the language service have been made for correctness and completeness, especially around import and export declarations. The language service now also provides better diagnostics for QIR generation errors. Please log issues if you encounter any problems!
Other notable changes
- Profile Selection Redesign by @ScottCarda-MS in #2636
- Import and export resolution improvements by @minestarks in #2638
- Fix parsing of OPENQASM version statement by @orpuente-MS in #2650
- Fix completions for import and exports by @minestarks in #2640
- Python - Q# UDT interop by @orpuente-MS in #2635
- Fix off-by-one error in stack traces by making line and column numbers 1-based for user display by @Copilot in #2628
- Allow recursive calls to operations that return
Unit
by @swernli in #2654 - Fix panic when running .qsc circuit file by @orpuente-MS in #2666
- OpenQASM language service: add rename/definition/references, semantic passes, and VS Code wiring by @idavis in #2656
- Add support for qubit alias decls by @idavis in #2665
- Remove Azure Quantum Credits deprecation message from VS Code extension by @Copilot in #2668
- Support numpy arrays in the Python interop layer by @orpuente-MS in #2671
- Definition, References, Hover, Rename for import/export decls by @minestarks in #2641
- Nicer error messages for QIR generation by @minestarks in #2664
- Improve interface and output for Submit Job Copilot tool by @minestarks in #2673
- Lower duration and stretch by @idavis in #2611
- OpenQASM support for Copilot tools by @minestarks in #2675
- Add support for array concatenation in OpenQASM by @orpuente-MS in #2676
- Copilot Reads Summaries from DocGen Tool by @ScottCarda-MS in #2672
- OpenQASM input and output interop by @idavis in #2678
- Better symbol resolution for OpenQASM LS support by @idavis in #2679
Full Changelog: v1.19.0...v1.20.0