mistel

20 Reputation

0 Badges

1 years, 79 days

MaplePrimes Activity


These are replies submitted by mistel

@ecterrab 

Thank you very much for your thorough answer! I guess I have to live with checking the summation indices manually.

@ecterrab 

Thanks for the help. Regarding issue 2: I understand, but is there no way to do that automatically? Even the expression

Projector(Ket(A, i))-Projector(Ket(A, j))

is not evaluated to 0, although j is just another dummy index. Since the dummy indices change automatically when working with projections onto projectors, it is quite an effort to look at all the dummy indices in a long expression. For example, in

Projector(Ket(A, i)) . Ket(B, i)

the "i" in the projector is changed to "i_1" to avoid index collisions.

@ecterrab 

Again, thank you very much for the help. Yes, when I try to edit the procedure, the lower left box in maple changes from "Ready" to "Evaluating..." and then maple aborts while consuming all of the memory my laptop has.  I will just aoivd touching the procedure.

 

Edit. Same hapens when I just mark and try to copy the procedure in the worksheet from your last post. At least, after the kernel aborts, I can still edit the document, save it and restart maple.

@ecterrab 

Thank you for the hints. Unfortunately, whenerver I want to edit the procedure (replacing op(2, K) with op(2..-1, K)) maple consumes all of the memory (16GB) and aborts with the error "Kernel connection lost".

@ecterrab 

Thanks for this nice solution. Unfortunately, it is a bit buggy (see attachment). In any case, this will hopefully suffice for now.
 

 

Physics:-Version()[2]

`2018, December 29, 20:47 hours, version in the MapleCloud: unable to determine, version installed in this computer: 271`

(1)

with(Physics)

 

Setup(redo, hermitianoperators = {H}, hilbertspaces = {{A, C, H}, {B, C, H}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C[1] = 1 .. Na, C[2] = 1 .. Nb}, quantumdiscretebasis = {A, B, C}, bracketrules = {%Bracket(Bra(A, i), Ket(C, j, k)) = delta[i, j]*Ket(B, k), %Bracket(Bra(B, i), Ket(C, j, k)) = delta[i, k]*Ket(A, j), %Bracket(Bra(C, i, j), H, Ket(C, k, l)) = H[i, j, k, l]})

``

 

 
"H := K ->   if K::Ket then      if procname::'indexed' then         H[op(procname), op(2, K)]     else          H[op(2, K)]     fi  else      'H . K'  fi:"

NULL

This works nicely

Bra(A, i).Bra(B, j).H.Ket(A, k).Ket(B, l)

H[i, j, k, l]

(2)

Bracket(Bra(A, i).Bra(B, j), H, Ket(A, k).Ket(B, l))

H[i, j, k, l]

(3)

 

NULL

This is buggy

 

NULL

Bra(C, i, j).H.Ket(C, k, l)

H[i, k]

(4)

However, this here works, I guess due to the bracketrules above

Bracket(Bra(X, i, j), H, Ket(X, k, l))

H[k, i]

(5)

 

 

But there are also problems when Bra/Ket is a state whose space is not specified

Bra(X, i, j).H.Ket(X, k, l)

 

 

H[i, k]

(6)

Another problem: Other symbols than kets in front of H:

``

`𝕀__A` := Projector(Ket(A, i)); `𝕀__B` := Projector(Ket(B, i))

 

`𝕀__A`.`𝕀__B`.H.`𝕀__A`.`𝕀__B`

Physics:-`*`(Sum(Physics:-`*`(Physics:-Ket(B, i), H[i]), i = 1 .. Nb), Physics:-`^`(Sum(Physics:-`*`(Physics:-Ket(A, i), Physics:-Bra(A, i)), i = 1 .. Na), 2), Sum(Physics:-`*`(Physics:-Ket(B, i), Physics:-Bra(B, i)), i = 1 .. Nb))

(7)

Workaround

Sum(Sum(Sum(Sum(Typesetting[delayDotProduct](Ket(A, i)*Bra(A, i)*Ket(B, j)*Bra(B, j).H.Ket(A, k), Bra(A, k), true)*Ket(B, l).Bra(B, l), l = 1 .. Nb), k = 1 .. Na), j = 1 .. Nb), i = 1 .. Na)

Sum(Sum(Sum(Sum(Physics:-`*`(Physics:-Ket(A, i), Physics:-Ket(B, j), H[i, j, k, l], Physics:-Bra(A, k), Physics:-Bra(B, l)), l = 1 .. Nb), k = 1 .. Na), j = 1 .. Nb), i = 1 .. Na)

(8)

``

``


 

Download algebra_rules_(reviewed_II)_bugs.mw

 

 

 

@ecterrab 

Hi,

thank you very much for your thorough reply. I apologize for this late answer. For some reasons, I did not get a notification that someone answered.

Your answer was exactly what I needed. However, I have two remaining questions:

- You use F as a continuous basis. What I wanted to achieve with "t" is actually a t-dependence of the basis states ( Bra(A,i) ) and so on. ( t is time and the basis is time-dependent). I guess I can do this also with an auxiliary continuous Hilbert space as you have done with F. Is this the preferred way?

- How to specify matrix elements for operators  with this approach? See below for an explanation. The Hermitian operator "H" should act on the space C = A \otimes B.

Best regards,

Henrik
 

restart, with(Physics)

 

Setup(redo, hermitianoperators = {H}, hilbertspaces = {{A, C}, {B, C}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C[1] = 1 .. Na, C[2] = 1 .. Nb}, quantumdiscretebasis = {A, B, C}, bracketrules = {%Bracket(Bra(A, i), Ket(C, j, k)) = delta[i, j]*Ket(B, k), %Bracket(Bra(B, i), Ket(C, j, k)) = delta[i, k]*Ket(A, j), %Bracket(Bra(C, i, j), H, Ket(C, k, l)) = H[i, j, k, l]})

[bracketrules = {%Bracket(%Bra(A, i), %Ket(C, j, k)) = Physics:-KroneckerDelta[i, j]*Physics:-Ket(B, k), %Bracket(%Bra(B, i), %Ket(C, j, k)) = Physics:-KroneckerDelta[i, k]*Physics:-Ket(A, j), %Bracket(%Bra(C, i, j), H, %Ket(C, k, l)) = H[i, j, k, l]}, disjointedspaces = {{A, C}, {B, C}}, hermitianoperators = {H}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C[1] = 1 .. Na, C[2] = 1 .. Nb}, quantumdiscretebasis = {A, B, C}]

(1)

  ``

Ket(C, k, l) = Ket(A, k).Ket(B, l)

Physics:-Ket(C, k, l) = Physics:-`*`(Physics:-Ket(A, k), Physics:-Ket(B, l))

(2)

Bra(C, i, j) = Bra(A, i).Bra(B, j)

Physics:-Bra(C, i, j) = Physics:-`*`(Physics:-Bra(A, i), Physics:-Bra(B, j))

(3)

``

This works

Bra(C, i, j).H.Ket(C, k, l)

H[i, j, k, l]

(4)

Bra(A, i).Bra(B, j).Ket(A, k).Ket(B, l)``

Physics:-KroneckerDelta[i, k]*Physics:-KroneckerDelta[j, l]

(5)

This does not work``

NULL``

Bra(A, i).Bra(B, j).H.Ket(A, k).Ket(B, l)

Physics:-Bracket(Physics:-Bra(B, j), H, Physics:-Ket(A, k))*Physics:-`*`(Physics:-Ket(B, l), Physics:-Bra(A, i))

(6)

Bracket(Bra(A, i).Bra(B, j), H, Ket(A, k).Ket(B, l))

Physics:-Bracket(Physics:-Bra(B, j), H, Physics:-Ket(A, k))*Physics:-`*`(Physics:-Ket(B, l), Physics:-Bra(A, i))

(7)

What I want

``

Bra(A, i)*Bra(B, j)*H*Ket(A, k)*Ket(B, l) = Bra(C, i, j)*H*Ket(C, k, l)

Physics:-`*`(Physics:-Bra(A, i), Physics:-Bra(B, j), H, Physics:-Ket(A, k), Physics:-Ket(B, l)) = Physics:-`*`(Physics:-Bra(C, i, j), H, Physics:-Ket(C, k, l))

(8)

Bra(C, i, j)*H*Ket(C, k, l) = Bra(C, i, j).H.Ket(C, k, l)

Physics:-`*`(Physics:-Bra(C, i, j), H, Physics:-Ket(C, k, l)) = H[i, j, k, l]

(9)

``

``


 

Download twoD_matrixElements.mw

Page 1 of 1