hera_sim.utils.matmul

hera_sim.utils.matmul(left: ndarray, right: ndarray, use_numba: bool = False) ndarray[source]

Helper function for matrix multiplies used in mutual coupling sims.

The MutualCoupling class performs two matrix multiplications of arrays with shapes (1, Nfreqs, 2*Nant, 2*Nant) and (Ntimes, Nfreqs, 2*Nant, 2*Nant). Typically the number of antennas is much less than the number of frequency channels, so the parallelization used by numpy’s matrix multiplication routine tends to be sub-optimal. This routine–when used with numba–produces a substantial speedup in matrix multiplication for typical HERA-sized problems.

Parameters:
  • left, right – Input arrays to perform matrix multiplication left @ right.

  • use_numba – Whether to use numba to speed up the matrix multiplication.

Returns:

prod – Product of the matrix multiplication left @ right.

Notes