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

time extension via SequencePT #830

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Nomos11
Copy link
Collaborator

@Nomos11 Nomos11 commented Jun 1, 2024

somewhat against the design principles discussed in #824, but maybe somewhat convenient for pad_to related utility?

branch https://github.com/qutech/qupulse/tree/feat/time_extension_pulse_template is more elaborate, however, in which situation is it really needed to deviate from a sequencePT-style?

Copy link

github-actions bot commented Jun 1, 2024

Test Results

    6 files  ±    0      6 suites  ±0   5m 1s ⏱️ + 1m 25s
1 214 tests +  527  1 144 ✅ +  504   68 💤 + 21   2 ❌ + 2 
7 284 runs  +3 162  6 864 ✅ +3 024  408 💤 +126  12 ❌ +12 

For more details on these failures, see this check.

Results for commit db9f56c. ± Comparison against base commit 1b3838e.

♻️ This comment has been updated with latest results.

@terrorfisch
Copy link
Member

terrorfisch commented Jun 3, 2024

I am not anymore convinced that encoding this in the type has enough advantages. A class method on sequencept could do the same.

@Nomos11
Copy link
Collaborator Author

Nomos11 commented Jun 3, 2024

The main point of increased convenience would probably be the automated insertion into the program creation by overwriting the _create_program method with the added self into to_single_waveform

self.assertEqual(duration_extended, duration_summed)

def test_pad_to_usecase(self):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What I mean by the previous comment is basically this, which gives a - in my opinion - quite convenient way of quickly extend waveforms with shorter and longer hold times guaranteed to match the hardware requirements

Copy link
Member

Choose a reason for hiding this comment

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

I think a utility function like this would be sufficient

def extend(self, *, total_duration = None, prepend = None, append = None) -> SequencePT:
    none_count = total_duration is None + prepend is None + append is None
    if none_count != 1:
        raise ValueError("Exactly two arguments must be specified.")
    # Return a SequencePT

Copy link
Collaborator Author

@Nomos11 Nomos11 Jun 5, 2024

Choose a reason for hiding this comment

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

for that case of not concatenating the waveforms, yes; what about the single wf case? (Which i initially added this for, the other one was then mostly to have similar syntax)

Copy link
Member

Choose a reason for hiding this comment

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

Ah, but why the SequencePT? Why represent the start and end as PulseTemplates? I would either have a PT that represents the time extention without introducing ConstantPTs in the front and in the back OR use SequencePT and add an atomic flag to it which encodes potential atomicity in the PT itself.

Copy link
Collaborator Author

@Nomos11 Nomos11 Jun 5, 2024

Choose a reason for hiding this comment

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

seemed like the least programmatic effort to me that does the job, but that can of course be changed.

@Nomos11 Nomos11 requested a review from terrorfisch June 4, 2024 17:37
inner_program = inner_builder.to_program()

if inner_program is not None:
#measurements not yet included
Copy link
Member

Choose a reason for hiding this comment

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

The linspace builder ignores measurements. The idea is to have a dedicated MeasurementBuilder to extract them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok

@Nomos11 Nomos11 mentioned this pull request Sep 5, 2024
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.

2 participants