Skip to content

Commit

Permalink
Remove deprecated use of qiskit.test.mock (#1547)
Browse files Browse the repository at this point in the history
* Remove deprecated use of qiskit.test.mock

Terra 0.21 triggers deprecation warnings for `qiskit.test.mock`, in
favour of `qiskit.providers.fake_provider`, which has been available
since Terra 0.20.  The only uses are in the tests, but it still
technically requires a version bump in the Terra requirement.  It's
fairly likely something else will bump the Terra version further before
release of Aer 0.11.

* Flatten unnecessarily nested import

This is also necessary because the submodule structure of
`qiskit.providers.fake_provider` is not guaranteed to be a public
interface, especially in Terra 0.20.

Co-authored-by: Hiroshi Horii <[email protected]>
  • Loading branch information
jakelishman and hhorii authored Jun 28, 2022
1 parent 7f24786 commit 3b5f444
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions releasenotes/notes/terra-version-bump-68eac37136428805.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
upgrade:
- |
The required version of Qiskit Terra has been bumped to 0.20.0.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def install_needed_req(import_name, package_name=None, min_version=None, max_ver
if not _DISABLE_CONAN:
setup_requirements.append('conan>=1.22.2')

requirements = common_requirements + ['qiskit-terra>=0.19.1', 'scipy>=1.0']
requirements = common_requirements + ['qiskit-terra>=0.20.0', 'scipy>=1.0']

if not hasattr(setuptools,
'find_namespace_packages') or not inspect.ismethod(
Expand Down
3 changes: 1 addition & 2 deletions test/terra/backends/test_config_pulse_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
from test.terra import common

from qiskit import QuantumCircuit, transpile, schedule
from qiskit.test.mock.backends.armonk.fake_armonk import FakeArmonk
from qiskit.test.mock.backends.athens.fake_athens import FakeAthens
from qiskit.providers.fake_provider import FakeArmonk, FakeAthens

from qiskit.providers.aer.backends import PulseSimulator
from qiskit.pulse import (Schedule, Play, ShiftPhase, SetPhase, Delay, Acquire,
Expand Down
2 changes: 1 addition & 1 deletion test/terra/backends/test_pulse_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from qiskit.providers.aer.pulse.system_models.hamiltonian_model import HamiltonianModel
from qiskit.providers.models.backendconfiguration import UchannelLO
from qiskit.providers.aer.aererror import AerError
from qiskit.test.mock import FakeArmonk
from qiskit.providers.fake_provider import FakeArmonk

from .pulse_sim_independent import (simulate_1q_model,
simulate_2q_exchange_model,
Expand Down
4 changes: 2 additions & 2 deletions test/terra/pulse/test_system_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import numpy as np
from numpy.linalg import norm
from test.terra.common import QiskitAerTestCase
from qiskit.test.mock import FakeOpenPulse2Q
from qiskit.providers.fake_provider import FakeOpenPulse2Q
from qiskit.providers.aer.pulse.system_models.pulse_system_model import PulseSystemModel
from qiskit.providers.aer.pulse.system_models.hamiltonian_model import HamiltonianModel
from qiskit.test.mock import FakeArmonk
from qiskit.providers.fake_provider import FakeArmonk
from qiskit.providers.models.backendconfiguration import UchannelLO


Expand Down

0 comments on commit 3b5f444

Please sign in to comment.