manif: The Lie Theory Library That Makes You Read the Paper First

A header-only C++ toolkit that turns micro Lie theory into a consistent API for robotics state estimation, with analytic Jacobians and no hidden conventions.

10 min read • View on GitHub • More from artivis

A wide editorial illustration of a roboticist's workbench. On the left, a thick open book covered in equations. On the right, a laptop showing a C++ header file. In the center, a small robot arm traces a smooth curve across a white sphere, and a single taut thread connects a formula in the book to a line of code on the screen. The scene depicts the bridge between a mathematics paper and its software implementation, the defining idea behind manif.
manif is the code half of a two-part project. The math half is a 17-page paper, and the README tells you to read it before you write a line.
Key Takeaways

The README That Sends You to a Paper

Most libraries open with a quickstart. manif opens with homework.

The README says it plainly: "We recommend every user of manif to read the paper (17 pages) before starting to use the library." That paper is Solà, Deray, and Atchuthan's "A micro Lie theory for state estimation in robotics."

That single instruction tells you what kind of project this is. manif is not trying to hide its conventions behind a friendly wrapper. It is trying to make the math usable, and it assumes you want to understand the math. In robotics state estimation, the conventions are the hard part. Rotations do not add. Poses do not subtract. Jacobians depend on where you define your perturbation. Get that wrong and your filter diverges.

manif is a Lie theory library for state-estimation targeted at robotics applications.

manif project, README description · artivis/manif README

From a Paper to Header-Only C++

manif is the code half of a two-part project. The math half is the micro Lie theory paper, a robotics-focused presentation of Lie groups that is careful about every convention. The paper is not a survey. It picks one consistent way to define things and sticks to it.

manif turns that presentation into a header-only C++11 library with Python 3 wrappers. Drop the headers into your project, link Eigen, and the groups are available. There is no build step for the library itself, which keeps it easy to vendor into an existing codebase.

The project was published in the Journal of Open Source Software as "Manif: A micro Lie theory library for state estimation in robotics applications," by Jeremie Deray and Joan Solà, under the MIT license. Deray is the primary maintainer.

What Is Actually in the Box

manif supports a set of groups that maps directly onto robotics problems:

For each group, manif provides the operations a filter or optimizer needs: exp and log maps, composition, inverse, the adjoint, plus and minus on the manifold, and analytic Jacobians for each of them. The unusual groups are part of the point. SE₂(3) and SGal(3) show up in inertial navigation, and many general-purpose geometry libraries stop at SE(3).

Why Rotations Do Not Add

Rotations are not vectors. Poses are not vectors. You cannot add two rotation matrices and get a meaningful rotation, and you cannot subtract two poses and get a displacement.

State estimation has to take derivatives anyway. A Kalman filter or a least-squares solver needs to nudge a state, measure the effect, and build a Jacobian. On a flat vector space that is easy. On a curved manifold it is where the whole problem lives.

The fix is to work in the tangent space. Pick a point on the manifold. At that point there is a flat tangent plane, and a small perturbation lives there as an ordinary vector. The exponential map takes that vector and lands you at a nearby point on the manifold. The logarithm map goes the other way.

The core mental model. A perturbation lives in the flat tangent space at the current estimate; the exp map carries it onto the manifold, and the log map brings it back. manif defines its Jacobians in this local frame.

The key choice is where the perturbation is defined. manif uses local tangent-space perturbations: the perturbation is applied at the current estimate, in the local frame. That is not the only convention. It is the one that keeps the Jacobians simple and consistent across operations, and it is the one the paper teaches.

The Jacobian Is the Product

What you actually pay for when you use manif is the Jacobians. Every operation ships with its analytic derivative, expressed with respect to local tangent-space perturbations.

That matters for two reasons. First, speed: analytic Jacobians are exact and cheaper than finite differences or runtime symbolic expansion. Second, consistency: every operation reports its derivative in the same convention, so the Jacobians compose without manual bookkeeping. When you chain operations in a filter update, you do not have to re-derive the chain rule by hand for each group.

A close-up editorial illustration of a single hand holding a pen and writing a matrix of numbers on a whiteboard. The matrix is only partly filled in. A thin arrow runs from one matrix entry to a small robot joint drawn on the right, and a second thin arrow runs from the same entry to a line of code on a laptop drawn on the left. The image makes the analytic Jacobian tangible as the bridge between the mathematics and the hardware.
The Jacobian is where the math meets the machine. manif ships the analytic derivative of every operation, so you never hand-derive it.

manif is also built to interoperate with automatic differentiation. It documents compatibility with Ceres Jets and other autodiff types, so you can use the analytic Jacobians where you have them and mix in autodiff where you do not. The shape of the API reflects that idea: a group element, a tangent vector, and a Jacobian.

#include "manif/SO3.h"

using namespace manif;

SO3d R = SO3d::Identity();               // a point on the manifold
SO3d::Tangent d = SO3d::Tangent::Zero(); // a vector in the local tangent space

SO3d R2 = R + d;                         // exp map: move along the manifold
SO3d::Jacobian J = R.plusJacobian();     // analytic Jacobian of the operation

manif vs. Sophus, GTSAM, kindr, and Ceres

manif is not a SLAM framework. It is a reusable geometry and Lie-theory layer that slots underneath one. The table below places it against the closest projects.

ProjectPrimary roleGroup coverageJacobian / API conventionBest for
manifReusable Lie-group layer for state estimationSO(2), SO(3), SE(2), SE(3), SE₂(3), SGal(3), bundles, ℝ(n)Analytic Jacobians in local tangent-space perturbationsFilters and optimizers that need explicit manifold math
SophusLie-group and geometry typesSO(2), SO(3), SE(2), SE(3) and relatedGroup operations, Eigen-basedGeneral rotation and pose math
GTSAMFull SLAM and estimation frameworkPose and manifold types inside a factor-graph systemFactor graphs, optimization, inferenceWhole estimation systems, not just geometry
kindrTyped kinematics and geometryRotations, poses, conversionsKinematics-oriented typed APIKinematics and transformation math
Ceres Solver manifoldsNonlinear least-squares optimizerManifold interface for optimization variablesLocal parameterization / manifold abstractionSolving least-squares problems

Two clarifications matter here. GTSAM and Ceres are complementary rather than competing: GTSAM is the whole estimation stack, and Ceres supplies the solver and the manifold abstraction that manif can plug into. Sophus is the closest conceptual alternative, and the difference to weigh is group coverage and the explicit local-perturbation Jacobian convention. kindr is a typed kinematics library, aimed more at transformations than at Lie-group calculus.

Star counts for the alternatives are deliberately omitted. They change, and the point of the comparison is the role each project plays, not its popularity.

Who Uses It and Why It Stays Small

manif maintains a curated list of downstream projects. It names:

That list supports ecosystem use, but it is project-maintained, so it demonstrates that these projects rely on manif, not how deeply. The library stays small on purpose. It does not try to own your state representation, your solver, or your filter. It gives you the groups and their derivatives and gets out of the way.

The Trade-off: A Library That Refuses to Be a Black Box

manif makes a deliberate trade. It asks you to learn the math in exchange for giving you a consistent, explicit, and fast foundation for it. If you are a roboticist or a state-estimation researcher who wants rigor and control over conventions, that is a good trade. You get analytic Jacobians, unusual groups like SE₂(3) and SGal(3), and a Python interface when you want to prototype.

If you want a drop-in SLAM stack, this is not it. manif is a layer, not a system. It will not solve your problem for you, and the README is honest about that. It hands you the paper and the code together and trusts you to use both.