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

Numerical Integration methods for real and imaginary time evolution. #8399

Merged
merged 56 commits into from
Dec 20, 2022

Conversation

MarcDrudis
Copy link
Contributor

@MarcDrudis MarcDrudis commented Jul 26, 2022

This addresses #8342.
The goal of this PR is to implement 2 classes that inherit from RealEvolver and ImaginaryEvolver and solve the time evolution of a state using classical methods.
Both classes will be very similar, but the RealEvolver will use a biconjugate gradient descent method to make each step (this allows the step evolution operator to be unitary) and for the ImaginaryEvolver a taylor expansion of the time evolution operator will be used at each timestep (and the state renormalized).

The user can specify a list, or dictionary, of observables and their expectancy value will be computed at each timestep and returned as a list or a dictionary respectively.

Lastly, there is a method that allows to estimate the number of timesteps needed to reach a certain error threshold given the norm of the hamiltonian to evolve under. I am not completely sure if this feature is over complicating the interface unnecessarily, so let me know what you think about it. Basically it consists on taking the next taylor expansion term and using it to compute the minimum ammount of timesteps necessary to yield a given error.

@MarcDrudis MarcDrudis requested review from a team, manoelmarques and woodsp-ibm as code owners July 26, 2022 07:44
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

@woodsp-ibm woodsp-ibm added the mod: algorithms Related to the Algorithms module label Jul 27, 2022
Copy link
Contributor

@dlasecki dlasecki left a comment

Choose a reason for hiding this comment

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

Left first part of feedback. Perhaps we could introduce an abstract parent class to reduce code duplication.

Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

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

Some comments (mainly about docs and the tests) I only left for the imaginary classes but they do also apply for the real classes 🙂

Copy link
Contributor

@dlasecki dlasecki left a comment

Choose a reason for hiding this comment

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

Thanks for the good work.

dlasecki
dlasecki previously approved these changes Nov 21, 2022
Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

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

Minor comments, the main one is on the naming of the timesteps 🙂

Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

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

LGTM thanks for this great feature!

@Cryoris
Copy link
Contributor

Cryoris commented Dec 15, 2022

@Mergifyio requeue

@mergify
Copy link
Contributor

mergify bot commented Dec 15, 2022

requeue

✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically

@mergify mergify bot merged commit d932d88 into Qiskit:main Dec 20, 2022
Cryoris added a commit to Cryoris/qiskit-terra that referenced this pull request Jan 12, 2023
…iskit#8399)

* All Changes so far

* Revert "All Changes so far"

This reverts commit 871f29e.

* Quantum Time Evolution

* operators and frob norm

* fro norm

* Changes

* changes

* Added history

* Removed files and fixed lint

* Changed name

* fixed accuracy associated to bicg

* Changed imaginary

* Fixed output for observables

* version

* changes

* Comments Part 1

* make black

* Changed output observalbes

* Changed to taylor expansion

* black

* Documentation

* black

* Some comments

* redesign

* changes

* restore evolvers

* unittest redoing path

* make black

* Fixed docs?

* Fixed issue with scipy1.7.3

* Delete 1.8

* Review

* Deleted opflow

* times documentation T_ev_result

* Added example to reno

* Julien review

* Update releasenotes/notes/scipy-evolvers-ca92bcb90e90b035.yaml

* Update releasenotes/notes/scipy-evolvers-ca92bcb90e90b035.yaml

Co-authored-by: Julien Gacon <gaconju@gmail.com>

* observable in reno

Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ElePT pushed a commit to ElePT/qiskit that referenced this pull request Jun 27, 2023
…iskit#8399)

* All Changes so far

* Revert "All Changes so far"

This reverts commit 871f29e.

* Quantum Time Evolution

* operators and frob norm

* fro norm

* Changes

* changes

* Added history

* Removed files and fixed lint

* Changed name

* fixed accuracy associated to bicg

* Changed imaginary

* Fixed output for observables

* version

* changes

* Comments Part 1

* make black

* Changed output observalbes

* Changed to taylor expansion

* black

* Documentation

* black

* Some comments

* redesign

* changes

* restore evolvers

* unittest redoing path

* make black

* Fixed docs?

* Fixed issue with scipy1.7.3

* Delete 1.8

* Review

* Deleted opflow

* times documentation T_ev_result

* Added example to reno

* Julien review

* Update releasenotes/notes/scipy-evolvers-ca92bcb90e90b035.yaml

* Update releasenotes/notes/scipy-evolvers-ca92bcb90e90b035.yaml

Co-authored-by: Julien Gacon <gaconju@gmail.com>

* observable in reno

Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ElePT pushed a commit to ElePT/qiskit-algorithms-test that referenced this pull request Jul 17, 2023
…iskit/qiskit#8399)

* All Changes so far

* Revert "All Changes so far"

This reverts commit 871f29ef540d3d5f93e3ffb5bee17295b3d4d65c.

* Quantum Time Evolution

* operators and frob norm

* fro norm

* Changes

* changes

* Added history

* Removed files and fixed lint

* Changed name

* fixed accuracy associated to bicg

* Changed imaginary

* Fixed output for observables

* version

* changes

* Comments Part 1

* make black

* Changed output observalbes

* Changed to taylor expansion

* black

* Documentation

* black

* Some comments

* redesign

* changes

* restore evolvers

* unittest redoing path

* make black

* Fixed docs?

* Fixed issue with scipy1.7.3

* Delete 1.8

* Review

* Deleted opflow

* times documentation T_ev_result

* Added example to reno

* Julien review

* Update releasenotes/notes/scipy-evolvers-ca92bcb90e90b035.yaml

* Update releasenotes/notes/scipy-evolvers-ca92bcb90e90b035.yaml

Co-authored-by: Julien Gacon <gaconju@gmail.com>

* observable in reno

Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
@Cryoris Cryoris deleted the QuantumTimeEvolution branch October 8, 2024 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog mod: algorithms Related to the Algorithms module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants