Open Arihant-Joshi opened 3 years ago
Hi @Arihant-Joshi , this seems like a nice extension (given that we already have multiple coord_type
s). Feel free to open a PR.
@kdk this PR is done with all checks passed. I've also added some error handling and warnings in case of different bloch[] list size, since this seems to be a user facing function. @nkanazawa1989 @nonhermitian
The original PR has been closed due to lack of response from original contributor and this issue is open again for new contributions. If anyone else would like to pick this work up please take a look at the old PR for ideas and remember to credit the original contributor if you use their implementation.
Currently, the plot_bloch_vector function can plot the Bloch sphere using spherical and cartesian coordinates.
I propose implementing an additional value of the
coord_type
parameter("dirac"??), which allows the user to plot the bloch sphere from the Amplitude of States. e.g. Given Qubit -> ∣ψ⟩ = α∣0⟩ + β∣1⟩ plot_bloch_vector([α, β], coord_type="dirac") would plot the corresponding Bloch Sphere.Also, I already have created a function which does something similar while going through the qiskit textbook(it converts Dirac Notation to Spherical Coordinates and calls plot_bloch_vector), so I can quickly make required changes and raise a PR if this feature if found needed.