-
Notifications
You must be signed in to change notification settings - Fork 188
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
Update block encoding demo #1080
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! |
Thank you for opening this pull request. You can find the built site at this link. Deployment Info:
Note: It may take several minutes for updates to this pull request to be reflected on the deployed site. |
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.
Looks good @soranjh! Do you want to refactor this demo cause there are some lines
e.g. wire_order = ancilla_wires + wires_i[::-1] + wires_j[::-1]
M = len(A) * qml.matrix(circuit,wire_order=wire_order)().real[0:len(A),0:len(A)]
in the code that don't work quite the same when using the template instead. With the template, we don't need to set the wire_order
this way, just need
M = len(A) * qml.matrix(circuit)().real[0 : len(A), 0 : len(A)]
There's also code like
wire_map = {control_index : wire for control_index, wire in enumerate(wires_j + wires_i)}
that can be replaced with what's in the template
wire_map = dict(enumerate(wires_j + wires_i))
Not a super big deal and the demo works as is though.
Thanks @austingmhuang, the demo codes are a bit verbose for educational purposes, so no need to change them if they run correctly. |
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.
Nice! Happy to approve 👍🏼
Just two comments:
- We could optionally show a circuit using
qml.Fable
and then draw the circuit usingmy_circuit.tape.expand().draw()
to show the decomposed operation - Just make sure that the link to the Fable template works well once the CI builds
Checked and confirmed locally but adding it here breaks the current nice workflow.
Confirmed with @KetpuntoG that it will work when merged. |
Update the demo on block encoding with matrix access oracles to:
qml.FABLE
to the demo.2 x 2
matrices.