iqm.pulla.utils_qir.qir_to_pulla

Contents

iqm.pulla.utils_qir.qir_to_pulla#

iqm.pulla.utils_qir.qir_to_pulla(pulla, qir, qubit_mapping=None)#

Convert a QIR module to a CPC circuit.

Parameters:
  • pulla (Pulla) – The Pulla instance to get compiler from.

  • qir (str | bytes) – The QIR source or bitcode to convert to a circuit.

  • qubit_mapping (dict[int, str] | None) – A dictionary mapping QIR qubit indexes to physical qubit names, None will assume opaque pointers match physical names.

Returns:

The QIR program name, tuple[CircuitOperation, …]: The circuit operations extracted from the QIR code.

Return type:

str

Raises:

ValueError – If the QIR program has more than one basic block.