Skip to content

Commit f0a80cc

Browse files
committed
Add docstrings for additional methods in quantumlib#2480
1 parent d7fefa8 commit f0a80cc

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

cirq/sim/clifford/clifford_simulator.py

+5
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,14 @@ def to_numpy(self):
254254
return self.ch_form.to_state_vector()
255255

256256
def stabilizers(self) -> List[DensePauliString]:
257+
"""Returns the stabilizer generators of the state. These
258+
are n operators {S_1,S_2,...,S_n} such that S_i |psi> = |psi> """
257259
return self.tableau.stabilizers()
258260

259261
def destabilizers(self) -> List[DensePauliString]:
262+
"""Returns the destabilizer generators of the state. These
263+
are n operators {S_1,S_2,...,S_n} such that along with the stabilizer
264+
generators above generate the full Pauli group on n qubits."""
260265
return self.tableau.destabilizers()
261266

262267
def wave_function(self):

cirq/sim/clifford/clifford_tableau.py

+5
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ def g(x1, z1, x2, z2):
169169
self.zs[q1, :] ^= self.zs[q2, :]
170170

171171
def _row_to_dense_pauli(self, i: int) -> DensePauliString:
172+
"""Returns a DensePauliString representing the row at index i in the
173+
tableau. The length of the string is equal to the total number of
174+
qubits and each character represents the effective single Pauli
175+
operator on that qubit. The overall phase is captured in the
176+
coefficient."""
172177
coefficient = -1 if self.rs[i] else 1
173178
pauli_mask = ""
174179

0 commit comments

Comments
 (0)