For example I want to define a function with parameters σx and σy, that is, the function will be declared as:
_] := . . .
Symbolize but it doesn't work. How can I use
Subscript in pattern names?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.Sign up to join this community
You can use
Symbolize, from the
Notation package following the tutorial as you did.
Then, just take the precaution of writing the pattern with its head explicit, such as:
The problem is that Mathematica can't interpret the short notation for patterns (
xr_ for example) if it has a box structure before the "_"
As mentioned by Rojo in the answer above,
xr_can't be interpreted as desired even after
Symbolizeis used, but one doesn't need to write
FullFormto circumvent the problem, actually you just need one more
You can also use the input form in the definition
f[Subscript[σ, x_], Subscript[σ, y_]] := ...