Problem with unit() method for very big N

17 views
Skip to first unread message

anago...@gmail.com

unread,
Feb 13, 2018, 8:05:41 AM2/13/18
to QuTiP: Quantum Toolbox in Python
I discovered a problem when normalizing a density matrix with unit() for a very big Hilbert space:

>> rho1 = qt.fock_dm(1000, 0)
>> rho2 = qt.fock_dm(2000, 0)  # same state but bigger Hilbert space

>> rhp1[0, 0] 
(1+0j)
>> rho1.unit()[0,0] 
(1+0j)

>> rhp2[0, 0] 
(1+0j)
>> rho2.unit()[0,0] 
(2.0833333333333333e-05+0j)

As you can see the last result is wrong and it shout be (1+0j).
Any idea why is that happening?

anago...@gmail.com

unread,
Feb 13, 2018, 10:18:15 AM2/13/18
to QuTiP: Quantum Toolbox in Python
there is a small typo, where rhp it should be rho

Andrew Dawes

unread,
Feb 14, 2018, 1:16:05 PM2/14/18
to qu...@googlegroups.com
This works as expected on my end in qutip 4.2.0. All of them give (1+0j).

What version qutip are you using, and on what platform?


--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

anago...@gmail.com

unread,
Feb 15, 2018, 6:37:45 AM2/15/18
to QuTiP: Quantum Toolbox in Python
I have QuTiP 4.2.0, Numpy 1.13.3 and Windows 7 (64-bit), running on pc with 8GB RAM.
Maybe if you try qt.fock_dm(N, 0) with N > 2000. For me it fails at N = 2000 but it can depend on the pc.
Reply all
Reply to author
Forward
0 new messages