## 20 Reputation

5 years, 322 days

## Physics Package: Projectors between disj...

Maple 2018

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

 (1)

 (2)

 (3)

 (4)

 (5)

 (6)

## Physics Package: How to define bracketru...

Maple 2018

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

-------

---------

Second try

---------

 (1)

 (2)

--------

Third try

--------

 (3)

 (4)

 (5)

 Page 1 of 1
﻿