## 478 Reputation

7 years, 354 days

## Physics...

As Edgardo said, Physics is the best environment to perform non-commutative algebra (and indeed, the only way in Maple). In addition, one can define quantum operator, the most general non commutative object, or one can refine the definition with hermitian or unitary operators. A value might also be assigned to the op and used whenever it is required. Here are a few example.

 >
 >
 >
 >
 (1)

A and B do not commute by default

 >
 (2)
 >
 (3)

For the inverse, just use

 >
 (4)

It is always possible to assign a value. Note however the lower case "matrix"

 >
 (5)
 >
 (6)
 >
 (7)

Using * operator leave the product unevaluated

 >
 (8)
 >
 (9)

Or use the . operator

 >
 (10)

Hermintian and unitary op are known

 >
 (11)
 >
 (12)
 >
 (13)
 >

## Physics:-Version(1409)...

Hi,

You could try :

Physics:-Version(1409)

1409 is the last version for M2022.2

## convert/exp...

Hi,

Maple result seems correct to me. The point is that the returned sum is a Dirac comb. Writting the result as a sum of exp or a sum of Dirac is a matter of choice depending of what you need. Using convert/exp might help:

 >
 >
 >
 >
 >
 (1)
 >
 (2)
 >
 (3)

Considering the Dirac comb

 >
 (4)

One has the relation

 >
 (5)

And finally

 >
 (6)

Note that the reciprocal conversion is not (yet) supported

 >
 (7)
 >
 >

## Possibly Physics:-Fundiff...

Hi,

For deriving an equation in Physics, Fundiff is often the good approach. This should give the result:

 >
 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >

## Define quantum operators and use Commuta...

Hi,

In order to have * redefined, you need first to define quantum operators for instance. Then [a,b] has the same meaning whether Physics is loaded or not. I guess you'd like to use the commutator. For that purpose, just use "Commutator":

 >
 >
 >
 (1)
 >
 (2)
 >
 (3)
 >

## anticommutativeprefix = {x, y}...

Hi,

In your case, you should rather use Setup(anticommutativeprefix = {x, y}), not "noncommutativeprefix". Then, it is unnecessary to specify "algebrarules={%AntiCommutator(x,x)=0, %AntiCommutator(y,y)=0}" as it will be automatically the case.

Finally, Maple's result:

AntiCommutator(x,y)=0

seems correct to me. As x and y anticommute, x*y + y*x = x*y - x*y = 0.

## Physics differentialoperators...

Hi,

A possible way is to define a formal differential operator within the Physics package. It can be define with an arbitrary function and trigged at will. For an exemple, have look at:

https://www.mapleprimes.com/posts/208710-Quantum-Commutation-Rules-Basics

## Component...

Hi,

Using "Component", it is possible to reconstruct a Vector:

V := Vector([seq(Component(q_, k), k = 1 .. 3)])

Component2Vector.mw

## Parentheses...

Try -3 - (-5) or  4*(-10), It should work as expected.

However, I agree that an expression like -3 - -5 should work without parentheses in Maple, mathematically the expression is correct, surprising. Entering -3-+-5 or 4*-10 in Matlab gives the expected result.

## Alias and Physics:-Latex...

Hi,

I think that using the new Physics:-Latex with alias, there is even no need for replacing.

 >
 >
 (1)
 >
 (2)
 >
 x \left( t \right) ={\it \_C1}\,{{\rm e}^{t}}+{\it \_C2}\,{{\rm e}^{-{ \frac {t}{2}}}}\sin \left( {\frac {\sqrt {3}t}{2}} \right) +{\it \_C3} \,{{\rm e}^{-{\frac {t}{2}}}}\cos \left( {\frac {\sqrt {3}t}{2}}  \right)
 >
 x \left(t \right) = c_{1} {\rm e}^{t}+c_{2} {\rm e}^{-\frac{t}{2}} \sin \left(\frac{\sqrt{3} t}{2}\right)+c_{3} {\rm e}^{-\frac{t}{2}} \cos \left(\frac{\sqrt{3} t}{2}\right)
 >

Hi,

## Differential operator...

You might define a differential operator

 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 (6)
 >
 >

## Setup(quantumoperators = V)...

Hi,

With Physics package, to get this feature, V should be declared as a quantum operator. Also, use Dagger instead of Transpose, or V_^*.

restart;
with(Physics);
with(Physics[Vectors]);
Setup(quantumoperators = V);
V_*Dagger(V_);

This question is related:

Hi,

L := [1, 2, 3, 4, 5];
L := [1, 2, 3, 4, 5]