Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated documents and tutorials which supports Qiskit 1.0 and Primitives V2 #2160

Merged
merged 18 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions docs/tutorials/2_device_noise_simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
},
"outputs": [],
"source": [
"from qiskit import IBMQ, transpile\n",
"from qiskit import QuantumCircuit\n",
"from qiskit import QuantumCircuit, transpile\n",
"from qiskit_aer import AerSimulator\n",
"from qiskit.tools.visualization import plot_histogram"
"from qiskit.visualization import plot_histogram"
]
},
{
Expand Down Expand Up @@ -64,7 +63,7 @@
},
"outputs": [],
"source": [
"from qiskit.providers.fake_provider import FakeVigo\n",
"from qiskit_ibm_runtime.fake_provider import FakeVigo\n",
"device_backend = FakeVigo()"
]
},
Expand Down Expand Up @@ -233,9 +232,8 @@
}
],
"source": [
"import qiskit.tools.jupyter\n",
"%qiskit_version_table\n",
"%qiskit_copyright"
"import qiskit\n",
"qiskit.__version__\n"
]
},
{
Expand Down
7 changes: 3 additions & 4 deletions docs/tutorials/3_building_noise_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"from qiskit import QuantumCircuit, transpile\n",
"from qiskit.quantum_info import Kraus, SuperOp\n",
"from qiskit_aer import AerSimulator\n",
"from qiskit.tools.visualization import plot_histogram\n",
"from qiskit.visualization import plot_histogram\n",
"\n",
"# Import from Qiskit Aer noise module\n",
"from qiskit_aer.noise import (NoiseModel, QuantumError, ReadoutError, \n",
Expand Down Expand Up @@ -868,9 +868,8 @@
}
],
"source": [
"import qiskit.tools.jupyter\n",
"%qiskit_version_table\n",
"%qiskit_copyright"
"import qiskit\n",
"qiskit.__version__\n"
]
}
],
Expand Down
7 changes: 3 additions & 4 deletions docs/tutorials/4_custom_gate_noise.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"from qiskit_aer import AerSimulator\n",
"from qiskit_aer.noise import NoiseModel, amplitude_damping_error\n",
"\n",
"from qiskit.tools.visualization import plot_histogram"
"from qiskit.visualization import plot_histogram"
]
},
{
Expand Down Expand Up @@ -486,9 +486,8 @@
}
],
"source": [
"import qiskit.tools.jupyter\n",
"%qiskit_version_table\n",
"%qiskit_copyright"
"import qiskit\n",
"qiskit.__version__\n"
]
},
{
Expand Down
34 changes: 6 additions & 28 deletions docs/tutorials/5_noise_transformation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -317,41 +317,19 @@
"outputs": [
{
"data": {
"text/html": [
"<h3>Version Information</h3><table><tr><th>Qiskit Software</th><th>Version</th></tr><tr><td><code>qiskit</code></td><td>0.24.0.dev0+dba2eff</td></tr><tr><td><code>qiskit-aer</code></td><td>0.11.2</td></tr><tr><td><code>qiskit-ignis</code></td><td>0.7.1</td></tr><tr><td><code>qiskit-ibmq-provider</code></td><td>0.20.0</td></tr><tr><td><code>qiskit</code></td><td>0.41.0</td></tr><tr><th>System information</th></tr><tr><td>Python version</td><td>3.8.11</td></tr><tr><td>Python compiler</td><td>Clang 12.0.5 (clang-1205.0.22.11)</td></tr><tr><td>Python build</td><td>default, Jul 27 2021 10:46:38</td></tr><tr><td>OS</td><td>Darwin</td></tr><tr><td>CPUs</td><td>8</td></tr><tr><td>Memory (Gb)</td><td>64.0</td></tr><tr><td colspan='2'>Wed Feb 15 14:17:23 2023 JST</td></tr></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
"'1.1.0'"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<div style='width: 100%; background-color:#d5d9e0;padding-left: 10px; padding-bottom: 10px; padding-right: 10px; padding-top: 5px'><h3>This code is a part of Qiskit</h3><p>&copy; Copyright IBM 2017, 2023.</p><p>This code is licensed under the Apache License, Version 2.0. You may<br>obtain a copy of this license in the LICENSE.txt file in the root directory<br> of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.<p>Any modifications or derivative works of this code must retain this<br>copyright notice, and modified files need to carry a notice indicating<br>that they have been altered from the originals.</p></div>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
"output_type": "execute_result"
}
],
"source": [
"import qiskit.tools.jupyter\n",
"%qiskit_version_table\n",
"%qiskit_copyright"
"import qiskit\n",
"qiskit.__version__"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -370,7 +348,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.12.3"
},
"varInspector": {
"cols": {
Expand Down
7 changes: 3 additions & 4 deletions docs/tutorials/6_extended_stabilizer_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"source": [
"from qiskit import QuantumCircuit, transpile\n",
"from qiskit_aer import AerSimulator\n",
"from qiskit.tools.visualization import plot_histogram\n",
"from qiskit.visualization import plot_histogram\n",
"\n",
"import random"
]
Expand Down Expand Up @@ -479,9 +479,8 @@
}
],
"source": [
"import qiskit.tools.jupyter\n",
"%qiskit_version_table\n",
"%qiskit_copyright"
"import qiskit\n",
"qiskit.__version__\n"
]
},
{
Expand Down
5 changes: 2 additions & 3 deletions docs/tutorials/7_matrix_product_state_method.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,8 @@
}
],
"source": [
"import qiskit.tools.jupyter\n",
"%qiskit_version_table\n",
"%qiskit_copyright"
"import qiskit\n",
"qiskit.__version__\n"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions qiskit_aer/primitives/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

Sampler
Estimator
SamplerV2
EstimatorV2

"""

import qiskit
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
extras_requirements = {"dask": ["dask", "distributed"]}

requirements = [
"qiskit>=0.45.2",
"qiskit>=1.1.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed for documentation?
If so, we have to discuss we can upgrade qiskit or not before merging.
(We are planning to upgrade in Aer 0.15 release but I think it is too early to upgrade to qiskit 1.1)

Copy link
Contributor Author

@divshacker divshacker Jun 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is Suggested by @kevinsung that's why I just updated.
Anyway I don't think there should be any problem, I have made all the tutorials compatible to qiskit 1.1
If you want I can revert that also.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps I misunderstood the issue. I thought that the code updates in the tutorials would require Qiskit 1.0.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirm that we can merge setup.py with Qiskit 1.1 requirement

"numpy>=1.16.3",
"scipy>=1.0",
"psutil>=5",
Expand Down
Loading