-
Notifications
You must be signed in to change notification settings - Fork 575
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
[Templates] Rewrite embeddings as operations #1156
Conversation
Co-authored-by: Chase Roberts <chase@xanadu.ai>
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.
Thanks @mariaschuld! I still have some tests to look through, but here are some initial comments.
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
… into rewrite-embeddings
|
||
@template | ||
def IQPEmbedding(features, wires, n_repeats=1, pattern=None): | ||
class IQPEmbedding(Operation): | ||
r""" | ||
Encodes :math:`n` features into :math:`n` qubits using diagonal gates of an IQP circuit. |
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.
what does "IQP" stand for?
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.
The embedding encodes into the diagonal gates of an IQP circuit...once more a case of an embedding which does not (yet) have a good name in the community
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.
Thanks @mariaschuld for showing us how this is done. Now, that I have got the general idea, will give it a second round in the afternoon. I have noticed that codefactor is complaining in different places.
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.
Thanks @mariaschuld! I have left some comments and minor suggestions, but overall approve 💯
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
… into rewrite-embeddings
@agran2018 can I merge? :) |
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.
Thanks @mariaschuld. I noticed that there is still an unrelated warning being issue by CodeFactor at the end.
This is part of making all templates inherit from
Operations
.In the process, the tests were mostly rewritten from scratch, the docstrings improved and the dependency on the
broadcast
function was removed for reasons of speed. Otherwise, code was just moved.It is quite hard to review this PR. I commented on everything that differs from the previous template design, and it would be great if the review could focus on the tests.