qat.purr.qatconfig module

class InstructionValidationConfig(**data)

Bases: BaseModel

The default settings for validation of instructions.

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.

ACQUIRE_CHANNEL: bool
property DISABLED
MAX_INSTRUCTION_LENGTH: bool
NO_MID_CIRCUIT_MEASUREMENT: bool
PULSE_DURATION_LIMITS: bool
classmethod check_disable_pulse_duration_limits(PULSE_DURATION_LIMITS)
disable()
model_config: ClassVar[ConfigDict] = {'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class QatConfig(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _secrets_dir=None, **values)

Bases: BaseSettings

Full settings for a single job. Allows environment variables to be overridden by direct assignment.

>>> import os
>>> os.environ["QAT_MAX_REPEATS_LIMIT"] = "654321"
>>> QatConfig() 
QatConfig(MAX_REPEATS_LIMIT=654321, ...)
>>> QatConfig(MAX_REPEATS_LIMIT=123) 
QatConfig(MAX_REPEATS_LIMIT=123, ...)
>>> del os.environ["QAT_MAX_REPEATS_LIMIT"]
>>> qatconfig = QatConfig()
>>> qatconfig.MAX_REPEATS_LIMIT = 16000
>>> qatconfig 
QatConfig(MAX_REPEATS_LIMIT=16000, ...)
>>> QatConfig(MAX_REPEATS_LIMIT=100.5) 
Traceback (most recent call last):
...
pydantic_core._pydantic_core.ValidationError
...
Input should be a valid integer, got a number with a fractional part

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 DISABLE_PULSE_DURATION_LIMITS

Flag to disable the lower and upper pulse duration limits. Only needs to be set to True for calibration purposes.

EXTENSIONS: list[ImportString]

QAT Extensions to initialise on start-up

HARDWARE: list[HardwareLoaderDescription]

QAT Hardware Models to load on start-up

INSTRUCTION_VALIDATION: InstructionValidationConfig

Options for Instruction validation before execution.

MAX_REPEATS_LIMIT: Optional[int]

Max number of repeats / shots to be performed in a single job.

PIPELINES: list[PipelineInstanceDescription | PipelineFactoryDescription | PipelineClassDescription] | None

QAT Pipelines to add on start-up, None adds default pipelines

SIMULATION: QatSimulationConfig

Options for QATs simulation backends.

classmethod from_yaml(path)
load_extensions()
classmethod matching_hardware_loaders(pipelines, info)
model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_flag_prefix_char': '-', 'cli_hide_none_type': False, 'cli_ignore_unknown_args': False, 'cli_implicit_flags': False, 'cli_kebab_case': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_use_class_docs_for_groups': False, 'enable_decoding': True, 'env_file': None, 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': '_', 'env_nested_max_split': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': 'QAT_', 'extra': 'forbid', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_validate', 'model_dump', 'settings_customise_sources'), 'secrets_dir': None, 'toml_file': None, 'validate_assignment': True, 'validate_default': True, 'yaml_file': 'qatconfig.yaml', 'yaml_file_encoding': None}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod one_default(v)
classmethod settings_customise_sources(settings_cls, init_settings, env_settings, dotenv_settings, file_secret_settings)

Define the sources and their order for loading the settings values.

Return type:

Tuple[PydanticBaseSettingsSource, ...]

Args:

settings_cls: The Settings class. init_settings: The InitSettingsSource instance. env_settings: The EnvSettingsSource instance. dotenv_settings: The DotEnvSettingsSource instance. file_secret_settings: The SecretsSettingsSource instance.

Returns:

A tuple containing the sources and their order for loading the settings values.

validate(compiler_config)

_summary_

Args:

compiler_config (CompilerConfig): _description_

class QatSimulationConfig(**data)

Bases: BaseModel

The default settings for QATs simulation backends.

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.

QISKIT: QiskitSimulationConfig
model_config: ClassVar[ConfigDict] = {'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class QiskitSimulationConfig(**data)

Bases: BaseModel

The default settings for the Qiskit Simulator, including overridden MPS settings.

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.

ENABLE_METADATA: bool

Returns the AerSimulator metadata if enabled.

FALLBACK_SEQUENCE: list[Literal['automatic', 'statevector', 'density_matrix', 'stabilizer', 'matrix_product_state', 'extended_stabilizer', 'unitary', 'superop']]

If the simulation fails, specify a fallback sequence of methods to call.

METHOD: Literal['automatic', 'statevector', 'density_matrix', 'stabilizer', 'matrix_product_state', 'extended_stabilizer', 'unitary', 'superop']

The simulation method to use.

OPTIONS: dict

Specify the options for a chosen AerSimulator backend. See https://docs.quantum.ibm.com/api/qiskit/0.37/qiskit.providers.aer.AerSimulator for options you can provide.

allowed_methods: type
model_config: ClassVar[ConfigDict] = {'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].