Efficient generation of random rotation matrices in four dimensions

Phys Rev E. 2023 Sep;108(3-2):035307. doi: 10.1103/PhysRevE.108.035307.

Abstract

Four-dimensional (4D) rotations have applications in the fields of robotics, computer vision, and rigid-body mechanics. In the latter, they can be used to transform between equimomental systems of point masses. Here we provide an efficient algorithm to generate random 4D rotation matrices covering an arbitrary, predefined range of rotation angles. These matrices can be combined with Monte Carlo methods for the efficient sampling of the SO(4) group of 4D rotations. The matrices are unbiased and constructed such that repeated rotations result in uniform sampling over SO(4). The algorithm can be used to optimize the mass partitioning in coarse-grained simulation models of molecules involving coupled constraints for stable time integration.