Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative phase bug on plot_state_qsphere #13724

Open
jvscursulim opened this issue Jan 23, 2025 · 1 comment
Open

Relative phase bug on plot_state_qsphere #13724

jvscursulim opened this issue Jan 23, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@jvscursulim
Copy link

Environment

  • Qiskit version: 1.3.2
  • Python version: 3.11.10
  • Operating system: Ubuntu 24.04.1 LTS

What is happening?

I was using the function plot_state_qsphere to inspect if the state that I was preparing with my quantum circuit was right, but what I saw it was the relative phase in the wrong state, like in the image attached to this comment. I took a look in the plot_state_qsphere function, and I saw that the class DensityMatrix is used, so I decided to check if the density matrix was correct and it was correct, then I think that must be a problem in the plot preparation.

Image

How can we reproduce the issue?

from qiskit.circuit import QuantumCircuit
from qiskit.visualization import plot_state_qsphere

qc = QuantumCircuit(2)

qc.x(qubit=0)
qc.h(qubit=0)
qc.cx(control_qubit=0, target_qubit=1)

plot_state_qsphere(qc)

What should happen?

The phase $e^{i\pi} = -1$ should appears on the state $\vert 11 \rangle$.

Any suggestions?

No response

@jvscursulim jvscursulim added the bug Something isn't working label Jan 23, 2025
@jakelishman
Copy link
Member

See #10029 (comment) for the detail.

I'm not opposed to somebody providing a PR to change the default behaviour, if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants