Skip to content

Commit

Permalink
Readout write_integration_weights to raise ToolkitError
Browse files Browse the repository at this point in the history
  • Loading branch information
markheik committed Apr 17, 2023
1 parent e1b4099 commit df51eb5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/zhinst/toolkit/driver/nodes/readout.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import numpy as np
import zhinst.utils.shfqa as utils
from zhinst.toolkit.exceptions import ToolkitError

from zhinst.toolkit.interface import AveragingMode
from zhinst.toolkit.nodetree import Node, NodeTree
Expand Down Expand Up @@ -155,17 +156,16 @@ def write_integration_weights(
keys correspond to the indices of the integration units to be
configured.
integration_delay: Delay in seconds before starting the readout.
(default = 0.0)
clear_existing: Flag whether to clear the waveform memory before
the present upload. (default = True)
the present upload.
"""
if (
len(weights.keys()) > 0
and max(weights.keys()) >= self._max_qubits_per_channel
):
raise RuntimeError(
raise ToolkitError(
f"The device only has {self._max_qubits_per_channel} qubits per channel"
f", but {max(weights.keys())} where specified"
f", but {max(weights.keys())} were specified."
)
waveform_dict = {}
if isinstance(weights, Waveforms):
Expand Down

0 comments on commit df51eb5

Please sign in to comment.