You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
7
4
8
5
## Install
9
6
10
-
Base (always includes `qsharp`):
7
+
To install the core functionality, which include Q\#\& OpenQASM simulation, compilation, and resource estimation support:
11
8
12
9
```bash
13
10
pip install qdk
14
11
```
15
12
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:
17
14
18
15
```bash
19
16
pip install qdk[jupyter]
20
17
```
21
18
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:
23
20
24
21
```bash
25
22
pip install qdk[azure]
26
23
```
27
24
28
-
Qiskit extra (adds `qiskit`):
25
+
For Qiskit integration, which exposes Qiskit interop utilities in the `qdk.qiskit` submodule:
29
26
30
27
```bash
31
28
pip install qdk[qiskit]
32
29
```
33
30
34
-
All extras:
31
+
To easily install all the above extras:
35
32
36
33
```bash
37
34
pip install qdk[all]
@@ -46,59 +43,41 @@ result = qsharp.run("{ use q = Qubit(); H(q); return MResetZ(q); }", shots=100)
46
43
print(result)
47
44
```
48
45
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
-
exceptImportError:
56
-
widgets =None# Optional: feature not installed
57
-
```
58
-
59
-
Qiskit (if installed):
46
+
To use widgets (installed via `qdk[jupyter]` extra):
60
47
61
48
```python
62
-
try:
63
-
from qdk import qiskit # requires: pip install qdk[qiskit]
64
-
qk = qiskit
65
-
# Example: qk.transpile(...)
66
-
exceptImportError:
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]
-`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).
94
73
95
-
### Lifted utilities from `qsharp`
74
+
### Top level exports
96
75
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`.
|`code`| module |`qsharp.code`|Exposes operations defined in Q\# or OpenQASM|
102
81
|`init`| function |`qsharp.init`| Initialize/configure the QDK interpreter (target profile, options). |
103
82
|`set_quantum_seed`| function |`qsharp.set_quantum_seed`| Deterministic seed for quantum randomness (simulators). |
104
83
|`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
112
91
|`DepolarizingNoise`| class |`qsharp.DepolarizingNoise`| Depolarizing noise model spec. |
113
92
|`BitFlipNoise`| class |`qsharp.BitFlipNoise`| Bit-flip noise model spec. |
114
93
|`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.
Copy file name to clipboardExpand all lines: source/vscode/changelog.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,49 @@
1
1
# QDK Changelog
2
2
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
0 commit comments