iqm.iqm_client.validation.validate_instruction#
- iqm.iqm_client.validation.validate_instruction(architecture: DynamicQuantumArchitecture, instruction: CircuitOperation, qubit_mapping: WithJsonSchema(json_schema={'anyOf': [{'type': 'array', 'items': {'type': 'object', 'required': ['logical_name', 'physical_name'], 'properties': {'logical_name': {'type': 'string'}, 'physical_name': {'type': 'string'}}, 'additionalProperties': False}}, {'type': 'null'}]}, mode=None)] | None = None) None#
Validate an instruction against the dynamic quantum architecture.
Checks that the instruction uses a valid implementation, and targets a valid locus.
- Parameters:
architecture (DynamicQuantumArchitecture) – Quantum architecture to check against.
instruction (CircuitOperation) – Instruction to check.
qubit_mapping (Annotated[dict[str, str], BeforeValidator(func=~iqm.station_control.interface.models.circuit._parse_legacy_qubit_mapping, json_schema_input_type=PydanticUndefined), PlainSerializer(func=~iqm.station_control.interface.models.circuit._serialize_as_legacy_qubit_mapping, return_type=PydanticUndefined, when_used=always), WithJsonSchema(json_schema={'anyOf': [{'type': 'array', 'items': {'type': 'object', 'required': ['logical_name', 'physical_name'], 'properties': {'logical_name': {'type': 'string'}, 'physical_name': {'type': 'string'}}, 'additionalProperties': False}}, {'type': 'null'}]}, mode=None)] | None) – Mapping of logical qubit names to physical qubit names. Can be set to
Noneifinstructionalready uses physical qubit names.
- Raises:
CircuitValidationError – validation failed
- Return type:
None