Question

I tried the following based on the first example in the maple 17 help for "Physics[Commutator]". anybody know what's wrong?

with(Physics);
Setup(mathematicalnotation = true);
e1:=[Z[1],Z[2]][-];
Error, invalid subscript
      Typesetting:-mambiguous(e1Assign(Z[1]commaZ[2])[

        Typesetting:-mambiguous(Typesetting:-mstyle( - , 

        executable = "false", mathcolor = "#909090", 

        mathvariant = "normal"), 

        Typesetting:-merror("invalid subscript"))])
Was it helpful?

Solution

Your third line is not the third input line from start of the Examples section of the help-page for the Physics[Commutator] command in Maple 17.

Indeed, you third line of code does not match any input on that help-page.

When the examples on the Physics[Commutator] help-page are viewed in 1D mode (in the Maple Standard GUI's Help system) the input will appear as red plaintext. When toggled so that the input for the examples is viewed in 2D mode then the input will appear as black 2D typeset math. In either case the output of the help examples will appear as blue 2D typeset math.

In the Std GUI there is an icon at the top of the Help window which allows you to toggle display of the input mode between red 1D and black 2D. In the Online Help the input is shown only as black 2D typeset math.

Your third line of code is not a valid syntax for the command in question. You appear to have incorrectly tried (either by typing or pasting) to use the literal form of the blue 2D typeset math output from the third statement on that help-page.

In other words, it seems as if you might be trying to use the echoed form of the displayed blue output as syntax for input. That wouldn't work. (It doesn't work generally in Maple.) If you want to run the code, then copy the input lines, not the output lines.

Note also that on that help-page in question the very next line of commentary explains that the output above it is just an artefact of a specialized display mechanism, displaying a shorthand to represent the structure.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top