Dear developers of module tensor
the documentation of tensor_indices (in 1.00 as well as in dev) seems inconsistent with the code:
DOC string [1] states:
Returns list of tensor indices given their names and their types
...
typ : list of ``TensorIndexType`` of the indices
while CODE [2] states
tilist = [TensorIndex(i, typ) for i in a]
hence this will not work as promized if typ is a list.
Example:
from sympy.tensor.tensor import TensorIndexType, tensor_indices
Lorentz = TensorIndexType('Lorentz', dummy_fmt='L')
Lor2 = TensorIndexType('Lor2', dummy_fmt='L')
a, b, c, d = tensor_indices('a,b,c,d', [Lorentz,Lor2,Lor2,Lor2])
a.tensortype
results in
[TensorIndexType(Symbol('Lorentz'), Integer(0)), TensorIndexType(Symbol('Lor2'), Integer(0)), TensorIndexType(Symbol('Lor2'), Integer(0)), TensorIndexType(Symbol('Lor2'), Integer(0))]
Best regards and thanks for your effort.
ric
PS I take the occasion to say that as newbie user I find the naming conventions for the helper functions tensorsymmetry and tensorhead
difficult to memorize because inconsistent with tensor_indices (and python usual conventions). You might want to rename the former helpers to tensor_symmetry and tensor_heads (plural)
[1]
https://github.com/sympy/sympy/blob/master/sympy/tensor/tensor.py#L1888
[1]
https://github.com/sympy/sympy/blob/master/sympy/tensor/tensor.py#L1902