-
Notifications
You must be signed in to change notification settings - Fork 30
Linspace followup waveforms #920
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
base: master
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,7 +67,8 @@ def __init__(self, *, | |
| self._metadata = metadata | ||
|
|
||
| self.__cached_hash_value = None | ||
|
|
||
| self.__pow_2_divisor = 0 | ||
|
|
||
| @property | ||
| def metadata(self) -> TemplateMetadata: | ||
| """The metadata is intended for information which does not concern the pulse itself but rather its usage. | ||
|
|
@@ -157,7 +158,18 @@ def initial_values(self) -> Dict[ChannelID, ExpressionScalar]: | |
| def final_values(self) -> Dict[ChannelID, ExpressionScalar]: | ||
| """Values of defined channels at t == self.duration""" | ||
| raise NotImplementedError(f"The pulse template of type {type(self)} does not implement `final_values`") | ||
|
|
||
|
|
||
| @property | ||
| def _pow_2_divisor(self) -> int: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CAn we move this to metadata?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. makes sense; forgot that this is already implemented. like this or even without accessor?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we do not need to include it in the type system for now. Just add it as a dynamic property. Question is, how to handle it for the waveform. whould we add a metadata field there as well?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. possibly, but the waveforms are not really used in the public interface anyway, so yagni?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will need it to propagate properties like these. |
||
| """A hacky implementation of telling waveforms to be sampled at reduced rate. | ||
| The hardware implementation will be responsible for correctly handling this, | ||
| so do not use unless support is ascertained. | ||
| """ | ||
|
|
||
| @_pow_2_divisor.setter | ||
| def _pow_2_divisor(self, val: int): | ||
| self.__pow_2_divisor = val | ||
|
|
||
| def create_program(self, *, | ||
| parameters: Optional[Mapping[str, Union[Expression, str, Number]]]=None, | ||
| measurement_mapping: Optional[Mapping[str, Optional[str]]]=None, | ||
|
|
@@ -708,10 +720,12 @@ def _internal_create_program(self, *, | |
| measurements = self.get_measurement_windows(parameters=scope, | ||
| measurement_mapping=measurement_mapping) | ||
| program_builder.measure(measurements) | ||
|
|
||
| if global_transformation: | ||
| waveform = TransformingWaveform.from_transformation(waveform, global_transformation) | ||
|
|
||
|
|
||
| waveform._pow_2_divisor = self._pow_2_divisor | ||
|
|
||
| constant_values = waveform.constant_value_dict() | ||
| if constant_values is None: | ||
| program_builder.play_arbitrary_waveform(waveform) | ||
|
|
||
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.
Do we need WaveformCollection in the main repo?
I thnk it needs a different name and it belongs into a different file. I understand what the class is used for but I do not have a concept of what it actually represents (in terms of nesting). I think it is useful for general command table like devices, but needs more refinement before putting it into the main repo.