Skip to content

Commit f2ca520

Browse files
authored
Bump version to v1.21 (#2732)
1 parent 67f5f70 commit f2ca520

File tree

6 files changed

+80
-96
lines changed

6 files changed

+80
-96
lines changed

library/fixed_point/qsharp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"github": {
77
"owner": "Microsoft",
88
"repo": "qsharp",
9-
"ref": "v1.20.0",
9+
"ref": "v1.21.0",
1010
"path": "library/signed"
1111
}
1212
}

library/signed/qsharp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"github": {
77
"owner": "Microsoft",
88
"repo": "qsharp",
9-
"ref": "v1.20.0",
9+
"ref": "v1.21.0",
1010
"path": "library/qtest"
1111
}
1212
}

source/qdk_package/README.md

Lines changed: 28 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
11
# qdk
22

3-
Experimental meta-package for the Quantum Development Kit (QDK) that bundles the existing
4-
`qsharp` Python package together with optional extras under a single, stable import root: `import qdk`.
5-
6-
The design is intentionally minimal: submodules plus import-time detection of optional components.
3+
Preview package for the Quantum Development Kit (QDK) that bundles the `qsharp` Python package together with optional extras under a single top level package.
74

85
## Install
96

10-
Base (always includes `qsharp`):
7+
To install the core functionality, which include Q\# \& OpenQASM simulation, compilation, and resource estimation support:
118

129
```bash
1310
pip install qdk
1411
```
1512

16-
Jupyter extra (bundles widgets + JupyterLab extension package — provides only the `qdk.widgets` Python surface):
13+
To include the Jupyter extra, which adds visualizations using Jupyter Widgets in the `qdk.widgets` submodule and syntax highlighting for Jupyter notebooks in the browser:
1714

1815
```bash
1916
pip install qdk[jupyter]
2017
```
2118

22-
Azure Quantum extra (adds `azure-quantum`):
19+
To add the Azure Quantum extra, which includes functionality for working with the Azure Quantum service in the `qdk.azure` submodule:
2320

2421
```bash
2522
pip install qdk[azure]
2623
```
2724

28-
Qiskit extra (adds `qiskit`):
25+
For Qiskit integration, which exposes Qiskit interop utilities in the `qdk.qiskit` submodule:
2926

3027
```bash
3128
pip install qdk[qiskit]
3229
```
3330

34-
All extras:
31+
To easily install all the above extras:
3532

3633
```bash
3734
pip install qdk[all]
@@ -46,59 +43,41 @@ result = qsharp.run("{ use q = Qubit(); H(q); return MResetZ(q); }", shots=100)
4643
print(result)
4744
```
4845

49-
Widgets (installed via jupyter extra):
50-
51-
```python
52-
try:
53-
from qdk import widgets # requires: pip install qdk[jupyter]
54-
# Use widgets per qsharp-widgets documentation
55-
except ImportError:
56-
widgets = None # Optional: feature not installed
57-
```
58-
59-
Qiskit (if installed):
46+
To use widgets (installed via `qdk[jupyter]` extra):
6047

6148
```python
62-
try:
63-
from qdk import qiskit # requires: pip install qdk[qiskit]
64-
qk = qiskit
65-
# Example: qk.transpile(...)
66-
except ImportError:
67-
qk = None
68-
```
69-
70-
Azure Quantum (if installed):
71-
72-
```python
73-
try:
74-
from qdk import azure # requires: pip install qdk[azure]
75-
# Example: azure.Workspace(...)
76-
except ImportError:
77-
azure = None
49+
from qdk.qsharp import eval, run
50+
from qdk.widgets import Histogram
51+
52+
eval("""
53+
operation BellPair() : Result[] {
54+
use qs = Qubit[2];
55+
H(qs[0]);CX(qs[0], qs[1]);
56+
MResetEachZ(qs)
57+
}
58+
""")
59+
results = run("BellPair()", shots=1000, noise=(0.005, 0.0, 0.0))
60+
Histogram(results)
7861
```
7962

8063
## Public API Surface
8164

8265
Submodules:
8366

84-
- `qdk.qsharp` – direct passthrough to `qsharp` APIs (import explicitly: `import qdk.qsharp`).
85-
- `qdk.widgets` – only if `qsharp-widgets` installed (through `qdk[jupyter]`).
86-
- `qdk.azure` – only if `azure-quantum` installed. Now a package with subpackages:
87-
- `qdk.azure.target``azure.quantum.target`
88-
- `qdk.azure.argument_types``azure.quantum.argument_types`
89-
- `qdk.azure.job``azure.quantum.job`
90-
Import style example: `from qdk.azure.job import Job`
91-
- `qdk.qiskit` – only if `qiskit` extra installed; exposes only QDK interop symbols (no blanket upstream re-export). Import upstream APIs directly from `qiskit`.
92-
- `qdk.estimator` – shim re-export of `qsharp.estimator` (always present if underlying `qsharp` provides it).
93-
- `qdk.openqasm` – shim re-export of `qsharp.openqasm` for OpenQASM integration.
67+
- `qdk.qsharp` – exports the same APIs as the `qsharp` Python package
68+
- `qdk.openqasm` – exports the same APIs as the `openqasm` submodule of the `qsharp` Python package.
69+
- `qdk.estimator` – exports the same APIs as the `estimator` submodule of the `qsharp` Python package.
70+
- `qdk.widgets` – exports the Jupyter widgets available from the `qsharp-widgets` Python package (requires the `qdk[jupyter]` extra to be installed).
71+
- `qdk.azure` – exports the Python APIs available from the `azure-quantum` Python package (requires the `qdk[azure]` extra to be installed).
72+
- `qdk.qiskit` – exports the same APIs as the `interop.qiskit` submodule of the `qsharp` Python package (requires the `qdk[qiskit]` extra to be installed).
9473

95-
### Lifted utilities from `qsharp`
74+
### Top level exports
9675

97-
For convenience, the following helpers and types are also importable directly from the `qdk` root (e.g. `from qdk import code, Result`). Algorithm execution APIs (like `run` / `estimate`) remain under `qdk.qsharp`.
76+
For convenience, the following helpers and types are also importable directly from the `qdk` root (e.g. `from qdk import code, Result`). Algorithm execution APIs (like `run` / `estimate`) remain under `qdk.qsharp` or `qdk.openqasm`.
9877

9978
| Symbol | Type | Origin | Description |
10079
| -------------------- | -------- | --------------------------- | ------------------------------------------------------------------- |
101-
| `code` | module | `qsharp.code` | Define inline Q# snippets / code objects. |
80+
| `code` | module | `qsharp.code` | Exposes operations defined in Q\# or OpenQASM |
10281
| `init` | function | `qsharp.init` | Initialize/configure the QDK interpreter (target profile, options). |
10382
| `set_quantum_seed` | function | `qsharp.set_quantum_seed` | Deterministic seed for quantum randomness (simulators). |
10483
| `set_classical_seed` | function | `qsharp.set_classical_seed` | Deterministic seed for classical host RNG. |
@@ -112,42 +91,3 @@ For convenience, the following helpers and types are also importable directly fr
11291
| `DepolarizingNoise` | class | `qsharp.DepolarizingNoise` | Depolarizing noise model spec. |
11392
| `BitFlipNoise` | class | `qsharp.BitFlipNoise` | Bit-flip noise model spec. |
11493
| `PhaseFlipNoise` | class | `qsharp.PhaseFlipNoise` | Phase-flip noise model spec. |
115-
116-
If you need additional items, import them from `qdk.qsharp` directly rather than expanding the root surface.
117-
118-
## Design Notes
119-
120-
- Root re-exports selected utility symbols from `qsharp` (e.g. `code`, `init`, `set_quantum_seed`, types) for convenience; algorithm APIs still live under `qdk.qsharp`.
121-
- Additional shims (`qdk.estimator`, `qdk.openqasm`) are thin pass-throughs to the corresponding `qsharp` submodules for discoverability.
122-
- Optional extras are thin pass-through modules/packages; failure messages instruct how to install.
123-
- `qdk.qiskit` deliberately does not re-export the full upstream Qiskit API—import those from `qiskit` directly.
124-
- `qdk.azure` is structured as a package so dotted imports like `from qdk.azure.job import Job` work.
125-
- Tests may stub dependencies in isolation environments.
126-
127-
## Testing
128-
129-
The test suite validates packaging & import contract without requiring the real
130-
optional dependencies to be installed.
131-
132-
Current approach (kept intentionally lean):
133-
134-
1. Core behavior: ensure the root package exposes only the minimal public API.
135-
2. A lightweight stub for the upstream `qsharp` package is injected (see `tests/conftest.py`)
136-
if the true package is not present, enabling fast iteration when working only on this meta-package.
137-
3. Optional extras (widgets, azure, qiskit) are tested using synthetic modules created in `tests/mocks.py`:
138-
- `mock_widgets()` creates a lightweight `qsharp_widgets` module (with a version attribute). Tests assert the `qdk.widgets` shim imports.
139-
- `mock_azure()` creates the nested namespace `azure.quantum` (with a version attribute). Tests assert the `qdk.azure` shim imports.
140-
- `mock_qiskit()` creates a `qiskit` module exposing a callable `transpile()` so tests can assert a functional symbol survives re-export.
141-
4. No network or cloud interactions are performed; all tests operate purely on import mechanics and mocks.
142-
143-
### Running the tests
144-
145-
Install test tooling:
146-
147-
```bash
148-
python -m pip install pytest
149-
python -m pytest -q qdk_package/tests
150-
```
151-
152-
Because mocks are used, failures generally indicate packaging / import logic regressions
153-
rather than upstream functional issues with the real dependencies.

source/vscode/changelog.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
11
# QDK Changelog
22

3+
## v1.21.0
4+
5+
Below are some of the highlights for the 1.21 release of the QDK.
6+
7+
### QDK Python package
8+
9+
With this release we are also publishing a `qdk` package to PyPI (see <https://pypi.org/project/qdk/>). This is still in the 'preview' stage as we lock down the API, but the goal is that going forward the QDK will be installed in Python via `pip install qdk`, with any optional extras needed (e.g. `pip install "qdk[jupyter,azure,qiskit]"` to add the Jupyter Notebooks, Azure Quantum, and Qiskit integration). Once installed, import from the necessary submodules (e.g. `from qdk.openqasm import compile`)
10+
11+
Please give it a try and open an issue if you have any feedback.
12+
13+
### Complex literals
14+
15+
The Q\# language added support for complex literals. For example,
16+
17+
```qsharp
18+
function GetComplex() : Complex {
19+
3. + 4.i
20+
}
21+
```
22+
23+
Additionally, Complex values can now be used in arithmetic expressions directly:
24+
25+
```qsharp
26+
let x = 2.0 + 3.0i;
27+
let y = x + (4.0 - 5.0i);
28+
```
29+
30+
## Other notable changes
31+
32+
- Update to latest simulator, new benchmark by @swernli in https://github.com/microsoft/qdk/pull/2690
33+
- Updated wording in 'complex numbers' kata by @DmitryVasilevsky in https://github.com/microsoft/qdk/pull/2694
34+
- Fix decomposition for controlled Rxx/Ryy by @swernli in https://github.com/microsoft/qdk/pull/2699
35+
- Fix panic in RCA when using tuple variables as arguments to a lambda by @swernli in https://github.com/microsoft/qdk/pull/2701
36+
- Support Complex literals, arithmetic operations by @swernli in https://github.com/microsoft/qdk/pull/2709
37+
- Fix panic when interpreter has unbound names in Adaptive/Base by @swernli in https://github.com/microsoft/qdk/pull/2691
38+
- [OpenQASM]: Properly detect zero step in const ranges by @orpuente-MS in https://github.com/microsoft/qdk/pull/2715
39+
- Short-circuiting expressions produce divergent types that propagate too far by @swernli in https://github.com/microsoft/qdk/pull/2700
40+
- Initial QDK Python Package by @ScottCarda-MS in https://github.com/microsoft/qdk/pull/2707
41+
- Extract logical resource counts from a Q# program by @msoeken in https://github.com/microsoft/qdk/pull/2717
42+
- Fix panic in loop unification pass for short-circuiting expressions by @swernli in https://github.com/microsoft/qdk/pull/2723
43+
- Support partial evaluation of `IndexRange` calls by @swernli in https://github.com/microsoft/qdk/pull/2727
44+
45+
**Full Changelog**: <https://github.com/microsoft/qdk/compare/v1.20.0...v1.21.0>
46+
347
## v1.20.0
448

549
Below are some of the highlights for the 1.20 release of the QDK.

source/vscode/src/registry.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"owner": "microsoft",
99
"repo": "qsharp",
1010
"refs": [
11-
{ "ref": "v1.20.0", "notes": "latest stable" },
11+
{ "ref": "v1.21.0", "notes": "latest stable" },
1212
{ "ref": "main", "notes": "nightly, unstable" }
1313
],
1414
"path": "library/chemistry"
@@ -23,7 +23,7 @@
2323
"owner": "microsoft",
2424
"repo": "qsharp",
2525
"refs": [
26-
{ "ref": "v1.20.0", "notes": "latest stable" },
26+
{ "ref": "v1.21.0", "notes": "latest stable" },
2727
{ "ref": "main", "notes": "nightly, unstable" }
2828
],
2929
"path": "library/signed"
@@ -38,7 +38,7 @@
3838
"owner": "microsoft",
3939
"repo": "qsharp",
4040
"refs": [
41-
{ "ref": "v1.20.0", "notes": "latest stable" },
41+
{ "ref": "v1.21.0", "notes": "latest stable" },
4242
{ "ref": "main", "notes": "nightly, unstable" }
4343
],
4444
"path": "library/fixed_point"
@@ -53,7 +53,7 @@
5353
"owner": "microsoft",
5454
"repo": "qsharp",
5555
"refs": [
56-
{ "ref": "v1.20.0", "notes": "latest stable" },
56+
{ "ref": "v1.21.0", "notes": "latest stable" },
5757
{ "ref": "main", "notes": "nightly, unstable" }
5858
],
5959
"path": "library/rotations"
@@ -68,7 +68,7 @@
6868
"owner": "microsoft",
6969
"repo": "qsharp",
7070
"refs": [
71-
{ "ref": "v1.20.0", "notes": "latest stable" },
71+
{ "ref": "v1.21.0", "notes": "latest stable" },
7272
{ "ref": "main", "notes": "nightly, unstable" }
7373
],
7474
"path": "library/qtest"

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import sys
99

1010
# To be updated every time we start a new major.minor version.
11-
major_minor = "1.20"
11+
major_minor = "1.21"
1212

1313
root_dir = os.path.dirname(os.path.abspath(__file__))
1414
source_dir = os.path.join(root_dir, "source")

0 commit comments

Comments
 (0)