Pascal4QM

478 Reputation

12 Badges

7 years, 65 days

MaplePrimes Activity


These are answers submitted by Pascal4QM

You can overload an operator, see help("overload").

For your example, it could give:

ListOperations := module () export `+`; option package; 

`+` := proc (a::list, b::list) option overload; [op(a), op(b)] end proc:

end module:


with(ListOperations);
                              [+]
[a, b, c]+[d, e, f];
                       [a, b, c, d, e, f]
 

 

Hi, you could try:

[seq(M[j][1] = 0, j = 1 .. 5)];

solve(%,{x[1],x[2],y[1],y[2],y[3],y[4],y[5]})

Hi, Try:

`%>`(2*x-5, 3*x-6)


Physics is definitely the good framework to help you solve your problem

restart; with(Physics)

Physics:-Setup(mathematicalnotation = true, quantumoperators = {x, y})

[mathematicalnotation = true, quantumoperators = {x, y}]

(1)

f := Physics:-`*`(x, Physics:-`^`(y, n))-Physics:-`*`(Physics:-`*`(Physics:-`^`(q, n), Physics:-`^`(y, n)), x);

Physics:-`*`(x, Physics:-`^`(y, n))-q^n*Physics:-`*`(Physics:-`^`(y, n), x)

(2)

eq1 := Physics:-`*`(x, y)-Physics:-`*`(Physics:-`*`(q, y), x) = 1;

Physics:-`*`(x, y)-q*Physics:-`*`(y, x) = 1

(3)

Be aware that "solve" do not handle quantum operators and gives an incorrect result:

x = solve(eq1, x);

x = RootOf(-Physics:-`*`(_Z, y)+q*Physics:-`*`(y, _Z)+1)

(4)

allvalues(x = RootOf(-Physics:-`*`(_Z, y)+q*Physics:-`*`(y, _Z)+1))

x = -1/(y*(q-1))

(5)

This result ((5)) is incorrect because solve has considered all variables as commutative ones. Up-to now, there is no other way than to solve the equation manually. It is useful to introduce the commutator of x and y, that is:

(%Commutator = `@`(expand, Physics:-Commutator))(x, y)

%Commutator(x, y) = Physics:-`*`(x, y)-Physics:-`*`(y, x)

(6)

Physics:-Library:-SortProducts(eq1, [x, y], usecommutator)

Physics:-`*`(x, y)-q*(Physics:-`*`(x, y)+Physics:-Commutator(y, x)) = 1

(7)

isolate(Physics:-`*`(x, y)-q*(Physics:-`*`(x, y)+Physics:-Commutator(y, x)) = 1, Physics:-`*`(x, y))

Physics:-`*`(x, y) = (1+q*Physics:-Commutator(y, x))/(-q+1)

(8)

Assuming y has an inverse:

Physics:-`*`(Physics:-`*`(x, y) = (1+q*Physics:-Commutator(y, x))/(-q+1), Physics:-Inverse(y))

x = -Physics:-`*`(1+q*Physics:-Commutator(y, x), Physics:-Inverse(y))/(q-1)

(9)

And finally

eval(f, x = -Physics:-`*`(1+q*Physics:-Commutator(y, x), Physics:-Inverse(y))/(q-1))

-Physics:-`*`(1+q*Physics:-Commutator(y, x), Physics:-Inverse(y), Physics:-`^`(y, n))/(q-1)+q^n*Physics:-`*`(Physics:-`^`(y, n), 1+q*Physics:-Commutator(y, x), Physics:-Inverse(y))/(q-1)

(10)

Physics:-Setup(combinepowersofsamebase = true)

[combinepowersofsamebase = true]

(11)

simplify(-Physics:-`*`(1+q*Physics:-Commutator(y, x), Physics:-Inverse(y), Physics:-`^`(y, n))/(q-1)+q^n*Physics:-`*`(Physics:-`^`(y, n), 1+q*Physics:-Commutator(y, x), Physics:-Inverse(y))/(q-1), size)

(q^n*Physics:-`*`(Physics:-`^`(y, n), 1+q*Physics:-Commutator(y, x), Physics:-Inverse(y))-Physics:-`*`(1+q*Physics:-Commutator(y, x), y^(-1+n)))/(q-1)

(12)

``


Download Quantum_Op.mw

You could also try "Fundiff" from the Physics Package.

restart; with(Physics)

Physics:-Intc(Physics:-`^`(Physics:-diff(f(x), x), 2), x);

Int((diff(f(x), x))^2, x = -infinity .. infinity)

(1)

Physics:-Fundiff(Int((diff(f(x), x))^2, x = -infinity .. infinity), f)

-2*(diff(diff(f(x), x), x))

(2)

dsolve({-2*(diff(diff(f(x), x), x)), f(0) = 0, f(1) = 1})

f(x) = x

(3)

``

 

Download FundiffDemo.mw

There is a space between "Matrix" and "'(". Remove it, and it should work.

Try (works with M2016):

subs(1/g(z)^2 = A, yourexpression): coeff(%, A)

 


You could try quantum operators from the Physics Package. A quantum operator is a non-commutative linear operator that is a very good symbolic representation of a matrix. At the end, you still have to solve your equation manually, but the non-commutative feature of matrices will be respected.

restart; with(Physics)

Define the quantum op, they will be displayed with an olive color

Physics:-Setup(mathematicalnotation = true, quantumoperators = {A, B, X})

[mathematicalnotation = true, quantumoperators = {A, B, X}]

(1)

Physics:-`*`(A, X) = B

Physics:-`*`(A, X) = B

(2)

Physics:-`*`(Physics:-Inverse(A), %)

X = Physics:-`*`(Physics:-Inverse(A), B)

(3)

``


Download quantum_operators_demo.mw

You could try quantum operators from the Physics Package. A quantum operator is a non-commutative linear operator that is a very good symbolic representation of a matrix. At the end, you still have to solve your equation manually, but the non-commutative feature of matrices will be respected.

 

 

I had a similar issue. After consulting MapleSoft, the answer is:

"Place the cursor in each math expression and press Shift+F5. This will make the expressions non-executable. See ?worksheet,documenting,2DMathDetails."

You could try the inert form:

%sin(x+y+z-Phi)

And, if necessary, to enhance the display use:

Physics:-Setup(mathematicalnotation = true)

1 2 3 4 Page 4 of 4