|
1 | 1 | # QDK Changelog
|
2 | 2 |
|
| 3 | +## v1.20.0 |
| 4 | + |
| 5 | +Below are some of the highlights for the 1.20 release of the QDK. |
| 6 | + |
| 7 | +### QIR target profile selection redesign |
| 8 | + |
| 9 | +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. |
| 10 | + |
| 11 | +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. |
| 12 | + |
| 13 | +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: |
| 14 | + |
| 15 | +```qsharp |
| 16 | +@EntryPoint(Base) |
| 17 | +operation Main() : Result[] { |
| 18 | + // ... |
| 19 | +} |
| 20 | +``` |
| 21 | + |
| 22 | +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. |
| 23 | + |
| 24 | +See the [QDK Profile Selection](https://github.com/microsoft/qsharp/wiki/QDK-Profile-Selection) wiki page for more details and examples. |
| 25 | + |
| 26 | +### OpenQASM improvements |
| 27 | + |
| 28 | +- Arrays and complex numbers can now be passed as input and output. |
| 29 | +- Qubit aliases and array concatenation are now supported. |
| 30 | +- In VS Code, OpenQASM files now support: |
| 31 | + - Rename symbol (F2) for user-defined identifiers, gates, functions, etc; built-ins are not renameable. |
| 32 | + - Go to Definition (F12) and Find All References (Shift+F12). |
| 33 | +- 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. |
| 34 | + |
| 35 | +### Python interop improvements |
| 36 | + |
| 37 | +In addition to primitive types, arrays, and tuples, users can now pass [Q# structs](https://github.com/microsoft/qsharp/wiki/Q%23-Structs). For example, the following shows passing a python object to a Q# operation that takes struct: |
| 38 | + |
| 39 | +<img width="899" src="https://github.com/user-attachments/assets/b711a19e-3814-44bc-9df7-cefca2830609" /> |
| 40 | + |
| 41 | +Complex numbers are also supported, allowing the passing of Python complex literals and variables directly to Q# callables, e.g. |
| 42 | + |
| 43 | +```python |
| 44 | +import qsharp |
| 45 | + |
| 46 | +qsharp.eval(""" |
| 47 | + import Std.Math.Complex; |
| 48 | +
|
| 49 | + function SwapComponents(c: Complex) : Complex { |
| 50 | + new Complex { Real = c.Imag, Imag = c.Real } |
| 51 | + } |
| 52 | + """) |
| 53 | + |
| 54 | +from qsharp.code import SwapComponents |
| 55 | +assert SwapComponents(2 + 3j) == 3 + 2j |
| 56 | +``` |
| 57 | + |
| 58 | +For more details on Python and Q# interop see our [wiki page](https://github.com/microsoft/qsharp/wiki/Invoking-Q%23-callables-from-Python). |
| 59 | + |
| 60 | +### Richer Copilot help for Q# APIs |
| 61 | + |
| 62 | +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. |
| 63 | + |
| 64 | +<img width="723" src="https://github.com/user-attachments/assets/005cf3f5-7364-4ef4-ac00-b558d2d953c8" /> |
| 65 | + |
| 66 | +### Language service improvements |
| 67 | + |
| 68 | +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! |
| 69 | + |
| 70 | +## Other notable changes |
| 71 | + |
| 72 | +- Profile Selection Redesign by [@ScottCarda-MS](https://github.com/ScottCarda-MS) in [#2636](https://github.com/microsoft/qsharp/pull/2636) |
| 73 | +- Import and export resolution improvements by [@minestarks](https://github.com/minestarks) in [#2638](https://github.com/microsoft/qsharp/pull/2638) |
| 74 | +- Fix parsing of OPENQASM version statement by [@orpuente-MS](https://github.com/orpuente-MS) in [#2650](https://github.com/microsoft/qsharp/pull/2650) |
| 75 | +- Fix completions for import and exports by [@minestarks](https://github.com/minestarks) in [#2640](https://github.com/microsoft/qsharp/pull/2640) |
| 76 | +- Python - Q# UDT interop by [@orpuente-MS](https://github.com/orpuente-MS) in [#2635](https://github.com/microsoft/qsharp/pull/2635) |
| 77 | +- Fix off-by-one error in stack traces by making line and column numbers 1-based for user display by [@Copilot](https://github.com/Copilot) in [#2628](https://github.com/microsoft/qsharp/pull/2628) |
| 78 | +- Allow recursive calls to operations that return `Unit` by [@swernli](https://github.com/swernli) in [#2654](https://github.com/microsoft/qsharp/pull/2654) |
| 79 | +- Fix panic when running .qsc circuit file by [@orpuente-MS](https://github.com/orpuente-MS) in [#2666](https://github.com/microsoft/qsharp/pull/2666) |
| 80 | +- OpenQASM language service: add rename/definition/references, semantic passes, and VS Code wiring by [@idavis](https://github.com/idavis) in [#2656](https://github.com/microsoft/qsharp/pull/2656) |
| 81 | +- Add support for qubit alias decls by [@idavis](https://github.com/idavis) in [#2665](https://github.com/microsoft/qsharp/pull/2665) |
| 82 | +- Remove Azure Quantum Credits deprecation message from VS Code extension by [@Copilot](https://github.com/Copilot) in [#2668](https://github.com/microsoft/qsharp/pull/2668) |
| 83 | +- Support numpy arrays in the Python interop layer by [@orpuente-MS](https://github.com/orpuente-MS) in [#2671](https://github.com/microsoft/qsharp/pull/2671) |
| 84 | +- Definition, References, Hover, Rename for import/export decls by [@minestarks](https://github.com/minestarks) in [#2641](https://github.com/microsoft/qsharp/pull/2641) |
| 85 | +- Nicer error messages for QIR generation by [@minestarks](https://github.com/minestarks) in [#2664](https://github.com/microsoft/qsharp/pull/2664) |
| 86 | +- Improve interface and output for Submit Job Copilot tool by [@minestarks](https://github.com/minestarks) in [#2673](https://github.com/microsoft/qsharp/pull/2673) |
| 87 | +- Lower duration and stretch by [@idavis](https://github.com/idavis) in [#2611](https://github.com/microsoft/qsharp/pull/2611) |
| 88 | +- OpenQASM support for Copilot tools by [@minestarks](https://github.com/minestarks) in [#2675](https://github.com/microsoft/qsharp/pull/2675) |
| 89 | +- Add support for array concatenation in OpenQASM by [@orpuente-MS](https://github.com/orpuente-MS) in [#2676](https://github.com/microsoft/qsharp/pull/2676) |
| 90 | +- Copilot Reads Summaries from DocGen Tool by [@ScottCarda-MS](https://github.com/ScottCarda-MS) in [#2672](https://github.com/microsoft/qsharp/pull/2672) |
| 91 | +- OpenQASM input and output interop by [@idavis](https://github.com/idavis) in [#2678](https://github.com/microsoft/qsharp/pull/2678) |
| 92 | +- Better symbol resolution for OpenQASM LS support by [@idavis](https://github.com/idavis) in [#2679](https://github.com/microsoft/qsharp/pull/2679) |
| 93 | + |
| 94 | +**Full Changelog**: [v1.19.0...v1.20.0](https://github.com/microsoft/qsharp/compare/v1.19.0...v1.20.0) |
| 95 | + |
3 | 96 | ## v1.19.0
|
4 | 97 |
|
5 | 98 | Below are some of the highlights for the 1.19 release of the QDK.
|
|
0 commit comments