PennyLaneAI / qml

Introductions to key concepts in quantum programming, as well as tutorials and implementations from cutting-edge quantum computing research.
https://pennylane.ai/qml
Apache License 2.0
527 stars 185 forks source link

[BUG] Correction in the Labeling of Plots in Intro to QSVT Tutorial #1028

Closed elucidator8918 closed 7 months ago

elucidator8918 commented 7 months ago

Issue description

The labels in the plot seem to be switched. The label "target" should correspond to the target_poly function, and the label "qsvt" should correspond to the quantum singular value transformation results. I would like to fix this by curating a PR.

Source code and tracebacks

Present Incorrect Code in the Tutorial:

plt.plot(a_vals, qsvt, label="target")
plt.plot(a_vals, target, "*", label="qsvt")

plt.legend()
plt.show()

Corrected Code:

plt.plot(a_vals, target, label="target")
plt.plot(a_vals, qsvt, "*", label="qsvt")

plt.legend()
plt.show()

Tutorial Link

Intro to QSVT Link

josh146 commented 7 months ago

Nice catch @elucidator8918! Would you like to open a PR to make this change to the demo? It is available here: https://github.com/PennyLaneAI/qml/blob/master/demonstrations/tutorial_intro_qsvt.py

elucidator8918 commented 7 months ago

@josh146 Yes i would love to make the PR :)

KetpuntoG commented 7 months ago

@elucidator8918 thanks for work on this!