-
Notifications
You must be signed in to change notification settings - Fork 57
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
Pennylane-Qualtran interoperability #1559
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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! will probably have to add some tests. We'll also need to add pennylane to the requirements, which I can help with (since we have a convoluted system for pinning the CI dependencies)
For the tests, I'm not sure where I'm supposed to add them. I took a look |
Yeah, that's a good question. Usually we'd put them alongside the code for the adapter classes; but that will reside in the Pennylane repository. I think in this case it will suffice to have some basic unit tests for the particular examples for which you implemented the method (which can live in the test files associated with those bloqs) |
You can also add a test to |
Hi @mpharrigan, I added some very basic unit tests for each of the atomic bloqs I wrote an |
Sorry, since you're a first-time contributor I have to press the "approve running the CI" button every time you push a commit, sadly |
You can run the various scripts in the check/format-incremental --apply it will apply the formatter to your code check/mypy
check/pylint will report typecheck and lint errors (but you have to fix thme) |
oh, I have to update our dependencies. I will do that tomorrow |
Can the [WIP] tag be removed from the title of the PR? |
instance truly should not be included in the PennyLane circuit (e.g. for reshaping | ||
bloqs). A bloq with no PennyLane equivalent should raise an exception instead. | ||
""" | ||
from pennylane.io import FromBloq |
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.
Actually, is this circular dependancy going to be a problem while trying to merge these two PRs across two packages? To merge this current, Qualtran PR; we need to depend on a release of Pennylane that includes this adapter. But that adapter needs a release of qualtran with Bloq.as_pl_op
. Am I capturing this 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.
Yeah good question. For the CI on PennyLane's side, the PR depends on this specific fork/branch (see: .github/workflows/interface-unit-tests.yml. For Qualtran, we can do something similar where the CI specifically depends on the branch qualtran_pl
in PennyLane rather than master
.
Depending on which branch is merged first, we would just edit the CI to depend on main
/master
.
Perhaps the workflow file should be edited instead for this PR specifically to get the CI passing. We can then remove it when qml.FromBloq is merged into pennylane master. |
In this PR, we set out to define a new method
as_pl_op()
for the baseBloq
class as well as several "basic gates" that have direct 1:1 translations with PennyLane operators. This is a work in progress and relies on another PR inside of PennyLane that contains theqml.FromBloq
adapter class. We open this now for visibility and discussion purposes, but the work is still on-going.