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
Another work-around is to use my
allowNonSymbol[ f[Subscript[σ, x] _, Subscript[σ, y] _] := Sin[Subscript[σ, x]] + 2^Subscript[σ, y]] f[a, b]