clifford.Layout¶

class
clifford.
Layout
(sig, bladeTupList, firstIdx=0, names=None)[source]¶ Layout stores information regarding the geometric algebra itself and the internal representation of multivectors.
It is constructed like this:
Layout(signature, bladeTupList, firstIdx=0, names=None)
The arguments to be passed are interpreted as follows:
 signature – the signature of the vector space. This should be
a list of positive and negative numbers where the sign determines the sign of the inner product of the corresponding vector with itself. The values are irrelevant except for sign. This list also determines the dimensionality of the vectors. Signatures with zeroes are not permitted at this time.
 Examples:
signature = [+1, 1, 1, 1] # Hestenes’, et al. SpaceTime Algebra signature = [+1, +1, +1] # 3D Euclidean signature
 bladeTupList – list of tuples corresponding to the blades in the whole
algebra. This list determines the order of coefficients in the internal representation of multivectors. The entry for the scalar must be an empty tuple, and the entries for grade1 vectors must be singleton tuples. Remember, the length of the list will be 2**dims.
 Example:
bladeTupList = [(), (0,), (1,), (0,1)] # 2D
 firstIdx – the index of the first vector. That is, some systems number
the base vectors starting with 0, some with 1. Choose by passing the correct number as firstIdx. 0 is the default.
 names – list of names of each blade. When prettyprinting multivectors,
use these symbols for the blades. names should be in the same order as bladeTupList. You may use an empty string for scalars. By default, the name for each nonscalar blade is ‘e’ plus the indices of the blade as given in bladeTupList.
 Example:
names = [‘’, ‘s0’, ‘s1’, ‘i’] # 2D
Layout’s Members:
dims – dimensionality of vectors (== len(signature))
sig – normalized signature (i.e. all values are +1 or 1)
firstIdx – starting point for vector indices
bladeTupList – list of blades
gradeList – corresponding list of the grades of each blade
gaDims – 2**dims
einf – if conformal returns einf
eo – if conformal returns eo
names – prettyprinting symbols for the blades
even – dictionary of even permutations of blades to the canonical blades
odd – dictionary of odd permutations of blades to the canonical blades
gmt – multiplication table for geometric product [1]
imt – multiplication table for inner product [1]
omt – multiplication table for outer product [1]
lcmt – multiplication table for the leftcontraction [1]
 [1] The multiplication tables are NumPy arrays of rank 3 with indices like
the tensor g_ijk discussed above.
Attributes
the psuedoScalar 

Ordered list of blades in this layout (with scalar as [0]) 

the psuedoScalar 

the scalar of value 1, for this GA (a MultiVector object) 
Methods
create a multivector in this layout 

Initialize self. 

Returns a dictionary mapping basis element names to their MultiVector instances, optionally for specific grades 

return all blades of a given grade, 

Takes a dictionary of coefficient values and converts it into a MultiVector object 

Generates the dual function for the pseudoscalar 

Generates the right complement of a multivector 

Generates the vee product function 

Returns the matrix M_g that performs grade projection via left multiplication eg. 

This produces the matrix X that performs left multiplication with x eg. 

This produces the matrix X that performs right multiplication with x eg. 

Takes a ga file Checks it is the same signature as this layout Loads the data into an MVArray 

Parses a multivector string into a MultiVector object 

Convenience method to create a random multivector. 

generate a random Rotor. 

generate n random 1vector s 