Skip to content

Update tutorials to use circuit library functions #968

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

woodsp-ibm
Copy link
Member

@woodsp-ibm woodsp-ibm commented Jul 18, 2025

Summary

Updates the tutorials to use the newer circuit library functions rather than the former, now deprecated, (BluePrint based) classes.
Addresses the checklist item to do this as found in #945

I will note that the output from these does not do so well - e.g. 02a Training on a Real Dataset where the scores are not as good and 11 Quantum Convolutional Neural Net where it classifies incorrectly one of the horizontal lines. Now these comparisons are against the tutorials as they are checked in where they were last run some time ago. I re-ran them to make sure they all worked so this is updating the output of these notebooks too. Now you can compare these to what is published out in the docs at https://qiskit-community.github.io/qiskit-machine-learning/tutorials/index.html where the notebooks would have been executed to produce the html. You can see they more compare to what I have here rather than the execution outcomes of what is checked in.

Oh I did notice the dataset plots in 03_quantum_kernel do not look like the published ones - mine had a plain blackground rather than the patterns these have. As they look correct in the published html and I did not change anything in regards of the plotting I assumed it was just some local rendering issue. Should be able to check the docs from the build here to make sure they come out correctly in the html when they get executed here.

I will also note that the circuit output, when things are printed, is not as before. Whereas before you might have seen a block that said RealAmplitudes where the gates were hidden in that block, now you just see the gates that comprise the circuit as built by the function.

Details and comments

Note: I left this PR as just addressing the circuit library changes over to using the function replacements. I did not attempt to alter the tutorials in any other way, and do not intend to, e.g. trying to improve the outcomes where it seems it did not do as well as the outcomes in the notebooks that are presently checked in. If this is done it should be in separate PR(s).

@woodsp-ibm woodsp-ibm changed the title Update tutorials Update tutorials to use circuit library functions Jul 18, 2025
@woodsp-ibm
Copy link
Member Author

Once #970 is merged that will remedy the CI failure that also happened here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant