mqt.qcec.compilation_flow_profiles

Module for generating compilation flow profiles for the equivalence checking process.

Functions

generate_profile_name(→ str)

Generate a profile name for the optimization level and target basis.

generate_profile(→ None)

Generate a compilation flow profile for the given optimization level.

Module Contents

generate_profile_name(optimization_level: int = 1, *, basis_gates: list[str] | None = None) → str[source]

Generate a profile name for the optimization level and target basis.

Gate order and duplicates do not affect the name. The default basis uses the bundled profile name.

Parameters:
  • optimization_level – The IBM Qiskit optimization level to use for the profile (0, 1, 2, or 3). Defaults to 1.

  • basis_gates – Target gate names, or None for ["id", "rz", "sx", "x", "cx"].

Returns:

The profile filename.

Raises:

ValueError – If the basis is empty or contains an invalid gate identifier.

generate_profile(optimization_level: int = 1, filepath: Path | None = None, *, basis_gates: list[str] | None = None) → None[source]

Generate a compilation flow profile for the given optimization level.

Multi-controlled gates use Qiskit’s default synthesis without additional ancilla qubits.

Parameters:
  • optimization_level – The IBM Qiskit optimization level to use for the profile (0, 1, 2, or 3). Defaults to 1.

  • filepath – The path to the directory where the profile should be stored. Defaults to the profiles directory in the mqt.qcec package.

  • basis_gates – Target gate names accepted by Qiskit’s transpile function. Defaults to ["id", "rz", "sx", "x", "cx"].