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
10 changes: 5 additions & 5 deletions cirq-core/cirq/devices/grid_qubit.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def rect(rows: int, cols: int, top: int = 0, left: int = 0, *, dimension: int) -

@staticmethod
def from_diagram(diagram: str, dimension: int) -> list[GridQid]:
"""Parse ASCII art device layout into a device.
r"""Parse ASCII art device layout into a device.

As an example, the below diagram will create a list of GridQid in a
pyramid structure.
Expand Down Expand Up @@ -322,7 +322,7 @@ def from_diagram(diagram: str, dimension: int) -> list[GridQid]:
a row. Alphanumeric characters are assigned as qid.
Dots ('.'), dashes ('-'), and spaces (' ') are treated as
empty locations in the grid. If diagram has characters other
than alphanumerics, spacers, and newlines ('\\n'), an error will
than alphanumerics, spacers, and newlines ('\n'), an error will
be thrown. The top-left corner of the diagram will be have
coordinate (0, 0).

Expand Down Expand Up @@ -439,7 +439,7 @@ def rect(rows: int, cols: int, top: int = 0, left: int = 0) -> list[GridQubit]:

@staticmethod
def from_diagram(diagram: str) -> list[GridQubit]:
"""Parse ASCII art into device layout info.
r"""Parse ASCII art into device layout info.

As an example, the below diagram will create a list of
GridQubit in a pyramid structure.
Expand Down Expand Up @@ -476,7 +476,7 @@ def from_diagram(diagram: str) -> list[GridQubit]:
a row. Alphanumeric characters are assigned as qid.
Dots ('.'), dashes ('-'), and spaces (' ') are treated as
empty locations in the grid. If diagram has characters other
than alphanumerics, spacers, and newlines ('\\n'), an error will
than alphanumerics, spacers, and newlines ('\n'), an error will
be thrown. The top-left corner of the diagram will be have
coordinate (0,0).

Expand All @@ -503,7 +503,7 @@ def _json_dict_(self) -> dict[str, Any]:


def _ascii_diagram_to_coords(diagram: str) -> list[tuple[int, int]]:
"""Parse ASCII art device layout into info about qids coordinates
r"""Parse ASCII art device layout into info about qids coordinates

Args:
diagram: String representing the qid layout. Each line represents
Expand Down
2 changes: 1 addition & 1 deletion cirq-core/cirq/linalg/decompositions.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def so4_to_magic_su2s(

@value.value_equality(approximate=True)
class AxisAngleDecomposition:
"""Represents a unitary operation as an axis, angle, and global phase.
r"""Represents a unitary operation as an axis, angle, and global phase.

The unitary $U$ is decomposed as follows:

Expand Down
4 changes: 2 additions & 2 deletions cirq-core/cirq/ops/named_qubit.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def __str__(self) -> str:

@staticmethod
def range(*args, prefix: str, dimension: int) -> list[NamedQid]:
"""Returns a range of ``NamedQid``\\s.
"""Returns a range of ``NamedQid``s.

The range returned starts with the prefix, and followed by a qid for
each number in the range, e.g.:
Expand All @@ -166,7 +166,7 @@ def range(*args, prefix: str, dimension: int) -> list[NamedQid]:
dimension: The dimension of the qid's Hilbert space, i.e.
the number of quantum levels.
Returns:
A list of ``NamedQid``\\s.
A list of ``NamedQid``s.
"""
return [NamedQid(f"{prefix}{i}", dimension=dimension) for i in range(*args)]

Expand Down
2 changes: 1 addition & 1 deletion cirq-core/cirq/vis/density_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def plot_density_matrix(
show_text: bool = False,
title: str | None = None,
) -> plt.Axes:
"""Generates a plot for a given density matrix.
r"""Generates a plot for a given density matrix.

1. Each entry of the density matrix, a complex number, is plotted as an
Argand Diagram where the partially filled red circle represents the magnitude
Expand Down
2 changes: 1 addition & 1 deletion examples/stabilizer_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def correct(self, qubits: list[cirq.Qid], ancillas: list[cirq.Qid]) -> cirq.Circ
return circuit

def decode(self, qubits: list[cirq.Qid], ancillas: list[cirq.Qid], state_vector) -> list[int]:
"""Computes the output of the circuit by projecting onto the \bar{Z}.
r"""Computes the output of the circuit by projecting onto the \bar{Z}.

Args:
qubits: the qubits where the (now corrected) code words are stored.
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ select = [
# pylint expression-not-assigned, pointless-exception-statement,
# pointless-statement, pointless-string-statement
"B033", # duplicate-value, pylint duplicate-value
"D301", # escape-sequence-in-docstring
"D419", # empty-docstring, pylint empty-docstring
"E402", # module-import-not-at-top-of-file, pylint wrong-import-position
"E501", # line-too-long, pylint line-too-long
Expand Down