iqm.pulla.utils_qir.qir_to_pulla#
- iqm.pulla.utils_qir.qir_to_pulla(compiler, qir, qubit_mapping=None)#
Convert a QIR module to an IQM quantum circuit.
- Parameters:
compiler (Compiler) – Compiler to use.
qir (str | bytes) – QIR source or bitcode to convert to a circuit.
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) – Dictionary mapping QIR qubit indexes to physical qubit names, None will assume opaque pointers match physical names.
- Returns:
Quantum circuits extracted from the QIR module, compiler with updated
component_mapping.- Raises:
ValueError – The QIR program has more than one basic block.
- Return type: