diff --git a/.github/actions/install-main-dependencies/action.yml b/.github/actions/install-main-dependencies/action.yml index 82b1301..1fb27e5 100644 --- a/.github/actions/install-main-dependencies/action.yml +++ b/.github/actions/install-main-dependencies/action.yml @@ -1,5 +1,3 @@ -# This code is part of a Qiskit project. -# # (C) Copyright IBM 2021, 2023. # # This code is licensed under the Apache License, Version 2.0. You may diff --git a/.github/actions/install-pipeline/action.yml b/.github/actions/install-pipeline/action.yml index b12d824..23a591c 100644 --- a/.github/actions/install-pipeline/action.yml +++ b/.github/actions/install-pipeline/action.yml @@ -1,5 +1,3 @@ -# This code is part of a Qiskit project. -# # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index 2e48096..1ac822a 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -1,5 +1,3 @@ -# This code is part of a Qiskit project. -# # (C) Copyright IBM 2021, 2023. # # This code is licensed under the Apache License, Version 2.0. You may @@ -33,7 +31,7 @@ runs: PYTHONWARNINGS: default run: | # run slow tests only on scheduled event or if input flag is set - if [ "${{ inputs.os }}" == "ubuntu-latest" ] && [ "${{ inputs.python-version }}" == "3.9" ]; then + if [ "${{ inputs.os }}" == "ubuntu-latest" ] && [ "${{ inputs.python-version }}" == "3.11" ]; then export PYTHON="coverage3 run --source qaoa_training_pipeline --parallel-mode" fi stestr --test-path test run 2> >(tee /dev/stderr out.txt > /dev/null) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 21a129a..0199f59 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,3 @@ -# This code is part of a Qiskit project. -# # (C) Copyright IBM 2021, 2023. # # This code is licensed under the Apache License, Version 2.0. You may @@ -33,7 +31,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.9] + python-version: [3.11] steps: - name: Print Concurrency Group env: @@ -75,14 +73,14 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: [3.9, 3.12] + python-version: [3.11, 3.12] include: - os: macos-latest - python-version: 3.9 + python-version: 3.11 - os: macos-latest python-version: 3.12 - os: windows-latest - python-version: 3.9 + python-version: 3.11 - os: windows-latest python-version: 3.12 steps: @@ -118,7 +116,7 @@ jobs: mkdir ./ci-artifact-data coverage3 combine mv .coverage ./ci-artifact-data/pipeline.dat - if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 }} + if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == 3.11 }} shell: bash - uses: actions/upload-artifact@v4 with: diff --git a/README.md b/README.md index 057e3bf..eb06c63 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,7 @@ This repository is still in development: new functionality is being added and th | 12 | More data in result saving in train.py | #26 | | 13 | Create PPEvaluator from configs | #25 | | 14 | Custom ansatz operator to state vector | #29 | +| 15 | Remove python 3.9 support | #31 | ## IBM Public Repository Disclosure diff --git a/pyproject.toml b/pyproject.toml index b23cd4f..537fd05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta" [tool.black] line-length = 100 -target-version = ['py39', 'py310', 'py311', 'py312', 'py313'] +target-version = ['py310', 'py311', 'py312', 'py313'] [tool.pylint.main] -py-version = "3.9" # update it when bumping minimum supported python version +py-version = "3.12" # update it when bumping minimum supported python version [tool.pylint.basic] good-names = ["a", "b", "i", "j", "k", "d", "n", "m", "ex", "v", "w", "x", "y", "z", "Run", "_", "logger", "q", "c", "r", "qr", "cr", "qc", "nd", "pi", "op", "b", "ar", "br", "p", "cp", "ax", "dt", "__unittest", "iSwapGate", "mu"] diff --git a/qaoa_training_pipeline/training/param_result.py b/qaoa_training_pipeline/training/param_result.py index c6351d6..ff4f780 100644 --- a/qaoa_training_pipeline/training/param_result.py +++ b/qaoa_training_pipeline/training/param_result.py @@ -47,7 +47,7 @@ def __init__( "system": platform.system(), "processor": platform.processor(), "platform": platform.platform(), - "qaoa_training_pipeline_version": 14, + "qaoa_training_pipeline_version": 15, } # Convert, e.g., np.float to float diff --git a/requirements-dev.txt b/requirements-dev.txt index 386bfef..2e33512 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -coverage>=4.4.0,<7.0 +coverage>=4.4.0 black[jupyter]~=24.1 pylint>=2.15.0 ddt>=1.2.0,!=1.4.0,!=1.4.3 diff --git a/requirements.txt b/requirements.txt index fc7b008..9d41a11 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,5 +7,5 @@ scipy quimb>=1.8.2 matplotlib>=3.3 python-sat -qiskit>=1.0,<2.0 +qiskit qiskit-optimization[cplex] diff --git a/setup.py b/setup.py index 46d6eef..e434b98 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,6 @@ ), install_requires=REQUIREMENTS, include_package_data=True, - python_requires=">=3.9", + python_requires=">=3.10", zip_safe=False, ) diff --git a/test/utils/test_graph_utils.py b/test/utils/test_graph_utils.py index ebfe723..7f8f8b2 100644 --- a/test/utils/test_graph_utils.py +++ b/test/utils/test_graph_utils.py @@ -17,7 +17,7 @@ from qiskit import QuantumCircuit from qiskit.circuit import Parameter -from qiskit.circuit.library import QAOAAnsatz +from qiskit.circuit.library import qaoa_ansatz from qiskit.transpiler import PassManager from qiskit.transpiler.passes import HighLevelSynthesis from qiskit.quantum_info import SparsePauliOp @@ -72,12 +72,12 @@ def test_circuit_to_graph(self): cost_operator = SparsePauliOp.from_list([("IIZZ", -1), ("ZIIZ", 1), ("IZIZ", 2)]) - cost_layer = QAOAAnsatz( + cost_layer = qaoa_ansatz( cost_operator, - mixer_operator=QuantumCircuit(4), + mixer_operator=SparsePauliOp.from_list([("IIII", 1)]), initial_state=QuantumCircuit(4), reps=1, - ).decompose() + ) pass_manager = PassManager([HighLevelSynthesis(basis_gates=["rzz"])]) cost_layer = pass_manager.run(cost_layer) @@ -93,12 +93,12 @@ def test_circuit_to_graph_single_z(self): cost_operator = SparsePauliOp.from_list([("IZZ", -1), ("IIZ", 1), ("ZIZ", 2)]) - cost_layer = QAOAAnsatz( + cost_layer = qaoa_ansatz( cost_operator, - mixer_operator=QuantumCircuit(3), + mixer_operator=SparsePauliOp.from_list([("III", 1)]), initial_state=QuantumCircuit(3), reps=1, - ).decompose() + ) pass_manager = PassManager([HighLevelSynthesis(basis_gates=["rzz", "rz"])]) cost_layer = pass_manager.run(cost_layer) diff --git a/tox.ini b/tox.ini index ddcbee7..cf43da4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] # Sets this min.version because of differences with env_tmp_dir env. minversion = 4.0.2 -envlist = py38, py39, py310, py311, py312, lint +envlist = py310, py311, py312, lint skipsdist = True [testenv]