sqrtm() is not working.

15 views
Skip to first unread message

anir...@gmail.com

unread,
Oct 23, 2017, 11:06:55 AM10/23/17
to QuTiP: Quantum Toolbox in Python
Somehow, in qutip, I was trying to take the square root of a matrix. So, I was using sqrtm(). I got these, where I wanted to find the square root of the first matrix. This is odd!
Quantum object: dims = [[2, 2, 2], [2, 2, 2]], shape = (8, 8), type = oper, isherm = True
Qobj data =
[[ 0.5  0.   0.   0.   0.   0.   0.   0.5]
 [ 0.   0.   0.   0.   0.   0.   0.   0. ]
 [ 0.   0.   0.   0.   0.   0.   0.   0. ]
 [ 0.   0.   0.   0.   0.   0.   0.   0. ]
 [ 0.   0.   0.   0.   0.   0.   0.   0. ]
 [ 0.   0.   0.   0.   0.   0.   0.   0. ]
 [ 0.   0.   0.   0.   0.   0.   0.   0. ]
 [ 0.5  0.   0.   0.   0.   0.   0.   0.5]]
Quantum object: dims = [[2, 2, 2], [2, 2, 2]], shape = (8, 8), type = oper, isherm = True
Qobj data =
[[ 0.50000001  0.          0.          0.          0.          0.          0.
   0.49999999]
 [ 0.          0.          0.          0.          0.          0.          0.
   0.        ]
 [ 0.          0.          0.          0.          0.          0.          0.
   0.        ]
 [ 0.          0.          0.          0.          0.          0.          0.
   0.        ]
 [ 0.          0.          0.          0.          0.          0.          0.
   0.        ]
 [ 0.          0.          0.          0.          0.          0.          0.
   0.        ]
 [ 0.          0.          0.          0.          0.          0.          0.
   0.        ]
 [ 0.49999999  0.          0.          0.          0.          0.          0.
   0.50000001]]
four.py

Paul Nation

unread,
Oct 23, 2017, 12:25:58 PM10/23/17
to QuTiP Group
Your matrix has only a single nonzero eigenvalue that is one.  Since root of one is one, the sqrtm is just going to be the projector.of the eigenstate associated with the nonzero eigenvalue, which is the same as the original matrix.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anirban Bhattacharjee

unread,
Oct 23, 2017, 5:59:52 PM10/23/17
to qu...@googlegroups.com
But my matrix contains 0.5 in all of its corners. How come sqrtm() yields the same matrix?

You received this message because you are subscribed to a topic in the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qutip/WVRZR_bPRcE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qutip+unsubscribe@googlegroups.com.

Paul Nation

unread,
Oct 23, 2017, 6:26:05 PM10/23/17
to QuTiP Group
See my previous reply.
Reply all
Reply to author
Forward
0 new messages