TRIQS / nda

C++ library for multi-dimensional arrays
https://triqs.github.io/nda
Other
13 stars 11 forks source link

Fast small matrix inversions #27

Closed harrisonlabollita closed 1 year ago

harrisonlabollita commented 1 year ago

This PR implements analytic expressions for the inversion of square matrices of size 2 and 3. In TRIQS, one often has to do many small matrix inversions when summing over the Brillouin zone. Attached are benchmarks for a matrix of size 3 (Nk denotes the number of points that are being summed).

Here, inverse_in_place refers to the corresponding LAPACK matrix inversion routine and inverse3_in_place is the new matrix inversion implementation for a square matrix of size 3.

sumk_nda_small_inv_benchmark.pdf

Wentzell commented 1 year ago

Thank you @harrisonlabollita for this improvement!