-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Trotterization-based Quantum Real Time Evolution #7411
Conversation
# Conflicts: # qiskit/opflow/primitive_ops/primitive_op.py
…re-trotter-qrte-2
…re-trotter-qrte-2
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the initializer we can currently set the attributes to None
but the getters and setters typehints indicate that a value is always returned. Could we make the getters and setters consistent and indicate that also None
can be returned? Probably the getter typehints should then also support None
🙂
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
* Introduced time evolution classes and interfaces. * Migrated trotterization as trotterization builder. * Implemented enum for trotterization mode; fixed imports. * Implemented trotter_qrte.py with unit tests. * trotter_qrte.py repetitions added. * Code refactoring. * Code refactoring. * Gradient object introduced in a signature. * Draft of trotter_qrte.py gradient with unit tests. * trotter_qrte.py improvements; unit tests extended. * trotter_qrte.py improvements; unit tests extended. * Trotter test fix. * Fixed float and complex handling. * qrte with product formula * Removed irrelevant files. * Removed irrelevant files. * Extended docs. * Removed outdated unit tests. * Removed outdated files. * Code refactoring, docs extended. * Code refactoring. * Updated unit tests. * Code refactoring, extended docs and typehints. * Reno added. * Extended checks and unit tests. * Code refactoring. * Code refactoring. * fix problem with test * Docs extended. * Added support for PauliOp, code refactoring. * Implemented general Quantum Time Evolution Framework interfaces. * Updated docs. * Reno added. * Improved reno. * Code refactoring. * Update qiskit/algorithms/time_evolution/evolution_base.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Code refactoring. * Introduced evolution problem classes. * Code refactoring. * Apply suggestions from code review Co-authored-by: Julien Gacon <gaconju@gmail.com> * Added unit tests. * Lint fixed. * Code refactoring * Code refactoring * Code refactoring * Code refactoring * Code refactoring * Code refactoring * Code review changes. * Removed gradient code for now. * Code review refactoring. * Removed gradient code for now. * Evolving observable removed. Evaluating observables added. * Code refactoring. * Improved naming. * Improved folder structure; filled evolvers init file. * Added Evolvers to algorithms init file. * Fixed missing imports. * Code refactoring * Fixed cyclic imports. * Extracted ListOrDict. * Code refactoring. * Code refactoring. * Fixed release note. * Fixed inheritance order. * Updated code to the latest time evolution interface. * Code refactoring. * Code refactoring. * Code refactoring. * Fixed cyclic imports. * Fixed pylint. * Name fix. * Import fix. * Lint fix. * Lint fix. * Code refactoring. * Extracted and refactored aux_ops_evaluator.py * Code refactoring * Implemented unit test. * Extended unit test. * Date fixed. * Reno added. * Switched to bound ansatz. * Fix reno. * Added docs. * Refactored unit test. * Lint fixed. * Code review edits. * Added unit test cases for dicts. * Fixed reno reference. * Improved unit test. * Added quantum instance support. * Added support for aux_ops and unit test. * Fixed input object to eval_observables. * Fixed quantum_state types and conversion. * Fixed quantum_state types and conversion. * Fixed types and docs. * Code refactoring. * Lint fix. * Code refactoring. * Reno update. * Code refactoring. * Implemented some CR feedback. * evolution_problem.py fix * Removed trotter_ops_validator.py for now, extended unit tests, code refactoring. * Updated names of the algorithm. * Added support for QuantumCircuit input. Code refactoring. * Improved error handling in evolution_problem.py and unit tests added. * Code refactoring. * Cyclic import fix * Refactored evolution_problem.py * Refactored test_trotter_qrte.py * Removed global tolerance. * CI fix. * Code review fixes. * Code refactoring. * Prepared qasm unit test. * Removing state eval. * Refactored and updated tests. * Added qasm test for aux ops. * Added param binding test. * Added missing setters. * Updated unit tests. * Improved folder structure. * Updated interfaces. * Fix lint. * Removed legacy (soon) BaseBackend. * Updated copyright years. * Added example to reno. * Fixed reno. * Removed BaseOperator. * Code refactoring. * Imports fix. * Delayed parameters checks. * Update qiskit/algorithms/evolvers/evolution_problem.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Code refactoring. * Update qiskit/algorithms/evolvers/evolution_problem.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Expectation might be None Co-authored-by: acv@zurich.ibm.com <acv@zurich.ibm.com> Co-authored-by: Julien Gacon <gaconju@gmail.com>
* Introduced time evolution classes and interfaces. * Migrated trotterization as trotterization builder. * Implemented enum for trotterization mode; fixed imports. * Implemented trotter_qrte.py with unit tests. * trotter_qrte.py repetitions added. * Code refactoring. * Code refactoring. * Gradient object introduced in a signature. * Draft of trotter_qrte.py gradient with unit tests. * trotter_qrte.py improvements; unit tests extended. * trotter_qrte.py improvements; unit tests extended. * Trotter test fix. * Fixed float and complex handling. * qrte with product formula * Removed irrelevant files. * Removed irrelevant files. * Extended docs. * Removed outdated unit tests. * Removed outdated files. * Code refactoring, docs extended. * Code refactoring. * Updated unit tests. * Code refactoring, extended docs and typehints. * Reno added. * Extended checks and unit tests. * Code refactoring. * Code refactoring. * fix problem with test * Docs extended. * Added support for PauliOp, code refactoring. * Implemented general Quantum Time Evolution Framework interfaces. * Updated docs. * Reno added. * Improved reno. * Code refactoring. * Update qiskit/algorithms/time_evolution/evolution_base.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Code refactoring. * Introduced evolution problem classes. * Code refactoring. * Apply suggestions from code review Co-authored-by: Julien Gacon <gaconju@gmail.com> * Added unit tests. * Lint fixed. * Code refactoring * Code refactoring * Code refactoring * Code refactoring * Code refactoring * Code refactoring * Code review changes. * Removed gradient code for now. * Code review refactoring. * Removed gradient code for now. * Evolving observable removed. Evaluating observables added. * Code refactoring. * Improved naming. * Improved folder structure; filled evolvers init file. * Added Evolvers to algorithms init file. * Fixed missing imports. * Code refactoring * Fixed cyclic imports. * Extracted ListOrDict. * Code refactoring. * Code refactoring. * Fixed release note. * Fixed inheritance order. * Updated code to the latest time evolution interface. * Code refactoring. * Code refactoring. * Code refactoring. * Fixed cyclic imports. * Fixed pylint. * Name fix. * Import fix. * Lint fix. * Lint fix. * Code refactoring. * Extracted and refactored aux_ops_evaluator.py * Code refactoring * Implemented unit test. * Extended unit test. * Date fixed. * Reno added. * Switched to bound ansatz. * Fix reno. * Added docs. * Refactored unit test. * Lint fixed. * Code review edits. * Added unit test cases for dicts. * Fixed reno reference. * Improved unit test. * Added quantum instance support. * Added support for aux_ops and unit test. * Fixed input object to eval_observables. * Fixed quantum_state types and conversion. * Fixed quantum_state types and conversion. * Fixed types and docs. * Code refactoring. * Lint fix. * Code refactoring. * Reno update. * Code refactoring. * Implemented some CR feedback. * evolution_problem.py fix * Removed trotter_ops_validator.py for now, extended unit tests, code refactoring. * Updated names of the algorithm. * Added support for QuantumCircuit input. Code refactoring. * Improved error handling in evolution_problem.py and unit tests added. * Code refactoring. * Cyclic import fix * Refactored evolution_problem.py * Refactored test_trotter_qrte.py * Removed global tolerance. * CI fix. * Code review fixes. * Code refactoring. * Prepared qasm unit test. * Removing state eval. * Refactored and updated tests. * Added qasm test for aux ops. * Added param binding test. * Added missing setters. * Updated unit tests. * Improved folder structure. * Updated interfaces. * Fix lint. * Removed legacy (soon) BaseBackend. * Updated copyright years. * Added example to reno. * Fixed reno. * Removed BaseOperator. * Code refactoring. * Imports fix. * Delayed parameters checks. * Update qiskit/algorithms/evolvers/evolution_problem.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Code refactoring. * Update qiskit/algorithms/evolvers/evolution_problem.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update qiskit/algorithms/evolvers/trotterization/trotter_qrte.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Expectation might be None Co-authored-by: acv@zurich.ibm.com <acv@zurich.ibm.com> Co-authored-by: Julien Gacon <gaconju@gmail.com>
Summary
This PR introduces the Trotterization-based Quantum Real Time Evolution algorithm.
ProductFormula
andPauliEvolutionGate
implementations.It closes the following epic:
And includes the following issue:
And also:
Details and comments
There are still some minor TODOs indicated in the code:
PauliOp
andOperatorBase
and their dependence on parameters.The replacement of current Trotter algorithms (in places where they are used) by this algorithm will happen in a separate PR.
To allow time-dependent Hamiltonians supported in this PR, there will be a separate PR prepared. Currently, an error message is thrown in case of time-dependent Hamiltonians.