Simulating position eigenkets

30 views
Skip to first unread message

VanDammeHouten

unread,
May 16, 2022, 10:23:43 PM5/16/22
to QuTiP: Quantum Toolbox in Python
Hi I am currently trying to simulate the probabilities of measuring single photons with wavefunctions  png.png that are defined as:
 png (1).png
I'm doing this in the discrete domain by taking finite position eigenkets png (2).png
Thus the single photon kets become png (3).png


Currently I am representing my single photons as column vectors  in numpy 
```
x = np.arange(-l/2,l/2+dx,dx)
psis = GuassianPsf(x,sigma)
```
however whenever I try to convert them to kets
```
ketPsis = qutip.ket(psis)
```
I get "OverflowError: value too large"

At the moment (psi.shape == 2001).

I'm relatively new to Qutip and want to leverage it for my simulations but I feel like I'm possibly going about it the wrong way.

Any help is appreciated!

Cheers

Simon Cross

unread,
May 17, 2022, 7:52:18 AM5/17/22
to qu...@googlegroups.com
Hi Zach,

qutip.ket is not the right function for your use case. It creates a single ket that is the tensor product of basis states. So qutip.ket("01") -> |01>.

You should probably call qutip.Qobj(psis, dims=[[n], [1]]) or similar to directly create the ket you want.

You can leave out the dims in this case because Qobj will default to the right value. I included it only because it's a good idea and often forgotten in more complex cases (including by me and the QuTiP development team :).

Regards,
Simon


VanDammeHouten

unread,
May 23, 2022, 6:37:20 PM5/23/22
to QuTiP: Quantum Toolbox in Python
Fantastic that works! Thanks for your help

Simon Cross

unread,
May 24, 2022, 4:51:56 AM5/24/22
to qu...@googlegroups.com
Yay! Pleasure.
Reply all
Reply to author
Forward
0 new messages