Open HaroldErbin opened 1 week ago
Hi @HaroldErbin !
Thank you for the detailed issue. I agree with you that what you are trying to do is not easy and we'll add a more convenient way to do it. In the meantime, I can tell what you should do to estimate the full delay that's being added between the pulses. In your case, this delay is being enforced because the phase is changing between the two pulses, which takes some time and can't be done while the amplitude is not zero. So you have to account for two contributions:
Pulse.fall_time()
Channel.phase_jump_time
.So, in your case,
ising_ch_obj = seq.declared_channels["ising"]
full_delay = hadamard.fall_time(ising_ch_obj) + ising_ch_obj.phase_jump_time
I hope this helps. I'll keep the issue open until we add a better way to do this.
Hi @HGSilveri . Thanks a lot for your reply! After posting, I had arrived at the following:
full_delay = hadamard.get_full_duration(ising_ch_obj) - hadamard.duration + ising_ch_obj.phase_jump_time
but I was not sure why it worked, and your explanations are clarifying it.
Hi @HGSilveri . Thanks a lot for your reply! After posting, I had arrived at the following:
full_delay = hadamard.get_full_duration(ising_ch_obj) - hadamard.duration + ising_ch_obj.phase_jump_time
but I was not sure why it worked, and your explanations are clarifying it.
Indeed, this is equivalent to what I suggested and should give exactly the same result :)
I was wondering if it would be possible to have a function in
Sequence
(orChannel
or anywhere convenient) to estimate the delay needed between two pulses on a physical device?Context: I want to simulate the dynamics for a global pulse for the maximum duration allowed by
AnalogDevice
. In some cases, I want to start the dynamics with a "short" pulse to change the initial state. To stay belowdevice.max_sequence_duration
, I want to reduce the duration of the long pulse. This is easy forMockDevice
since the pulses are sharp, but the pulses are modified forAnalogDevice
to respect the physical constraints of the device. In particular, a delay can be added between the two pulses. Since I cannot get the duration of the delay before adding the long pulse to the sequence, butseq.add()
raises an error because maximal duration is exceeded, I am stuck:Here is the relevant part of my code:
I tried to investigate the source, but did not manage to extract a simple function to get the delay. For example, I thought that this would work:
but it does not give the delay observed inside the full sequence (which I get by just decreasing duration until it works, which is not generalizable):