Skip to content

Commit

Permalink
Minor docs cleanup. (#1764)
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-alec authored Jan 31, 2025
1 parent 6499130 commit 42598e2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 15 deletions.
8 changes: 4 additions & 4 deletions pytket/binders/circuit/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,9 @@ PYBIND11_MODULE(circuit, m) {
"A classical operation applied to multiple bits simultaneously")
.value(
"ClassicalExpBox", OpType::ClassicalExpBox,
"A box for holding compound classical operations on Bits.\n"
"DEPRECATED: Please use :py:class:`WiredClExpr` instead. This class "
"will be removed after pytket 1.40.")
"A box for holding compound classical operations on Bits. "
"DEPRECATED: This will be removed after pytket 1.40 (replaced by "
"`ClExpr`).")
.value(
"MultiplexorBox", OpType::MultiplexorBox,
"A multiplexor (i.e. uniformly controlled operations)")
Expand Down Expand Up @@ -596,7 +596,7 @@ PYBIND11_MODULE(circuit, m) {
.def(
"is_clifford_type",
[](const Op &op) { return op.get_desc().is_clifford_gate(); },
"Check if the operation is one of the Clifford `OpType`s.")
"Check if the operation is one of the Clifford " CLSOBJS(OpType) ".")
.def(
"is_clifford", [](const Op &op) { return op.is_clifford(); },
"Test whether the operation is in the Clifford group. A return value "
Expand Down
6 changes: 4 additions & 2 deletions pytket/binders/passes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <tklog/TketLog.hpp>

#include "binder_json.hpp"
#include "binder_utils.hpp"
#include "tket/Mapping/LexiLabelling.hpp"
#include "tket/Mapping/LexiRouteRoutingMethod.hpp"
#include "tket/Mapping/RoutingMethod.hpp"
Expand Down Expand Up @@ -532,7 +533,8 @@ PYBIND11_MODULE(passes, m) {
m.def(
"DecomposeBoxes", &DecomposeBoxes,
"Recursively replaces all boxes by their decomposition into circuits."
"\n\n:param excluded_types: box `OpType`s excluded from decomposition"
"\n\n:param excluded_types: box " CLSOBJS(OpType) " excluded from "
"decomposition"
"\n:param excluded_opgroups: opgroups excluded from decomposition",
py::arg("excluded_types") = std::unordered_set<OpType>(),
py::arg("excluded_opgroups") = std::unordered_set<std::string>());
Expand Down Expand Up @@ -1115,7 +1117,7 @@ PYBIND11_MODULE(passes, m) {

m.def(
"CnXPairwiseDecomposition", &CnXPairwiseDecomposition,
"Decompose CnX gates to 2-qubit gates `fand single qubit gates. "
"Decompose CnX gates to 2-qubit gates and single qubit gates. "
"For every two CnX gates, reorder their control qubits to improve "
"the chance of gate cancellation");

Expand Down
10 changes: 5 additions & 5 deletions pytket/docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Fixes:

* Fix `symbol_substitution` not preserving opgroups.
* Remove hardware inefficient circuit construction in `_tk1_to_rzsx`
* Support converting conditional `RangePredicate`s to QASM.
* Support converting conditional `RangePredicate`s to QASM.
* Fix `maxwidth` parameter of `circuit_from_qasm_str`
* Add `scratch_reg_resize_pass` to `circuit_from_qasm_str`
* Reject incompete classical registers in pytket to qasm conversion
Expand Down Expand Up @@ -411,7 +411,7 @@ Minor new features:
the circuit is unchanged.
* Add optional parameters ``excluded_types`` and ``excluded_opgroups``
to ``DecomposeBoxes``.
* More efficient decomposition for quantum controlled ``ConjugationBox``es.
* More efficient decomposition for quantum controlled ``ConjugationBox``es.
* New ``PassSelector`` for automatically compiling with the best pass from a list
* ``PauliExpBox``, ``PauliExpPairBox``, and ``PauliExpCommutingSetBox`` are now
decomposed into a single ``ConjugationBox``.
Expand All @@ -432,7 +432,7 @@ Fixes:

Fixes:

* Fix ``Op.get_unitary()`` runtime error for non gate ``Op``s.
* Fix ``Op.get_unitary()`` runtime error for non gate ``Op``s.
* Fix ``CliffordSimp`` slow runtime issue.
* Correct implementation of ``free_symbols()`` and ``symbol_substitution()`` for
``ConjugationBox``.
Expand Down Expand Up @@ -634,7 +634,7 @@ Minor new features:

Fixes:

* ``DelayMeasures`` pass now correctly handles circuits with ``CircBox``es.
* ``DelayMeasures`` pass now correctly handles circuits with ``CircBox``es.
* ``get_op_map`` in multiplexor boxes return unhashable python dictionaries.


Expand Down Expand Up @@ -802,7 +802,7 @@ Minor new features:
fewer two-qubit gates.

* Add ``SquashRzPhasedX`` pass to squash single qubit gates into
``Rz`` and ``PhasedX`` gates while trying to commute ``Rz``s to the back.
``Rz`` and ``PhasedX`` gates while trying to commute ``Rz``s to the back.
1.5.1 (August 2022)
-------------------
Expand Down
2 changes: 1 addition & 1 deletion pytket/pytket/_tket/circuit.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3416,7 +3416,7 @@ class Op:
"""
def is_clifford_type(self) -> bool:
"""
Check if the operation is one of the Clifford `OpType`s.
Check if the operation is one of the Clifford :py:class:`OpType`s.
"""
def is_gate(self) -> bool:
...
Expand Down
4 changes: 2 additions & 2 deletions pytket/pytket/_tket/passes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def CliffordSimp(allow_swaps: bool = True) -> BasePass:
"""
def CnXPairwiseDecomposition() -> BasePass:
"""
Decompose CnX gates to 2-qubit gates `fand single qubit gates. For every two CnX gates, reorder their control qubits to improve the chance of gate cancellation
Decompose CnX gates to 2-qubit gates and single qubit gates. For every two CnX gates, reorder their control qubits to improve the chance of gate cancellation
"""
def CommuteThroughMultis() -> BasePass:
"""
Expand Down Expand Up @@ -352,7 +352,7 @@ def DecomposeBoxes(excluded_types: set[pytket._tket.circuit.OpType] = set(), exc
"""
Recursively replaces all boxes by their decomposition into circuits.
:param excluded_types: box `OpType`s excluded from decomposition
:param excluded_types: box :py:class:`OpType`s excluded from decomposition
:param excluded_opgroups: opgroups excluded from decomposition
"""
def DecomposeClassicalExp() -> BasePass:
Expand Down
2 changes: 1 addition & 1 deletion pytket/pytket/_tket/predicates.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import typing
__all__ = ['CliffordCircuitPredicate', 'CommutableMeasuresPredicate', 'CompilationUnit', 'ConnectivityPredicate', 'DefaultRegisterPredicate', 'DirectednessPredicate', 'GateSetPredicate', 'MaxNClRegPredicate', 'MaxNQubitsPredicate', 'MaxTwoQubitGatesPredicate', 'NoBarriersPredicate', 'NoClassicalBitsPredicate', 'NoClassicalControlPredicate', 'NoFastFeedforwardPredicate', 'NoMidMeasurePredicate', 'NoSymbolsPredicate', 'NoWireSwapsPredicate', 'NormalisedTK2Predicate', 'PlacementPredicate', 'Predicate', 'UserDefinedPredicate']
class CliffordCircuitPredicate(Predicate):
"""
Predicate asserting that a circuit has only Clifford gates.
Predicate asserting that a circuit has only Clifford gates and measurements.
"""
@staticmethod
def _pybind11_conduit_v1_(*args, **kwargs): # type: ignore
Expand Down
1 change: 1 addition & 0 deletions pytket/pytket/utils/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def all_qubits(self) -> set[Qubit]:
"""
:return: The set of all qubits the operator ranges over (including qubits
that were provided explicitly as identities)
:rtype: Set[Qubit]
"""
return self._all_qubits
Expand Down

0 comments on commit 42598e2

Please sign in to comment.