cherab / core

The core source repository for the Cherab project.
https://www.cherab.info
Other
44 stars 24 forks source link

Consider sparse-aware routines for bolometry inversions #440

Open jacklovell opened 3 months ago

jacklovell commented 3 months ago

Following on from https://github.com/cherab/core/pull/439#issuecomment-2120494947:

The bolometry demos use cherab.tools.inversions.invert_regularised_nnls, since in the past this has produced the most reasonable-looking inversions in test cases using all the available Cherab inversion routines (least squares, NN least squares, SART). However, bolometer geometry matrices (and regularisation operators) are typically very sparse and so algorithms developed for inverting dense matrices may not be optimal.

Switching to scipy.optimize.lsq_linear, which can use the LSMR algorithm for computing sparse matrix inverses, potentially offers several benefits:

i'll have a play with some test cases to see whether it's worthwhile providing additional inversion routines in Cherab which better deal with sparse cases and report back.