Currently the mode overlaps are computed with vectorized numpy matrix inner products. However, various modes and various layers are accessed via lots of loops (literal while and for loops). There could be some speed improvements if we vectorize the entire process. Or conditional vectorization based on the optical resolution of each 2d grid. If it's super dense, vectorizing across modes as well may require too much memory.
Currently the mode overlaps are computed with vectorized numpy matrix inner products. However, various modes and various layers are accessed via lots of loops (literal while and for loops). There could be some speed improvements if we vectorize the entire process. Or conditional vectorization based on the optical resolution of each 2d grid. If it's super dense, vectorizing across modes as well may require too much memory.