-
Notifications
You must be signed in to change notification settings - Fork 380
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
Conversation
|
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.
PR 1831 fixed the REAME #1806 problem, 5 hours earlier than PR 1832. This is my first time to submit a PR. Forgot to link the file.
Fix #1806 |
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 a fix for documentation. You do not need to check results of CI tests. Our CI is unstable (sometimes Windows's compiler fail due to memory shortage).
README.md
Outdated
group = "open" | ||
project = "main" | ||
backend_name = "ibmq_lima" | ||
backend = provider.get_backend(backend_name, instance=f"{hub}/{group}/{project}") |
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.
I think README example should be simple. Could you change the codes to get aersim_backend
as follows?
backend = FakeVigo()
aersim_backend = AerSimulator.from_backend(backend)
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.
Thanks. I made the change as you suggested and also added from qiskit.providers.fake_provider import FakeVigo. The code runs well in IBM-q well.
README.md
Outdated
|
||
# Perform noisy simulation | ||
result_noise = qiskit.execute(circ, aersim_backend).result() | ||
result_noise = aersim_backend.run(circ, shots=1000).result() |
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.
shots
is optional. So, please just call run(circ)
here.
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.
Thanks. shots=1000 has been removed for both ideal and noisy backend.
Thank you. All done.
________________________________
From: Hiroshi Horii ***@***.***>
Sent: Thursday, June 1, 2023 3:52:48 AM
To: Qiskit/qiskit-aer ***@***.***>
Cc: David Liu ***@***.***>; Author ***@***.***>
Subject: Re: [Qiskit/qiskit-aer] Fix Renew example codes in README #1806: qiskit.providers.ibmq is deprecated; ibmq_athens is not available (PR #1831)
CAUTION: This email originated from outside the university. DO NOT click links or open attachments unless you recognize the sender and know the content is safe.
@hhorii requested changes on this pull request.
This is a fix for documentation. You do not need to check results of CI tests. Our CI is unstable (sometimes Windows's compiler fail due to memory shortage).
________________________________
In README.md<#1831 (comment)>:
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')
-aersim_backend = AerSimulator.from_backend(backend)
+provider = IBMProvider()
+hub = "ibm-q"
+group = "open"
+project = "main"
+backend_name = "ibmq_lima"
+backend = provider.get_backend(backend_name, instance=f"{hub}/{group}/{project}")
I think README example should be simple. Could you change the codes to get aersim_backend as follows?
provider = IBMProvider(token='FILL_WITH_YOUR_TOKEN')
backend = provider.get_backend('ibmq_lima')
aersim_backend = AerSimulator.from_backend(backend)
________________________________
In README.md<#1831 (comment)>:
# Perform noisy simulation
-result_noise = qiskit.execute(circ, aersim_backend).result()
+result_noise = aersim_backend.run(circ, shots=1000).result()
shots is optional. So, please just call run(circ) here.
—
Reply to this email directly, view it on GitHub<#1831 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AQHBD7L77YL4ZWG3X2RZINTXJBC5BANCNFSM6AAAAAAYQXMKUY>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
README.md
Outdated
@@ -47,7 +47,7 @@ $ python | |||
|
|||
```python | |||
import qiskit | |||
from qiskit import IBMQ | |||
from qiskit_ibm_provider import IBMProvider |
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.
README.md
Outdated
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move this line to the head of this example?
Done.
________________________________
From: Hiroshi Horii ***@***.***>
Sent: Monday, June 5, 2023 7:34:15 AM
To: Qiskit/qiskit-aer ***@***.***>
Cc: David Liu ***@***.***>; Author ***@***.***>
Subject: Re: [Qiskit/qiskit-aer] Fix Renew example codes in README #1806: qiskit.providers.ibmq is deprecated; ibmq_athens is not available (PR #1831)
CAUTION: This email originated from outside the university. DO NOT click links or open attachments unless you recognize the sender and know the content is safe.
@hhorii requested changes on this pull request.
________________________________
In README.md<#1831 (comment)>:
@@ -47,7 +47,7 @@ $ python
```python
import qiskit
-from qiskit import IBMQ
+from qiskit_ibm_provider import IBMProvider
IBMProvider is no longer necessary.
________________________________
In README.md<#1831 (comment)>:
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
Could you move this line to the head of this example?
—
Reply to this email directly, view it on GitHub<#1831 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AQHBD7M2PI2HMZPUDMTEUALXJXG4PANCNFSM6AAAAAAYQXMKUY>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Summary
Details and comments
The same as above,