Skip to content

Commit dfa69e6

Browse files
authored
Add descriptive docstring for _get_phases in CZLayerGate. (#467)
Replaced the "TODO" docstring with a detailed description of the parameters and return value for the _get_phases method, clarifying its role in the CZLayerGate's decomposition.
1 parent b83327a commit dfa69e6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

recirq/third_party/quaff/cz_layer.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,14 @@ def get_phase_poly(num_qubits, pairs):
144144
return phase_poly % 4
145145

146146
def _get_phases(self):
147-
"""TODO"""
147+
"""Computes phase exponents for the single-qubit S gates in the decomposition.
148+
149+
Returns:
150+
A tuple (linear, quadratic), where linear is a vector of exponents for
151+
the initial single-qubit phase layer, and quadratic is a matrix where
152+
each row s contains exponents for the single-qubit phase layer following
153+
the s-th basis change stage.
154+
"""
148155
n = self.num_qubits()
149156
phase_poly = self.phase_poly
150157
quadratic = np.zeros((n // 2, n), dtype=linalg.DTYPE)

0 commit comments

Comments
 (0)