Question: How to prevent complex number decomposition into Re+I*Im?

Hi. I have two problems connected to Physics package and complex numbers. The main problem is undesired decomposition of a complex value t into Re(t)+I*Im(t).

The first problem is connected to evaluation of action of the
Quantum Operator on the Ket vector.  Namely     H:=Hamiltonianf0(f).phi; eval(H,[phi= Ket(psi,1,0,1,1,0,0),f=1]);   doesn't give expected result.

restart; Physics:-Version(); with(Physics); Setup(mathematicalnotation = true); Physics:-Setup(anticommutativeprefix = psi); am := proc (i, j, sigma) local k::posint; if [i, j, sigma]::(Not(list(posint))) then return 'procname(args)' end if; k := 6*i-8+2*j+sigma; Annihilation(psi, k, notation = explicit) end proc; ap := proc (i, j, sigma) local k::posint; if [i, j, sigma]::(Not(list(posint))) then return 'procname(args)' end if; k := 6*i-8+2*j+sigma; Creation(psi, k, notation = explicit) end proc; Setup(op = {am, ap}); Hissf0 := proc (i, sigma) options operator, arrow; t*ap(i, 2, sigma).am(i, 3, sigma) end proc; Hissf := proc (i, sigma) options operator, arrow; Hissf0(i, sigma)+Dagger(Hissf0(i, sigma)) end proc; Hamiltonianf0 := proc (f) options operator, arrow; sum(add(Hissf(i, sigma), sigma = 1 .. 2), i = 1 .. f) end proc; H := Hamiltonianf0(f).phi; eval(H, [phi = Ket(psi, 1, 0, 1, 1, 0, 0), f = 1])

"C:\Documents and Settings\Administrator\MapleLib\Physics.mla", `2013, October 3, 18:51 hours`

 

`* Partial match of  'op' against keyword 'quantumoperators'`

 

[quantumoperators = {am, ap}]

 

phi*(sum(t*Physics:-`.`(ap(i, 2, 1), am(i, 3, 1))+conjugate(t)*Physics:-`.`(Physics:-Dagger(am(i, 3, 1)), Physics:-Dagger(ap(i, 2, 1)))+t*Physics:-`.`(ap(i, 2, 2), am(i, 3, 2))+conjugate(t)*Physics:-`.`(Physics:-Dagger(am(i, 3, 2)), Physics:-Dagger(ap(i, 2, 2))), i = 1 .. f))

 

Physics:-Ket(psi, 1, 0, 1, 1, 0, 0)*(t*Physics:-`.`(`a+`[psi[3]], `a-`[psi[5]])+conjugate(t)*Physics:-`.`(`a+`[psi[5]], `a-`[psi[3]])+t*Physics:-`.`(`a+`[psi[4]], `a-`[psi[6]])+conjugate(t)*Physics:-`.`(`a+`[psi[6]], `a-`[psi[4]]))

(1)

The second problem is connected to undesired decomposition of a complex number into real and imaginary part. Is it possible to avoid such decomposition?

phi := Ket(psi, 1, 0, 1, 1, 0, 0);

Physics:-Ket(psi, 1, 0, 1, 1, 0, 0)

 

(I*Im(t)-Re(t))*Physics:-Ket(psi, 1, 0, 0, 1, 1, 0)+(Re(t)-I*Im(t))*Physics:-Ket(psi, 1, 0, 1, 0, 0, 1)

(2)

The following code shows the same result but without decomposition. However it is not appropriate to me as I need to define dff before defining f. The code below has only demonstration purpose.

f := 1;

1

 

-conjugate(t)*Physics:-Ket(psi, 1, 0, 0, 1, 1, 0)+conjugate(t)*Physics:-Ket(psi, 1, 0, 1, 0, 0, 1)

(3)

``

compl_number_decom.mw

Please Wait...