Skip to content

v1.20.0

Latest
Compare
Choose a tag to compare
@billti billti released this 26 Aug 19:25
· 11 commits to main since this release
73ca361

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

Full Changelog: v1.19.0...v1.20.0