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 tutorials to work with Qiskit 1.0 #156

Merged
merged 7 commits into from
Feb 19, 2024

Conversation

woodsp-ibm
Copy link
Member

@woodsp-ibm woodsp-ibm commented Feb 16, 2024

Summary

Qiskit 1,0 removed the deprecated qiskit.tools which included some .jupyter from which the magics that did the version and copyright were imported. This PR adds a local file in the tutorials folder that contains just these magics and changes the import to use this.

Update: more needed fixing after this - see comments below.

Details and comments

@woodsp-ibm
Copy link
Member Author

Seems the notebook that shows VQE with Aer with a noise etc fails now that the magics are fixed

      1 from qiskit_aer.noise import NoiseModel
----> 2 from qiskit.providers.fake_provider import FakeVigo
      4 # fake providers contain data from real IBM Quantum devices stored in Qiskit,
      5 # and are useful for extracting realistic noise models.
      6 device = FakeVigo()

ImportError: cannot import name 'FakeVigo' from 'qiskit.providers.fake_provider' (/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/qiskit/providers/fake_provider/__init__.py)

Will fix/update this

@woodsp-ibm
Copy link
Member Author

I see I need to update the Grover notebook too as this fails since tools is gone

from qiskit.tools.visualization import plot_histogram

@coveralls
Copy link

coveralls commented Feb 16, 2024

Pull Request Test Coverage Report for Build 7958120916

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 7 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.03%) to 90.653%

Files with Coverage Reduction New Missed Lines %
qiskit_algorithms/algorithm_job.py 2 75.0%
qiskit_algorithms/utils/algorithm_globals.py 5 85.71%
Totals Coverage Status
Change from base Build 7891628732: 0.03%
Covered Lines: 6488
Relevant Lines: 7157

💛 - Coveralls

@woodsp-ibm
Copy link
Member Author

woodsp-ibm commented Feb 16, 2024

I downloaded the tutorials3.12 and was surprised to see the histogram was not there in the output of 07 grover one - it had worked for me locally under 3.9. But its there in turorials3.8, and we publish docs under 3.8 so I guess its ok. I'll check after this (hopefully) final change to fix styles (just had warnings about iqx saying it was not found) and if its not there I'll raise an issue so perhaps it can be investigated in the future.

Update: In looking more closely, the reason the figure is not there is because nothing actually runs since it depends on a library (tweedledum) that is not installed under 3.12 as requirements-dev limits this.

@woodsp-ibm
Copy link
Member Author

This is good to go now.

Copy link
Collaborator

@ElePT ElePT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Steve! LGTM, I just re-ran all the tutorials to make sure that the version tables show the latest versions and that the plotted circuits now follow the new color scheme. No more qiskit-terra and qiskit versions reported at the same time!

Screenshot 2024-02-19 at 11 30 39

@mergify mergify bot merged commit e0c050c into qiskit-community:main Feb 19, 2024
20 checks passed
@woodsp-ibm woodsp-ibm deleted the fix_tutorials branch February 19, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants