Skip to content

Commit

Permalink
edocs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
drewvandeth committed Aug 29, 2024
1 parent 589e477 commit d13aa87
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx.ext.extlinks",
"sphinx.ext.napoleon",
"sphinx_autodoc_typehints",
"nbsphinx",
"matplotlib.sphinxext.plot_directive",
Expand Down
33 changes: 13 additions & 20 deletions src/qiskit_qec/operators/pauli.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,69 +52,62 @@ def __init__(
tuple_order: Optional[str] = "zx",
num_qubits: Optional[int] = None,
):
r"""Initialize the Pauli
"""Initialize the Pauli
Args:
data (str | tuple | List | np.ndarray | BasePauli | None): Input data.
Initialiazation of the N-qubit Pauli operator
Args:
data (Union[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. 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.
Examples:
>>>Pauli('XYXXIZ')
>>> Pauli('XYXXIZ')
Pauli('XYXXIZ')
>>>Pauli('X1Y3Z12')
>>> Pauli('X1Y3Z12')
Pauli('ZIIIIIIIIYIXI')
>>>Pauli('X', num_qubits=12)
>>> Pauli('X', num_qubits=12)
Pauli('IIIIIIIIIIIX')
>>>Pauli(np.array([[0,1,1,1]]), phase_exp="(-i,1)", num_qubits=10)
>>> Pauli(np.array([[0,1,1,1]]), phase_exp="(-i,1)", num_qubits=10)
Pauli('-iIIIIIIIIYZ')
>>>Pauli(np.array([[0,1,1,1]]),phase_exp="(-i,1)", num_qubits=10, order="zx")
>>> Pauli(np.array([[0,1,1,1]]),phase_exp="(-i,1)", num_qubits=10, order="zx")
Pauli('-iIIIIIIIIYX')
>>>Pauli(None, x=[0,1],z=[1,1],phase_exp = '-i')
>>> Pauli(None, x=[0,1],z=[1,1],phase_exp = '-i')
Pauli('-iYZ')
>>>Pauli(np.array([[0,1,1,1]]),
>>> Pauli(np.array([[0,1,1,1]]),
phase_exp="(-i,1)(-1,0)",
num_qubits=10, order="zx", input_pauli_encoding='-isXZ')
Pauli('-iIIIIIIIIYX')
>>>Pauli(([0,1],[1,1],'-i'), tuple_order='xz')
>>> Pauli(([0,1],[1,1],'-i'), tuple_order='xz')
Pauli('-iYZ')
>>>Pauli(([0,1],[1,1],'-i'))
>>> Pauli(([0,1],[1,1],'-i'))
Pauli('-iYX')
"""
# str
if isinstance(data, str):
Expand Down

0 comments on commit d13aa87

Please sign in to comment.