clifford (clifford)

The top-level module. Provides two core classes, Layout and MultiVector, along with several helper functions to implement the algebras.

Constructing algebras

Note that typically the predefined-algebras are sufficient, and there is no need to build an algebra from scratch.

Cl([p, q, r, sig, names, firstIdx, mvClass])

Returns a Layout and basis blade MultiVectors for the geometric algebra \(Cl_{p,q,r}\).

conformalize(layout[, added_sig, mvClass])

Conformalize a Geometric Algebra

Whether you construct your algebras from scratch, or use the predefined ones, you’ll end up working with the following types:

MultiVector(layout[, value, string])

An element of the algebra

Layout(*args, **kw)

Layout stores information regarding the geometric algebra itself and the internal representation of multivectors.

ConformalLayout(*args[, layout])

A layout for a conformal algebra, which adds extra constants and helpers.

Advanced algebra configuration

It is unlikely you will need these features, but they remain as a better spelling for features which have always been in clifford.


Represents the storage order in memory of basis blade coefficients.

BasisVectorIds(*args, **kwds)

Stores ids for the ordered set of basis vectors, typically integers.

Global configuration functions

These functions are used to change the global behavior of clifford.


Get/Set the epsilon for float comparisons.


Makes repr(MultiVector) default to pretty-print.

precision arg can be used to set the printed precision.


precision (int) – number of sig figs to print past decimal


>>> pretty(5)

Makes repr(MultiVector) default to eval-able representation.


Set the epsilon for float comparisons.


newVal (int) – number of sig figs to print (see builtin round)


>>> print_precision(5)

Miscellaneous classes


MultiVector Array


A frame of vectors

BladeMap(blades_map[, map_scalars])

A Map Relating Blades in two different algebras

Miscellaneous functions

grade_obj(objin[, threshold])

Returns the modal grade of a multivector

randomMV(layout[, min, max, grades, …])

n Random MultiVectors with given layout.