All of the math you are trying to do here could be simplified by using Grassmann.jl multivectors instead of matrices. It encodes both rotational algebras as well as spacetime geometry, so that matrices are no longer needed for that.
Perhaps you could demo a rewrite of the existing code in Grassmann so we can see it in action?
Sure, I’m writing a few papers to explain how to use groups in Grassmann and doing some other work but I don’t currently have time for blog-post style things. I have my own specific problems right now to deal with. When I’m ready publish it, there will be a much longer paper explaining how to work with Lie subgroups and vector fields… I promise it is all simply powered by the geometric algebraic product in various ways. There are lots of resources out there for understanding this already and I definitely am working on writing various extended papers on applications… however, my applications may not be open source like Grassmann.jl
I just meant a direct translation of these 20 lines of code (which might be shorter with the extra simplicity from Grassmann), not a big blog post. But I understand if you are busy with other things.
I don’t necessarily disagree, lacking familiarity with geometric algebra, but the snippets above are part of a coupled-dipole method which at its core consists of solving a linear system of, unsurprisingly, coupled-dipole equations. So I think some use of matrices is warranted, though I imagine that constructing the interaction matrix block by block using alternatives to matrices could be advantageous.
If you have some references of using Grassmann in electromagnetic modelling, I’ve always had some curiosity for the topic.
The standard reference for that would be
Offtopic, but my recollection is that Grassman-algebra formulations of electromagnetism are mainly useful in vacuum. Once you have matter, e.g. for scattering problems, the matter sets a preferred reference frame and wedge-product-type formulations (while possible) become extremely cumbersome. As a result, they are virtually never used outside of GR and high-energy physics, since most other interesting applications of electromagnetism involve interactions with materials.
Scattering type problems are actually related to what I study, which is acoustic and microwave scattering and soliton particles. If you use projections and spin groups from a higher dimensional Grassmann cone, it actually gets less cumbersome to linearize geometrically, at least for multi-layer optics type scattering.
If you only talk about Grassmann algebra… then you are not talking about geometric algebra yet… so yea it might be cumbersome if you don’t know Clifford algebra also. The geometric product is what really sets the foundation… Grassmann alone did a lot but you also need to add other things to the algebra.
Please go ahead and study scattering in whatever way you like best though, I just like trying out different ways and will be publishing some about it in the future.