-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Time Evolution Framework with primitives. #8681
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
Merged
mergify
merged 31 commits into
Qiskit:main
from
dlasecki:evolution-framework-primitives
Sep 13, 2022
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
e3233b7
Implemented observables_evaluator.py with primitives.
d71f50b
Added evolvers problems and interfaces to time_evolvers package.
7a7c82b
Mostly updated trotter_qrte.py to use primitives.
54afe25
Added observables_evaluator.py that uses primitives.
d2b67d9
Added observables_evaluator.py that uses primitives.
c1276d2
Updated trotter_qrte.py to use primitives.
e06c6c2
Updated imports
5a9bebe
Updated typehints and limited use of opflow.
356deae
Updated typehints and limited use of opflow.
14ba35d
Removed files out of scope for this PR.
4cf6f61
Added annotations import.
604944c
Applied some CR comments.
23821e0
Added reno.
a2960b2
Accepting Statevector.
9b5f50a
Added attributes docs.
107dc2b
Merge branch 'main' into evolution-framework-primitives
manoelmarques 387ce78
Add pending deprecation for evolvers
manoelmarques a7e2f60
Renamed classes and linked to algorithms init.
34c2deb
Merge remote-tracking branch 'origin/evolution-framework-primitives' …
5c87255
fix docstring
manoelmarques d03bddf
Improved reno.
a656db0
Merge branch 'main' into evolution-framework-primitives
7680019
Code refactoring.
1dce473
Black fix.
d3c601e
Applied CR comments.
4795b45
Add deprecation msg to evolvers package
manoelmarques ce6d828
Merge branch 'main' into evolution-framework-primitives
0552379
Merge branch 'main' into evolution-framework-primitives
woodsp-ibm 6e834f0
Merge branch 'main' into evolution-framework-primitives
d9c8d84
Merge branch 'main' into evolution-framework-primitives
cc7d678
Merge branch 'main' into evolution-framework-primitives
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # This code is part of Qiskit. | ||
| # | ||
| # (C) Copyright IBM 2022. | ||
| # | ||
| # This code is licensed under the Apache License, Version 2.0. You may | ||
| # obtain a copy of this license in the LICENSE.txt file in the root directory | ||
| # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. | ||
| # | ||
| # Any modifications or derivative works of this code must retain this | ||
| # copyright notice, and modified files need to carry a notice indicating | ||
| # that they have been altered from the originals. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # This code is part of Qiskit. | ||
| # | ||
| # (C) Copyright IBM 2021, 2022. | ||
| # | ||
| # This code is licensed under the Apache License, Version 2.0. You may | ||
| # obtain a copy of this license in the LICENSE.txt file in the root directory | ||
| # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. | ||
| # | ||
| # Any modifications or derivative works of this code must retain this | ||
| # copyright notice, and modified files need to carry a notice indicating | ||
| # that they have been altered from the originals. | ||
|
|
||
| """Interface for Quantum Imaginary Time Evolution.""" | ||
|
|
||
| from abc import ABC, abstractmethod | ||
|
|
||
| from .time_evolution_problem import TimeEvolutionProblem | ||
| from .time_evolution_result import TimeEvolutionResult | ||
|
|
||
|
|
||
| class ImaginaryTimeEvolver(ABC): | ||
| """Interface for Quantum Imaginary Time Evolution.""" | ||
|
|
||
| @abstractmethod | ||
| def evolve(self, evolution_problem: TimeEvolutionProblem) -> TimeEvolutionResult: | ||
| r"""Perform imaginary time evolution :math:`\exp(-\tau H)|\Psi\rangle`. | ||
|
|
||
| Evolves an initial state :math:`|\Psi\rangle` for an imaginary time :math:`\tau` | ||
| under a Hamiltonian :math:`H`, as provided in the ``evolution_problem``. | ||
|
|
||
| Args: | ||
| evolution_problem: The definition of the evolution problem. | ||
|
|
||
| Returns: | ||
| Evolution result which includes an evolved quantum state. | ||
| """ | ||
| raise NotImplementedError() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # This code is part of Qiskit. | ||
| # | ||
| # (C) Copyright IBM 2021, 2022. | ||
| # | ||
| # This code is licensed under the Apache License, Version 2.0. You may | ||
| # obtain a copy of this license in the LICENSE.txt file in the root directory | ||
| # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. | ||
| # | ||
| # Any modifications or derivative works of this code must retain this | ||
| # copyright notice, and modified files need to carry a notice indicating | ||
| # that they have been altered from the originals. | ||
|
|
||
| """Interface for Quantum Real Time Evolution.""" | ||
|
|
||
| from abc import ABC, abstractmethod | ||
|
|
||
| from .time_evolution_problem import TimeEvolutionProblem | ||
| from .time_evolution_result import TimeEvolutionResult | ||
|
|
||
|
|
||
| class RealTimeEvolver(ABC): | ||
| """Interface for Quantum Real Time Evolution.""" | ||
|
|
||
| @abstractmethod | ||
| def evolve(self, evolution_problem: TimeEvolutionProblem) -> TimeEvolutionResult: | ||
| r"""Perform real time evolution :math:`\exp(-i t H)|\Psi\rangle`. | ||
|
|
||
| Evolves an initial state :math:`|\Psi\rangle` for a time :math:`t` | ||
| under a Hamiltonian :math:`H`, as provided in the ``evolution_problem``. | ||
|
|
||
| Args: | ||
| evolution_problem: The definition of the evolution problem. | ||
|
|
||
| Returns: | ||
| Evolution result which includes an evolved quantum state. | ||
| """ | ||
| raise NotImplementedError() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.