0

I would like to use subscripted notation such as $\sigma_x$ as identifiers for use as variables. In this example I am using the Pauli Matrices so that I would use notation such as: $$ \sigma_x = \{\{0,1\},\{1,0\}\} $$ However, when defining the expression, two variables or identifiers are defined in my current context. Using the Names function for the context I would find that the two identifiers $\sigma$ and $x$ are both individually defined but the identifier symbol $\sigma_x$ is not defined.

How do I prevent the individual definition of the $\sigma$ and $x$ and force the definition of the ONE subscripted identifier $\sigma_x$?

K7PEH
  • 619
  • 1
  • 6
  • 16
  • Have a read through these: https://mathematica.stackexchange.com/questions/29043/using-greek-letters-with-subscripts-as-symbols/29046#29046 https://mathematica.stackexchange.com/questions/33672/preventing-superscript-from-being-interpreted-as-power-when-using-ctrl-shortcu/33689#33689 https://mathematica.stackexchange.com/questions/19759/details-about-symbolize/19760#19760 https://mathematica.stackexchange.com/questions/20195/solve-with-v9-issues-with-subscript-overscript-superscript-etc/20208#20208 – Mike Honeychurch Jun 07 '17 at 23:24

1 Answers1

1

You could try using [x] instead of subscript-x:

Clear[σ, x];
σ[x] := {{0,1},{1,0}};
{σ, x, σ[x]}

It's not as elegant as a subscript, but it works. Just be sure not to define 'x' elsewhere!

James Stein
  • 416
  • 2
  • 6