From 2bc9066dcb2f89ff0215edf7db82372470edfc48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 06:32:46 +0000 Subject: [PATCH 1/7] Bump pdoc from 14.1.0 to 14.4.0 Bumps [pdoc](https://github.com/mitmproxy/pdoc) from 14.1.0 to 14.4.0. - [Changelog](https://github.com/mitmproxy/pdoc/blob/main/CHANGELOG.md) - [Commits](https://github.com/mitmproxy/pdoc/compare/v14.1.0...v14.4.0) --- updated-dependencies: - dependency-name: pdoc dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 54d810b..2e99b6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ dev = [ "pylint==3.0.2", "tox==4.11.4", "build==1.0.3", - "pdoc==14.1.0", + "pdoc==14.4.0", "notebook==7.0.6" ] diff --git a/requirements-dev.txt b/requirements-dev.txt index 5615e28..085e3c3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,5 +2,5 @@ coverage==7.3.2 pylint==3.0.2 tox==4.11.4 build==1.0.3 -pdoc==14.1.0 +pdoc==14.4.0 notebook==7.0.6 \ No newline at end of file From 35273b9bc7695d69de1b259b664e397372599a06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 06:22:07 +0000 Subject: [PATCH 2/7] Bump numpy from 1.26.2 to 1.26.4 Bumps [numpy](https://github.com/numpy/numpy) from 1.26.2 to 1.26.4. - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst) - [Commits](https://github.com/numpy/numpy/compare/v1.26.2...v1.26.4) --- updated-dependencies: - dependency-name: numpy dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 54d810b..599c434 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ dependencies = [ "sympy==1.12", "antlr4-python3-runtime==4.11", "ipython==8.18.1", - "numpy==1.26.2" + "numpy==1.26.4" ] [project.optional-dependencies] diff --git a/requirements.txt b/requirements.txt index fcd62e3..0fc5c51 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ loguru==0.7.2 sympy==1.12 antlr4-python3-runtime==4.11 ipython==8.18.1 -numpy==1.26.2 \ No newline at end of file +numpy==1.26.4 \ No newline at end of file From 53cbf2c0ed08462ab77f38ff9a65f03a432f853a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 06:21:43 +0000 Subject: [PATCH 3/7] Bump pylint from 3.0.2 to 3.1.0 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.0.2 to 3.1.0. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.0.2...v3.1.0) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 54d810b..ecc90e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ dependencies = [ [project.optional-dependencies] dev = [ "coverage==7.3.2", - "pylint==3.0.2", + "pylint==3.1.0", "tox==4.11.4", "build==1.0.3", "pdoc==14.1.0", diff --git a/requirements-dev.txt b/requirements-dev.txt index 5615e28..5a5790d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ coverage==7.3.2 -pylint==3.0.2 +pylint==3.1.0 tox==4.11.4 build==1.0.3 pdoc==14.1.0 From 04ebe9621e0cf0bd7fc22bf23f6a8cfb2a256617 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Feb 2024 08:05:39 +0000 Subject: [PATCH 4/7] Bump coverage from 7.3.2 to 7.4.3 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.3.2 to 7.4.3. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.3.2...7.4.3) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 513108d..661c0d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ [project.optional-dependencies] dev = [ - "coverage==7.3.2", + "coverage==7.4.3", "pylint==3.1.0", "tox==4.11.4", "build==1.0.3", diff --git a/requirements-dev.txt b/requirements-dev.txt index c7b4ce7..62c0722 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -coverage==7.3.2 +coverage==7.4.3 pylint==3.1.0 tox==4.11.4 build==1.0.3 From 04e288499be8ab707406aca2e3ebf2df39eea107 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 06:10:43 +0000 Subject: [PATCH 5/7] Bump notebook from 7.0.6 to 7.1.1 Bumps [notebook](https://github.com/jupyter/notebook) from 7.0.6 to 7.1.1. - [Release notes](https://github.com/jupyter/notebook/releases) - [Changelog](https://github.com/jupyter/notebook/blob/main/CHANGELOG.md) - [Commits](https://github.com/jupyter/notebook/compare/@jupyter-notebook/tree@7.0.6...@jupyter-notebook/tree@7.1.1) --- updated-dependencies: - dependency-name: notebook dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 661c0d8..112833b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ dev = [ "tox==4.11.4", "build==1.0.3", "pdoc==14.4.0", - "notebook==7.0.6" + "notebook==7.1.1" ] [project.urls] diff --git a/requirements-dev.txt b/requirements-dev.txt index 62c0722..343fc9e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,4 +3,4 @@ pylint==3.1.0 tox==4.11.4 build==1.0.3 pdoc==14.4.0 -notebook==7.0.6 \ No newline at end of file +notebook==7.1.1 \ No newline at end of file From 37301ca917468ac5a5cfa6746ca762bb43706a0a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 06:10:48 +0000 Subject: [PATCH 6/7] Bump qiskit-aer from 0.13.1 to 0.13.3 Bumps [qiskit-aer](https://github.com/Qiskit/qiskit-aer) from 0.13.1 to 0.13.3. - [Release notes](https://github.com/Qiskit/qiskit-aer/releases) - [Commits](https://github.com/Qiskit/qiskit-aer/compare/0.13.1...0.13.3) --- updated-dependencies: - dependency-name: qiskit-aer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 661c0d8..5fd4310 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ classifiers = [ ] dependencies = [ "qiskit==0.45.1", - "qiskit-aer==0.13.1", + "qiskit-aer==0.13.3", "loguru==0.7.2", "sympy==1.12", "antlr4-python3-runtime==4.11", diff --git a/requirements.txt b/requirements.txt index 0fc5c51..14090dc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ qiskit==0.45.1 -qiskit-aer==0.13.1 +qiskit-aer==0.13.3 loguru==0.7.2 sympy==1.12 antlr4-python3-runtime==4.11 From b99600012799b6568921ed490f45980bc7d234db Mon Sep 17 00:00:00 2001 From: minwook-shin Date: Wed, 6 Mar 2024 12:33:36 +0900 Subject: [PATCH 7/7] updated to be compatible Qiskit 1.0.0 and Python 3.12 --- .github/workflows/python_tox.yml | 2 +- CHANGELOG.md | 28 +++++++++++++++++ README.md | 3 ++ SECURITY.md | 6 ++-- docs/qiskit_class_converter.html | 8 ++--- pyproject.toml | 4 +-- .../converters/quantum_circuit_to_matrix.py | 30 ++++--------------- requirements.txt | 2 +- scripts/migration_to_1.0.sh | 11 +++++++ tox.ini | 3 +- 10 files changed, 61 insertions(+), 36 deletions(-) create mode 100644 scripts/migration_to_1.0.sh diff --git a/.github/workflows/python_tox.yml b/.github/workflows/python_tox.yml index 12770af..7705ddc 100644 --- a/.github/workflows/python_tox.yml +++ b/.github/workflows/python_tox.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.9', '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 874d3b9..f205307 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # CHANGELOG.md +## 0.5.0 (2024-03-06) + +The Version has been updated to be compatible with **Qiskit 1.0.0** and **Python 3.12**. + +Qiskit Dependencies: + +- **Bump qiskit from 0.45.1 to 1.0.1** + - changes in Qiskit 1.0.0 + - read the release notes for more information + - https://docs.quantum.ibm.com/api/qiskit/release-notes/1.0 +- Bump qiskit-aer from 0.13.1 to 0.13.3 + +Other Dependencies: + +- Bump numpy from 1.26.2 to 1.26.4 +- Bump notebook from 7.0.6 to 7.1.1 +- Bump pdoc from 14.1.0 to 14.4.0 +- Bump pylint from 3.0.2 to 3.1.0 +- Bump coverage from 7.3.2 to 7.4.3 + +Changes: + +- Updated the QuantumCircuitToMatrixConverter class to be compatible with Qiskit 1.0.0. + - The Bit class in Qiskit 1.0.0 no longer has register and index attributes. + - The actual_convert_action method of the QuantumCircuitToMatrixConverter class has been updated to use QuantumCircuit.find_bit() instead of directly accessing the index attribute of a Bit object. +- optimized the code to be compatible with qiskit 1.0.0 +- added unittest to be compatible with python 3.12 + ## 0.4.3 (2023-12-02) Qiskit Dependencies: diff --git a/README.md b/README.md index a416eed..971e8c1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # qiskit-classroom-converter Qiskit classroom Converter +> 0.5.0 (2024-03-06) : The Version has been updated to be compatible with **Qiskit 1.0.0** and **Python 3.12**. + + ## Documents https://kmu-quantum-classroom.github.io/qiskit-classroom-converter/qiskit_class_converter.html diff --git a/SECURITY.md b/SECURITY.md index ccfa4b9..08c56d2 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -3,6 +3,6 @@ ## Supported Versions | Version | Supported | -| ------- | ------------------ | -| >= 0.3 | :white_check_mark: | -| < 0.2 | :x: | +|---------| ------------------ | +| >= 0.5 | :white_check_mark: | +| < 0.4 | :x: | diff --git a/docs/qiskit_class_converter.html b/docs/qiskit_class_converter.html index 6712c35..250484f 100644 --- a/docs/qiskit_class_converter.html +++ b/docs/qiskit_class_converter.html @@ -3,7 +3,7 @@ - + qiskit_class_converter API documentation @@ -638,7 +638,7 @@
Inherited Members
__VERSION__ = -'0.4.1' +'0.5.0'
@@ -650,7 +650,7 @@
Inherited Members
__QISKIT_VERSION__ = -'0.44.2' +'1.0.1'
@@ -662,7 +662,7 @@
Inherited Members
__FULL_VERSION__ = -{'Qiskit': '0.44.2', 'Lib': '0.4.1'} +{'Qiskit': '1.0.1', 'Lib': '0.5.0'}
diff --git a/pyproject.toml b/pyproject.toml index bfaea26..e4a1c71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ exclude = ['qiskit_class_converter*tests'] [project] name = "qiskit-classroom-converter" -version = "0.4.3" +version = "0.5.0" authors = [ { name = "KMU-quantum-classroom" }, ] @@ -26,7 +26,7 @@ classifiers = [ "Operating System :: OS Independent", ] dependencies = [ - "qiskit==0.45.1", + "qiskit==1.0.1", "qiskit-aer==0.13.3", "loguru==0.7.2", "sympy==1.12", diff --git a/qiskit_class_converter/converters/quantum_circuit_to_matrix.py b/qiskit_class_converter/converters/quantum_circuit_to_matrix.py index 092fb9f..da7037b 100644 --- a/qiskit_class_converter/converters/quantum_circuit_to_matrix.py +++ b/qiskit_class_converter/converters/quantum_circuit_to_matrix.py @@ -64,30 +64,12 @@ def actual_convert_action(self): "gate_qubits": []} for _inst in circuit.data: _inst_upper_name = _inst[0].name.upper() - if _inst[0].num_qubits == 2: - gate_name = (_inst_upper_name + - "_{q" + str(_inst.qubits[0].index) + - ", q" + str(_inst.qubits[1].index) + "}") - self.__programmable_variable_per_qubit["gate_qubits"].append( - {"name": gate_name, - "qubit": [_inst.qubits[0].index, _inst.qubits[1].index]} - ) - elif _inst[0].num_qubits == 3: - gate_name = (_inst_upper_name + - "_{q" + str(_inst.qubits[0].index) + - ", q" + str(_inst.qubits[1].index) + - ", q" + str(_inst.qubits[2].index) + "}") - self.__programmable_variable_per_qubit["gate_qubits"].append( - {"name": gate_name, - "qubit": [_inst.qubits[0].index, - _inst.qubits[1].index, - _inst.qubits[2].index]} - ) - else: - gate_name = _inst_upper_name + "_{q" + str(_inst.qubits[0].index) + "}" - self.__programmable_variable_per_qubit["gate_qubits"].append( - {"name": gate_name, "qubit": [_inst.qubits[0].index]} - ) + qubit_indices = [circuit.find_bit(qubit)[0] for qubit in _inst[1]] + gate_name = (_inst_upper_name + + "_{" + ", ".join(f"q{i}" for i in qubit_indices) + "}") + self.__programmable_variable_per_qubit["gate_qubits"].append( + {"name": gate_name, "qubit": qubit_indices} + ) matrix_list["name"].append((layer_index, self.insert_i_gate())) layer_index += 1 matrix_list["result"] = self.qiskit.quantum_info.Operator(self.input_value).to_matrix() diff --git a/requirements.txt b/requirements.txt index 14090dc..1aaa9bf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -qiskit==0.45.1 +qiskit==1.0.1 qiskit-aer==0.13.3 loguru==0.7.2 sympy==1.12 diff --git a/scripts/migration_to_1.0.sh b/scripts/migration_to_1.0.sh new file mode 100644 index 0000000..fef993d --- /dev/null +++ b/scripts/migration_to_1.0.sh @@ -0,0 +1,11 @@ +# Make new environment and install +python -m venv .flake8-qiskit-migration-venv +source .flake8-qiskit-migration-venv/bin/activate +pip install flake8-qiskit-migration + +# Run plugin on Python code +flake8 --select QKT100 ../qiskit_class_converter/* + +# Deactivate and delete environment +deactivate +rm -r .flake8-qiskit-migration-venv \ No newline at end of file diff --git a/tox.ini b/tox.ini index 3265b48..3c95553 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.9 -envlist = py39, py310, py311, lint, coverage +envlist = py39, py310, py311, py312, lint, coverage skipsdist = True [gh-actions] @@ -8,6 +8,7 @@ python = 3.9: py39 3.10: py310 3.11: py311 + 3.12: py312 [testenv] usedevelop = true