Decomposition of bivectors in python

As a part of a project, I have to solve the following problem and I wondered if one can use the clifford library in python to solve it efficiently: It is known that every bivector of R^4 can be written as the sum of two (orthogonal) simple bivectors, i.e. the sum of two wedge products. Is there a way of calculating this decomposition using the clifford library? Is it also possible to find a decomposition into orthogonal simple bivectors?

I can’t speak to clifford, but the general algorithm is laid out in @LeoDorst’s book chapter “A Guided Tour to the Plane-Based Geometric Algebra.” The part you’re interested in begins around page 44.

[Edit: paper title]

we do have a function, in clifford.tools.rotor_decomp, which i think will work for you.

Rotor decomposition of rotor V

Given a rotor V, and a vector x, this will decompose V into a
series of two rotations, U and H, where U leaves x
invariant and H contains x.

Limited to 4D for now.

See :cite:`hestenes-space-time`, Appendix B, Theorem 4.

Ah we also have a method that does this in Clifford.tools.g3c.rotor_parameterisation I think. We use it as part of the log of a 3d CGA bivector… We should really just implement the arbitrary signature method and be done with the special cases!

It’s a bit late, but I’ve posted on Discord a general procedure to calculate the bivector invariant decomposition. The procedure is based on the eig function of matlab, and the code works in matlab or octave. BICV1.m. I tested it with random bivectors in many signatures. Like all eigenvector-based calculations, it relies on the eigenvalues being distinct. If you have eig function in python, it should be an easy conversion.