5
$\begingroup$

I'm trying to plot 2 vectors on the same Bloch sphere. From the qiskit documentation here, we can find plot_bloch_vector(bloch, title='', ax=None, figsize=None, coord_type='cartesian'). So I'm not quite sure if we could plot 2 vectors (say [0,0,1] and [0,1,0]) on the same Bloch sphere.

Also, from the default visualization angle, some vectors might look like they're overlapping with the x-axis (e.g the figure below). Can I switch to another angle to visualize the sphere?

enter image description here

Thanks for the help:)

$\endgroup$
4
$\begingroup$

If you are on a Jupyter notebook, you can use kaleidoscope for that. It has a block_sphere function that does exactly that. See the documentation for more info. To install it pip install kaleidoscope.

You can set several vectors in the sphere that can be rotated with the mouse.

from kaleidoscope import bloch_sphere

bloch_sphere([[0,1,0], [0,0,1]])

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks so much, that works really great:) $\endgroup$ – ZR- Mar 17 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.