Add WindowMPOHamiltonian enabling propagators and dynamical DMRG on WindowMPS#417
Conversation
|
Your PR no longer requires formatting changes. Thank you for your contribution! |
Codecov Report❌ Patch coverage is
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
lkdvos
left a comment
There was a problem hiding this comment.
Looks good to me! I left some minor comments but otherwise I'm happy to merge this and go from there
|
I added a windowmps constructor that takes in a unitrange, similar to windowmpohamiltonian. |
|
Looks good to me! I rebased on the latest main to hopefully resolve the errors in the tests, but if it works I'll just merge this so it is included in the next release, which I hope to get out today. |
|
I forgot that I still want to write some docstring referencing exactly what propagator returns, I wouldn't merge just yet |
2f5c16d to
161c540
Compare
The WindowMPOHamiltonian environments method must call initialize_environments on the finite Hamiltonian (there is no environments(::WindowMPS, ::FiniteMPOHamiltonian, ...) method), and expose leftstart/rightstart as keywords so squaredenvs (Jeckelmann flavour) can pass squared boundary environments through. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Fix `+`/`-` on WindowMPOHamiltonian: the finite window carries full Jordan virtual spaces on its boundaries, so summands must be block-diagonalized at every site (including edges), like InfiniteMPOHamiltonian addition. Add a dedicated `_add_finite_window` helper and a `VectorInterface.scale` method so unary `-`, scalar `*`/`/` work through the AbstractMPO fallbacks. - Avoid spurious non-convergent fixed-point solves in `squaredenvs`: inline the `leftstart`/`rightstart` defaults in the WindowMPOHamiltonian environments method so the infinite environment of e.g. `conj(H) * H` is only computed when no explicit boundaries are passed. - Attach and clean up the WindowMPOHamiltonian docstring (was silently detached), document the interval constructors of WindowMPOHamiltonian and WindowMPS, and fix the propagator/DynamicalDMRG docstrings (return value + LaTeX). - Add test/operators/windowhamiltonian.jl covering non-trivial intervals (circshift alignment via offset invariance) and the linear algebra. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add two Hamiltonians with different Jordan bond dimensions (Ising ZZ string vs XY hopping) so the boundary/bulk virtual spaces of the summands differ and must be block-diagonalized consistently, checking expectation-value additivity in both orders. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a
WindowMPOHamiltonian: the operator counterpart of aWindowMPS, a finite window embedded between infinite left/right "bath" Hamiltonians.This resolves the pain points from #411, where
propagator/dynamical DMRG could not run on aWindowMPS.What was wrong
A
WindowMPShas a finite window but infinite environments.Slicing an
InfiniteMPOHamiltonianinto aFiniteMPOHamiltoniandoes not impose trivial finite boundary conditions, soenvironments/squaredenvshit aSpaceMismatch.There was also no finite energy reference for
z(the true ground-state energy is extensive).What this adds
WindowMPOHamiltonian(H::InfiniteMPOHamiltonian, interval)— carves a finite window out of an infinite Hamiltonian, keeping the boundary Hamiltonians and circshifting their unit cells to align with the window.environments(::WindowMPS, ::WindowMPOHamiltonian)— builds finite env caches with boundaries from the infinite fixed-points; explicitleftstart/rightstartavoid the fixed-point solve forconj(H)*H.propagator/squaredenvsaccept aWindowMPS+WindowMPOHamiltoniandirectly; docstrings corrected to the1/(z-H)convention and Jeckelmann functional (14).expectation_value,dot, and linear algebra (+,-,*,scale,conj) forWindowMPOHamiltonian;WindowMPS(ψ, interval)constructor with aligned environments.AC_hamiltonian/AC2_hamiltonian) forward to the finite window so DMRG/TDVP/propagator use the Jordan-optimized operators.WindowMPS(both flavours, vs analytic result), window-Hamiltonian linear algebra + circshift-offset invariance, andfind_groundstate/timestepon windows.Remaining work / limitations
AbstractMPOinterface coverage (only the pieces used here are wired).InfiniteMPOHamiltonianwindows (no dense-MPO windows yet).propagator.Closes #411