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

Reinstate support for user-defined gates in PyQVM.execute #1067

Merged
merged 3 commits into from
Oct 29, 2019

Conversation

appleby
Copy link
Contributor

@appleby appleby commented Oct 20, 2019

In #874, PyQVM was changed to remove the restriction for
run-and-measure style programs. In the process, PyQVM.execute lost the
ability to execute programs with user defined gates, which apparently
broke pennylane-forest's PyQVM support.

This commit reinstates the block of code for extracting defined_gates
from the Program passed to PyQVM.execute, and with it the ability to
execute Programs with (non-parametric) defgates.

Fixes #1059

See also: PennyLaneAI/pennylane-rigetti#22

Checklist

  • The above description motivates these changes.
  • There is a unit test that covers these changes.
  • All new and existing tests pass locally and on Semaphore.
  • Parameters have type hints with PEP 484 syntax.
  • Functions and classes have useful sphinx-style docstrings.
  • (New Feature) The docs have been updated accordingly.
  • (Bugfix) The associated issue is referenced above using
    auto-close keywords.
  • The changelog is updated,
    including author and PR number (@username, gh-xxx).

In #874, PyQVM was changed to remove the restriction for
run-and-measure style programs. In the process, PyQVM.execute lost the
ability to execute programs with user defined gates, which apparently
broke pennylane-forest's PyQVM support.

This commit reinstates the block of code for extracting defined_gates
from the Program passed to PyQVM.execute, and with it the ability to
execute Programs with (non-parametric) defgates.

Fixes #1059

See also: PennyLaneAI/pennylane-rigetti#22
@karalekas
Copy link
Contributor

Was that PR also what caused the PyQVM to get much slower? (re: PennyLaneAI/pennylane-rigetti#24) (cc: @ecpeterson)

@appleby
Copy link
Contributor Author

appleby commented Oct 20, 2019

@appleby appleby marked this pull request as ready for review October 20, 2019 02:36
@appleby appleby requested a review from a team as a code owner October 20, 2019 02:36
@karalekas karalekas added the bug 🐛 An issue that needs fixing. label Oct 29, 2019
@karalekas karalekas added this to the v2.13 milestone Oct 29, 2019
@karalekas karalekas merged commit cb8bbd3 into master Oct 29, 2019
@karalekas karalekas deleted the fix/pyqvm-execute branch October 29, 2019 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue that needs fixing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DefGate broken in the NumpyWavefunctionSimulator
2 participants