# Can I name a function with a string that looks like an exponent?

Posted 1 year ago
2548 Views
|
3 Replies
|
0 Total Likes
|
 I am just starting to work with tensors such as the electromagnetic field tensors. I would like to write functions whose names indicate whether the tensor is contra variant, covariant or of mixed type. I can do this for some instances but not for the contravariant case.In the attached Notebook you can see some simple examples. In the contravariant case, I would like to 'fool" Mathematica into treating the function name as just that and not an attempt to raise it to the power of mu times nu.Any help much appreciated,David Attachments:
3 Replies
Sort By:
Posted 1 year ago
 Hi David,Maybe this? Superscript[f,μυ][x_] := x^2 Superscript[f, μυ][3] (* 9 *) Convert the cell to StandardForm to format it.