diff --git a/test/curve_analysis/test_curve_fitting.py b/test/curve_analysis/test_curve_fitting.py index e64b5b5d65..937cd65b95 100644 --- a/test/curve_analysis/test_curve_fitting.py +++ b/test/curve_analysis/test_curve_fitting.py @@ -15,7 +15,7 @@ import numpy as np from qiskit import QuantumCircuit, transpile -from qiskit.providers.basicaer import QasmSimulatorPy +from qiskit_aer import AerSimulator from qiskit_experiments.curve_analysis import process_curve_data from qiskit_experiments.curve_analysis.utils import ( level2_probability, @@ -36,7 +36,7 @@ def simulate_experiment_data(self, thetas, shots=1024): qc.measure_all() circuits.append(qc) - sim = QasmSimulatorPy() + sim = AerSimulator() circuits = transpile(circuits, sim) job = sim.run(circuits, shots=shots, seed_simulator=10) result = job.result() diff --git a/test/library/calibration/test_rabi.py b/test/library/calibration/test_rabi.py index 962b3abd92..21befd314d 100644 --- a/test/library/calibration/test_rabi.py +++ b/test/library/calibration/test_rabi.py @@ -18,8 +18,9 @@ from qiskit import QuantumCircuit, pulse, transpile from qiskit.exceptions import QiskitError from qiskit.circuit import Parameter -from qiskit.providers.basicaer import QasmSimulatorPy from qiskit.qobj.utils import MeasLevel +from qiskit.providers.basic_provider import BasicSimulator +from qiskit_aer import AerSimulator from qiskit_experiments.framework import ExperimentData, ParallelExperiment from qiskit_experiments.library import Rabi, EFRabi @@ -223,7 +224,7 @@ def simulate_experiment_data(self, thetas, amplitudes, shots=1024): qc.measure_all() circuits.append(qc) - sim = QasmSimulatorPy() + sim = AerSimulator() circuits = transpile(circuits, sim) job = sim.run(circuits, shots=shots, seed_simulator=10) result = job.result() @@ -272,7 +273,10 @@ def test_bad_analysis(self): """Test the Rabi analysis.""" experiment_data = ExperimentData() - thetas = np.linspace(0.0, np.pi / 4, 31) + # Change rotation angle with square root of amplitude so that + # population versus amplitude will not be sinusoidal and the fit will + # be bad. + thetas = np.sqrt(np.linspace(0.0, 4 * np.pi**2, 31)) amplitudes = np.linspace(0.0, 0.95, 31) experiment_data.add_data(self.simulate_experiment_data(thetas, amplitudes, shots=200))