-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
IQP as circuit library function (and in Rust) #13241
Conversation
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 11590872936Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
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. I only had a few questions.
qiskit/circuit/library/iqp.py
Outdated
# otherwise validate the interactions | ||
else: | ||
if num_qubits is not None: | ||
raise ValueError("Only one of interactions or num_qubits can be provided, not both.") |
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.
perhaps both could be given, and one can assert that num_qubits = len(interactions)
in this case ?
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.
Yeah I thought about that, it seemed a bit strange that passing an additional argument could raise an error in a function when one could just omit it. Explicitly disallowing passing both would make sure users can only have a single way of running the code... but I'm also happy to allow num_qubits
🙂
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.
Overall this looks great. One question is why we need the new "random IQP" mode, is this used anywhere in Qiskit? In addition, personally I would prefer to have a separate function that returns a random IQP circuit.
As discussed offline I split the |
i hope this was the cause of the error, lets see
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 looks good. Just one comment about generating random IQP instances.
m.add_wrapped(wrap_pyfunction!(iqp::py_iqp))?; | ||
m.add_wrapped(wrap_pyfunction!(iqp::py_random_iqp))?; |
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.
I don't think it matters too much, but this uses a slightly different naming convention from most of the other circuit library code (i.e. here the functions are prefixed with py
).
-- the diagonal entries on the diagonal got lost! Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
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 for the quick fix, LGTM!
Summary
Part of #13046. Moves
IQP
(instantaneous quantum polytime) circuits to be a function, and ports the internals to Rust.Details and comments
IQP timings