734 Reputation

14 Badges

15 years, 169 days

MaplePrimes Activity

These are answers submitted by itsme

so to fully answer my own question (hah!) in case someone else needs this... i think this does what i want:

quantumOperators:={ap,am, sx, sy, sz}:
Setup(Commutator(ap,sx)=0, Commutator(ap,sy)=0, Commutator(ap,sz)=0, Commutator(am,sx)=0, Commutator(am,sy)=0, Commutator(am,sz)=0):

now am, ap do not commute with eachother (likewise sx,sy,sz), but a and s "type" operators do commute.

i would still be interested to know how other people deal with this in maple.


in the spirit of partly answering my own question...  it looks like the physics package may do this:



a1^2 + a1 a2 + a2 a1 + a2^2

x1^2 + x1 x2 + x2 x1 + x2^2

... so that works.. but now:


a1^2 + a1 x2 + x2 a1 x2^2

... now i just need to tell maple that operators that start with x DO commute with operators which start with a.

if i do

Setup(noncommutativeprefix=a, noncommutativeprefix=x):

then the non-commutative properties of a get overwritten.

thanks to all for suggestions.

In my case the matrices usually do have a full set of linearly independent eigenvectors, and hence I have been simply diagonalizing before exponentiating (just as Robert suggested - although his code snippet manages to look much cleaner that mine!)...  

I am still curious however if Mathematica manages to do something clever(er) inside their equivalent function...

clearly the second case is complex, so that may add some overhead... however that fact that Mathemacia (that's what MMA is) does it so much faster screams at me that there may be another way.. (note that specifying datatype in the original matrix does not really help). any other thoughts?

thanks for the suggestions, although neither really works for me.

By the way in case I might not have been clear, by "sections" I literally mean maple sections (i.e. indented blocks that are created via insert->section).

Perhaps a simple way of comment/uncomment in the GUI editor is just not possible.... hmm.

I have version 13.

Ok - I do see what you mean.. this however for me only works when I want to comment out multiple lines wihtin the same execution block.

It still does not work when trying to comment out a whole sections

any other ideas?


thanks for your response, but you must be thinking about mathematica... this (for me) does not work in maple.

any other suggestions?


1 2 3 4 Page 4 of 4