# galgebra.lt¶

Multivector Linear Transformation

## Members¶

galgebra.lt.Matrix_to_dictionary(mat_rep, basis)[source]

Convert matrix representation of linear transformation to dictionary

galgebra.lt.Dictionary_to_Matrix(dict_rep, ga)[source]

Convert dictionary representation of linear transformation to matrix

class galgebra.lt.Lt(self, *args, ga, **kwargs)[source]

A Linear Transformation

Except for the spinor representation the linear transformation is stored as a dictionary with basis vector keys and vector values self.lt_dict so that a is a vector $$a = a^{i}e_{i}$$ then

$\mathtt{self(}a\mathtt{)} = a^{i} * \mathtt{self.lt\_dict[}e_{i}\mathtt{]}.$

For the spinor representation the linear transformation is stored as the even multivector self.R so that if a is a vector:

self(a) = self.R * a * self.R.rev().

lt_dict

the keys are the basis symbols, $$e_i$$, and the dictionary entries are the object vector images (linear combination of sympy non-commutative basis symbols) of the keys so that if L is the linear transformation then:

L(e_i) = self.Ga.mv(L.lt_dict[e_i])

Type

dict

Note this constructor is overloaded, based on the type of the positional argument:

class Lt(lt_dict: Dict[Expr, Expr], /, *, ga)

Construct from a dictionary mapping source basis blade expressions to multivectors.

class Lt(lt_matrix: Matrix, /, *, ga)

Construct from the operation of matrix pre-multiplication.

class Lt(spinor: mv.Mv, /, *, ga)

Construct from a spinor / rotor, which need not square to one.

class Lt(func: Callable[[mv.Mv], mv.Mv], /, *, ga)

Construct from a function, which is tested for linearity.

class Lt(s: str, /, *, ga, f=False, mode='g')

Construct an appropriate matrix from a string s.

Parameters
• ga (Ga) – Geometric algebra which is the domain and codomain of this transform

• f (bool) – True if Lt if function of coordinates. Only supported in the string constructor

• mode (str) – g:general, s:symmetric, a:antisymmetric transformation. Only supported in the string constructor.

det()sympy.core.expr.Expr[source]

Returns the determinant (a scalar) of the linear transformation, $$L$$, defined by $${{\det}\lp {L} \rp }I = {{L}\lp {I} \rp }$$.

tr()sympy.core.expr.Expr[source]

Returns the trace (a scalar) of the linear transformation, $$L$$, defined by $${{\operatorname{tr}}\lp {L} \rp }=\nabla_{a}\cdot{{L}\lp {a} \rp }$$ where $$a$$ is a vector in the tangent space.

adj()galgebra.lt.Lt[source]

Returns the adjoint (a linear transformation) of the linear transformation, $$L$$, defined by $$a\cdot{{L}\lp {b} \rp } = b\cdot{{\bar{L}}\lp {a} \rp }$$ where $$a$$ and $$b$$ are any two vectors in the tangent space and $$\bar{L}$$ is the adjoint of $$L$$.

matrix()sympy.matrices.dense.MutableDenseMatrix[source]

Returns the matrix representation of the linear transformation, $$L$$, defined by $${{L}\lp {{{\eb}}_{i}} \rp } = L_{ij}{{\eb}}_{j}$$ where $$L_{ij}$$ is the matrix representation.

class galgebra.lt.Mlt(f, Ga, nargs=None, fct=False)[source]

A multilinear transformation (mlt) is a multilinear multivector function of a list of vectors (*args) $$F(v_1,...,v_r)$$ where for any argument slot $$j$$ we have ($$a$$ is a scalar and $$u_j$$ a vector)

$\begin{split}F(v_1,...,a*v_j,...,v_r) &= a*F(v_1,...,v_j,...,v_r) \\ F(v_1,...,v_j+u_j,...,v_r) &= F(v_1,...,v_j,...,v_r) + F(v_1,...,u_j,...,v_r).\end{split}$

If F and G are two Mlts with the same number of argument slots then the sum is

$(F+G)F(v_1,...,v_r) = F(v_1,...,v_r) + G(v_1,...,v_r).$

If $$F$$ and $$G$$ are two Mlts with $$r$$ and $$s$$ argument slots then their product is

$(F*G)(v_1,...,v_r,...,v_{r+s}) = F(v_1,...,v_r)*G(v_{r+1},...,v_{r+s}),$

where $$*$$ is any of the multivector multiplicative operations. The derivative of a Mlt with is defined as the directional derivative with respect to the coordinate vector (we assume $$F$$ is implicitely a function of the coordinates)

$F(v_1,...,v_r;v_{r+1}) = (v_{r+1} \bullet \nabla)F(v_1,...,v_j,...,v_r).$

The contraction of a Mlt between slots $$j$$ and $$k$$ is defined as the geometric derivative of $$F$$ with respect to slot $$k$$ and the inner geometric derivative with respect to slot $$j$$ (this gives the standard tensor definition of contraction for the case that $$F$$ is a scalar function)

$\begin{split}\operatorname{Contract}(i,j,F) &= \nabla_i \bullet (\nabla_j F(v_1,...,v_i,...,v_j,...,v_r)) \\ &= \nabla_j \bullet (\nabla_i F(v_1,...,v_i,...,v_j,...,v_r)).\end{split}$

This returns a Mltwith slot $$i$$ and $$j$$ removed.

Fmt(lcnt=1, title=None)galgebra.printer.GaPrintable[source]

Set format for printing of Tensors

Parameters

lcnt – Number of components per line

Notes

Usage for tensor T example is:

T.fmt('2', 'T')


output is:

print 'T = '+str(A)


with two components per line. Works for both standard printing and for latex.

pdiff(slot: int)[source]

Returns gradient of tensor, T, with respect to slot vector.

For example if the tensor is $${{T}\lp {a_{1},a_{2}} \rp }$$ then T.pdiff(2) is $$\nabla_{a_{2}}T$$. Since T is a scalar function, T.pdiff(2) is a vector function.

contract(slot1: int, slot2: int)[source]

Returns contraction of tensor between slot1 and slot2 where slot1 is the index of the first vector argument and slot2 is the index of the second vector argument of the tensor.

For example if we have a rank two tensor, T(a1, a2), then T.contract(1, 2) is the contraction of T. For this case since there are only two slots, there can only be one contraction.

cderiv()[source]

Returns covariant derivative of tensor field.

If T is a tensor of rank $$k$$ then T.cderiv() is a tensor of rank $$k+1$$. The operation performed is defined in section Multilinear Functions.