Message Boards Message Boards

3 Replies
0 Total Likes
View groups...
Share this post:

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

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,


POSTED BY: David Mackay
3 Replies


I have a well developed tensor program, Tensorial, that I could share with you. It has all the standard processing of tensor index notation.

And I have another solution, which is even better if you are interested in the mathematics of modern physics.

If you would like to write me at the email address in my profile I can tell you more.

Morning (for me at least) Rohit,

That works fine, thank you very much. I can now use the same formalism in my MMA Notebooks as in the various text books that I am working with.

Thanks again for your advice. Bye David

POSTED BY: David Mackay
Posted 4 years ago

Hi David,

Maybe this?

Superscript[f,μυ][x_] := x^2

Superscript[f, μυ][3]
(* 9 *)

Convert the cell to StandardForm to format it.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract