-
Notifications
You must be signed in to change notification settings - Fork 212
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
base: master
Are you sure you want to change the base?
Update qsvt demos #1522
Conversation
👋 Hey, looks like you've updated some demos! 🐘 Don't forget to update the Please hide this comment once the field(s) are updated. Thanks! |
# .. 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}.` |
There was a problem hiding this comment.
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?
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) |
There was a problem hiding this comment.
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
plt.plot(a_vals, target, label="target polynomial: (5x^3 - 3x)/2") | ||
plt.plot(a_vals, qsvt, "*", label="qsvt circuit matrix top left entry") |
There was a problem hiding this comment.
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.
Updating a couple of QSVT demos after we got the following feedback