From 001f113f69fbd08f7e303463b419769a9593ce48 Mon Sep 17 00:00:00 2001 From: Prakhar Bhatnagar <42675093+prakharb10@users.noreply.github.com> Date: Thu, 30 May 2024 02:58:12 +0000 Subject: [PATCH 1/9] migrated to qiskit 1.0 --- src/openqaoa-azure/requirements.txt | 2 +- .../openqaoa_qiskit/backends/qaoa_qiskit_sim.py | 4 ++-- src/openqaoa-qiskit/requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openqaoa-azure/requirements.txt b/src/openqaoa-azure/requirements.txt index 1132ee171..d91373cbf 100644 --- a/src/openqaoa-azure/requirements.txt +++ b/src/openqaoa-azure/requirements.txt @@ -1,4 +1,4 @@ qdk -qiskit-qir +qiskit-qir~=0.5.0 qiskit-ionq azure-quantum[qiskit] \ No newline at end of file diff --git a/src/openqaoa-qiskit/openqaoa_qiskit/backends/qaoa_qiskit_sim.py b/src/openqaoa-qiskit/openqaoa_qiskit/backends/qaoa_qiskit_sim.py index 9d5824d1b..5f7f43712 100644 --- a/src/openqaoa-qiskit/openqaoa_qiskit/backends/qaoa_qiskit_sim.py +++ b/src/openqaoa-qiskit/openqaoa_qiskit/backends/qaoa_qiskit_sim.py @@ -3,8 +3,8 @@ # IBM Qiskit imports from qiskit import QuantumCircuit, QuantumRegister -from qiskit.providers.aer import AerSimulator -from qiskit.providers.aer.noise import NoiseModel +from qiskit_aer import AerSimulator +from qiskit_aer.noise import NoiseModel from qiskit.opflow.primitive_ops import PauliSumOp from qiskit.quantum_info import Statevector from qiskit.circuit import Parameter diff --git a/src/openqaoa-qiskit/requirements.txt b/src/openqaoa-qiskit/requirements.txt index 469ae1b6e..4503a5d9d 100644 --- a/src/openqaoa-qiskit/requirements.txt +++ b/src/openqaoa-qiskit/requirements.txt @@ -1,3 +1,3 @@ -qiskit>=0.36.1,<1.0 +qiskit~=1.0.0 qiskit-ibm-provider qiskit-aer \ No newline at end of file From 90edf1a777b1a57a8807dd375037837928b34b69 Mon Sep 17 00:00:00 2001 From: Prakhar Bhatnagar <42675093+prakharb10@users.noreply.github.com> Date: Thu, 30 May 2024 04:01:06 +0000 Subject: [PATCH 2/9] fixed tests and added `qiskit-ibm-runtime` as a requirement --- .../openqaoa_qiskit/backends/qaoa_qiskit_sim.py | 1 - src/openqaoa-qiskit/requirements.txt | 3 ++- src/openqaoa-qiskit/tests/test_qpu_qiskit.py | 1 - src/openqaoa-qiskit/tests/test_workflows_qiskit.py | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/openqaoa-qiskit/openqaoa_qiskit/backends/qaoa_qiskit_sim.py b/src/openqaoa-qiskit/openqaoa_qiskit/backends/qaoa_qiskit_sim.py index 4c01fa4cc..7d4f3efa3 100644 --- a/src/openqaoa-qiskit/openqaoa_qiskit/backends/qaoa_qiskit_sim.py +++ b/src/openqaoa-qiskit/openqaoa_qiskit/backends/qaoa_qiskit_sim.py @@ -5,7 +5,6 @@ from qiskit import QuantumCircuit, QuantumRegister from qiskit_aer import AerSimulator from qiskit_aer.noise import NoiseModel -from qiskit.opflow.primitive_ops import PauliSumOp from qiskit.quantum_info import Statevector, SparsePauliOp from qiskit.circuit import Parameter diff --git a/src/openqaoa-qiskit/requirements.txt b/src/openqaoa-qiskit/requirements.txt index 4503a5d9d..a2d0962c4 100644 --- a/src/openqaoa-qiskit/requirements.txt +++ b/src/openqaoa-qiskit/requirements.txt @@ -1,3 +1,4 @@ qiskit~=1.0.0 qiskit-ibm-provider -qiskit-aer \ No newline at end of file +qiskit-aer +qiskit-ibm-runtime \ No newline at end of file diff --git a/src/openqaoa-qiskit/tests/test_qpu_qiskit.py b/src/openqaoa-qiskit/tests/test_qpu_qiskit.py index 78707b723..16c5238e6 100644 --- a/src/openqaoa-qiskit/tests/test_qpu_qiskit.py +++ b/src/openqaoa-qiskit/tests/test_qpu_qiskit.py @@ -9,7 +9,6 @@ from qiskit import QuantumCircuit from qiskit.quantum_info import Operator -from qiskit.tools.monitor import job_monitor from qiskit_ibm_provider.job.exceptions import IBMJobError from qiskit.converters import circuit_to_dag, dag_to_circuit diff --git a/src/openqaoa-qiskit/tests/test_workflows_qiskit.py b/src/openqaoa-qiskit/tests/test_workflows_qiskit.py index 6f4153b6c..518dec86f 100644 --- a/src/openqaoa-qiskit/tests/test_workflows_qiskit.py +++ b/src/openqaoa-qiskit/tests/test_workflows_qiskit.py @@ -4,8 +4,8 @@ import numpy as np import datetime -from qiskit.providers.fake_provider import FakeVigo -from qiskit.providers.aer.noise import NoiseModel +from qiskit_ibm_runtime.fake_provider import FakeVigo +from qiskit_aer.noise import NoiseModel from qiskit_aer import AerSimulator from openqaoa import QAOA, RQAOA From 27b3be41361f14cc83b3eb2aa8c207847c8003d1 Mon Sep 17 00:00:00 2001 From: Prakhar Bhatnagar <42675093+prakharb10@users.noreply.github.com> Date: Thu, 30 May 2024 04:18:22 +0000 Subject: [PATCH 3/9] added `pydantic` to requirements --- src/openqaoa-qiskit/requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openqaoa-qiskit/requirements.txt b/src/openqaoa-qiskit/requirements.txt index a2d0962c4..bd4e4abcc 100644 --- a/src/openqaoa-qiskit/requirements.txt +++ b/src/openqaoa-qiskit/requirements.txt @@ -1,4 +1,5 @@ qiskit~=1.0.0 qiskit-ibm-provider qiskit-aer -qiskit-ibm-runtime \ No newline at end of file +qiskit-ibm-runtime +pydantic~=2.7.2 \ No newline at end of file From 6f2c2742d936061aa9cfa7ff2375d99a5be52c99 Mon Sep 17 00:00:00 2001 From: Prakhar Bhatnagar <42675093+prakharb10@users.noreply.github.com> Date: Thu, 30 May 2024 18:19:28 +0000 Subject: [PATCH 4/9] changed `pydantic` version --- src/openqaoa-qiskit/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openqaoa-qiskit/requirements.txt b/src/openqaoa-qiskit/requirements.txt index bd4e4abcc..99d5408f0 100644 --- a/src/openqaoa-qiskit/requirements.txt +++ b/src/openqaoa-qiskit/requirements.txt @@ -2,4 +2,4 @@ qiskit~=1.0.0 qiskit-ibm-provider qiskit-aer qiskit-ibm-runtime -pydantic~=2.7.2 \ No newline at end of file +pydantic~=2.5.0 \ No newline at end of file From f355e759772e8b5f916bd3614c260619c3595314 Mon Sep 17 00:00:00 2001 From: Prakhar Bhatnagar Date: Mon, 3 Jun 2024 18:18:07 -0700 Subject: [PATCH 5/9] updated python version in workflow --- .github/workflows/test_dev_ext.yml | 4 ++-- src/openqaoa-qiskit/requirements.txt | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_dev_ext.yml b/.github/workflows/test_dev_ext.yml index ef1daf264..7be40eeee 100644 --- a/.github/workflows/test_dev_ext.yml +++ b/.github/workflows/test_dev_ext.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: 3.8 + python-version: 3.9 - name: Install qvm run: | find /usr/lib -name "libffi.so*" @@ -66,7 +66,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: 3.8 + python-version: 3.9 - name: Install OpenQAOA run: | diff --git a/src/openqaoa-qiskit/requirements.txt b/src/openqaoa-qiskit/requirements.txt index 99d5408f0..a2d0962c4 100644 --- a/src/openqaoa-qiskit/requirements.txt +++ b/src/openqaoa-qiskit/requirements.txt @@ -1,5 +1,4 @@ qiskit~=1.0.0 qiskit-ibm-provider qiskit-aer -qiskit-ibm-runtime -pydantic~=2.5.0 \ No newline at end of file +qiskit-ibm-runtime \ No newline at end of file From e9ef99100343f06e758a4c84883f04f9a086b424 Mon Sep 17 00:00:00 2001 From: Prakhar Bhatnagar <42675093+prakharb10@users.noreply.github.com> Date: Fri, 7 Jun 2024 03:14:50 +0000 Subject: [PATCH 6/9] updated imports in `simulators-comparison` example --- examples/02_simulators_comparison.ipynb | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/02_simulators_comparison.ipynb b/examples/02_simulators_comparison.ipynb index 5ca47ca42..9c8e7dbc8 100644 --- a/examples/02_simulators_comparison.ipynb +++ b/examples/02_simulators_comparison.ipynb @@ -201,9 +201,9 @@ ], "source": [ "from qiskit import Aer\n", - "from qiskit.test.mock import FakeVigo\n", - "from qiskit.providers.aer.noise import NoiseModel\n", - "from qiskit.providers.aer import QasmSimulator\n", + "from qiskit_ibm_runtime.fake_provider import FakeVigo\n", + "from qiskit_aer.noise import NoiseModel\n", + "from qiskit_aer import QasmSimulator\n", "device_backend = FakeVigo()\n", "device = QasmSimulator.from_backend(device_backend)\n", "noise_model = NoiseModel.from_backend(device)" @@ -324,9 +324,9 @@ ], "metadata": { "kernelspec": { - "display_name": "fix_qiskit_and_deprecations", + "display_name": "Python 3", "language": "python", - "name": "fix_qiskit_and_deprecations" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -352,11 +352,6 @@ "toc_position": {}, "toc_section_display": true, "toc_window_display": false - }, - "vscode": { - "interpreter": { - "hash": "d2582286b70c3b030a2fde61b871db03dec7fee33191883f4394b540a2eb90c7" - } } }, "nbformat": 4, From 6c9e3d978778e5e25a01bcdaa85b93025746f722 Mon Sep 17 00:00:00 2001 From: Prakhar Bhatnagar <42675093+prakharb10@users.noreply.github.com> Date: Fri, 7 Jun 2024 03:14:50 +0000 Subject: [PATCH 7/9] updated imports in `simulators-comparison` example --- examples/02_simulators_comparison.ipynb | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/examples/02_simulators_comparison.ipynb b/examples/02_simulators_comparison.ipynb index 5ca47ca42..721c15fda 100644 --- a/examples/02_simulators_comparison.ipynb +++ b/examples/02_simulators_comparison.ipynb @@ -200,10 +200,9 @@ } ], "source": [ - "from qiskit import Aer\n", - "from qiskit.test.mock import FakeVigo\n", - "from qiskit.providers.aer.noise import NoiseModel\n", - "from qiskit.providers.aer import QasmSimulator\n", + "from qiskit_ibm_runtime.fake_provider import FakeVigo\n", + "from qiskit_aer.noise import NoiseModel\n", + "from qiskit_aer import QasmSimulator\n", "device_backend = FakeVigo()\n", "device = QasmSimulator.from_backend(device_backend)\n", "noise_model = NoiseModel.from_backend(device)" @@ -324,9 +323,9 @@ ], "metadata": { "kernelspec": { - "display_name": "fix_qiskit_and_deprecations", + "display_name": "Python 3", "language": "python", - "name": "fix_qiskit_and_deprecations" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -352,11 +351,6 @@ "toc_position": {}, "toc_section_display": true, "toc_window_display": false - }, - "vscode": { - "interpreter": { - "hash": "d2582286b70c3b030a2fde61b871db03dec7fee33191883f4394b540a2eb90c7" - } } }, "nbformat": 4, From 1e743050e449c4caf713240f79d966117757261e Mon Sep 17 00:00:00 2001 From: Prakhar Bhatnagar <42675093+prakharb10@users.noreply.github.com> Date: Mon, 10 Jun 2024 05:09:48 +0000 Subject: [PATCH 8/9] updated `mitiq` requirement --- src/openqaoa-core/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openqaoa-core/requirements.txt b/src/openqaoa-core/requirements.txt index b7fb109bb..2e82819ca 100644 --- a/src/openqaoa-core/requirements.txt +++ b/src/openqaoa-core/requirements.txt @@ -10,4 +10,4 @@ semantic_version>=2.10 autoray>=0.3.1 requests ipython>=8.2.0 -mitiq +mitiq[qiskit] From 9e36b76e330ef3f48969bf1966a3bb77a7413cec Mon Sep 17 00:00:00 2001 From: Prakhar Bhatnagar <42675093+prakharb10@users.noreply.github.com> Date: Tue, 11 Jun 2024 04:29:47 +0000 Subject: [PATCH 9/9] updated requirements --- src/openqaoa-core/requirements.txt | 2 +- src/openqaoa-qiskit/requirements.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/openqaoa-core/requirements.txt b/src/openqaoa-core/requirements.txt index 2e82819ca..b7fb109bb 100644 --- a/src/openqaoa-core/requirements.txt +++ b/src/openqaoa-core/requirements.txt @@ -10,4 +10,4 @@ semantic_version>=2.10 autoray>=0.3.1 requests ipython>=8.2.0 -mitiq[qiskit] +mitiq diff --git a/src/openqaoa-qiskit/requirements.txt b/src/openqaoa-qiskit/requirements.txt index a2d0962c4..f2ce81dd5 100644 --- a/src/openqaoa-qiskit/requirements.txt +++ b/src/openqaoa-qiskit/requirements.txt @@ -1,4 +1,5 @@ qiskit~=1.0.0 qiskit-ibm-provider qiskit-aer -qiskit-ibm-runtime \ No newline at end of file +qiskit-ibm-runtime +mitiq[qiskit] \ No newline at end of file