Andriy

260 Reputation

13 Badges

9 years, 249 days

MaplePrimes Activity


These are questions asked by Andriy

Hello
There is some kind of strange behaviour with copying/pasting maple code from IDE to some text editor. Namely, the code collapses into one long line in text editor. Is it OK with Maple IDE?

Does Maple have a variable containing the directory (path) of current working file?

Thank  you.

Hello
I encountered with a problem in understanding of structured types. I test following structured types:



the result is

true

false
false

I cannot understand two last results as I expected to receive trues. Could you explain me the result?
Thank you.

UPD
A code appropriate for copy/pase along with short problem solution is presented below

restart;
`type/A1`:={integer, rational};
`type/A2`:=integer or rational; #  it matchs the expressions that literally contain `or` (see @Carl Love's
answer below)
`type/A3`:=OR(integer, rational); # `Or` should be used rather then `OR` (see @acer's
answer below)

x:=5;
type(x, A1);
type(x, A2);
type(x, A3);

Hello.
I am trying to extract the terms that are a product of a commutative part and an operator part from the input expression. That is I am trying to extract a terms like a*A.B where A and B are quantum pperators.

I am trying to do it by creating corresponding structured type:

restart; 
with(Physics);
Physics[Setup](op = {A, B}, quiet);

`type/ProdComOp` := `&*`(commutative, specfunc(anything, Physics:-`*`));
z0 := u*A.B-A+k*B+B.A.B+g;
z1 := z0+v*A.B.A;
S1 := indets(z1, ProdComOp);

and all it is Ok. The result is 
But if

z2 := z0-v*A.B.A; 
S2 := indets(z2, ProdComOp);

then
however I expected to receive the same as S1.

How to handle the sign of the commutative part? Thank you.

Hi. I need to test if a variable is a dot-product of "anything"-s (usually it is quantum operators).
I try the following

restart; 
with(Physics);
Physics:-Setup(mathematicalnotation = true);
Physics:-Setup(anticommutativeprefix = psi);
ap1 := Physics:-Creation(psi, 1, notation = explicit);
am1 := Physics:-Annihilation(psi, 1, notation = explicit);
ap2 := Physics:-Creation(psi, 2, notation = explicit);
am2 := Physics:-Annihilation(psi, 2, notation = explicit);

z1 := ap1.am1.ap2:
type(z1, ('`.`')(anything));

and get

false

whereas

z2 := a*b*c; 
type(z2, (':-`*`')(anything));

returns

true

I studied ?type,structured and other sources but didn't find any answer.

1 2 3 4 5 6 7 Page 1 of 8