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

[Frontend][Runtime] lightning.qubit specifies its supported capabilities, compilation options, and runtime options in a config file #369

Merged
merged 121 commits into from
Dec 14, 2023

Conversation

erick-xanadu
Copy link
Contributor

@erick-xanadu erick-xanadu commented Nov 22, 2023

Context:

Description of the Change:

  • Device specification for lightning.qubit is available.
  • Device specification for lightning.kokkos is available.
  • Device specification for braket.local.qubit device is available.
  • Device specification for braket.aws.qubit device is available.
  • Device specification for dummy.device is available
  • Check validity by
    • checking if existing file exists
    • check if gates in "native", "decomp" and "matrix" overlap
    • check if gates in "native", "decomp" and "matrix" do not match with those in qml.device.operations
  • Support custom devices.
  • decomposition to QubitUnitary may be specified by "matrix" gates in the specification.
    • However, to maintain maximum differentiability at the moment this is overriden by the compiler.
  • Users can specify compilation options/details, which will be taken into account by the compiler.
    • We don't have any compilation options at the moment that fit in this scope.
  • Users can specify Lightning runtime options within the device loader, as allowed by the configuration, which will be taken into account at runtime (for example, MCMC sampling).
    • options are encoded in the IR
    • options are used in the device
    • options are tested
  • Documentation
  • After discussion, do not install these files in Catalyst, have them be accessible from qml.Device.

Benefits:

  • Implementation of ADR. Please see ADR 73 for the details.

Possible Drawbacks:

  • Now tests for custom devices require toml files as well.

Related GitHub Issues:

Notes:

[sc-46420]

@erick-xanadu erick-xanadu force-pushed the eochoa/2023-11-22/supported-gates-via-toml branch 2 times, most recently from 1a16bcc to 64cfa62 Compare November 22, 2023 21:46
Copy link

codecov bot commented Nov 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (980f584) 99.49% compared to head (a721451) 99.54%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #369      +/-   ##
==========================================
+ Coverage   99.49%   99.54%   +0.05%     
==========================================
  Files          42       43       +1     
  Lines        7150     7302     +152     
  Branches      483      497      +14     
==========================================
+ Hits         7114     7269     +155     
+ Misses         20       17       -3     
  Partials       16       16              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@erick-xanadu erick-xanadu force-pushed the eochoa/2023-11-22/supported-gates-via-toml branch 10 times, most recently from 013e662 to 09ce4f8 Compare November 24, 2023 16:20
@erick-xanadu erick-xanadu marked this pull request as ready for review November 24, 2023 16:22
@erick-xanadu erick-xanadu changed the title [WIP] lightning.qubit specifies its supported capabilities, compilation options, and runtime options in a config file [Frontend][Runtime] lightning.qubit specifies its supported capabilities, compilation options, and runtime options in a config file Nov 24, 2023
@erick-xanadu erick-xanadu force-pushed the eochoa/2023-11-22/supported-gates-via-toml branch from 15af2c4 to 9416bfc Compare November 24, 2023 16:51
@erick-xanadu erick-xanadu marked this pull request as draft November 24, 2023 20:43
doc/changelog.md Outdated Show resolved Hide resolved
runtime/lib/backend/lightning/lightning.qubit.toml Outdated Show resolved Hide resolved
@erick-xanadu erick-xanadu force-pushed the eochoa/2023-11-22/supported-gates-via-toml branch 2 times, most recently from faac1ac to e63b60b Compare November 30, 2023 16:08
@erick-xanadu erick-xanadu marked this pull request as ready for review November 30, 2023 16:50
doc/changelog.md Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
runtime/tests/third_party/dummy.device.toml Outdated Show resolved Hide resolved
runtime/lib/backend/openqasm/braket.local.qubit.toml Outdated Show resolved Hide resolved
runtime/lib/backend/openqasm/braket.local.qubit.toml Outdated Show resolved Hide resolved
doc/requirements.txt Outdated Show resolved Hide resolved
doc/dev/custom_devices.rst Show resolved Hide resolved
doc/dev/custom_devices.rst Outdated Show resolved Hide resolved
doc/dev/custom_devices.rst Outdated Show resolved Hide resolved
doc/dev/custom_devices.rst Outdated Show resolved Hide resolved
@erick-xanadu erick-xanadu force-pushed the eochoa/2023-11-22/supported-gates-via-toml branch from cbc7938 to 1fb1813 Compare December 12, 2023 22:07
doc/dev/custom_devices.rst Outdated Show resolved Hide resolved
Copy link
Collaborator

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Great work @erick-xanadu, from my side this looks good 💯

I just wanted to clarify, what is the strategy we have to remove the lightning toml files from our repo (since we could already build the runtime against the latest lightning commit)? Does it require that the installed user package of lightning is the latest?

doc/dev/custom_devices.rst Outdated Show resolved Hide resolved
doc/dev/custom_devices.rst Outdated Show resolved Hide resolved
doc/dev/custom_devices.rst Show resolved Hide resolved
doc/dev/custom_devices.rst Show resolved Hide resolved
doc/dev/custom_devices.rst Show resolved Hide resolved
frontend/catalyst/pennylane_extensions.py Show resolved Hide resolved
frontend/catalyst/pennylane_extensions.py Show resolved Hide resolved
frontend/catalyst/pennylane_extensions.py Outdated Show resolved Hide resolved
frontend/catalyst/pennylane_extensions.py Show resolved Hide resolved
frontend/catalyst/pennylane_extensions.py Show resolved Hide resolved
@erick-xanadu erick-xanadu force-pushed the eochoa/2023-11-22/supported-gates-via-toml branch from 85dc234 to 95cb1f5 Compare December 14, 2023 15:47
@erick-xanadu
Copy link
Contributor Author

@dime10 feel free to add more suggestions. Will merge by the end of the day.

@dime10
Copy link
Collaborator

dime10 commented Dec 14, 2023

All good from my end 👍

@erick-xanadu erick-xanadu merged commit ea1c7b7 into main Dec 14, 2023
21 checks passed
@erick-xanadu erick-xanadu deleted the eochoa/2023-11-22/supported-gates-via-toml branch December 14, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Pull requests that update the frontend runtime Pull requests that update the runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants