# I Qubit mixed state density matrix coordinates on a Bloch ball

Tags:
1. Feb 23, 2017

### maxverywell

What are the coordinates on the 3D Bloch ball of a qubit's mixed state of the form:
$\rho=p_{00}|0\rangle \langle 0|+p_{01}|0\rangle \langle 1|+p_{10}|1\rangle \langle 0|+p_{11}|1\rangle \langle 1|$

Last edited: Feb 23, 2017
2. Feb 24, 2017

### maxverywell

Do we have to diagonalize the density matrix everytime and then use the forumla for the coordinates
$(\sum p_i x_i, \sum p_i y_i,\sum p_i z_i)$ ?
https://en.wikipedia.org/wiki/Bloch_sphere

Not very practical.

3. Feb 24, 2017

### Strilanc

From stackoverflow: "Convert from qubit density matrix to Bloch vector"

Code (Text):
def toBloch(matrix):
[[a, b], [c, d]] = matrix
x = complex(c + b).real
y = complex(c - b).imag
z = complex(d - a).real
return x, y, z
In other words, yes you have to use the formula. But I'm not sure why you think it's impractical... it's just three additions/subtractions.