Skip to content

Update qsvt demos #1522

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update qsvt demos #1522

wants to merge 2 commits into from

Conversation

DSGuala
Copy link
Contributor

@DSGuala DSGuala commented Aug 18, 2025

Updating a couple of QSVT demos after we got the following feedback

  • Intro to QSVT - drawing gave a black box QSVT/QSP circuit - would like to see a clear+explained circuit diagram
  • Intro to QSVT - would like more explanation on transition from scalar to matrix (small a to capital A)
  • Intro to QSVT - confusion about what how each point in the graph is obtained - explain that each one is a different circuit that encodes a different value
  • QSVT in Practice - user had trouble following the difference between x and vector x (P(X) = s * 1/x)

Copy link

👋 Hey, looks like you've updated some demos!

🐘 Don't forget to update the dateOfLastModification in the associated metadata files so your changes are reflected in Glass Onion (search and recommendations).

Please hide this comment once the field(s) are updated. Thanks!

Comment on lines +81 to +85
# .. note::
# Be careful to follow the notation in this section carefully.
# :math:`x` is a scalar and :math:`\vec{x}` is a vector. Sometimes we are talking about the scalar
# function :math:`P(x) = s \cdot \frac{1}{x}` and sometimes we are talking about the matrix-vector
# function :math:`A \cdot \vec{x} = \vec{b}.`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback from user: found it confusing that x is both a vector and a scalar and it was difficult to track

Temporarily added a note, there are likely better options. Could we switch to another variable other than x?

Comment on lines +96 to +108
the target polynomial. This function implements alternate products of :math:`U(a)` and :math:`S(\phi)`
as described above:

"""

target_poly = [0, -3 * 0.5, 0, 5 * 0.5]
a = 0.5
qml.draw_mpl(qml.qsvt(a, target_poly, encoding_wires=[0], block_encoding="embedding").decomposition)()

##############################################################################
# In this figure :math:`\Pi_\phi` are phase angle rotations (:math:`S(\phi)`) and `BlockEncode` calls
# are implementations of a block encoding of the scalar :math:`a`. (this needs to be rewritten because
# block encoding is not explaine yet in the demo)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User feedback: would like to see what the circuit looks like, trying to draw gave a black box qsvt

We can make it easier by drawing the decomposition for them. This gives one more visual to help understanding the alternating pattern in QSVT/QSP

Comment on lines +128 to +129
plt.plot(a_vals, target, label="target polynomial: (5x^3 - 3x)/2")
plt.plot(a_vals, qsvt, "*", label="qsvt circuit matrix top left entry")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is meant to help address

User feedback: confused about what the points mean in this graph

Would like a better label for qsvt than suggested here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant