mistel

20 Reputation

0 Badges

1 years, 68 days

MaplePrimes Activity


These are questions asked by mistel

Hi,

I try to define the action of projectors of two discrete basis onto a general state. This works as expected when I define the projector by myself. However, when using the "Projector" command, I get a not fully simplified result; see below. It seems like there is a confusion with dot/tensor product.  Can somoeone help?

Best,

Henrik


 

restart; with(Physics)

Setup(hilbertspaces = {{A, alpha}, {B, beta}}, quantumbasisdimension = {A = 1 .. N[a], B = 1 .. N[b]}, quantumdiscretebasis = {A, B, alpha, beta}, bracketrules = {%Bracket(Bra(A, i), Ket(Psi)) = Ket(beta, i), %Bracket(Bra(A, i), Ket(alpha, j)) = C[i, j], %Bracket(Bra(B, i), Ket(Psi)) = Ket(alpha, i), %Bracket(Bra(B, j), Ket(beta, i)) = C[i, j]})

[bracketrules = {%Bracket(%Bra(A, i), %Ket(Psi)) = Physics:-Ket(beta, i), %Bracket(%Bra(A, i), %Ket(alpha, j)) = C[i, j], %Bracket(%Bra(B, i), %Ket(Psi)) = Physics:-Ket(alpha, i), %Bracket(%Bra(B, j), %Ket(beta, i)) = C[i, j]}, disjointedspaces = {{A, alpha}, {B, beta}}, quantumbasisdimension = {A = 1 .. N[a], B = 1 .. N[b]}, quantumdiscretebasis = {A, B, alpha, beta}]

(1)

``

proj := Sum(Sum(Ket(A, i).Bra(A, i).Ket(B, j).Bra(B, j), i = 1 .. N[a]), j = 1 .. N[b])

Sum(Sum(Physics:-`*`(Physics:-Ket(A, i), Physics:-Ket(B, j), Physics:-Bra(A, i), Physics:-Bra(B, j)), i = 1 .. N[a]), j = 1 .. N[b])

(2)

proj2 := Projector(Ket(A, i)).Projector(Ket(B, i))

Physics:-`*`(Sum(Physics:-`*`(Physics:-Ket(A, i), Physics:-Bra(A, i)), i = 1 .. N[a]), Sum(Physics:-`*`(Physics:-Ket(B, i), Physics:-Bra(B, i)), i = 1 .. N[b]))

(3)

proj.Ket(Psi)

Sum(Sum(C[i, j]*Physics:-`*`(Physics:-Ket(A, i), Physics:-Ket(B, j)), i = 1 .. N[a]), j = 1 .. N[b])

(4)

NULL

proj2.Ket(Psi)

Sum(Sum(Physics:-`*`(Physics:-Ket(A, i__1), Physics:-Bra(A, i__1), Physics:-Ket(alpha, i), Physics:-Ket(B, i)), i = 1 .. N[b]), i__1 = 1 .. N[a])

(5)

proj-proj2

Sum(Sum(Physics:-`*`(Physics:-Ket(A, i), Physics:-Ket(B, j), Physics:-Bra(A, i), Physics:-Bra(B, j)), i = 1 .. N[a]), j = 1 .. N[b])-Physics:-`*`(Sum(Physics:-`*`(Physics:-Ket(A, i), Physics:-Bra(A, i)), i = 1 .. N[a]), Sum(Physics:-`*`(Physics:-Ket(B, i), Physics:-Bra(B, i)), i = 1 .. N[b]))

(6)

``


 

Download projector_2d_space.mw

 

Hi,

with the Physics package, I want to represent a discrete two-dimensional Hilbert space in a direct-product basis.

I have looked at https://www.mapleprimes.com/posts/209099-Tensor-Product-Of-Quantum-State-Spaces but am not sure how to implement bracketrules.

Let's assume I have one-dimensional bases A and B that span a two-dimensional space C. A is of size Na and B is of size Nb. Consequently, C is of size Na * Nb.

If I understand it correclty, this can be done with

Setup(hilbertspaces = {{A, C}, {B, C}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C = 1 .. Na*Nb}, quantumdiscretebasis = {A, B, C})

First question: Is this correct and if yes, why do I need to specify quantumbasisdimension for C?

Then, I want to define, using bracketrules, <A[i]| <B[j]| |Psi> = X[i,j],

where |Psi> lives in the full, two-dimensional space C and X is a matrix.

<B[j]|Psi> would be a state living in A and <A[i]||Psi> would be a state in B.

How do I define this?

bracketrules = {%Bracket(Bra(A, i)*Bra(B, j), Ket(C, t)) = X[i,j](t)}

gives me an error.

I found a way using the nested expression

bracketrules = {%Bracket(Bra(A, i), Ket(A, j)) = X[i,j], %Bracket(Bra(B, j), Ket(C)) = Ket(A, j)}

giving

Bracket(Bra(A, i), Bracket(Bra(B, j), Ket(C, t))) = X[i,j]

but this is error prone, clumsy and only works in one direction:

Bracket(Bra(B, j), Bracket(Bra(A, i), Ket(C)))

does not work. Of course, I could also specify rules for the reverse direction but this is quite an effort for higher-dimensional spaces (I have, e.g., 9-dimensional spaces in mind).

So how do I do this properly?

Please have a look at the attached example, where I also included time-dependence.

Thanks,

Henrik

 


 

-------``

First try

-------

restart; restart, with(Physics)

Setup(hilbertspaces = {{A, C}, {B, C}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C = 1 .. Na*Nb}, quantumdiscretebasis = {A, B, C}, bracketrules = {%Bracket(Bra(A, i)*Bra(B, j), Ket(C, t)) = X[i, j](t)})

Error, (in Physics:-Setup) expected first argument in the Bracket defining a bracket rule to be a 'Bra'; received: Physics:-`*`(%Bra(A, i), %Bra(B, j))

 

 

---------

Second try

---------

 

restart; restart, with(Physics)

Setup(hilbertspaces = {{A, C}, {B, C}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C = 1 .. Na*Nb}, quantumdiscretebasis = {A, B, C}, bracketrules = {%Bracket(Bra(A, i), Bra(B, j), Ket(C, t)) = X[i, j](t)})

[bracketrules = {%Bracket(%Bra(A, i), %Bra(B, j), %Ket(C, t)) = X[i, j](t)}, disjointedspaces = {{A, C}, {B, C}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C = 1 .. Na*Nb}, quantumdiscretebasis = {A, B, C}]

(1)

Bracket(Bra(A, i), Bra(B, j), Ket(C, t))

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

(2)

--------

Third try

--------

 

 

restart; restart, with(Physics)

Setup(hilbertspaces = {{A, C}, {B, C}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C = 1 .. Na*Nb}, quantumdiscretebasis = {A, B, C}, bracketrules = {%Bracket(Bra(A, i), Ket(A, j, t)) = X[i, j](t), %Bracket(Bra(B, j), Ket(C, t)) = Ket(A, j, t)})

[bracketrules = {%Bracket(%Bra(A, i), %Ket(A, j, t)) = X[i, j](t), %Bracket(%Bra(B, j), %Ket(C, t)) = Physics:-Ket(A, j, t)}, disjointedspaces = {{A, C}, {B, C}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C = 1 .. Na*Nb}, quantumdiscretebasis = {A, B, C}]

(3)

Bracket(Bra(A, i).Bra(B, j), Ket(C, t))

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

(4)

Bracket(Bra(A, i), Bracket(Bra(B, j), Ket(C, t)))

X[i, j](t)

(5)

Bracket(Bra(B, j), Bracket(Bra(A, i), Ket(C, t)))

Error, (in Physics:-Bracket) expected a Bra and a Ket as a first and last arguments, or no Bra and no Ket when using the shortcut notation; received: Physics:-Bra(B,j), Physics:-Bracket(Physics:-Bra(A,i),Physics:-Ket(C,t))

 

``


 

Download twoD.mw

 

Page 1 of 1