The Cartan–Karlhede algorithm is a procedure for completely classifying and comparing Riemannian manifolds. Given two Riemannian manifolds of the same dimension, it is not always obvious whether they are locally isometric. Élie Cartan, using his exterior calculus with his method of moving frames, showed that it is always possible to compare the manifolds. Carl Brans developed the method further, and the first practical implementation was presented by in 1980. The main strategy of the algorithm is to take covariant derivatives of the Riemann tensor. Cartan showed that in n dimensions at most n(n+1)/2 differentiations suffice. If the Riemann tensor and its derivatives of the one manifold are algebraically compatible with the other, then the two manifolds are isometric. The Cartan–Karlhede algorithm therefore acts as a kind of generalization of the Petrov classification. The potentially large number of derivatives can be computationally prohibitive. The algorithm was implemented in an early symbolic computation engine, SHEEP, but the size of the computations proved too challenging for early computer systems to handle. For most problems considered, far fewer derivatives than the maximum are actually required, and the algorithm is more manageable on modern computers. On the other hand, no publicly available version exists in more modern software. Physical applications The Cartan–Karlhede algorithm has important applications in general relativity. One reason for this is that the simpler notion of curvature invariants fails to distinguish spacetimes as well as they distinguish Riemannian manifolds. This difference in behavior is due ultimately to the fact that spacetimes have isotropy subgroups which are subgroups of the Lorentz group SO+(1,3), which is a noncompact Lie group, while four-dimensional Riemannian manifolds (i.e., with positive definite metric tensor), have isotropy groups which are subgroups of the compact Lie group SO(4). In 4 dimensions, Karlhede's improvement to Cartan's program reduces the maximal number of covariant derivatives of the Riemann tensor needed to compare metrics to 7. In the worst case, this requires 3156 independent tensor components. There are known models of spacetime requiring all 7 covariant derivatives. For certain special families of spacetime models, however, often far fewer often suffice. It is now known, for example, that at most one differentiation is required to compare any two null dust solutions, at most two differentiations are required to compare any two Petrov D vacuum solutions, at most three differentiations are required to compare any two perfect fluid solutions. See also Vanishing scalar invariant spacetime