Skip to content

Commit 6ab12b0

Browse files
committed
Do not cache times for concatenated pulse in any case
It's faster to compute them from scratch
1 parent f1d5444 commit 6ab12b0

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

filter_functions/pulse_sequence.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,18 +1528,9 @@ def concatenate_without_filter_function(pulses: Iterable[PulseSequence],
15281528
attributes.update(**{key: value for key, value in zip(noise_keys, noise_values)})
15291529

15301530
newpulse = PulseSequence(**attributes)
1531-
1532-
if all(pulse.is_cached('t') for pulse in pulses):
1533-
# Cache times
1534-
times = [pulses[0].t]
1535-
for pulse in pulses[1:]:
1536-
times.append(pulse.t[1:] + times[-1][-1])
1537-
1538-
newpulse.t = np.concatenate(times)
1539-
else:
1540-
# Only cache total duration (whole array of times might be large
1541-
# in case of concatenation)
1542-
newpulse.tau = sum(pulse.tau for pulse in pulses)
1531+
# Only cache total duration (whole array of times might be large
1532+
# in case of concatenation)
1533+
newpulse.tau = sum(pulse.tau for pulse in pulses)
15431534

15441535
if return_identifier_mappings:
15451536
return newpulse, control_values[-1], noise_values[-1]

0 commit comments

Comments
 (0)