From 836a731d2c8eca632089893357d4a6e6f13f47dd Mon Sep 17 00:00:00 2001 From: Drew Vandeth Date: Thu, 29 Aug 2024 17:30:31 +1000 Subject: [PATCH] Working to fix docs --- requirements-dev.txt | 2 + .../geometry/tiles/checkerboardtile.py | 2 +- .../geometry/tiles/diagonalbartile.py | 2 +- src/qiskit_qec/geometry/tiles/hexagontile.py | 2 +- .../geometry/tiles/squarediamondtile.py | 2 +- src/qiskit_qec/operators/pauli.py | 38 ++++++++++++------- 6 files changed, 31 insertions(+), 17 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 2c0d33ae..ccddc0a9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,3 +7,5 @@ nbsphinx ddt~=1.4.2 matplotlib>=3.3.0 black[jupyter] +pandoc +pylatexenc diff --git a/src/qiskit_qec/geometry/tiles/checkerboardtile.py b/src/qiskit_qec/geometry/tiles/checkerboardtile.py index ad70effa..18758ef0 100644 --- a/src/qiskit_qec/geometry/tiles/checkerboardtile.py +++ b/src/qiskit_qec/geometry/tiles/checkerboardtile.py @@ -127,7 +127,7 @@ def __new__( operators=None, optype="pXZXZ", ) -> Shell: - """Creates a Checker Board Tile (Shell) + r"""Creates a Checker Board Tile (Shell) :: diff --git a/src/qiskit_qec/geometry/tiles/diagonalbartile.py b/src/qiskit_qec/geometry/tiles/diagonalbartile.py index d9b79adc..7cd5bb1b 100644 --- a/src/qiskit_qec/geometry/tiles/diagonalbartile.py +++ b/src/qiskit_qec/geometry/tiles/diagonalbartile.py @@ -112,7 +112,7 @@ def __new__( operators=None, optype="pXXZZXX", ) -> Shell: - """Diagonal Hour Glass Tile + r"""Diagonal Hour Glass Tile The diagram is as follows:: diff --git a/src/qiskit_qec/geometry/tiles/hexagontile.py b/src/qiskit_qec/geometry/tiles/hexagontile.py index de4a9691..f1753a44 100644 --- a/src/qiskit_qec/geometry/tiles/hexagontile.py +++ b/src/qiskit_qec/geometry/tiles/hexagontile.py @@ -273,7 +273,7 @@ def __new__( operators=None, optype="cZ-aXX", ) -> Shell: - """Hexagon Tile + r"""Hexagon Tile Tile:: diff --git a/src/qiskit_qec/geometry/tiles/squarediamondtile.py b/src/qiskit_qec/geometry/tiles/squarediamondtile.py index c1767cdf..ec52431a 100644 --- a/src/qiskit_qec/geometry/tiles/squarediamondtile.py +++ b/src/qiskit_qec/geometry/tiles/squarediamondtile.py @@ -104,7 +104,7 @@ def __new__( operators=None, optype="pXZXZ", ) -> Shell: - """Square Diamond Tile + r"""Square Diamond Tile The following labels are used:: diff --git a/src/qiskit_qec/operators/pauli.py b/src/qiskit_qec/operators/pauli.py index 480b99b7..d15f0204 100644 --- a/src/qiskit_qec/operators/pauli.py +++ b/src/qiskit_qec/operators/pauli.py @@ -54,21 +54,33 @@ def __init__( ): r"""Initialize the Pauli + Args: + data (str | tuple | List | np.ndarray | BasePauli | None): Input data. + x (Union[List, np.ndarray, None], optional): + X part. Defaults to None. - Args: - data (str | tuple | List | np.ndarray | BasePauli | None): Input data - x (Union[List, np.ndarray, None], optional): X Part. Defaults to None. - z (Union[List, np.ndarray, None], optional): Z Part. Defaults to None. - phase_exp (Union[str, np.ndarray, None], optional): Phase expression of - Pauli. Defaults to None. - input_pauli_encoding (str, optional): What encoding is used for the input - data. Default = BasePauli.EXTERNAL_PAULI_ENCODING - input_qubit_order (str, optional): Qubit read order. Defaults to "right-to-left". - order (str, optional): Order in which data lists X and Z. Defaults to 'xz' - tuple_order (str, optional): Order in data for X and Z parts of tuples. - Defaults to 'zx' - num_qubits (int, optional): Number of qubits to use in Pauli. Defaults to None. + z (Union[List, np.ndarray, None], optional): + Z part. Defaults to None. + + phase_exp (Union[str, np.ndarray, None], optional): + Phase expression of Pauli. Defaults to None. + + input_pauli_encoding (str, optional): + What encoding is used for the input data. Defaults to + BasePauli.EXTERNAL_PAULI_ENCODING. + + input_qubit_order (str, optional): + Qubit read order. Defaults to "right-to-left". + + order (str, optional): + Order in which data lists X and Z. Defaults to 'xz'. + + tuple_order (str, optional): + Order in data for X and Z parts of tuples. Defaults to 'zx'. + + num_qubits (int, optional): + Number of qubits to use in Pauli. Defaults to None. Raises: QiskitError: Something went wrong.