Researchers Martin Schuck, Alexander von Rohr, and Angela P. Schoellig have introduced a significant update to the SciPy library that promises to streamline 3D transformations in machine learning workflows. Their work focuses on enhancing the spatial.transform module, making it compatible with various array libraries, including JAX, PyTorch, and CuPy. This update is crucial for fields like robotics, vision, and simulation, where accurate 3D rigid-body transformations are essential.
The researchers highlight that implementing numerically robust and mathematically correct 3D transformations, particularly on the special orthogonal group SO(3), is fraught with challenges. Issues such as axis conventions, normalizations, and composition consistency can lead to subtle errors that are difficult to detect. The SciPy library has long been a reliable resource for these transformations, but its previous limitation to NumPy has restricted its use in modern, GPU-accelerated, and autodiff-based workflows.
The overhaul of the spatial.transform module addresses these limitations by making it compatible with any array library that implements the Python array API. This means that users can now leverage the power of GPU/TPU execution, JIT compilation, vectorized batching, and differentiation via native autodiff of their chosen backend. The updated implementation maintains the familiar SciPy interface, ensuring a smooth transition for existing users.
The researchers demonstrate the capabilities of this enhanced module through two case studies. The first case study focuses on the scalability of 3D transforms and rotations, showcasing the module’s ability to handle large-scale computations efficiently. The second case study involves a JAX drone simulation that utilizes SciPy’s Rotation for accurate integration of rotational dynamics. These examples highlight the practical applications of the updated module in real-world scenarios.
The contributions made by Schuck, von Rohr, and Schoellig have been merged into the SciPy main branch and will be included in the next release. This update provides a framework-agnostic, production-grade basis for 3D spatial math in differentiable systems and machine learning. By enabling seamless integration with various array libraries, the enhanced spatial.transform module is poised to become an indispensable tool for researchers and developers in the fields of robotics, vision, and simulation. Read the original research paper here.

