diff --git a/pyzx/drawing.py b/pyzx/drawing.py index d3f49836..7c3e81b8 100644 --- a/pyzx/drawing.py +++ b/pyzx/drawing.py @@ -543,7 +543,7 @@ def pretty_complex(z: complex) -> str: else: out += f"{r:.2f}".rstrip("0").rstrip(".") if abs(f) > 1: - out += f"\cdot 10^{{{-f}}}" + out += f"\\cdot 10^{{{-f}}}" minus = "" if arg < 0: diff --git a/pyzx/generate.py b/pyzx/generate.py index a0b49a34..d06acfd7 100644 --- a/pyzx/generate.py +++ b/pyzx/generate.py @@ -130,7 +130,7 @@ def CNOT_HAD_PHASE_circuit( clifford:bool=False ) -> Circuit: """Construct a Circuit consisting of CNOT, HAD and phase gates. - The default phase gate is the T gate, but if ``clifford=True``\ , then + The default phase gate is the T gate, but if ``clifford=True``, then this is replaced by the S gate. Args: diff --git a/pyzx/gflow.py b/pyzx/gflow.py index d8956c54..46fdd733 100644 --- a/pyzx/gflow.py +++ b/pyzx/gflow.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" +r""" Based on algorithm by Perdrix and Mhalla. Here is the pseudocode from dx.doi.org/10.1007/978-3-540-70575-8_70 diff --git a/pyzx/optimize.py b/pyzx/optimize.py index 1d8540fc..8eed0cf4 100644 --- a/pyzx/optimize.py +++ b/pyzx/optimize.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""This module implements several optimization methods on ``Circuit``\ s. +"""This module implements several optimization methods on ``Circuit`` s. The function :func:`basic_optimization` runs a set of back-and-forth gate commutation and cancellation routines. :func:`phase_block_optimize` does phase polynomial optimization using the TODD algorithm, and :func:`full_optimize` combines these two methods.""" diff --git a/pyzx/todd.py b/pyzx/todd.py index f8742f68..e665b8df 100644 --- a/pyzx/todd.py +++ b/pyzx/todd.py @@ -207,7 +207,7 @@ def phase_gates_to_poly(gates: List[Gate], qubits: int) -> Tuple[ParityPolynomia def xi(m: Mat2, z: List[Z2]) -> Mat2: - """Constructs the \chi matrix from the TOpt paper.""" + r"""Constructs the \chi matrix from the TOpt paper.""" arr = np.asarray(m.data) rows = m.rows() data = []