|
18 | 18 | from qiskit import QuantumCircuit, pulse, transpile
|
19 | 19 | from qiskit.exceptions import QiskitError
|
20 | 20 | from qiskit.circuit import Parameter
|
21 |
| -from qiskit.providers.basicaer import QasmSimulatorPy |
22 | 21 | from qiskit.qobj.utils import MeasLevel
|
| 22 | +from qiskit.providers.basic_provider import BasicSimulator |
| 23 | +from qiskit_aer import AerSimulator |
23 | 24 |
|
24 | 25 | from qiskit_experiments.framework import ExperimentData, ParallelExperiment
|
25 | 26 | from qiskit_experiments.library import Rabi, EFRabi
|
@@ -223,7 +224,7 @@ def simulate_experiment_data(self, thetas, amplitudes, shots=1024):
|
223 | 224 | qc.measure_all()
|
224 | 225 | circuits.append(qc)
|
225 | 226 |
|
226 |
| - sim = QasmSimulatorPy() |
| 227 | + sim = AerSimulator() |
227 | 228 | circuits = transpile(circuits, sim)
|
228 | 229 | job = sim.run(circuits, shots=shots, seed_simulator=10)
|
229 | 230 | result = job.result()
|
@@ -272,7 +273,10 @@ def test_bad_analysis(self):
|
272 | 273 | """Test the Rabi analysis."""
|
273 | 274 | experiment_data = ExperimentData()
|
274 | 275 |
|
275 |
| - thetas = np.linspace(0.0, np.pi / 4, 31) |
| 276 | + # Change rotation angle with square root of amplitude so that |
| 277 | + # population versus amplitude will not be sinusoidal and the fit will |
| 278 | + # be bad. |
| 279 | + thetas = np.sqrt(np.linspace(0.0, 4 * np.pi**2, 31)) |
276 | 280 | amplitudes = np.linspace(0.0, 0.95, 31)
|
277 | 281 |
|
278 | 282 | experiment_data.add_data(self.simulate_experiment_data(thetas, amplitudes, shots=200))
|
|
0 commit comments