1

I understand how bivectors can be used to represent rotations in 2 and 3 dimensions, where we start with a normalized bivector which defines the plane of rotation and an angle through which to rotate points. (I'm assuming rotations about the origin because it's simpler to understand).

I also understand that in 4+ dimensions, bivectors are not necessarily "simple" (they cannot be represented by a single wedge product of vectors). Unfortunately, this shift in complexity happens after I'm able to visualize the rotations, so I'm having trouble extending the notion to higher dimensions. I know there are single and double rotations in 4 dimensions (Wikipedia). I think, but am not sure, that these cover the cases where the bivector of the rotation is simple or not?

So here's my thought for randomly sampling rotations in higher dimensions (without having to generate massive matrices and factor them):

  • Generate a bivector $B$ by sampling the standard basis coefficients (which I think in $n$ dimensions there should be $n \choose 2$ of) from the surface of a hypersphere (so that the coefficients are normalized)
  • Generate an angle $\theta$ in $[0, 2\pi)$
  • Build the rotor $R = e^{B/2}$ associated with the two (interior part $\cos(\theta/2)$ and exterior parts $\sin(\theta/2) B$)
  • Rotating a vector $v$ is accomplished by doing the geometric product $R v R^{-1}$, where $R^{-1}$ simply has the coefficients of the the exterior part negated

Is this a good approach? Am I misunderstanding something fundamental? My main sources for learning were this great interactive post and the Wikipedia page on bivectors. My main goal is for doing random rotations in Euclidean spaces, but it would be very cool if this approach could be extended to more general manifolds.

miak
  • 11
  • It might be worth noting that what you're describing is essentially equivalent to exponential coordinates, with bivectors corresponding to elements of $\mathfrak{so}(n)$. – Kajelad Dec 05 '20 at 22:08
  • @Kajelad I'm not very familiar with abstract algebra. Is there a short-ish introductory explanation to exponential coordinates and how they might be useful? It's important that I'm able to sample a rotation uniformly. – miak Dec 05 '20 at 22:13
  • I'm not sure of a succinct reference for exponential coordinates, but for uniformly (Haar) distributed orthogonal matrices, it seems that exponential methods aren't so common. The references in this section describe some of the common algorithms. – Kajelad Dec 05 '20 at 22:45

2 Answers2

1

The exponential of an arbitrary bivector $B$ in a $n$-D geometric algebra is a multivector called a versor. A versor is an operator that transforms a vector to a vector, or the (sub-)space as a whole. In a nutshell, versors represents orthogonal transformations.

As a multivector, a versor is represented as a sum of k-vectors. We call it an odd versor if k is odd and even versor if k is even. If we consider the algebra of sub-spaces (i.e., lines and planes passing through the origin) then odd versors represents reflections and even versors represents rotations.

You want to construct even versors. That means, to construct a rotor the exponential must be a 2-blade (2-blade is not the same as 2-vector). Since 2-blades coincide with bivectors in 2-D and 3-D, you don't need to care about those distinctions in those dimensions. But in 4 and more dimensions that is not the case. However, Riesz shows that in the Euclidean space $R^{n,0,0}$ (the space of your interest) a rotor can be expressed as the exponential of an arbitrary bivector. The reason is that in that n-dimensional Euclidean space, an arbitrary bivector can be written as the sum of $commuting$ 2-blades.

Also, in a Euclidean $R^{n,0,0}$ space, a rotor is the geometric product of an even number of unit vectors. So you can also do this to generate random rotors.

  • Thanks for the response! On the Wikipedia page for bivectors, it associates simple bivectors with simple rotations in 4D and general bivectors with double rotations. If I generate rotations only with 2-blades instead of from bivectors, won't I be excluding some rotations in higher dimensions? – miak Dec 06 '20 at 03:59
  • Yes, the simple bivector (2-blade) will generate rotations around hyperplane. You will need two rotations to cover all SO(4) or use a non-simple bivector. See this question as to why this is true https://math.stackexchange.com/questions/1402362/rotation-in-4d – Mauricio Cele Lopez Belon Dec 06 '20 at 12:48
  • Yes, I understand that part. What I'm confused about is why you said I need to construct exponentials of 2-blades (simple 2-vectors), but also that to generate all of SO(4) I need non-simple 2-vectors or two rotations. As my goal is to randomly sample from all possible rotations—like in this post: https://math.stackexchange.com/questions/3839152/sample-a-random-rotation-in-n-dimensions, but with geometric algebra to avoid computing the QR decomposition—don't I need to sample from all possible unit bivectors, not just 2-blades? – miak Dec 06 '20 at 17:41
  • Yes rotors are exponentials of 2-blades. It is just that in $R^{n,0,0}$ non-simple bivector $B$ can be written as sum of commuting 2-blades $B_1$ and $B_2$. Since $B_1$ and $B_2$ commutes then $B_1 B_2 = B_2 B_1$. Then $e^B = e^{B_1+B_2} = e^{B_1} e^{B_2}$. So exponential of general bivector is actually the concatenation of two rotors (hence a rotor) and can cover all SO(4). – Mauricio Cele Lopez Belon Dec 06 '20 at 18:01
  • But can single exponentials of 2-blades cover all of SO(n) without concatenation? I understand that taking exponentials of 2-vectors will still produce rotations, but I'm concerned with uniformly sampling any possible rotation. – miak Dec 06 '20 at 18:26
  • From wikipedia article that you shared I understand that you need both, rotations around an hyperplane, using exponential of 2-blades, and rotations around the origin (leaving two invariant planes which are orthogonal to each other and, hence, commute), using exponential of 2-vectors. But since 2-blades are just special case of 2-vectors, then 2-vectors are sufficient. – Mauricio Cele Lopez Belon Dec 06 '20 at 21:52
0

In N dimensions, the representation of rotations using the minimum set of floor(N/2) rotation angles that you describe is nontrivial, whereas using N(N-1)/2 Euler angles you can straightforwardly uniformly cover the space of orientations.

This is a very interesting problem, the structure of SO(N) in terms of these minimal rotations. Sorry for editing my answer several times.

Apparently this is called "Weyl integration", using the angle eigenvalues as integration variables.

It is not clear what you mean by "uniformly sampled" (U.S.) rotations. I presume that uniformly sampling orientations (uniformly covering SO(N)) is what you mean.

Uniformly covering SO(N) is easy: to randomly uniformly cover SO(N) you just need to generate random spherical vectors, see below + link.

Uniformly sampling orientations is NOT the same as uniformly covering the floor(N/2) angles! It is very different. SO(N) is populated mostly by matrices whose angle eigenvalues are different. The angles repel one another.

If you follow the construction below and compute eigenvalues to extract the minimal floor(N/2) angles, you can this structure, how the eigenvalues repel one another. If you choose random rotation planes and floor(N/2) angles independently then you will not uniformly cover SO(N). You will grossly over-sample points near your starting orientation. You need to do the Weyl integration properly with the proper weight (see below).

This minimal set of floor(N/2) rotation angles corresponding to pairs of conjugate eigenvalues and bivectors are defined always [0,pi]. (For N=2, instead of a random bivector you choose a random rotation direction +/-1.)

Consider N=3. For N=3 there is one rotation angle, and one rotation axis which must be uniformly sampled on the sphere.

For N=3, in (axis, angle) Weyl convention, the average cosine of the rotation angle must be -1/2 for the average trace of the 3D rotation matrices to be zero. The most compact quadrature for N=3 would use the single rotation angle 2pi/3 (120deg). A tetrahedron is sufficient; you can make four 120 degree rotation matrices that average to zero. That seems to be the minimum quadrature for N=3.

This is really interesting, considering Weyl integration by quadrature. I am thinking about regular uniform quadrature. But you are asking about randomly choosing the rotation planes (bivectors), a random Weyl quadrature. I would not do that. If you want to use random numbers, then I would just directly randomly quadrature SO(N), randomly choose vectors not bivectors, as I have done to produce the figure below.

To randomly, uniformly cover SO(N), I would directly generate a space of random orthogonal matrices SO(N), as I have done to examine its eigenvalue spectrum.

How to generate uniformly sampled random member of SO(N):

Generate N random spherical N-vectors and orthogonalize them. If the determinant is negative, flip the sign of the last vector.

How to generate a random spherical N-vector: The best way is to use normally distributed random numbers. Simply generate N normally distributed numbers each with mean 0 and variance 1 (normrnd in matlab).

So generate N random spherical N-vectors and put them in the columns of a NxN matrix. (Generate N^2 normally distributed random numbers)

If the determinant is negative, flip the sign of the last vector.

Then orthonormalize the rows and columns of the matrix (e.g. Gram-Schmidt)

Really it is sufficient to generate (N-1) random N-vectors and orthonormalize them; the Nth column of the rotation matrix is then determined.

This procedure generates nontrivial distributions of eigenvalues (rotation angles) for N>2, even and odd. For N odd, again, the average rotation angle is greater than pi/2.

.. with nAngles = M = floor(N/2),

empirically I find that the probability dtheta1 dtheta2.. dthetaM for a set of angles theta1 theta2 ..thetaM = [0,pi]

is proportional to

product_(i,j=1..M,i<j) (cos(theta_i)-cos(theta_j))^2

times product_i=1..M (1-cos(theta_i)) for odd N.

This is the Weyl integration metric (see link below). In other words, the eigenvalues strongly repel one another. You cannot simply choose M = floor(N/2) angles independently. That will not evenly cover SO(N).

In other words, with Weyl integration by quadrature, what you are talking about, the angles should be different to efficiently cover SO(N). At the lowest level of quadrature, use just one one operation defined by an evenly spaced, fixed set of rotation angles and vary the rotation planes (the orientation of that operation) to cover the sphere. (If you can do this systematically, you reduce the space that you have to cover by 2^N using Weyl quadrature. But you are talking about choosing the rotation planes randomly, so I don't think Weyl quadrature helps you).

For instance, choose these angles

N=3: 120

N=4: 0, 180

N=5: 60, 180

N=6: 0, 90, 180

N=7: 36, 108, 180

etc. For Weyl integration by quadrature, at the lowest level of quadrature, choose a single operation with M=floor(N/2) angles evenly spaced like that, so that the average trace of the rotation matrices is zero.

I include a plot of the distribution of the eigenvalues for SO(5): You can see how they cluster near (60,180).

https://i.sstatic.net/82mVQ.png

But again I don't really think this helps you. If you are going to choose the rotation planes randomly, then you might as well randomly quadrature SO(N) directly, not use Weyl quadrature as you are talking about (angle eigenvalues).

Here are some references I found

"ROTATION MATRIX SAMPLING SCHEME FOR MULTIDIMENSIONAL PROBABILITY DISTRIBUTION TRANSFER" - similar method to generate the random SO(N) matrix http://research.gistda.or.th/assets/uploads/pdfs/d45e9-31.rotation-matrix-sampling-scheme-for-multidimensional-probability-distribution-transfer.pdf

"Sampling sets and quadrature formulae on the rotation group" - I am not sure whether this is consistent https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.525.2150&rep=rep1&type=pdf

Using eigenvalues as the integration variables is the Weyl integration formula, see page 7, this has the (cos theta_i - cos theta_j)^2 factor

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.179.1333&rep=rep1&type=pdf

The eigenvalue spectrum of SO(n) reflects its "simple roots" apparently.. see figure 4, showing the root diagram for D2 = SO(4) and B2 = SO(5) here

http://sites.science.oregonstate.edu/~tevian/JOMA/joma_paper_softlinks.pdf

These root diagrams, the "simple roots" of the algebra reflect the most likely eigenvalue spectrum of the ensemble, correspond to the angles above