/

String manipulation for Geometric Algebra

Function Reference

sympy.galgebra.stringarrays.fct_sym_array(str_lst, coords=None)[source]

Construct list of symbols or functions with names in ‘str_lst’. If ‘coords’ are given (tuple of symbols) function list constructed, otherwise a symbol list is constructed.

sympy.galgebra.stringarrays.str_array(base, n=None)[source]

Generate one dimensional (list of strings) or two dimensional (list of list of strings) string array.

For one dimensional arrays: -

base is string of variable names separated by blanks such as base = ‘a b c’ which produces the string list [‘a’,’b’,’c’] or it is a string with no blanks than in conjunction with the integer n generates -

str_array(‘v’,n=-3) = [‘v_1’,’v_2’,’v_3’] str_array(‘v’,n=3) = [‘v__1’,’v__2’,’v__3’].

In the case of LaTeX printing the ‘_’ would give a subscript and the ‘__’ a super script.

For two dimensional arrays: -

base is string where elements are separated by spaces and rows by commas so that -

str_array(‘a b,c d’) = [[‘a’,’b’],[‘c’,’d’]]
sympy.galgebra.stringarrays.str_combinations(base, lst, rank=1, mode='_')[source]

Construct a list of strings of the form ‘base+mode+indexes’ where the indexes are formed by converting ‘lst’ to a list of strings and then forming the ‘indexes’ by concatenating combinations of elements from ‘lst’ taken ‘rank’ at a time.

sympy.galgebra.stringarrays.symbol_array(base, n=None)[source]

Generates a string arrary with str_array and replaces each string in array with Symbol of same name.

Table Of Contents

Previous topic

Noncommutative utilities for Geometric Algebra

Next topic

Debug code for Geometric Algebra

This Page