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 pulse support to the PennyLane-Braket plugin for the OQC device #15

Open
wants to merge 159 commits into
base: main
Choose a base branch
from

Conversation

lillian542
Copy link
Owner

@lillian542 lillian542 commented Jul 18, 2023

Description of changes:
Adds access to the OQC device Lucy through PennyLane's pulse programming module.

Where it was simple to do so, the code was kept general for ease of adding additional devices later. However, some refactoring to remove hardcoded assumptions based on the Lucy device will certainly be necessary to add additional pulse-based devices.

  • adds ParametrizedEvolution as an allowed operation for the OQC Lucy device only
  • adds a dispatch of _translate_operation for converting a PennyLane ParameterizedEvolution to a Braket PulseGate
    • to facilitate this, because device-specific information regarding frames is needed for translation, a device kwarg is added to _translate_operation, which defaults to None
  • adds validation checks for parameters of the pulse where needed to ensure timely and clear error messages wrt invalid pulse inputs
  • adds a pulse_settings attribute (user-facing) that retrieves and displays some of the device specs (resonant frequency, connectivity, anharmonicity) that users might want in PL simulations
    • to facilitate this, several helper-functions are added to retrieve frame names rather than hardcoding them to use the Lucy format

Open questions:

  • Should a warning be raised if a user provides settings to use with a pulse to inform them that the settings will be ignored? Raising a warning would be inconsistent with vanilla PennyLane behaviour.

Testing done:

  • unit testing of the _translate_operation function for both constant amplitudes and amplitudes with a callable defining a pulse envelope
  • unit testing for the pulse_settings and the functions to access device frames
  • unit testing for errors raised in validation for invalid ParametrizedEvolution operators

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

lillian542 and others added 30 commits March 9, 2023 13:55
Also made plugin compatible with new return types specification (amazon-braket#153)

Co-authored-by: Mudit Pandey <[email protected]>
Co-authored-by: Christina Lee <[email protected]>
Co-authored-by: Tom Bromley <[email protected]>
Co-authored-by: Korbinian Kottmann <[email protected]>
Co-authored-by: David Wierichs <[email protected]>
Co-authored-by: Cody Wang <[email protected]>
lillian542 and others added 30 commits August 14, 2023 16:13
Co-authored-by: Jean-Christophe Jaskula <[email protected]>
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.