catalyst.CompileOptions¶
- class CompileOptions(verbose: bool | None = False, logfile: ~_io.TextIOWrapper | None = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, target: str | None = 'binary', keep_intermediate: str | int | bool | ~catalyst.pipelines.KeepIntermediateLevel | None = False, use_nameloc: bool | None = False, pipelines: ~typing.List[~typing.Any] | None = None, autograph: bool | None = False, autograph_include: ~typing.Iterable[str] | None = (), async_qnodes: bool | None = False, static_argnums: int | ~typing.Iterable[int] | None = None, static_argnames: str | ~typing.Iterable[str] | None = None, abstracted_axes: ~typing.Iterable[~typing.Iterable[str]] | ~typing.Dict[int, str] | None = None, lower_to_llvm: bool | None = True, checkpoint_stage: str | None = '', disable_assertions: bool | None = False, seed: int | None = None, circuit_transform_pipeline: dict[str, dict[str, str]] | None = None, pass_plugins: ~typing.Set[~pathlib.Path] | None = None, dialect_plugins: ~typing.Set[~pathlib.Path] | None = None)[source]¶
Bases:
objectGeneric compilation options, for which reasonable default values exist.
- Parameters:
verbose (Optional[bool]) – Flag indicating whether to enable verbose output. Default is
False.logfile (Optional[TextIOWrapper]) – The logfile to write output to. Default is
sys.stderr.keep_intermediate (Optional[Union[str, int, bool]]) –
Level controlling intermediate file generation.
Falseor0or"none"(default): No intermediate files are kept.Trueor1or"pipeline": Intermediate files are saved after each pipeline.2or"pass": Intermediate files are saved after each pass.
use_nameloc (Optional[bool]) – If
True, add function parameter names to the IR as name locations.pipelines (Optional[List[Tuple[str,List[str]]]]) – A list of tuples. The first entry of the tuple corresponds to the name of a pipeline. The second entry of the tuple corresponds to a list of MLIR passes.
autograph (Optional[bool]) – Flag indicating whether experimental autograph support is to be enabled.
autograph_include (Optional[Iterable[str]]) – A list of (sub)modules to be allow-listed for autograph conversion.
async_qnodes (Optional[bool]) – Flag indicating whether experimental asynchronous execution of QNodes support is to be enabled.
lower_to_llvm (Optional[bool]) – Flag indicating whether to attempt the LLVM lowering after the main compilation pipeline is complete. Default is
True.static_argnums (Optional[Union[int, Iterable[int]]]) – Indices of static arguments. Default is
None.static_argnames (Optional[Union[str, Iterable[str]]]) – Names of static arguments. Default is
None.abstracted_axes (Optional[Any]) – Store the abstracted_axes value. Default is
None.disable_assertions (Optional[bool]) – Disable all assertions. Default is
False.seed (Optional[int]) – the seed for random operations in a qjit call. Default is
None.circuit_transform_pipeline (Optional[dict[str, dict[str, str]]]) – A dictionary that specifies the quantum circuit transformation pass pipeline order, and optionally arguments for each pass in the pipeline. Default is
None.pass_plugins (Optional[Iterable[Path]]) – List of paths to pass plugins.
dialect_plugins (Optional[Iterable[Path]]) – List of paths to dialect plugins.
Attributes
- abstracted_axes: Iterable[Iterable[str]] | Dict[int, str] | None = None¶
- async_qnodes: bool | None = False¶
- autograph: bool | None = False¶
- autograph_include: Iterable[str] | None = ()¶
- checkpoint_stage: str | None = ''¶
- circuit_transform_pipeline: dict[str, dict[str, str]] | None = None¶
- dialect_plugins: Set[Path] | None = None¶
- disable_assertions: bool | None = False¶
- keep_intermediate: str | int | bool | KeepIntermediateLevel | None = False¶
- logfile: TextIOWrapper | None = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>¶
- lower_to_llvm: bool | None = True¶
- pass_plugins: Set[Path] | None = None¶
- pipelines: List[Any] | None = None¶
- seed: int | None = None¶
- static_argnames: str | Iterable[str] | None = None¶
- static_argnums: int | Iterable[int] | None = None¶
- target: str | None = 'binary'¶
- use_nameloc: bool | None = False¶
- verbose: bool | None = False¶
Methods
Get effective pipelines
Returns all stages in order for compilation