0
$\begingroup$

I'd like the plot_bloch_multivector function (or some other function that I can use in Qiskit) to display a Bloch sphere in a way that makes it clear whether the arrow points toward the front of the sphere or toward the back of the sphere. As it is, the display of |-> can be mistaken for an arrow that's undergone an ry(pi/4) and rz(p/4) operation from |0>.

$\endgroup$

2 Answers 2

0
$\begingroup$

normally it should always label x,y. Can you provide a picture of your output looks like. Normal way to fix it, is just reinstall qiskit-terra. Or just imagine it, because it only got one position of view.

from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
from qiskit.visualization import plot_bloch_multivector
%matplotlib inline

qc = QuantumCircuit(2)
qc.h(0)
qc.x(1)

state = Statevector.from_instruction(qc)
plot_bloch_multivector(state)

enter image description here

$\endgroup$
8
  • $\begingroup$ This is how Qiskit draws |->: link, but I'd like to draw |-> with a dotted line, or something similar indicating a backward-pointing arrow: link $\endgroup$
    – bburd
    Jun 18 at 21:21
  • $\begingroup$ @bburd good idea, I will request a issue and pr about this. $\endgroup$
    – poig
    Jun 18 at 21:48
  • $\begingroup$ @bburd github.com/Qiskit/qiskit-terra/issues/8202#issue-1275923578 $\endgroup$
    – poig
    Jun 20 at 18:30
  • $\begingroup$ @bburd current solution is you can make change of github.com/Qiskit/qiskit-terra/blob/…, to add any parameter that is allowed for FancyArrowPatch $\endgroup$
    – poig
    Jun 20 at 18:33
  • $\begingroup$ @bburd accept answer will help a lot, thank you. $\endgroup$
    – poig
    Jun 20 at 18:48
0
$\begingroup$

Not sure about Qiskit, but within Qutip you can draw a Bloch sphere using the bloch3d. In bloch3d, there’s perspective, ie. dots which are farther away appear smaller.

This might help.

$\endgroup$

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.