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

Migrate algorithm-related tutorials from qiskit-tutorials to qiskit-algorithms. #38

Closed

Conversation

robotAstray
Copy link

@robotAstray robotAstray commented Aug 6, 2023

Summary

This PR aims to resolve issue #14

The tutorials have been added and modified to be consistent with the new library qiskit-algorithms

To do:

  • History-preserving move from qiskit-tutorials/algorithms to qiskit_algorithms/tutorials is being completed via PR History-preserving move from qiskit-tutorials/algorithms to qiskit_algorithms/tutorials #39
  • Update imports in code snippets from qiskit.algorithms to qiskit_algorithms
  • Update API-reference links and other documentation links in the tutorial body
  • Update any references to tutorials in code API docstrings - grover.py has a note that links to the textbook and the tutorial (I noticed this first and searched for others but that was the only place I saw that needed fixing)
  • Update wording around Qiskit. For instance the title of the 1st tutorial is An Introduction to Algorithms in Qiskit and perhaps we need something more like An Introduction to Algorithms for Qiskit instead given the move etc. Text in the main body should be checked over too and reworded appropriately e.g. from same tutorial Qiskit provides a number of Algorithms...
  • Update random_seed setting using algorithm_globals (an import change) - see A new algorithm_globals to replace use of qiskit.utils instance #33

Details and comments

File docs/tutorials/01_algorithms_introduction.ipynb

  • Updated the links in the markdown cells
  • Modified the title to "[..] Algorithms for Qiskit rather than "in Qiskit"
  • Re-run the cells
  • Note the Noisy VQE tutorial link will returns 404 because the tutorial has not been deployed yet. When the new changes are merged then the link should be working.

File docs/tutorials/02_vqe_advanced_options.ipynb

  • Updated the links in the markdown cells
  • Migration from qiskit.opflow to primitives

File 03_vqe_simulation_with_noise.ipynb, 04_vqd.ipynb

  • Updated the links in the markdown cells
  • Migration from qiskit.algorithms to qiskit_algorithms

Note the Noisy VQE tutorial returns 404 because the tutorial has not been deployed yet. When the new changes are merged then the link should be working.
@robotAstray robotAstray changed the title Migrate qiskit algorithms tutorials from qiskit-tutorials Migrate algorithm-related tutorials from qiskit-tutorials to qiskit-algorithms. Aug 6, 2023
@woodsp-ibm
Copy link
Member

The history preserving move/copy would be the first thing done so when the files are in the new place they already have their commit history - e.g that history would be visible in your fork. Then any changes are done to the files afterwards so these new changes build. You can search for git history preserving copies for how this is done. I imagine this would be all tutorials except 09_IQPE which does not use anything from algorithms at all - if it needed to be copied to facilitate the history that would ok. As part of the next changes it can just get deleted.

We would likely have to do the move/copy in a separate PR since by default the merge here flattens commit history so we would need to do something special when merging (which can be done) to preserve that history. It would be possible to add in the new changes at the same time but if that is done over a set of commits, because we want/need to comment/fix any new changes etc, they would all end up in the history which is not something we would likely want - for new changes normally all commits are flattened into a single commit (this is what history of tutorials is already). So arguably separating dealing with the history and then the new changes across a couple of PRs is more likely the better way to cater to this.

@robotAstray
Copy link
Author

OK @woodsp-ibm I will do some research on that, and make new branch to do the move/copy step. Thank you for the explanation.

@woodsp-ibm
Copy link
Member

I will do some research on that, and make new branch to do the move/copy step. Thank you for the explanation.

Sure. And I imagine that any refs to issues/PRs in the commit will need fixing up too. @ElePT did the move of the algorithms from qiskit to here preserving history etc in which that was done too. For the one tutorial that is here already I imagine that would get overridden in some way by the one from tutorials so we get the history - we simply put it here quickly as a placeholder so that we could get CI to include tutorials etc. We were figuring it would get sorted correctly once we brought over them all.

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.

None yet

2 participants