Truth Table API#

qblox_instruments.qcodes_drivers.truth_table.LEVEL_OPTIONS = ('low', 'mid', 'high', 'invalid')#

Built-in immutable sequence.

If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

If the argument is a tuple, the return value is the same object.

qblox_instruments.qcodes_drivers.truth_table.MEASUREMENT_OPTIONS = ('count', 'digital')#

Built-in immutable sequence.

If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

If the argument is a tuple, the return value is the same object.

class qblox_instruments.qcodes_drivers.truth_table.ChannelMeasurement(channel: int, measurement: str)[source]#

Bases: object

Represents a measurement on a specific channel.

Parameters:
  • channel (int) – The channel number (must be in 0…7).

  • measurement (str) – The measurement type (must be one of MEASUREMENT_OPTIONS).

channel: int#
measurement: str#
__init__(channel: int, measurement: str) None#
class qblox_instruments.qcodes_drivers.truth_table.Condition(channel_measurement: ChannelMeasurement, level: str)[source]#

Bases: object

Represents a condition for a truth table entry, combining a channel measurement with a level.

Parameters:
channel_measurement: ChannelMeasurement#
level: str#
__init__(channel_measurement: ChannelMeasurement, level: str) None#
class qblox_instruments.qcodes_drivers.truth_table.TruthTableEntry(conditions: list[Condition], trigger_address: int)[source]#

Bases: object

Represents an entry in the truth table.

Parameters:
  • conditions (list[Condition]) – List of conditions that must be met.

  • trigger_address (int) – The trigger address associated with these conditions.

conditions: list[Condition]#
trigger_address: int#
__init__(conditions: list[Condition], trigger_address: int) None#
class qblox_instruments.qcodes_drivers.truth_table.TruthTable(default_trigger_address: int = 0, overwrite_conflict: bool = False)[source]#

Bases: object

Truth table manager class.

MAX_INPUTS#

Maximum number of distinct input channels allowed.

Type:

int

MAX_TRIGGER_ADDRESSES#

Maximum number of distinct trigger addresses allowed.

Type:

int

__init__(default_trigger_address: int = 0, overwrite_conflict: bool = False) None[source]#

Initialize the TruthTable.

Parameters:
  • default_trigger_address (int, optional) – The default trigger address. Must be in range 0…15.

  • overwrite_conflict (bool, optional) – Whether to overwrite existing LUT entries on conflict.

Raises:

ValueError – If the default trigger address is not in range 0…15.

property lut: dict[str, Any]#

Returns the lookup table (LUT).

Returns:

A dictionary with keys: src and lut,

src - list of input configurations, lut - list of trigger addresses.

Return type:

dict

add_conditions(conditions: list[Condition], trigger_address: int) None[source]#

Adds a set of conditions with an associated trigger address to the truth table.

Parameters:
  • conditions (list[Condition]) – List of conditions to add.

  • trigger_address (int) – Trigger address to associate with these conditions. Must be in range 1…15.

Raises:

ValueError – If trigger_address is not in range 1…15. If number of distinct inputs exceeds MAX_INPUTS. If adding the trigger_address would exceed MAX_TRIGGER_ADDRESSES. If a conflict is detected in the LUT and overwriting is disabled.

classmethod from_config(entries: list, default_trigger_address: int = 0, overwrite_conflict: bool = False) TruthTable[source]#

Builds a TruthTable from a list of dictionaries.

Parameters:
  • entries (list of dict) – List of configuration dictionary entries.

  • default_trigger_address (int, optional) – Default trigger address.

  • overwrite_conflict (bool, optional) – Whether to overwrite conflicts in the LUT.

Returns:

The constructed truth table.

Return type:

TruthTable

Notes

Each dictionary is expected to have the format:

{
    "conditions": [
        {"channel": int, "measurement": str, "level": str},
        ...
    ],
    "trigger": int
}