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

Incorrect Axis Label in Magnetization Plot for Quantum State Measurements #176

Open
ixaixim opened this issue May 10, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@ixaixim
Copy link

ixaixim commented May 10, 2024

Environment

Algorithms: 0.30

What is happening?

Description

The second plot generated by the code for visualizing magnetization over time uses the ylabel "magnetization $\langle Z_1 Z_2 \rangle$", which suggests a correlation measurement between the first and second qubits. However, the observable used is defined as SparsePauliOp(["ZI", "IZ"]), which measures the Z component independently on the first and second qubits. This leads to a potential misunderstanding of what the plot represents.

Suggested Label Changes

Instead of the current ylabel, I suggest one of the following, depending on the actual computation performed:

  • If measurements are plotted separately: Use two separate plots or labels stating $\langle Z_1 \rangle$ and $\langle Z_2 \rangle$ respectively.
  • If measurements are aggregated (e.g., summed or averaged): Use labels such as "Average magnetization of $Z_1$ and $Z_2$" or "Sum magnetization $\langle Z_1 \rangle + \langle Z_2 \rangle$".

How can we reproduce the issue?

run tutorial 10 pqvd.

Look where the following code is located (second plot).

Code Reference

The relevant code snippet is as follows:

plt.plot(result.times, magnetizations.real, color="crimson", label="PVQD")
plt.plot(exact_times, exact_magnetizations, ":", color="k", label="Exact")
plt.xlabel("time $t$")
plt.ylabel(r"magnetization $\langle Z_1 Z_2 \rangle$")
plt.title("Magnetization over time")
plt.legend(loc="best")
plt.savefig("magnetization_plot.png")

What should happen?

Axis name should be $\langle Z_1 \rangle + \langle Z_2 \rangle$.

Any suggestions?

No response

@ixaixim ixaixim added the bug Something isn't working label May 10, 2024
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

1 participant