Skip to content

Commit aa22429

Browse files
authored
Issue #2152: Fix catalyst.qjit and catalyst.CompileOptions docs render (#2156)
**Context:** `catalyst.qjit` and `catalyst.CompileOptions` docs are not rendered properly in a couple of sections. **Description of the Change:** The fixes just consist of adding a blank line before the first element of a sublist. I've also taken the opportunity to do some minor changes on the `catalyst.qjit` and `catalyst.CompileOptions` pages (mostly to be consistent with most of the descriptions): - Fix `catalyst.CompileOptions` doc render of `autograph_include` parameter. - Start argument descriptions with a capital letter. - End argument descriptions with a period. - Use verb forms in plural (e.g., store or disable). - Use `Default is <default value>` (instead of sometimes `Defaults to <default value>`). **Benefits:** Proper doc rendering. **Possible Drawbacks:** None. **Related GitHub Issues:** #2152
1 parent a792e86 commit aa22429

File tree

3 files changed

+25
-19
lines changed

3 files changed

+25
-19
lines changed

doc/releases/changelog-dev.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
* A typo in the code example for :func:`~.passes.ppr_to_ppm` has been corrected.
3434
[(#2136)](https://github.com/PennyLaneAI/catalyst/pull/2136)
3535

36+
* Fix `catalyst.qjit` and `catalyst.CompileOptions` docs rendering.
37+
[(#2156)](https://github.com/PennyLaneAI/catalyst/pull/2156)
38+
3639
<h3>Contributors ✍️</h3>
3740

3841
This release contains contributions from (in alphabetical order):

frontend/catalyst/jit.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,22 @@ def qjit(
105105
a full of supported devices, please see :doc:`/dev/devices`.
106106
107107
Args:
108-
fn (Callable): the quantum or classical function
108+
fn (Callable): The quantum or classical function.
109109
autograph (bool): Experimental support for automatically converting Python control
110110
flow statements (including ``if`` statements, ``for`` and ``while`` loops) to
111111
Catalyst-compatible control flow, and more. For more details, see the
112112
:doc:`AutoGraph guide </dev/autograph>`.
113113
autograph_include: A list of (sub)modules to be allow-listed for autograph conversion.
114114
async_qnodes (bool): Experimental support for automatically executing
115115
QNodes asynchronously, if supported by the device runtime.
116-
target (str): the compilation target
116+
target (str): The compilation target.
117117
keep_intermediate (Union[str, int, bool]): Level controlling intermediate file generation.
118+
118119
- ``False`` or ``0`` or ``"none"`` or ``None`` (default): No intermediate file is kept.
119120
- ``True`` or ``1`` or ``"pipeline"``: Intermediate files are saved after each pipeline.
120121
- ``2`` or ``"pass"``: Intermediate files are saved after each pass.
121122
If enabled, intermediate representations are available via the following attributes:
123+
122124
- :attr:`~.QJIT.jaxpr`: JAX program representation
123125
- :attr:`~.QJIT.mlir`: MLIR representation after canonicalization
124126
- :attr:`~.QJIT.mlir_opt`: MLIR representation after optimization
@@ -133,9 +135,9 @@ def qjit(
133135
elements of this list are named sequences of MLIR passes to be executed. A ``None``
134136
value (the default) results in the execution of the default pipeline. This option is
135137
considered to be used by advanced users for low-level debugging purposes.
136-
static_argnums(int or Seqence[Int]): an index or a sequence of indices that specifies the
138+
static_argnums(int or Seqence[Int]): An index or a sequence of indices that specifies the
137139
positions of static arguments.
138-
static_argnames(str or Seqence[str]): a string or a sequence of strings that specifies the
140+
static_argnames(str or Seqence[str]): A string or a sequence of strings that specifies the
139141
names of static arguments.
140142
abstracted_axes (Sequence[Sequence[str]] or Dict[int, str] or Sequence[Dict[int, str]]):
141143
An experimental option to specify dynamic tensor shapes.

frontend/catalyst/pipelines.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ class CompileOptions:
7575
"""Generic compilation options, for which reasonable default values exist.
7676
7777
Args:
78-
verbose (Optional[bool]): flag indicating whether to enable verbose output.
79-
Default is ``False``
80-
logfile (Optional[TextIOWrapper]): the logfile to write output to.
81-
Default is ``sys.stderr``
78+
verbose (Optional[bool]): Flag indicating whether to enable verbose output.
79+
Default is ``False``.
80+
logfile (Optional[TextIOWrapper]): The logfile to write output to.
81+
Default is ``sys.stderr``.
8282
keep_intermediate (Optional[Union[str, int, bool]]): Level controlling intermediate file
83-
generation.
83+
generation.
84+
8485
- ``False`` or ``0`` or ``"none"`` (default): No intermediate files are kept.
8586
- ``True`` or ``1`` or ``"pipeline"``: Intermediate files are saved after each pipeline.
8687
- ``2`` or ``"pass"``: Intermediate files are saved after each pass.
@@ -89,26 +90,26 @@ class CompileOptions:
8990
pipelines (Optional[List[Tuple[str,List[str]]]]): A list of tuples. The first entry of the
9091
tuple corresponds to the name of a pipeline. The second entry of the tuple corresponds
9192
to a list of MLIR passes.
92-
autograph (Optional[bool]): flag indicating whether experimental autograph support is to
93+
autograph (Optional[bool]): Flag indicating whether experimental autograph support is to
9394
be enabled.
9495
autograph_include (Optional[Iterable[str]]): A list of (sub)modules to be allow-listed
95-
for autograph conversion.
96-
async_qnodes (Optional[bool]): flag indicating whether experimental asynchronous execution
96+
for autograph conversion.
97+
async_qnodes (Optional[bool]): Flag indicating whether experimental asynchronous execution
9798
of QNodes support is to be enabled.
98-
lower_to_llvm (Optional[bool]): flag indicating whether to attempt the LLVM lowering after
99+
lower_to_llvm (Optional[bool]): Flag indicating whether to attempt the LLVM lowering after
99100
the main compilation pipeline is complete. Default is ``True``.
100-
static_argnums (Optional[Union[int, Iterable[int]]]): indices of static arguments.
101+
static_argnums (Optional[Union[int, Iterable[int]]]): Indices of static arguments.
101102
Default is ``None``.
102-
static_argnames (Optional[Union[str, Iterable[str]]]): names of static arguments.
103+
static_argnames (Optional[Union[str, Iterable[str]]]): Names of static arguments.
103104
Default is ``None``.
104-
abstracted_axes (Optional[Any]): store the abstracted_axes value. Defaults to ``None``.
105-
disable_assertions (Optional[bool]): disables all assertions. Default is ``False``.
105+
abstracted_axes (Optional[Any]): Store the abstracted_axes value. Default is ``None``.
106+
disable_assertions (Optional[bool]): Disable all assertions. Default is ``False``.
106107
seed (Optional[int]) : the seed for random operations in a qjit call.
107-
Default is None.
108+
Default is ``None``.
108109
circuit_transform_pipeline (Optional[dict[str, dict[str, str]]]):
109110
A dictionary that specifies the quantum circuit transformation pass pipeline order,
110111
and optionally arguments for each pass in the pipeline.
111-
Default is None.
112+
Default is ``None``.
112113
pass_plugins (Optional[Iterable[Path]]): List of paths to pass plugins.
113114
dialect_plugins (Optional[Iterable[Path]]): List of paths to dialect plugins.
114115
"""

0 commit comments

Comments
 (0)