-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove remaining code usage deprecated in Qiskit 0.46 #1384
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c5d4bd2
Replace qiskit.providers.basicaer test usage with qiskit-aer
wshanks e2c6ec1
Unpin qiskit
wshanks db6f49f
Use FakeJob from qiskit_experiments.test instead of Qiskit
wshanks 08ea54c
Switch from plot_histogram to plot_distribution in experiment manual
wshanks 1c110e7
Handle deprecation of FakeBackendV2 in Qiskit 1.0
wshanks f958426
Guard the right FakeBackendV2 import
wshanks 45480bc
Use internal FakeProvider in place of one removed in Qiskit 1.0
wshanks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
qiskit==0.45.3 | ||
# Linters | ||
black~=22.0 | ||
pylint~=3.0.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,8 @@ | |
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_aer import AerSimulator | ||
|
||
from qiskit_experiments.framework import ExperimentData, ParallelExperiment | ||
from qiskit_experiments.library import Rabi, EFRabi | ||
|
@@ -223,7 +223,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 +272,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)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seemed like this test chose somewhat arbitrary input data to be "bad" but changing simulators made it start fitting as good again. I made the data worse so that it should more reliably fit as bad. |
||
amplitudes = np.linspace(0.0, 0.95, 31) | ||
|
||
experiment_data.add_data(self.simulate_experiment_data(thetas, amplitudes, shots=200)) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good for now. I noticed our
FakeJob
is implemented differently from the removedFakeJob
and also from currentJob
s. For example, the qiskit-ibm-runtimeJob
doesn't havetime_per_step()
implemented currently. If we're using our ownFakeJob
going forward, we should make sure it matches the external specs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good. If possible, I would like to see us push more for external specs. The Qiskit base classes are minimal and we rely on a lot of private attributes of the provider classes in a way that seems very brittle.