-
Notifications
You must be signed in to change notification settings - Fork 360
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
Fix Renew example codes in README #1806: qiskit.providers.ibmq is deprecated; ibmq_athens is not available #1831
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4256dc3
Fix REAM #1896 qiskit.providers.ibmq is deprecated;
davidlearn 0c9eea3
In README example, simplify code to get aersim_backend
davidlearn 80d6506
Update README.md remove shots=1000
davidlearn 970a787
Merge branch 'main' into main
davidlearn 6b60091
use FakeManilaV2
davidlearn ee269e0
Update README.md import Fake backend in the beginning
davidlearn 3d5e628
Update README.md remove unneeded IBM_Providers import.
davidlearn e39ea83
Merge branch 'main' into main
hhorii 3b374b2
Merge branch 'main' into main
hhorii 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ $ python | |
|
||
```python | ||
import qiskit | ||
from qiskit import IBMQ | ||
from qiskit_ibm_provider import IBMProvider | ||
from qiskit_aer import AerSimulator | ||
|
||
# Generate 3-qubit GHZ state | ||
|
@@ -61,24 +61,24 @@ circ.measure_all() | |
aersim = AerSimulator() | ||
|
||
# Perform an ideal simulation | ||
result_ideal = qiskit.execute(circ, aersim).result() | ||
result_ideal = aersim.run(circ).result() | ||
counts_ideal = result_ideal.get_counts(0) | ||
print('Counts(ideal):', counts_ideal) | ||
# Counts(ideal): {'000': 493, '111': 531} | ||
|
||
# Construct a noisy simulator backend from an IBMQ backend | ||
# This simulator backend will be automatically configured | ||
# using the device configuration and noise model | ||
provider = IBMQ.load_account() | ||
backend = provider.get_backend('ibmq_athens') | ||
from qiskit.providers.fake_provider import FakeManilaV2 | ||
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. Could you move this line to the head of this example? |
||
backend = FakeManilaV2() | ||
aersim_backend = AerSimulator.from_backend(backend) | ||
|
||
# Perform noisy simulation | ||
result_noise = qiskit.execute(circ, aersim_backend).result() | ||
result_noise = aersim_backend.run(circ).result() | ||
counts_noise = result_noise.get_counts(0) | ||
|
||
print('Counts(noise):', counts_noise) | ||
# Counts(noise): {'000': 492, '001': 6, '010': 8, '011': 14, '100': 3, '101': 14, '110': 18, '111': 469} | ||
# Counts(noise): {'101': 16, '110': 48, '100': 7, '001': 31, '010': 7, '000': 464, '011': 15, '111': 436} | ||
``` | ||
|
||
## Contribution Guidelines | ||
|
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.
IBMProvider
is no longer necessary.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.
Removed it.