Skip to content

Commit

Permalink
Merge pull request #931 from qiboteam/waveform-memory-rectangular
Browse files Browse the repository at this point in the history
Change waveform memory estimation
  • Loading branch information
alecandido authored Jul 11, 2024
2 parents f0dd15f + fe100ba commit 9d03bf1
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/qibolab/unrolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,23 @@
from dataclasses import asdict, dataclass, field, fields
from functools import total_ordering

from .pulses import PulseSequence
from .pulses import Pulse, PulseSequence
from .pulses.envelope import Rectangular


def _waveform(sequence: PulseSequence):
# TODO: deduplicate pulses (Not yet as drivers may not support it yet)
# TODO: count Rectangular and delays separately (Zurich Instruments supports this)
# TODO: Any constant part of a pulse should be counted only once (Zurich Instruments supports this)
# TODO: check if readout duration is faithful for the readout pulse (I would only check the control pulses)
# TODO: Handle multiple qubits or do all devices have the same memory for each channel ?
return sequence.duration - sequence.ro_pulses.duration
# TODO: VirtualZ deserves a separate handling
# TODO: any constant part of a pulse should be counted only once (Zurich Instruments supports this)
# TODO: handle multiple qubits or do all devices have the same memory for each channel ?
return sum(
(
(pulse.duration if not isinstance(pulse.envelope, Rectangular) else 1)
if isinstance(pulse, Pulse)
else 1
)
for pulse in sequence
)


def _readout(sequence: PulseSequence):
Expand Down

0 comments on commit 9d03bf1

Please sign in to comment.