Skip to content
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 9 commits into from
Jun 5, 2023

Conversation

davidlearn
Copy link
Contributor

@davidlearn davidlearn commented May 26, 2023

Summary

  • close Renew example codes in README #1806
  • In REAME, use IBMProvider instead qiskit.providers.ibmq to creare provider
  • Use NoiseModel.from_backend_properties to create noise model since IBMQ,get)backend is not longer available
  • Add noise_model to AerSimulator
  • Tested in IBM-Q

Details and comments

The same as above,

@CLAassistant
Copy link

CLAassistant commented May 26, 2023

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@davidlearn davidlearn changed the title Fix REAM #1806: qiskit.providers.ibmq is deprecated; ibmq_athens is not available Fix REAME #1806: qiskit.providers.ibmq is deprecated; ibmq_athens is not available May 26, 2023
@davidlearn davidlearn changed the title Fix REAME #1806: qiskit.providers.ibmq is deprecated; ibmq_athens is not available Fix Renew example codes in README #1806: qiskit.providers.ibmq is deprecated; ibmq_athens is not available May 26, 2023
Copy link
Contributor Author

@davidlearn davidlearn left a 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.

@davidlearn
Copy link
Contributor Author

Fix #1806

@hhorii hhorii added stable-backport-potential The issue or PR might be minimal and/or import enough to backport to stable documentation Something is not clear or error in description labels May 30, 2023
@hhorii hhorii added this to the Aer 0.12.1 milestone May 30, 2023
@davidlearn
Copy link
Contributor Author

davidlearn commented May 30, 2023

Tests / tests_windows (3.9, windows-2019) (pull_request): Install Aer Windows Failed has nothing to do with my PR #1831 which only updates README file for issue #1831

Copy link
Collaborator

@hhorii hhorii left a 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}")
Copy link
Collaborator

@hhorii hhorii Jun 1, 2023

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)

Copy link
Contributor Author

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()
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@davidlearn
Copy link
Contributor Author

davidlearn commented Jun 1, 2023 via email

README.md Outdated
@@ -47,7 +47,7 @@ $ python

```python
import qiskit
from qiskit import IBMQ
from qiskit_ibm_provider import IBMProvider
Copy link
Collaborator

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.

Copy link
Contributor Author

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
Copy link
Collaborator

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?

@davidlearn
Copy link
Contributor Author

davidlearn commented Jun 5, 2023 via email

@hhorii hhorii added the automerge This PR will automatically merge once its CI has passed label Jun 5, 2023
@mergify mergify bot merged commit b6cc4a2 into Qiskit:main Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge This PR will automatically merge once its CI has passed documentation Something is not clear or error in description stable-backport-potential The issue or PR might be minimal and/or import enough to backport to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Renew example codes in README
3 participants