Open terrorfisch opened 2 months ago
yes, that sounds reasonable to me. However, would the user then explicitly have to take care of the changed requirements for pulse granularity? That might run into some not so user friendly handling issues again if the time is not by chance compatible with all relevant powers of 2 (but maybe the pad_to_next_multiple or how it was called can help in some form)
Yes this is also somewhing that bothers me.
The best I can come up with is
shuttle = FunctionPT('sin(t / t_dur)', duration='t_dur')
s1 = shuttle.with_mapping({'t_dur': '192 * 2**i'})
s2 = shuttle.with_mapping({'t_dur': '256 * 2**i'})
s3 = shuttle.with_mapping({'t_dur': '320 * 2**i'})
sweep = (s1 @ s2 @ s3).with_iteration(i, 10, 1000)
In the end I think this is sufficient though. qupulse should probably enforce strict regulations and throw errors otherwise, and another layer on top [c/sh]ould allow potential inacurracies be handled. maybe some convenience functions can be drafted to assist this.
In principle we can add timing requirements to PulseMetaData
as well in the future to allow imprecise timing.
additionally, something with rolling out loops that would not natively be supported by the linspacebuilder/the hardware could potentially be included.
minimal_sample_rate
mixes physical information and setup information (depends on hardware filtering and interpolation)
Option 3 is the best bet
We need to insert the information that specific pulse templates can be sampled with a reduced rate into the build process at some point. The program builder needs to recognize these. These can be done in three ways.
create_program
is callecreate_program
which PTs are special (like the currentto_single_waveform
kwarg)IMO point 2 is the one that fits best into qupulse design philosophy because we do not attach any metadata to the PTs right now. However, this leads to a rather unintuitive interface in practice as the
to_single_waveform
case demonstrated (anecdotal evidence).My current preferred idea would be the following:
PulseMetaData
class with the fieldsto_single_waveform: bool
andminimal_sample_rate: float
metadata
kwarg tocreate_program
which is a map ofPulseTemplate | PulseTemplateIdentifier -> PTMetaData
@Nomos11 Does this sound reasonable?
Example for 2.:
Example for 3.: