unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
358 stars 157 forks source link

CI failing due to qiskit aer deprecation message #1601

Closed nathanshammah closed 1 year ago

nathanshammah commented 1 year ago

Issue Description

Currently, the CI is failing on master with macos with py 3.9, seemingly due to qiskit aer deprecation

  /Users/runner/work/mitiq/mitiq/mitiq/interface/mitiq_qiskit/qiskit_utils.py:124: PendingDeprecationWarning: The qiskit.Aer entry point will be deprecated in a future release and subsequently removed. Instead you should use this directly from the root of the qiskit-aer package.

See the environment details below for the full error message. Not clear why this pops up only in py3.9 mac-os, but we've been informed of this issue happening also locally for notebooks in the research repo.

How to Reproduce

See https://github.com/unitaryfund/mitiq/actions/runs/3512731403/jobs/5884750195

Expected behavior


Environment Context ```python =================================== FAILURES =================================== ______________________ mitiq/zne/tests/test_inference.py _______________________ [gw2] darwin -- Python 3.9.14 /Users/runner/hostedtoolcache/Python/3.9.14/x64/bin/python worker 'gw2' crashed while running 'mitiq/zne/tests/test_inference.py::test_plot_data[LinearFactory]' =============================== warnings summary =============================== mitiq/interface/mitiq_qiskit/tests/test_qiskit_utils.py::test_execute /Users/runner/work/mitiq/mitiq/mitiq/interface/mitiq_qiskit/qiskit_utils.py:124: PendingDeprecationWarning: The qiskit.Aer entry point will be deprecated in a future release and subsequently removed. Instead you should use this directly from the root of the qiskit-aer package. backend=qiskit.Aer.get_backend("aer_simulator_density_matrix"), mitiq/interface/mitiq_qiskit/tests/test_qiskit_utils.py::test_sample_bitstrings_with_backend mitiq/interface/mitiq_qiskit/tests/test_qiskit_utils.py::test_compute_expectation_value_on_noisy_backend_with_qiskit_backend /Users/runner/hostedtoolcache/Python/3.9.14/x64/lib/python3.9/site-packages/qiskit/providers/fake_provider/fake_backend.py:462: PendingDeprecationWarning: "warnings" argument will be deprecated as part of the qiskit-aer 0.12.0 and subsequently removed noise_model = NoiseModel.from_backend(self, warnings=False) mitiq/zne/tests/test_zne.py::test_qiskit_measurement_order_is_preserved_single_register[order2] /Users/runner/work/mitiq/mitiq/mitiq/zne/tests/test_zne.py:292: PendingDeprecationWarning: The qiskit.Aer entry point will be deprecated in a future release and subsequently removed. Instead you should use this directly from the root of the qiskit-aer package. circuit, qiskit.Aer.get_backend("aer_simulator"), shots=100 mitiq/zne/tests/test_zne.py::test_qiskit_run_factory_with_number_of_shots /Users/runner/work/mitiq/mitiq/mitiq/interface/mitiq_qiskit/qiskit_utils.py:176: PendingDeprecationWarning: The qiskit.Aer entry point will be deprecated in a future release and subsequently removed. Instead you should use this directly from the root of the qiskit-aer package. backend=qiskit.Aer.get_backend("aer_simulator"), ```
natestemen commented 1 year ago

I believe CI failed due to the fact that a test failed (see here), not because of the PendingDeprecationWarning. The test that's failing is being tracked in https://github.com/unitaryfund/mitiq/issues/1509.

As you can see in this build (https://github.com/unitaryfund/mitiq/actions/runs/3512731403/jobs/5892663542#step:5:3633) the warnings exist, but CI still passes.

This particular PendingDeprecationWarning cannot be fixed at the moment. Rather it seems to be a warning that a future qiskit version will have a DeprecationWarning which I believe will fail our CI. I'll close this for now, but feel free to reopen if you think something needs addressed that's not tracked elsewhere.