Skip to content

Commit

Permalink
Merge pull request #210 from arnaucasau/fix-ci
Browse files Browse the repository at this point in the history
CI was broken for four reasons:

    pylint was pinned to version 2.16.2 which doesn't support Python 3.12 and 3.11 officially
    Python 3.12 removed support for the imp library in favor of importlib and we were using a version of ipykernal that was importing the old library. The PR pins ipykernal to the first version supporting importlib. See this issue.
    The 'QuantumCircuit' object has no method 'bind_parameters' in qiskit 1.0 as we can see in #791 . This PR replaces the call to bind_parameters for assign_parameters as explained in the qiskit 1.0 release notes.
    The qiskit.execute function is not available in Qiskit 1.0 anymore -> Migration guide
  • Loading branch information
mtreinish authored Apr 11, 2024
2 parents 7094e0a + 9246845 commit 512036f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
- name: Install dependencies
run: |
conda config --set always_yes yes --set changeps1 no
pip install -U -r requirements.txt
pip install -U -r requirements.txt -c constraints.txt
- name: Lint with pylint and pycodestyle
run: |
pip install -U -r requirements-dev.txt
pip install -U -r requirements-dev.txt -c constraints.txt
python setup.py build_ext --inplace
pylint -rn mthree
pycodestyle --max-line-length=100 mthree
Expand Down
2 changes: 2 additions & 0 deletions constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
astroid~=3.0.1 # Must be kept aligned to what pylint wants
ipykernel==6.11.0
4 changes: 2 additions & 2 deletions docs/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ For example let us compare raw data verse the mitigated results in a simple case
qc.cx(1, 0)
qc.measure_all()

raw_counts = execute(qc, backend).result().get_counts()
raw_counts = backend.run(qc).result().get_counts()
mit = mthree.M3Mitigation(backend)
mit.cals_from_system()
mit_counts = mit.apply_correction(raw_counts, qubits=range(4),
Expand Down Expand Up @@ -117,7 +117,7 @@ mitigate 5 circuits:

.. jupyter-execute::

raw_counts = execute([qc]*5, backend).result().get_counts()
raw_counts = backend.run([qc]*5).result().get_counts()
mit = mthree.M3Mitigation(backend)
mit.cals_from_system()
mit_counts = mit.apply_correction(raw_counts, qubits=range(4),
Expand Down
3 changes: 1 addition & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
qiskit-aer>=0.13
pytest
pylint==2.16.2
pylint~=3.0.2
pycodestyle
Sphinx>=7.0,<=8
qiskit_sphinx_theme~=1.12.0
Expand All @@ -9,6 +9,5 @@ pylatexenc
jupyter-sphinx
nbsphinx
psutil
ipykernel<6
Jinja2<3.1
quantum-styles
2 changes: 1 addition & 1 deletion tutorials/10_basic_vqe.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
"source": [
"def vqe_func(params, *args):\n",
" # Attach parameters to the transpiled circuit variables\n",
" bound_circs = [circ.bind_parameters(params) for circ in trans_circs]\n",
" bound_circs = [circ.assign_parameters(params) for circ in trans_circs]\n",
" # Submit the job and get the resultant counts back\n",
" counts = backend.run(bound_circs, shots=4096).result().get_counts()\n",
" # Apply mitigation to get quasi-probabilities\n",
Expand Down

0 comments on commit 512036f

Please sign in to comment.