qat.model.target_data module
- class AbstractTargetData(**data)
Bases:
NoExtraFieldsFrozenModelData related to a general target machine.
- Parameters:
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
-
default_shots:
Annotated[int]
- classmethod from_yaml(path)
-
max_acquisitions:
Annotated[int]
- property max_shots: Annotated[int, Gt(gt=0)]
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'ser_json_inf_nan': 'constants', 'use_enum_values': False, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod warn_on_max_shots(values)
- CustomTargetData(max_shots=10000, default_shots=1000, passive_reset_time=0.001)
Returns a default TargetData instance, allowing configuration over user-level parameters.
Deprecated since version 3.3.0: This will be removed in version 4.0.0. Use
TargetData()with appropriate keyword arguments instead.- Parameters:
max_shots¶ (
int) – The maximum amount of shots possible on this target.default_shots¶ (
int) – The default amount of shots on this target if none specified through the instructions or compiler_config.passive_reset_time¶ (
float) – The amount of time to wait after each shot to allow the qubits to passively reset.
- Return type:
- DefaultTargetData()
Returns a default TargetData instance. :rtype:
TargetDataDeprecated since version 3.3.0: This will be removed in version 4.0.0. Use
TargetData()instead.
- class DeviceDescription(**data)
Bases:
NoExtraFieldsFrozenModelDevice-related target description.
- Parameters:
sample_time¶ – The rate at which the pulse is sampled (in s).
samples_per_clock_cycle¶ – The number of samples per clock cycle.
instruction_memory_size¶ – The max. allowed number of instructions.
waveform_memory_size¶ – The max. memory that can be used for waveforms, in clock cycles.
pulse_duration_min¶ – The minimal pulse duration for all pulse channels.
pulse_duration_max¶ – The maximal pulse duration for all pulse channels.
pulse_channel_lo_freq_min¶ – The minimal LO frequency for a pulse channel.
pulse_channel_lo_freq_max¶ – The maximal LO frequency for a pulse channel.
pulse_channel_if_freq_min¶ – The minimal intermediate frequency for a pulse channel.
pulse_channel_if_freq_max¶ – The maximal intermediate frequency for a pulse channel.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- property clock_cycle
-
instruction_memory_size:
Annotated[int]
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'ser_json_inf_nan': 'constants', 'use_enum_values': False, 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
pulse_channel_if_freq_max:
Annotated[int]
-
pulse_channel_if_freq_min:
Annotated[int]
-
pulse_channel_lo_freq_max:
Annotated[int]
-
pulse_channel_lo_freq_min:
Annotated[int]
-
pulse_duration_max:
Annotated[float]
-
pulse_duration_min:
Annotated[float]
- classmethod random(seed=None)
Build a randomized device description for testing and demos.
- Parameters:
seed¶ (
Union[int,float,str,bytes,bytearray,None]) – Optional seed used to make the generated values reproducible.- Returns:
A
DeviceDescriptionwith randomized, valid hardware limits.
-
sample_time:
Annotated[float]
-
samples_per_clock_cycle:
Annotated[int]
- validate_durations()
-
waveform_memory_size:
Annotated[int]
- class QubitDescription(**data)
Bases:
DeviceDescriptionQubit-related target description.
- Parameters:
passive_reset_time¶ – The amount of time after each shot where the qubit is idle.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'ser_json_inf_nan': 'constants', 'use_enum_values': False, 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
passive_reset_time:
Annotated[float]
- classmethod random(seed=None)
Build a randomized qubit description for testing and demos.
This method starts from
DeviceDescription.random()and adds a randomizedpassive_reset_time.- Parameters:
seed¶ (
Union[int,float,str,bytes,bytearray,None]) – Optional seed used to make the generated values reproducible.- Returns:
A
QubitDescriptioninstance with randomized valid fields.
- class ResonatorDescription(**data)
Bases:
DeviceDescriptionResonator-related target description.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'ser_json_inf_nan': 'constants', 'use_enum_values': False, 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class TargetData(**data)
Bases:
AbstractTargetDataData related to a general target machine.
- Parameters:
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
-
QUBIT_DATA:
QubitDescription
-
RESONATOR_DATA:
ResonatorDescription
- property clock_cycle
- classmethod create_with(passive_reset_time=None, **kwargs)
Returns a default TargetData instance, allowing configuration over user-level parameters.
Deprecated since version 3.3.0: This method will be removed in version 4.0.0. Use
TargetData()with appropriate keyword arguments instead.- Parameters:
max_shots¶ – The maximum amount of shots possible on this target.
default_shots¶ – The default amount of shots on this target if none specified through the instructions or compiler_config.
passive_reset_time¶ (
Optional[float]) – The amount of time to wait after each shot to allow the qubits to passively reset.
- Return type:
- classmethod default()
Returns a default TargetData instance. :rtype:
TargetDataDeprecated since version 3.3.0: This method will be removed in version 4.0.0. Use
TargetData()instead.
-
default_shots:
Annotated[int]
- property instruction_memory_size
Deprecated since version 3.3.0: This property will be removed in version 4.0.0. Use
TargetData.QUBIT_DATA(thenTargetData().QUBIT_DATA.instruction_memory_size) orTargetData.RESONATOR_DATA(thenTargetData().RESONATOR_DATA.instruction_memory_size) instead.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'ser_json_inf_nan': 'constants', 'use_enum_values': False, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod random(seed=None)
Build randomized target data for testing and synthetic examples.
When
seedisNone, a seed is generated and reused for both qubit and resonator descriptions so they remain clock-cycle compatible.- Parameters:
seed¶ (
Union[int,float,str,bytes,bytearray,None]) – Optional seed used to make the generated values reproducible.- Return type:
- Returns:
A randomized
TargetDatainstance.
- validate_clock_cycles()