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

extend pad_to to pad_to_all_atomic_subtemplates #882

Open
Nomos11 opened this issue Jan 15, 2025 · 4 comments
Open

extend pad_to to pad_to_all_atomic_subtemplates #882

Nomos11 opened this issue Jan 15, 2025 · 4 comments
Labels
Milestone

Comments

@Nomos11
Copy link
Collaborator

Nomos11 commented Jan 15, 2025

to increase convenience even more, the pad_to could be called from the top-level-pt to extend all atomic subtemplates to adhere to awg-specifications.
This is e.g. outlined in branch feat/linspace_measurements and should be simple to implement

def pad_all_atomic_subtemplates_to(self,

Potentially for 1.0?
In that regard however, the PT time-extended in this manner should by default be translated into a single waveform, otherwise the convenience gets lost again.

@Nomos11 Nomos11 changed the title exten pad_to to pad_to_all_atomic_subtemplates extend pad_to to pad_to_all_atomic_subtemplates Jan 15, 2025
@Nomos11 Nomos11 added this to the Release 1.0 milestone Feb 13, 2025
@Nomos11
Copy link
Collaborator Author

Nomos11 commented Feb 13, 2025

also the padding should allow to create the pulse as a single waveform,otherwise the convenience is lost
maybe by inheriting from atomicPT?

class SingleWFTimeExtensionPulseTemplate(AtomicPulseTemplate):

@shumpohl
Copy link
Member

Everything AWG specific should go into create_program if possible. Can you give a usecase?

In that regard however, the PT time-extended in this manner should by default be translated into a single waveform, otherwise the convenience gets lost again.

Do you mean the root PT? Where is then the difference to pad_to(..., to_single_waveform=True)?

@Nomos11
Copy link
Collaborator Author

Nomos11 commented Feb 14, 2025

But is to_single_waveform=True available on the master branch currently? it seems that a sequencePT is created when kwargs are provided (what does to_single_waveform do then?). Probably I don't understand it right now.

The usecase would be that I could imagine the user assuming this "padding" functionality to fix the awg quanta issue by extending the "same PT" object that the function is called on, but right now (maybe I'm missing the decisive step) a SequencePT is created which by default will be translated to two waveforms unless specified explicitly in create_program's to_single_waveform, which seems clumsy (?) for many pulses

@shumpohl
Copy link
Member

But is to_single_waveform=True available on the master branch currently?

Touché. One neat hack would be to add to_single_waveform as a PulseTemplate.__init__ key word argument. I will make an issue for that.

The usecase would be that I could imagine the user assuming this "padding" functionality to fix the awg quanta issue by extending the "same PT" object that the function is called on, but right now (maybe I'm missing the decisive step) a SequencePT is created which by default will be translated to two waveforms unless specified explicitly in create_program's to_single_waveform, which seems clumsy (?) for many pulses

One solution is to add a wavefrom padding functionality to create_program. However, this breaks any duration dependent code, i.e. when you do

pt = some_pt()
other_pt = some_other_pt(pt.duration) @ pt

and the correctness of other_pt depends on the exact value of pt.duration. It is very hard/impossible to detect this automatically with the current design. Another question is wether this functionality should go into the pulse template or in the program builder code. I argue for pulse template so we can be sure that all program builders (linspace, plotting, measurement) work with the same waveform lengths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants