mix states on Bloch sphere

405 views
Skip to first unread message

Mojdeh S. N

unread,
Nov 10, 2019, 5:25:47 PM11/10/19
to QuTiP: Quantum Toolbox in Python
Hi all,

I am going to plot density matrix of the final state on bloch sphere by using bloch.add_states(), but
i have no idea that how i should that, any suggestion?

Pavel Penshin

unread,
Mar 31, 2021, 7:10:25 AM3/31/21
to QuTiP: Quantum Toolbox in Python
See here 
under  "uvw representation" 
There is an explanation on how to convert a density matrix into a "bloch vector" (any density matrix can be converted, pure and mixed states).
You can implement it manually, create this vector and then use bloch.add_vectors() to add it.

Good luck,

Gerardo Suarez

unread,
Apr 5, 2021, 10:56:34 PM4/5/21
to QuTiP: Quantum Toolbox in Python
As stated by pavel above you need to write out the bloch vector [u,v,w], here's a python function that returns it from the density matrix

def uvw_representation(rho):
    w=rho[0,0]-rho[1,1]
    u=rho[0,1]+rho[1,0]
    v=-1j*(rho[1,0]-rho[0,1])
    return [u.real,v.real,w.real]


Remember that this is only meant for two level systems, that is 2x2 density matrices. For more complicated systems the bloch sphere is not adequate
some other methods for those systems are explained here 

Pasha

unread,
Apr 7, 2021, 12:07:34 PM4/7/21
to QuTiP: Quantum Toolbox in Python
Hi Gerardo, 

Just for you to know. 

It is possible to do turip.bloch.add_states(rho)

Wheb rho is a qutip operator object and represents a density matrix (hernitian trace=1 etc...) 
I discovered it recently. So anyway no need for the long wat we proposed here :) 

Good luck. 

Gerardo Suarez

unread,
Apr 7, 2021, 12:07:46 PM4/7/21
to QuTiP: Quantum Toolbox in Python
As pavel indicated all that needs to be done is writing the bloch-vector [u,v,w]

If the density matrix elements are denoted by P_ij Then:

P_00-P_11=w
2 Re(P_10)=u
2 Im(P_10)=v

A python function for this is simply:

def uvw_representation(rho):
    w=rho[0,0]-rho[1,1]
    u=rho[0,1]+rho[1,0]
    v=-1j*(rho[1,0]-rho[0,1])
    return [u.real,v.real,w.real]

Also remember that the bloch sphere is only useful for visualizing two level systems or a single qubit. If you're working with a more complicated system such a representation is in general not possible for those systems there are some methods such as the ones explained in this book



El miércoles, 31 de marzo de 2021 a las 5:10:25 UTC-6, pavel....@mail.huji.ac.il escribió:
Reply all
Reply to author
Forward
0 new messages