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

docs(notebooks): add Krylov subspace expansion tutorial #11

Merged
merged 24 commits into from
Mar 29, 2024

Conversation

miamico
Copy link
Contributor

@miamico miamico commented Feb 10, 2024

Summary

Adding a tutorial on finding the ground state energy of a given Hamiltonian (Heisenberg model) using the Krylov subspace expansion techniques.

Details and comments

The tutorial is formatted in the Qiskit Patterns framework with a detailed description of the method in Step 1., optimization of the circuits in Step 2., execution with the primitives on a simulator in Step 3. and post-processing of the results to get the value of the ground state energy of the system in Step 4.

@coveralls
Copy link

coveralls commented Feb 10, 2024

Pull Request Test Coverage Report for Build 8472840764

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 8031993973: 0.0%
Covered Lines: 290
Relevant Lines: 290

💛 - Coveralls

@pedrorrivero
Copy link
Member

pedrorrivero commented Feb 17, 2024

Hi @miamico can you check that this notebook runs with a freshly created environment and only this repo installed from source? Please make sure to install the notebook optional dependencies.

Since Friday, this should be equivalent to Qiskit 1.0.0. You will need to rebase this branch to merge main, let me know if you need help.

If you need additional dependencies please flag.

@pedrorrivero pedrorrivero added documentation Improvements or additions to documentation PL-3 Priority level 3/5 → Medium labels Feb 17, 2024
@miamico
Copy link
Contributor Author

miamico commented Feb 19, 2024

I've modified the notebook to work on qiskit 1.0. Verified that it runs top to bottom installing the repo dependencies and qiskit 1.0.

Note that when installing the optional dependencies with the command:
pip install -e .[notebook]
I've encountered the following error:
zsh: no matches found: .[notebook]
Apparently brackets and zsh don't go along so I had to use the following command instead to escape the brackets:
pip install -e ".[notebook]"
It may be worth mentioning this in the install instructions

@pedrorrivero pedrorrivero removed the documentation Improvements or additions to documentation label Feb 24, 2024
@nathanearnestnoble
Copy link
Contributor

I think this is a good 'starter kit' for someone looking to try and explore using the krylov method.

Given similar focus on Heisenberg chains, and in context of this existing related tutorial, I wonder if a title 'Heisenberg Chains with quantum krylov subspace expansion' might be an apt name -- thoughts?

The text is very verbose, but I think this is useful with respect to learning about krylov method. May be worth considering future updates to leave out edu content for tutorials and include this in other edu sections.

@miamico
Copy link
Contributor Author

miamico commented Feb 26, 2024

Thanks @miamico!

I have not gotten to the contents of the guide, but we need to do these two things before merging is possible:

  1. Merge main into this branch to get the latest updates.
  2. Remove the word guide from the file name.

The file is now called:
Calculating ground states on large scale systems with the quantum krylov subspace method.ipynb

@miamico
Copy link
Contributor Author

miamico commented Feb 26, 2024

I think this is a good 'starter kit' for someone looking to try and explore using the krylov method.

Given similar focus on Heisenberg chains, and in context of this existing related tutorial, I wonder if a title 'Heisenberg Chains with quantum krylov subspace expansion' might be an apt name -- thoughts?

The text is very verbose, but I think this is useful with respect to learning about krylov method. May be worth considering future updates to leave out edu content for tutorials and include this in other edu sections.

I'm afraid to emphasize too much Heisemberg chain as that may give the impression that this technique is specifically for this case while I want to focus more on the technique itself. Open to further discussions.

I agree on the verbose part. We can figure out what is the right amount of information.

@miamico miamico changed the title docs(notebooks): add Krylov subspace expansion guide docs(notebooks): add Krylov subspace expansion tutorial Feb 26, 2024
@pedrorrivero
Copy link
Member

I've modified the notebook to work on qiskit 1.0. Verified that it runs top to bottom installing the repo dependencies and qiskit 1.0.

Note that when installing the optional dependencies with the command: pip install -e .[notebook] I've encountered the following error: zsh: no matches found: .[notebook] Apparently brackets and zsh don't go along so I had to use the following command instead to escape the brackets: pip install -e ".[notebook]" It may be worth mentioning this in the install instructions

I missed this comment before @miamico, can you mention me in the future so that I get notified?

This is/was already referenced in INSTALL.md. Can you see it?

Copy link
Member

@pedrorrivero pedrorrivero left a comment

Choose a reason for hiding this comment

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

Thanks @miamico!
I have not gotten to the contents of the guide, but we need to do these two things before merging is possible:

  1. Merge main into this branch to get the latest updates.
  2. Remove the word guide from the file name.

The file is now called: Calculating ground states on large scale systems with the quantum krylov subspace method.ipynb

Wow, that is a long name for a file! I would suggest:

  1. Short names
  2. Avoid spaces

How about just krylov.ipynb @miamico?

@miamico
Copy link
Contributor Author

miamico commented Mar 1, 2024

I've modified the notebook to work on qiskit 1.0. Verified that it runs top to bottom installing the repo dependencies and qiskit 1.0.
Note that when installing the optional dependencies with the command: pip install -e .[notebook] I've encountered the following error: zsh: no matches found: .[notebook] Apparently brackets and zsh don't go along so I had to use the following command instead to escape the brackets: pip install -e ".[notebook]" It may be worth mentioning this in the install instructions

I missed this comment before @miamico, can you mention me in the future so that I get notified?

This is/was already referenced in INSTALL.md. Can you see it?

Oh yes I saw it now!

Copy link
Contributor

@a-matsuo a-matsuo left a comment

Choose a reason for hiding this comment

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

The notebook looks great! I suggest some minor changes.

docs/notebooks/krylov.ipynb Outdated Show resolved Hide resolved
docs/notebooks/krylov.ipynb Outdated Show resolved Hide resolved
docs/notebooks/krylov.ipynb Outdated Show resolved Hide resolved
docs/notebooks/krylov.ipynb Outdated Show resolved Hide resolved
@pedrorrivero
Copy link
Member

@miamico , can you mark as resolved the comments that you have already addressed? If everything is okay with the rest I think we should be ready to mereg

@miamico
Copy link
Contributor Author

miamico commented Mar 28, 2024

Yep, I've addressed the various comments. I think it's ready to be merged

@pedrorrivero pedrorrivero merged commit 0331e07 into main Mar 29, 2024
11 checks passed
@pedrorrivero pedrorrivero deleted the krylov_guide branch March 29, 2024 12:52
frankharkins pushed a commit to Qiskit/documentation that referenced this pull request May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notebook Notebook improvements or additions PL-3 Priority level 3/5 → Medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants