mfherbst / ReducedBasis.jl

Reduced basis methods for parametrised eigenproblems
https://mfherbst.github.io/ReducedBasis.jl/stable/
MIT License
14 stars 0 forks source link

Snapshot truncation of offline objects #33

Open pbrehmer opened 1 year ago

pbrehmer commented 1 year ago

To check for the stability of a RB surrogate, it is essential to be able to remove snapshots from an RBasis and other offline quantities such as HamiltonianCache and AffineDecompositions.

With AffineDecompositions we face the difficulty that currently only the $B^\dagger O_r B = V^\dagger \Upsilon^\dagger O_r \Upsilon V$ terms are computed. However, to truncate snapshot-wise, we need to access the $\Upsilon^\dagger O_r \Upsilon$ matrix elements.

To solve this issue, we could include a keyword argument, such that compress(ad::AffineDecomposition, basis::RBasis; return_matrix_elements=false). If return_matrix_elements=true, the function would return also an AffineDecomposition with untransformed matrix elements as terms.

pbrehmer commented 1 year ago

This is now mostly implemented in PR #34, however there is also one feature missing: There should be an object that does not contain the snapshots $\Psi_i$, nor the snapshot applications $H\Psi_i$, since these can become very memory intensive in realistic simulations. Then we could have a truncate(object, basis_trunc) which would conveniently truncate all relevant quantities (aside from the problem-specific observables) in the online stage.

Another thing which should be added in the future is an example showcasing the truncation functionality in a somehow pedagogic way, i.e. something like a "Basis analysis during the online stage" example.