-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: Introduce Device AHS validator for additional device information. #271
Conversation
…alidator, add validators for device constraints.
…etuning check in DeviceHamiltonianValidator.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #271 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 48 55 +7
Lines 3802 4102 +300
Branches 930 988 +58
==========================================
+ Hits 3802 4102 +300 ☔ View full report in Codecov by Sentry. |
a.txt
Outdated
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.
This can be removed
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.
Removed!
from braket.analog_hamiltonian_simulator.rydberg.validators.device_validators.device_atom_arrangement import ( # noqa: E501 F401 | ||
DeviceAtomArrangementValidator, | ||
) | ||
from braket.analog_hamiltonian_simulator.rydberg.validators.device_validators.device_capabilities_constants import ( # noqa: E501 F401 | ||
DeviceCapabilitiesConstants, |
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.
These two imports are going to cause circular import issues. One fix would be to swap the ordering of L1 and L4 but I would encourage you to see what other options there would be to resolve the circular import issue.
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.
In 746ab2c I opt to move device_capabilities_constants.py
to the parent directory, so it lives alongside the capabilities_constants.py
; this does break the separation of device_validation
and validation
constructs/methods but separates the DeviceCapabilitiesConstants
from the constructs that use it without having to enforce an import order in __init__.py
.
Please let me know if this approach is appropriate!
...analog_hamiltonian_simulator/rydberg/validators/device_validators/device_atom_arrangement.py
Outdated
Show resolved
Hide resolved
if start_value != 0 or end_value != 0: | ||
raise ValueError( | ||
f"The values of the Rabi frequency at the first and last time points are \ | ||
{start_value}, {end_value}; they both must be both 0." |
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.
{start_value}, {end_value}; they both must be both 0." | |
{start_value}, {end_value}; they both must be nonzero." |
...aket/analog_hamiltonian_simulator/rydberg/validators/device_validators/device_hamiltonian.py
Outdated
Show resolved
Hide resolved
… from style enforcement changes
Closing - Moving AHS Device Validation to the BDK instead of extending the default-simulator repo. |
Issue #, if available:
Description of changes:
Extend the AHS Validator by introducing a DeviceCapabilitiesConstants data class and additional Device-AtomArrangement, LocalDetuning, Hamiltonian, and DrivingField validators for information that's available in AWS AHS devices (e.g. Quera Aquila).
Testing done:
Testing done to achieve full coverage.
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
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.