Ask Your Question

Revision history [back]

Tensors on Spaces with Scalar Product

Greetings everyone!

I have recently started using SageMath and learning about its capabilities. Currently I am trying to model some physical process and need to represent a quantity that is so called material tensor of third rank. It is a single quantity, not a field.

Is there any idiomatic and efficient way to do that in Sage?

I have heard about tensors over free modules of finite rank, but free modules of finite rank seem to lack scalar product, which I need. Defining metric should be relatively straightforward, but I am concerned about readability and performance implications. On the other hand, vector spaces such as RR^3 have scalar product, norm, etc., but I haven't seen tensors mentioned in corresponding documentation. A simple generalization of matrices to more than two indices would suit the purpose.

Given the vast library of mathematical structures in Sage, I am certain that I am missing something.

Any advice will be greatly appreciated. Thanks in advance.