I have implemented a basis transformation in C of the following form


where A and B are matrices and kron is the Kronecker product.

However, my naive code is not scalable, and I am looking for a library to achieve this. My starting point was to look in BLAS and LAPACK for Kronecker products and basis contractions (ie. B*A*Transpose[B]) but from my reading of the documentation these are not in the standard build, is there an efficient way to achieve this using these packages (in particular the contraction)?

  • $\begingroup$ How large are your matrices? $\endgroup$ Aug 6 '15 at 19:32
  • $\begingroup$ If $A$ is suitably large, it may make sense to just perform the multiplication block-wise directly with gemm. $\endgroup$
    – Kirill
    Aug 6 '15 at 21:28

To the best of my knowledge, you are correct that there is no two-sided matrix multiplication routine $BAB^T$ in BLAS/LAPACK (but I could easily have missed it).

For the symmetric case, I have found code for this operation in Slicot and Elemental. The latter is a library for parallel linear algebra, so it is a different setting. If you can get your hands on a copy of MB01RD from Slicot, it should be best suited to your needs. The library is available free of charge for academic users.

If the matrix $C$ in $BCB^T$ is symmetric, then another possibility is changing your algorithm to work with symmetric factors of $C$, for instance $C=LDL^T$ with $D$ diagonal. Now to perform your two-sided conjugation you only have to replace $L$ with $BL$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.