Skip to content

More efficient handling of overlap matrices - #127

Merged
andreagrisafi merged 6 commits into
masterfrom
overlap-disk-ram-opt
Sep 30, 2026
Merged

andreagrisafi merged 6 commits into
masterfrom
overlap-disk-ram-opt

Conversation

@agustinsalcedo

@agustinsalcedo agustinsalcedo commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

The overlap matrices are large and take up a lot of RAM and disk space. Two main modifications related to this have been implemented in this branch:

  • Now salted.cp2k.density_fitting saves only the lower triangle of the overlap matrices, using the new save_overlap function, taking advantage of the fact that they are symmetric. When these matrices are read by salted.validation, salted.hessian_matrix and salted_minimize_loss, the full matrix is reconstructed by the load_overlap function. Note that load_overlap ensures backward compatibility, it can distinguish between lower-triangle matrices and full matrices and read them accordingly.
  • The line del over, psivec added to salted.hessian_matrix prevents the script from storing two copies of the overlap matrices at the same time in RAM.

Other minor changes are:

  • More timers to make the verbose output of salted.hessian_matrix more detailed.
  • Re-formatting of the code using Ruff.

@andreagrisafi
andreagrisafi merged commit 9e100de into master Sep 30, 2026
7 checks passed
@andreagrisafi
andreagrisafi deleted the overlap-disk-ram-opt branch September 30, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants