Skip to content

Releases: microsoft/qsharp

v1.12

20 Dec 20:46
939e2aa
Compare
Choose a tag to compare

We are excited to release v1.12 of the Azure Quantum Development Kit! Here are some highlights of features included in this month's release:

Python interoperability improvements

You can now import and invoke your Q# callables for simulation directly from Python as functions. Your callables defined in %%qsharp magic cells, through calls to qsharp.eval, or loaded from projects in qsharp.init can now be imported from the qsharp.code module:

import qsharp

qsharp.eval("""
    operation Superposition() : Result {
        use q = Qubit();
        H(q);
        Std.Diagnostics.DumpMachine();
        MResetZ(q)
    }
    """)

from qsharp.code import Superposition
result = Superposition()

For more details and current limitations, see Invoking Q# callables from Python in the wiki.

Syntax for capturing state dumps from DumpMachine or DumpRegister and operation matrices from DumpOperation calls in your Q# code has also been improved (see #2042)

Deprecation of set keyword

The set keyword used for updating mutable values is now deprecated, so where you previously had to use set x += 1 you can now just write x += 1. In addition, the compiler includes a new lint that defaults to "allow" that you can use to warn or error on usage of set in your code (see #2062).

ApplyUnitary operation for simulation

When running against the simulator, your Q# code can call ApplyUnitary and pass a unitary matrix represented by a Std.Math.Complex[][] along with an array of qubit targets and have the simulator directly apply that unitary to the current sparse state vector.

Increase minimum versions for Python and Ubuntu

Starting with v1.12, the minimum supported Python version for the qsharp package is Python 3.9. Along with this change, the minimum compatible version of Ubuntu has been increased to 22.04 (see #2061)

Full Changelog: v1.11.1...v1.12

v1.11.1

05 Dec 18:53
ac1704c
Compare
Choose a tag to compare

We are excited to release v1.11.1 of the Azure Quantum Development Kit! This month's release includes features and bug fixes, such as:

Configure Pauli Noise Dynamically within Q#

You can now use the ConfigurePauliNoise function to dynamically update noise settings during simulation, allowing samples, exercises, or test code to directly set noise used in testing (#1997).

Stabilization of the Microsoft.Quantum.Unstable libraries

The Arithmetic, StatePreparation, and TableLookup libraries have been stabilized and are now available under Std. Several samples and libraries have been updated to reflect the new location, while the Microsoft.Quantum.Unstable namespace will be preserved for backward compatibility (#2022, #2043).

Support for Qiskit v1.3.0

Changes made to the Qiskit target class in v1.3.0 that broke interoperability with the qsharp Python package are now handled dynamically allowing use of both v1.2 and v1.3 versions of Qiskit (#2050).

Other Notable Changes

New Contributors

Full Changelog: v1.10.1...v1.11.1

v1.10.1

01 Nov 21:07
b700869
Compare
Choose a tag to compare

We are excited to release v1.10 of the Azure Quantum Development Kit! This month's release includes several new features and improvements including:

Code editing improvements

Code editing is now greatly improved. A couple of examples of the many improvements:

  • Context aware completions (#1947) show only the relevant completions for the location. For example, only showing types when in a type position:

    image
  • Namespace member (#1947) completion lists are now provided when drilling into namespaces:

    image
  • User Defined Type (#1954) member completions are now populated

    image

And much more! Parser error recovery has also been greatly improved so that editor assistance is available whilst mid-edit in many more scenarios.

Noisy simulation

You can now add Pauli noise to simulations run from Python or VS Code (#1971, #1975, #1980). This can help model the results of running on a real quantum machine for education purposes, and to help develop and test the effectiveness of error correction.

Below shows the results of configuring 5% bit-flip noise in VS Code and running a histogram on the GHZ sample. This would return only $\ket{000}$ and $\ket{111}$ shot results if run in a noise free simulation.

image

To see how to use noisy simulation in Python, check out the sample notebook at https://github.com/microsoft/qsharp/blob/main/samples/notebooks/noise.ipynb

Refreshed API docs interface

The in-editor Q# API documentation has had a UI refresh (#1978). This is accessed via the "Q#: Show API documentation" command in the command palette when editing a Q# file. The new UX allows you to quickly & easily search & navigate the APIs within your project, referenced projects, and the standard library.

image

File icons

The Q# file extension (.qs) now gets a unique icon in VS Code (#1976)

image

Custom measurements and resets

Previously you could define custom gates, but not custom measurement or reset operations. With #1967, #1981, and #1985 this is now possible. This allows for the definition and use of custom operations for quantum simulation and QIR code generation.

Samples for this feature will be added shortly, in the meantime see the test code at https://github.com/microsoft/qsharp/blob/v1.10.1/compiler/qsc/src/codegen/tests.rs#L529 for an example of how this may be used.

Python telemetry

In this release we have added telemetry to our qsharp Python package to collect minimal and anonymous metrics on feature usage and performance. This will allow us to focus our investments going forward on the most valuable areas. Please see the notes in the package readme for details on what is collected and how to disable it.

What's changed

And much more!! See the below list of changes in this release for the full details.

Full Changelog: v1.9.0...v1.10.1

v1.9.0

30 Sep 20:52
0380457
Compare
Choose a tag to compare

The 1.9.0 release of the QDK includes interoperability with Qiskit circuits built upon the core Q# compiler infrastructure.

The Qiskit interop provided by the QDK includes:

The Qiskit interop wiki page provides a brief overview of the integration while detailed examples, potential errors, and usage with parameterized circuits are demonstrated in the sample Qiskit interop notebook.

In addition to the Qiskit interop feature, the language service for Q# will now auto-suggest the new standard library API instead of the legacy Microsoft.Quantum-prefixed standard library API. For example, when typing DumpMachine, you'll now get a suggested import for Std.Diagnostics.DumpMachine instead of Microsoft.Quantum.Diagnostics.DumpMachine.

What's Changed

  • Remove benchmarking comment bot; Run benches weekly and save results as an artifact by @sezna in #1870
  • Port signed integer math to modern QDK by @sezna in #1841
  • Add samples of testing Q# code that prepares a quantum state by @tcNickolas in #1873
  • Simplify display of evaluation results in VS Code by @swernli in #1882
  • Bump rust dependency versions (except pyo3, rustc_hash, and miette) by @sezna in #1876
  • Update samples to reflect latest 1.7 changes; Update katas and stdlib to use structs by @sezna in #1797
  • Remove profile selection for Katas by @JPark1023 in #1881
  • Include CompareGTSI in the Signed math API by @sezna in #1888
  • Update Placeholder.qs by @HopeAnnihilator in #1890
  • Fix GetLink-Tutorial-Playground-state issue 1558 by @ggridin in #1855
  • update miette to v7.2.0 by @sezna in #1889
  • Update Node packages by @billti in #1894
  • Implements serialization for physical resource estimation by @msoeken in #1892
  • Update pyo3 from v0.20 to v0.22 by @sezna in #1893
  • Added DoubleAsStringWithPrecision function - Complex Arithmetics by @devikamehra in #1883
  • Added DoubleAsStringWithPrecision function - Single Qubit Gate by @devikamehra in #1884
  • Port fixed point library to modern QDK by @sezna in #1838
  • Katas UI review - Preparing states by @SoniaLopezBravo in #1847
  • Fix to RCA panic when original tuple binding is dynamic by @cesarzc in #1900
  • Generic code with code distance and threshold by @msoeken in #1896
  • Basic interop with Qiskit by @idavis in #1899
  • Use T gate time for physical factories by @msoeken in #1906
  • Add more items to RE system API by @msoeken in #1907
  • Configure ESRP@7 by @idavis in #1913
  • Basic samples for RE API by @msoeken in #1915
  • Introduce Relabel API by @swernli in #1905
  • Serialize logical post-layout overhead in resource estimation result by @msoeken in #1914
  • Support Adjoint of Relabel by @swernli in #1920
  • Migrate the standard library to the project system by @sezna in #1912
  • Bug fixes found during bash by @idavis in #1916
  • Fix typo in vscode extension's package.json by @m1c0l in #1917
  • Re-enable simulatable intrinsics for Qiskit/OpenQASM interop by @idavis in #1927
  • Add str value for TargetProfile by @idavis in #1930
  • Completions: existing glob import will prevent an exact import with t… by @minestarks in #1909
  • Playground: Fix error squiggle updates getting dropped by @minestarks in #1908
  • Add ProtocolSpecification to API by @msoeken in #1931
  • Migrate core library to the new Stdlib API/projects system by @sezna in #1919
  • Add from_str to TargetProfile by @idavis in #1937
  • Optimize RIR reindexing, QIR qubit use by @swernli in #1938
  • Update circuits widget sizing behavior by @swernli in #1921
  • Fix bug preventing display of circuits where same qubit measured more than once by @swernli in #1939
  • Fix python version compat signature by @idavis in #1941
  • Add DumpOperation support in Q# by @billti in #1885
  • Control how physical qubits are computed in factories by @msoeken in #1940
  • Update version to 1.9 by @idavis in #1942

New Contributors

Full Changelog: v1.8.0...v1.9.0

v1.8.0

21 Aug 21:02
89ba8c9
Compare
Choose a tag to compare

The 1.8.0 release of the QDK includes a number of improvements and fixes, with a focus on refining the project references and editor completions experience.

The full list of changes is below.

What's Changed

Full Changelog: v1.7.0...v1.8.0

v1.7.0

24 Jul 23:23
5763700
Compare
Choose a tag to compare

QDK 1.7.0 release notes

The team is very excited to ship this release. It has some of the most significant improvements to the Q# language in a long time.

Major language changes

External project references

The biggest feature in this release is the ability to reference other projects and consume their APIs. The projects can be in a separate local directory or published to GitHub. As part of this change, we also introduced import and export syntax, and generate an implicit namespace hierarchy based on file layout, removing the need for the namespace syntax.

For more details see the wiki page at https://github.com/microsoft/qsharp/wiki/Q%23-External-Dependencies-(Libraries). (The official documentation will be updated shortly with more details and examples).

New struct syntax

We're also introducing a new struct syntax, and long term see this as the replacement for the current UDT syntax. The custom types created by either are largely compatible, but the new syntax is simpler, cleaner, and similar to several popular languages. See more details at https://github.com/microsoft/qsharp/wiki/Q%23-Structs until the official docs are updated.

Optional EntryPoint

As well as removing the need to wrap code in a namespace, we're also removing the need to specify the EntryPoint attribute. If you have one callable called Main in your project, this will be the default entry point. (Note: Any specified @EntryPoint will still take precedence).

A new standard library namespace

We've also simplified the namespaces for our standard library. What was previously all under Microsoft.Quantum can now be accessed under the Std namespace. This reduces visual clutter and highlights what APIs are part of the "standard" library included with Q#.

Example

Taken together the above provides for a much cleaner language with a simple code sharing mechanism. For example, if your project references another project named Sparkle which exports an operation named Correct that takes a custom type Input with a Double and a Qubit, your entire Q# code to call this can be as simple as:

import Std.Diagnostics.DumpMachine;
import Sparkle.Input, Sparkle.Correct;

operation Main() : Unit {
    use q = Qubit[1];
    let x = new Input { A = 3.14, B = q[0] };
    
    Correct(x);

    DumpMachine();
    MResetZ(q[0]);
}

(Note these changes are additional capabilities. There are no breaking changes or requirements to change code to adopt this release).

Other updates and improvements

Many other changes have gone into this release. Some of the main ones include:

  • Unitary Hack contributions
    • Save RE widget to .png (#1604)
    • Lint rule: Use Functions (#1579)
    • Add doc for internal AND (#1580)
  • New DrawRandomBool API (#1645)
  • New DoubleAsStringWithPrecision API (#1664)
  • Fix display of CCX in a circuit (#1685)
  • Completion list improvements (#1682, #1715)
  • New samples (e.g. #1721)
  • Many more Katas additions and updates
  • Various bug fixes and perf improvements
  • Lots of engineering improvements to build times, testing, pipelines, etc.

New Contributors

Full Changelog: v1.6.0...v1.7.0

We hope you enjoy this release. Please log an issue if you need any assistance or to provide feedback. Thanks!

v1.6.0

06 Jun 16:58
1e123fa
Compare
Choose a tag to compare

Welcome to the v1.6.0 release of the Azure Quantum Development Kit!

The big feature in this release is the ability to compile Q# programs to QIR that require "Adaptive Profile" capabilities. This enables programs to take advantage of the latest capabilities of quantum hardware, such as the ability to perform mid-circuit measurement of qubits, branch based on the results, and perform some classical computations at runtime. For more details, see https://aka.ms/qdk.qir.

We've added or updated a number of samples that can leverage Adaptive Profile capabilities, such as the Three Qubit Repetition Code and the Iterative Phase Estimation notebook. Please do try it out and give us your feedback!

As part of the above work, the previous code generation approach was replaced, even in the non-Adaptive ("base profile") case. Please log an issue if you see any unexpected change in behavior.

Other notable new features include Q# linting support in Jupyter Notebooks, CodeActions in VS Code to fix certain Q# errors, Q# library documentation inside VS Code, and more!

Impactful changes and fixes

New Contributors

Full Changelog: v1.4.0...v1.6.0

v1.4.0

23 Apr 21:00
f9046ca
Compare
Choose a tag to compare

Welcome to the v1.4.0 release of the Azure Quantum Development Kit. The main highlights of this release are:

Other notable fixes and improvements include:

And lots of Katas updates! Including:

  • Add state flip task to Single-Qubit Gates kata by @WWhitedogi in #1343
  • Add tasks 1.8, 1.9, 1.10 to Superposition Kata by @jkingdon-ms in #1346
  • Add sign flip, basis change, amplitude change tasks to Single-Qubit Gates kata by @WWhitedogi in #1352
  • Add global phase -1, relative phase i, and complex relative phase tasks to Single-Qubit Gates kata by @WWhitedogi in #1369
  • Add tasks 1.11, 1.12 to Superposition Kata by @jkingdon-ms in #1381
  • Add task 2.1 to Superposition kata by @tcNickolas in #1395
  • Update READMEs to add details on building playground and katas by @Manvi-Agrawal in #1402
  • Add tasks on Bell states changes to Multi-Qubit States kata by @WWhitedogi in #1385
  • Add CZ section and CNOT and CZ tasks to Multi-Qubit Gates kata by @WWhitedogi in #1389
  • Adds task 1.13 to Superposition Kata by @frtibble in #1382

Full Changelog: v1.3.1...v1.4.0

v1.3.1

22 Mar 19:10
cfc3bc9
Compare
Choose a tag to compare

Includes a fix for an issue rendering DumpMachine calls in VS Code.

See v1.3.0...v1.3.1 for the change.

v1.3.0

21 Mar 16:59
072d85d
Compare
Choose a tag to compare

Welcome to the v1.3.0 release of the Azure Quantum Development Kit. The main highlights of this release are:

  • Initial support for linting (#1140)
  • Document and selection formatting (#1172 and #1275)
  • Authenticate to Azure Quantum workspaces via a connection string (#1238)
  • Add a 'Create Q# project' command (#1286)
  • Significant performance improvements from using mimalloc (#1249)
  • More significant performance improvements via CFG usage (#1261)
  • Add Microsoft.Quantum.Measurement to the prelude (#1233)
  • Changes to the data returned by dump_machine and dump_operation (#1227)

And more! See v1.2.0...v1.3.0 for the full list of changes.