QuSTaR / kaleidoscope

Kaleidoscope - Visualizations for quantum computing.
https://nonhermitian.org/kaleido/
Apache License 2.0
21 stars 7 forks source link

multivector bloch_sphere should raise an error #57

Open 1ucian0 opened 3 years ago

1ucian0 commented 3 years ago

When introducing phase kickback to the general public I realised that multivector bloch sphere has no labels. That can be confusing when you are not very familiar with the polar basis.

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

bloch_sphere(state.statevector()))
Screenshot 2021-01-25 at 13 58 56

This is particularly necessary when the vectors overlap:

state = QuantumCircuit(2)
state.h(0)
state.x(1)
state.h(1)
state.cx(0, 1)

bloch_sphere(state.statevector())
Screenshot 2021-01-25 at 14 00 51
nonhermitian commented 3 years ago

Seeing this now. It should probably raise an error for a multi-qubit statevector as that is definitely not something a Bloch sphere can handle. The typical use case for displaying multiple vectors is for when you want to look at the evolution of a single-qubit state over some time or series of steps.