Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions guppylang/std/qsystem/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def zz_phase(q1: qubit, q2: qubit, angle: angle) -> None:
0 & 0 & e^{\frac{i \theta}{2}} & 0 \\
0 & 0 & 0 & e^{\frac{-i \theta}{2}}
\end{pmatrix}

>>> @guppy
... def qsystem_cx(q1: qubit, q2: qubit) -> None:
... phased_x(angle(3/2), angle(-1/2), q2)
Expand Down Expand Up @@ -125,7 +126,7 @@ def measure_and_reset(q: qubit) -> bool:
@guppy.hugr_op(quantum_op("Reset", ext=QSYSTEM_EXTENSION))
@no_type_check
def reset(q: qubit) -> None:
"""Reset a qubit to the |0> state."""
"""Reset a qubit to the :math:`|0\rangle` state."""


# TODO
Expand Down Expand Up @@ -197,7 +198,7 @@ def discard(self: "MaybeLeaked @ owned") -> None:
def _phased_x(q: qubit, angle1: float, angle2: float) -> None:
"""PhasedX operation from the qsystem extension.

See `guppylang.std.qsystem.phased_x` for a public definition that
See ``guppylang.std.qsystem.phased_x`` for a public definition that
accepts angle parameters.
"""

Expand All @@ -207,7 +208,7 @@ def _phased_x(q: qubit, angle1: float, angle2: float) -> None:
def _zz_phase(q1: qubit, q2: qubit, angle: float) -> None:
"""ZZPhase operation from the qsystem extension.

See `guppylang.std.qsystem.zz_phase` for a public definition that
See ``guppylang.std.qsystem.zz_phase`` for a public definition that
accepts angle parameters.
"""

Expand All @@ -217,6 +218,6 @@ def _zz_phase(q1: qubit, q2: qubit, angle: float) -> None:
def _rz(q: qubit, angle: float) -> None:
"""Rz operation from the qsystem extension.

See `guppylang.std.qsystem.rz` for a public definition that
See ``guppylang.std.qsystem.rz`` for a public definition that
accepts angle parameters.
"""
2 changes: 1 addition & 1 deletion guppylang/std/quantum/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def measure(q: qubit @ owned) -> bool:
@guppy.hugr_op(quantum_op("Reset"))
@no_type_check
def reset(q: qubit) -> None:
"""Reset a single qubit to the |0> state."""
"""Reset a single qubit to the :math:`|0\rangle` state."""


N = guppy.nat_var("N")
Expand Down
Loading