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, 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:
object
Generic 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. –
False
or0
or"none"
(default): No intermediate files are kept.True
or1
or"pipeline"
: Intermediate files are saved after each pipeline.2
or"pass"
: Intermediate files are saved after each pass.
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
conversion. (for autograph)
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. Defaults to
None
.disable_assertions (Optional[bool]) – disables 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'¶
- verbose: bool | None = False¶
Methods
Get effective pipelines
Returns all stages in order for compilation