Bath compression#228
Open
kbidzhiev wants to merge 22 commits into
Open
Conversation
Merged
…into kb/bath_compression
kbidzhiev
commented
Apr 2, 2026
| from .math.brents_root_finding import find_root_brents | ||
| from .math.krylov_exp import krylov_exp, DEFAULT_MAX_KRYLOV_DIM | ||
| from .jump_lindblad_operators import compute_noise_from_lindbladians | ||
| from .math.brents_root_finding import find_root_brents |
Contributor
Author
There was a problem hiding this comment.
the file is sorted in alphabetic order
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In this PR, I introduce a new method for packing Hermitian objects of the shape (χ, m , χ), specifically energy baths.
The main idea is to avoid storing the full Hermitian matrix. Instead, we store only the lower triangular part, including the main diagonal. The upper triangular part can then be reconstructed from the lower triangular entries using complex conjugation. Lower triangular columns are stacked to$$\chi(\chi+1)/2$$
mvectors of lengthThis reduces the memory footprint of an$$\chi \times \chi$$ matrix from $$\chi^2$$ to $$\chi(\chi+1)/2$$ .
The PR closes #95
(I've tried decompositions like
SVD,eigh,cholesky. No compression, baths are ~full rank tensors)the following part contains results for 5x5
quench_performance_gpufrom our benchmark suit.Memory measurement is done with
get_max_rssin emu_base/utils.py, which is usingtorch.cuda.max_memory_allocated(...). In the following I'm going to tests the new code with.memory_allocated(...)vs.max_memory_allocated(...)Results
torch.cuda.memory_allocated(...):Returns the current GPU memory occupied by tensors in bytes for a given device.torch.cuda.max_memory_allocated(...): <- MAX allocation:Return the maximum GPU memory occupied by tensors in bytes for a given device. By default, this returns the peak allocated memory since the beginning of this program.NB on performance.
every Hermitean bath tensor is validated on hermiticity. That can be weakened
Outcome
The real GPU memory occupation is reduced asymptotically by factor 2, though the peak memory occupation is still high and is not addressed here. The peak memory is hidden in operator application in Krylov routines