-
Notifications
You must be signed in to change notification settings - Fork 60
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
Adding a function to draw SequenceSamples
#522
Comments
Hey all, I would like to work on this issue as part of the Unitary Hack. |
Hey @neogyk, |
@a-corni I have a doubt; the parameter list of EDIT: The drawing of This is the last thing I have to handle to complete the task. Content of
Content of
|
There is indeed an issue in rebuilding the
I see two options:
|
The best option I think is the first, but I can't get it; in I commited the branch, still WIP but draw_samples and draw_sequence are decoupled and works. |
You can only reconstruct the That is why I was saying you cannot rebuild I am not sure I see why you need pulse information to draw phase shifts. Can you be more explicit about what you have in mind ? |
Now I think I understood it.
This was my misunderstanding, I've got it. Now the current solution I'm implementing is this:
To work as before for draw_sequence, I need to do you think is a good solution if I add an optional parameter |
Discussing with @HGSilveri, we are now convinced that the second option is the best - it's a bit annoying to approximate the times of the We can even do something easier than having an attribute for the To avoid the repetition of information of the attributes You can also transform the attribute |
ok.
What do you prefer? |
For consistency, I think we have to pass channel_obj to ChannelSamples constructor. That way, SequenceSamples and ChannelSamples will be closer in structure to Schedule and ChannelSchedule, I find this nice. I think the first option has to be dropped for consistency. About the third, I find preferable to add to the current implementation an attribute to store the target slots instead of creating an attribute to store all the time slots. @HGSilveri what is your opinion on this ? I find it better to add to the attributes of a |
@dakk you can go for the last proposal, that is, add to the attributes of |
@a-corni it is clear, but I don't understand why only if slot.type == "target":
target[(slot.ti, slot.tf - 1)] = slot.targets
continue
if slot.type == "delay":
continue
pulse = cast(Pulse, slot.type)
for wf_type in ["amplitude", "detuning"]:
wf = getattr(pulse, wf_type)
if isinstance(wf, InterpolatedWaveform):
pts = wf.data_points
pts[:, 0] += slot.ti
interp_pts[wf_type] += pts.tolist() |
This part is to draw |
Ok done; please have a look to the edits |
At the moment, we can draw instances of
Sequence
using thedraw_sequence
function ofpulser.sequence._seq_drawer
, but there is no function to drawSequenceSamples
(the result of the sampling of aSequence
instance, that can be obtained using thesample
method frompulser.sampler.sampler
). We could need such a function to drawSequenceSamples
in the recently builtQutipEmulator
ofpulser_simulation
.In fact,
draw_sequence
mainly relies on thesample
method, and handles almost exclusivelySequenceSamples
. I propose to have an intermediate function (draw_samples
) that would draw samples, and that would be called bydraw_sequence
with the sampled sequence.This can be implemented by modifying
gather_data
such that it works withSequenceSamples
. The features ofSequence
that cannot be accessed inSequenceSamples
(like interpolation of waveforms) can normally still be performed in thedraw_sequence
, such that the previous results ofdraw_sequence
are unchanged.The text was updated successfully, but these errors were encountered: