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

feat: Make MAX_NET_DETUNING in AHS device capabilities optional and extend field validator utility functions. #272

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

Conversation

Altanali
Copy link
Contributor

@Altanali Altanali commented Jul 27, 2024

Issue #, if available:

Description of changes:
Make the MAX_NET_DETUNING device capability data point optional for AHS program validation - this is done so the Program validator used for AHS programs with the local simulator can also be used with capabilities derived from QPU capabilities, which don't provide a MAX_NET_DETUNING data point.

Additionally, utility methods validate_max_absolute_slope,validate_time_precision,validate_time_separation,validate_value_precision are added to field validator utilities for use AHS Program validation with Device Capabilities Constants (introduced in BDK).

Testing done:
Tested the newly introduced field validation utility functions.

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.

@Altanali Altanali requested a review from a team as a code owner July 27, 2024 02:19
Copy link

codecov bot commented Jul 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a9808f3) to head (20c1b54).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #272   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           48        48           
  Lines         3802      3821   +19     
  Branches       930       938    +8     
=========================================
+ Hits          3802      3821   +19     

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

@@ -104,3 +104,50 @@ def validate_net_detuning_with_warning(
# Return immediately if there is an atom has net detuning
# exceeding MAX_NET_DETUNING at a time point
return program


Copy link
Contributor

@maolinml maolinml Jul 31, 2024

Choose a reason for hiding this comment

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

Just want to remind myself, are these four functions the only things that needs to be moved from the service side to the client side? Also it maybe good to comment on the top of each of these functions that they are only for device emulator and not for AHS local simulator [so that people won't be confused that why they are not used in this repo].

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, don't we also need "validate_pattern_precision"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

validate_pattern_precision is never used by the Device validators so I chose not to bring it over to the Default Simulator repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding the additional comments makes sense for explaining the use of these helpers!

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.

3 participants