-
Notifications
You must be signed in to change notification settings - Fork 32
Add keyword argument assume_hermitian to liouvillian
#581
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
Conversation
liouvillianassume_hermitian to liouvillian
|
I think we need to set compat |
|
Ok, I made a PR in SciMLOperators.jl This fixes all the benchmark regressions. I don't understand if the Zygote and Enzyme autodiff are also fixed. We should see it once we re-trigger the benchmarks. |
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.
Pull Request Overview
This PR adds a keyword argument assume_hermitian to the liouvillian function, aligning with QuTiP v5.2.1's generalized Liouvillian definition. This allows users working with non-Hermitian physics to disable the Hermitian assumption for Hamiltonians.
- Modified the
liouvillianfunction to acceptassume_hermitianparameter (default:Val(true)) - Updated internal
_liouvillianimplementations to handle both Hermitian and non-Hermitian Hamiltonians - Upgraded SciMLOperators dependency from 1.4 to 1.11 to support updated operator representations
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/qobj/superoperators.jl | Core implementation of assume_hermitian parameter for Liouvillian construction, including updated documentation and optimized tuple handling for collapse operators |
| src/time_evolution/mesolve.jl | Updated to use QuantumObjectEvolution constructor for consistency |
| src/time_evolution/time_evolution_dynamical.jl | Adapted to SciMLOperators 1.11 changes (MatrixOperator → ScaledOperator), updating field access from .A to .L |
| test/core-test/quantum_objects_evo.jl | Added comprehensive tests for assume_hermitian parameter, including operator structure verification and type inference tests |
| test/core-test/time_evolution.jl | Added integration tests for assume_hermitian = Val(false) with time-dependent Hamiltonians; updated operator type assertions for SciMLOperators 1.11 |
| test/ext-test/cpu/autodiff/autodiff.jl | Extended autodiff tests (Zygote and Enzyme) to verify compatibility with non-Hermitian Liouvillians |
| Project.toml | Bumped SciMLOperators version requirement from 1.4 to 1.11 |
| CHANGELOG.md | Documented the new assume_hermitian feature |
| src/settings.jl | Minor whitespace cleanup |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Checklist
Thank you for contributing to
QuantumToolbox.jl! Please make sure you have finished the following tasks before opening the PR.make test.juliaformatted by running:make format.docs/folder) related to code changes were updated and able to build locally by running:make docs.CHANGELOG.mdshould be updated (regarding to the code changes) and built by running:make changelog.Request for a review after you have completed all the tasks. If you have not finished them all, you can also open a Draft Pull Request to let the others know this on-going work.
Description
Start from
QuTiP v5.2.1, they have generalize the definition ofliouvillianassee also the PR in
qutip: qutip/qutip#2658That is, we should at least allow users to disable the assumption that the Hamiltonian is Hermitian. This could be beneficial for people working on non-Hermitian physics.