Skip to content

Commit d00896d

Browse files
committed
fix errors
1 parent 22be128 commit d00896d

4 files changed

Lines changed: 132 additions & 149 deletions

File tree

docs/guides/multiverse-computing-singularity.ipynb

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
},
138138
{
139139
"cell_type": "code",
140-
"execution_count": 1,
140+
"execution_count": 6,
141141
"id": "95a715d2",
142142
"metadata": {},
143143
"outputs": [
@@ -156,7 +156,7 @@
156156
" QiskitFunction(kipu-quantum/iskay-quantum-optimizer)]"
157157
]
158158
},
159-
"execution_count": 1,
159+
"execution_count": 6,
160160
"metadata": {},
161161
"output_type": "execute_result"
162162
}
@@ -172,8 +172,8 @@
172172
},
173173
{
174174
"cell_type": "code",
175-
"execution_count": 2,
176-
"id": "9d4151fe",
175+
"execution_count": 7,
176+
"id": "b83c0077-412e-4f06-9e34-51599ffa7183",
177177
"metadata": {},
178178
"outputs": [],
179179
"source": [
@@ -248,19 +248,25 @@
248248
},
249249
{
250250
"cell_type": "code",
251-
"execution_count": 3,
251+
"execution_count": 2,
252252
"id": "731db300",
253253
"metadata": {},
254254
"outputs": [
255255
{
256-
"ename": "ModuleNotFoundError",
257-
"evalue": "No module named 'sklearn'",
258-
"output_type": "error",
259-
"traceback": [
260-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
261-
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
262-
"Cell \u001b[0;32mIn[3], line 8\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21;01mnumpy\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mas\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21;01mnp\u001b[39;00m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;66;03m# Import the make_moons and the train_test_split functions from scikit-learn\u001b[39;00m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;66;03m# to create a synthetic dataset and split it into training and test datasets\u001b[39;00m\n\u001b[0;32m----> 8\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21;01msklearn\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mdatasets\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m make_moons\n\u001b[1;32m 9\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21;01msklearn\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mmodel_selection\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m train_test_split\n\u001b[1;32m 11\u001b[0m \u001b[38;5;66;03m# generate the synthetic dataset\u001b[39;00m\n",
263-
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'sklearn'"
256+
"name": "stdout",
257+
"output_type": "stream",
258+
"text": [
259+
"Features: [[ 0.84757037 -0.48831433]\n",
260+
" [ 0.98132552 0.19235443]\n",
261+
" [-0.71626723 0.6978261 ]\n",
262+
" [ 1.18957848 -0.48186557]\n",
263+
" [ 0.52118982 -0.37791846]\n",
264+
" [ 0.81115408 0.58483251]\n",
265+
" [ 0.48706462 0.87336593]\n",
266+
" [-0.81880144 0.57407682]\n",
267+
" [ 1.67335408 -0.23932015]\n",
268+
" [ 0.50181306 0.8649761 ]]\n",
269+
"Targets: [1 0 0 1 1 0 0 0 1 0]\n"
264270
]
265271
}
266272
],
@@ -382,7 +388,7 @@
382388
},
383389
{
384390
"cell_type": "code",
385-
"execution_count": null,
391+
"execution_count": 5,
386392
"id": "f5a54432",
387393
"metadata": {},
388394
"outputs": [
@@ -405,9 +411,6 @@
405411
"# list available classifiers using the list action\n",
406412
"job = singularity.run(action=\"list\")\n",
407413
"\n",
408-
"# Print the ID so you can use it later, if necessary\n",
409-
"print(job.job_id)\n",
410-
"\n",
411414
"print(job.result())\n",
412415
"\n",
413416
"# you can also find your classifiers in the shared data directory with a *.pkl.tar extension\n",
@@ -727,7 +730,7 @@
727730
],
728731
"metadata": {
729732
"kernelspec": {
730-
"display_name": "Python 3",
733+
"display_name": "Python 3 (ipykernel)",
731734
"language": "python",
732735
"name": "python3"
733736
},
@@ -741,7 +744,7 @@
741744
"name": "python",
742745
"nbconvert_exporter": "python",
743746
"pygments_lexer": "ipython3",
744-
"version": "3"
747+
"version": "3.12.3"
745748
}
746749
},
747750
"nbformat": 4,

docs/guides/noise-learning.ipynb

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "8490c8b9-abc4-40df-a8d0-281ec9c9441d",
65
"metadata": {},
76
"source": [
87
"---\n",
@@ -16,7 +15,6 @@
1615
},
1716
{
1817
"cell_type": "markdown",
19-
"id": "895ce32a-0531-416c-b076-796406bf9613",
2018
"metadata": {
2119
"tags": [
2220
"version-info"
@@ -47,7 +45,6 @@
4745
},
4846
{
4947
"cell_type": "markdown",
50-
"id": "f7733fee-ce78-4476-8199-bcf293b9bdc4",
5148
"metadata": {},
5249
"source": [
5350
"The error mitigation techniques [PEA](/docs/guides/error-mitigation-and-suppression-techniques#pea) and [PEC](/docs/guides/error-mitigation-and-suppression-techniques#pec) both utilize a noise learning component based on a [Pauli-Lindblad noise model](https://arxiv.org/abs/2201.09866), which is typically managed during execution after submitting one or more jobs through `qiskit-ibm-runtime` without any local access to the fitted noise model. However, as of `qiskit-ibm-runtime` v0.27.1, a [`NoiseLearner`](/docs/api/qiskit-ibm-runtime/noise-learner) and associated [`NoiseLearnerOptions`](/docs/api/qiskit-ibm-runtime/options-noise-learner-options) class have been created to obtain the results of these noise learning experiments. These results can then be stored locally as a `NoiseLearnerResult` and used as input in later experiments. This page provides an overview of its usage and the associated options available.\n",
@@ -68,7 +65,6 @@
6865
{
6966
"cell_type": "code",
7067
"execution_count": 1,
71-
"id": "a2ea782f-1d47-49e8-97fe-1f32844a104a",
7268
"metadata": {},
7369
"outputs": [],
7470
"source": [
@@ -112,7 +108,6 @@
112108
},
113109
{
114110
"cell_type": "markdown",
115-
"id": "9b891a09-ffb4-408a-8176-6a4e92328bad",
116111
"metadata": {},
117112
"source": [
118113
"The resulting `NoiseLearnerResult.data` is a list of [`LayerError`](../api/qiskit-ibm-runtime/utils-noise-learner-result-layer-error) objects containing the [noise model](https://arxiv.org/abs/2201.09866) for each individual entangling layer that belongs to the target circuit(s). Each `LayerError` stores the layer information, in the form of a circuit and a set of qubit labels, alongside the [`PauliLindbladError`](../api/qiskit-ibm-runtime/utils-noise-learner-result-pauli-lindblad-error) for the noise model that was learned for the given layer."
@@ -121,7 +116,6 @@
121116
{
122117
"cell_type": "code",
123118
"execution_count": null,
124-
"id": "db9fda1f-189c-4acc-9368-b9ce7c6e7057",
125119
"metadata": {},
126120
"outputs": [
127121
{
@@ -206,7 +200,6 @@
206200
},
207201
{
208202
"cell_type": "markdown",
209-
"id": "425ce528-1964-4df7-86c0-0310efaf7b99",
210203
"metadata": {},
211204
"source": [
212205
"The `LayerError.error` attribute of the noise learning result contains the generators and error rates of the fitted Pauli Lindblad model, which has the form\n",
@@ -218,7 +211,6 @@
218211
},
219212
{
220213
"cell_type": "markdown",
221-
"id": "c819a7f6-7f42-4b08-9a33-282afac9b51f",
222214
"metadata": {},
223215
"source": [
224216
"### Noise learning options\n",
@@ -231,7 +223,6 @@
231223
{
232224
"cell_type": "code",
233225
"execution_count": 3,
234-
"id": "93039690-4b12-4967-83cd-d05d183a71e0",
235226
"metadata": {},
236227
"outputs": [],
237228
"source": [
@@ -260,7 +251,6 @@
260251
},
261252
{
262253
"cell_type": "markdown",
263-
"id": "584c02d4-40ad-4089-b8a0-70d617e9d4ed",
264254
"metadata": {},
265255
"source": [
266256
"### Input noise model to a primitive\n",
@@ -271,7 +261,6 @@
271261
{
272262
"cell_type": "code",
273263
"execution_count": 4,
274-
"id": "f49176c5-0cb0-4823-9bc6-f3a7c4483d43",
275264
"metadata": {},
276265
"outputs": [],
277266
"source": [
@@ -283,7 +272,6 @@
283272
{
284273
"cell_type": "code",
285274
"execution_count": 5,
286-
"id": "d2f637a1-2496-4d26-a7d7-25b279fdb747",
287275
"metadata": {},
288276
"outputs": [],
289277
"source": [
@@ -296,7 +284,6 @@
296284
{
297285
"cell_type": "code",
298286
"execution_count": 6,
299-
"id": "fff7f21f-41de-4b8c-9b75-35ae7d1aa847",
300287
"metadata": {},
301288
"outputs": [],
302289
"source": [
@@ -311,15 +298,13 @@
311298
},
312299
{
313300
"cell_type": "markdown",
314-
"id": "5ad112ad-afc6-41a0-9397-88978b22501d",
315301
"metadata": {},
316302
"source": [
317303
"After the noise model is passed into the `EstimatorV2` object, it can be used to run workloads and perform error mitigation as normal."
318304
]
319305
},
320306
{
321307
"cell_type": "markdown",
322-
"id": "c77d7204-8618-4c91-a4fe-e94743bc61a0",
323308
"metadata": {},
324309
"source": [
325310
"## NoiseLearnerV3\n",
@@ -336,7 +321,6 @@
336321
{
337322
"cell_type": "code",
338323
"execution_count": 7,
339-
"id": "7ffed5ab-b8c8-4e96-b879-36703d0138b1",
340324
"metadata": {},
341325
"outputs": [
342326
{
@@ -409,7 +393,6 @@
409393
},
410394
{
411395
"cell_type": "markdown",
412-
"id": "3d59bd31-95d7-45b2-8f88-02d57ac6385b",
413396
"metadata": {},
414397
"source": [
415398
"The job result is a list of `NoiseLearnerV3Result` objects, one for each input-boxed set of instructions. `NoiseLearnerV3Result` has a `to_pauli_lindblad_map()` method that returns a [`PauliLindbladMap`](/docs/api/qiskit/qiskit.quantum_info.PauliLindbladMap) object, which has methods to extract the generators, error rates, and more."
@@ -418,7 +401,6 @@
418401
{
419402
"cell_type": "code",
420403
"execution_count": null,
421-
"id": "3cfcc856-1fe5-4b79-ad2a-ebf275b87fb6",
422404
"metadata": {},
423405
"outputs": [
424406
{
@@ -457,7 +439,6 @@
457439
},
458440
{
459441
"cell_type": "markdown",
460-
"id": "f1bae39a-f2dc-474d-9521-4a2be6a47ea5",
461442
"metadata": {},
462443
"source": [
463444
"### Noise learning options\n",
@@ -467,7 +448,6 @@
467448
},
468449
{
469450
"cell_type": "markdown",
470-
"id": "6e747e83-8865-4de4-80c2-be92024b5f66",
471451
"metadata": {},
472452
"source": [
473453
"### Input a noise model to Executor\n",
@@ -495,7 +475,6 @@
495475
{
496476
"cell_type": "code",
497477
"execution_count": null,
498-
"id": "8a5eee66-2636-435e-8674-0b8a27d1f6f8",
499478
"metadata": {},
500479
"outputs": [
501480
{
@@ -520,7 +499,6 @@
520499
},
521500
{
522501
"cell_type": "markdown",
523-
"id": "866b0f71-0399-455e-b513-0de0dbcbfdcd",
524502
"metadata": {},
525503
"source": [
526504
"The result of the `NoiseLearnerV3` job must be converted to a dictionary before being passed to Executor. This dictionary's keys are the `InjectNoise.ref` attributes and the values are the corresponding noise maps. This mapping tells Executor which noise models to inject where.\n",
@@ -531,7 +509,6 @@
531509
{
532510
"cell_type": "code",
533511
"execution_count": 10,
534-
"id": "e750accb-740a-497f-8849-6e6283a06ddd",
535512
"metadata": {},
536513
"outputs": [],
537514
"source": [
@@ -564,7 +541,6 @@
564541
},
565542
{
566543
"cell_type": "markdown",
567-
"id": "651c8b3a-581a-4ce5-8fda-c1ab5f7dba49",
568544
"metadata": {},
569545
"source": [
570546
"## Next steps\n",
@@ -580,7 +556,7 @@
580556
],
581557
"metadata": {
582558
"kernelspec": {
583-
"display_name": "Python 3",
559+
"display_name": "Python 3 (ipykernel)",
584560
"language": "python",
585561
"name": "python3"
586562
},
@@ -594,7 +570,7 @@
594570
"name": "python",
595571
"nbconvert_exporter": "python",
596572
"pygments_lexer": "ipython3",
597-
"version": "3"
573+
"version": "3.12.3"
598574
}
599575
},
600576
"nbformat": 4,

docs/guides/q-ctrl-optimization-solver.ipynb

Lines changed: 6 additions & 4 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)