Skip to content
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

Add the execute and batch_execute methods #6

Merged
merged 118 commits into from
Dec 17, 2020
Merged

Conversation

antalszava
Copy link
Contributor

@antalszava antalszava commented Dec 16, 2020

Context
OrquestraDevice and its subclasses are capable of serializing backend specifications, circuits and operators. There are also auxiliary functions available that make it possible to:

  • fit serialized data into an Orquestra workflow (gen_workflow.py)
  • place CLI calls to Orquestra (cli_actions.py).

To put pieces together, executing circuits and computing expectation values of operators remain.

Changes
Adds two device methods:

  • OrquestraDevice.execute: supports computing expectation values for (an) operator(s) and returning the result(s) to a QNode
  • OrquestraDevice.batch_execute: supports computing expectation values for batches of circuits (e.g., when computing jacobians and using a JacobianTape with the new tape mode feature of PennyLane)
  • End-to-end integration tests that test the connectivity of a local machine with Orquestra workflow submission (just like a user would use the available devices). These tests are not run by the CI.

Copy link

@thisac thisac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice code and testing @antalszava. Just had a few questions and some text-comments (a few docstrings in the tests need to be updated, etc.) 🏅

Comment on lines 51 to 52
- name: Adjust coverage file for Codecov
run: bash <(sed -i 's/filename=\"/filename=\"pennylane_orquestra\//g' coverage.xml)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, just re-iterating what @josh146 said earlier, is this necessary here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, thanks so much for catching that! Still remained there somehow (maybe in between branches). Removed.

pennylane_orquestra/gen_workflow.py Show resolved Hide resolved
pennylane_orquestra/orquestra_device.py Show resolved Hide resolved
pennylane_orquestra/orquestra_device.py Show resolved Hide resolved
pennylane_orquestra/orquestra_device.py Show resolved Hide resolved
tests/test_orquestra_device.py Outdated Show resolved Hide resolved
tests/test_orquestra_device.py Outdated Show resolved Hide resolved
tests/test_orquestra_device.py Outdated Show resolved Hide resolved
tests/test_orquestra_device.py Show resolved Hide resolved
tests/test_orquestra_device.py Show resolved Hide resolved
Base automatically changed from docs to main December 17, 2020 16:51
@antalszava antalszava merged commit 59d846f into main Dec 17, 2020
@antalszava antalszava deleted the execute_and_batch branch December 17, 2020 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants