Skip to content

Commit 2c795d2

Browse files
authored
Update top level module documentation (#4893)
* Trying to avoid "types and methods" and be more descriptive. * Updated top level doc string. * See go/q-stage for how this renders.
1 parent 64e2eac commit 2c795d2

File tree

20 files changed

+42
-21
lines changed

20 files changed

+42
-21
lines changed

cirq-core/cirq/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
"""Cirq is a framework for creating, editing, and invoking quantum circuits."""
16+
1517
from cirq import _import
1618

1719
# A module can only depend on modules imported earlier in this list of modules

cirq-core/cirq/circuits/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Types and methods related to building and optimizing sequenced circuits."""
15+
"""Circuit classes, mutators, and outputs."""
1616

1717
from cirq.circuits.text_diagram_drawer import (
1818
TextDiagramDrawer,

cirq-core/cirq/contrib/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Package for contributions.
15+
"""Functionality that is not part of core supported Cirq apis.
1616
1717
Any contributions not ready for full production can be put in a subdirectory in
1818
this package.

cirq-core/cirq/devices/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Types for devices, device-specific qubits, and noise models."""
15+
"""Device classes, qubits, and topologies, as well as noise models."""
16+
1617
from cirq.devices.device import (
1718
Device,
1819
DeviceMetadata,

cirq-core/cirq/experiments/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
"""Package containing characterization tools and experiments."""
14+
"""Experiments and tools for characterizing quantum operations."""
1515

1616
from cirq.experiments.google_v2_supremacy_circuit import (
1717
generate_boixo_2018_supremacy_circuits_v2,

cirq-core/cirq/interop/__init__.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1-
# pylint: disable=wrong-or-nonexistent-copyright-notice
2-
"""Package containing code for interoperating with other quantum software."""
1+
# Copyright 2022 The Cirq Developers
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Methods for interoperating with other quantum software."""
315

416
from cirq.interop.quirk import (
517
quirk_json_to_circuit,

cirq-core/cirq/ion/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Types for representing and methods for manipulating ion trap operations.
16-
"""
15+
"""Trapped ion devices, gates, and compiling utilties."""
1716

1817
from cirq.ion.ion_gates import (
1918
ms,

cirq-core/cirq/json_resolver_cache.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
"""Methods for resolving JSON types during serialization."""
1415

1516
import functools
1617
from typing import Dict, TYPE_CHECKING

cirq-core/cirq/linalg/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
"""Types and methods related to performing linear algebra.
14+
"""Linear algebra methods and classes useful for quantum primitives.
1515
1616
Focuses on methods useful for analyzing and optimizing quantum circuits.
1717
Avoids duplicating functionality present in numpy.

cirq-core/cirq/neutral_atoms/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Device classes and tools specific to a neutral atom quantum processor."""
15+
"""Neutral atom devices and gates."""
1616

1717
from cirq.neutral_atoms.neutral_atom_devices import (
1818
NeutralAtomDevice,

cirq-core/cirq/ops/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
"""Types for representing and methods for manipulating circuit operation trees.
14+
"""Gates (unitary and non-unitary), operations, base types, and gate sets.
1515
"""
1616

1717
from cirq.ops.arithmetic_operation import (

cirq-core/cirq/optimizers/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Circuit transformation utilities."""
15+
"""Classes and methods that optimize quantum circuits."""
1616

1717
from cirq.optimizers.align_left import (
1818
AlignLeft,

cirq-core/cirq/protocols/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Methods and classes that define cirq's protocols."""
15+
"""Protocols (structural subtyping) supported in Cirq."""
1616

1717
from cirq.protocols.act_on_protocol import (
1818
act_on,

cirq-core/cirq/qis/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Tools and methods for quantum information science."""
15+
"""Tools and methods for primitives used in quantum information science."""
1616

1717
from cirq.qis.channels import (
1818
choi_to_kraus,

cirq-core/cirq/sim/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Base simulation classes and generic simulators."""
15+
"""Classes for circuit simulators and base implementations of these classes."""
1616
from typing import Tuple, Dict
1717

1818
from cirq.sim.act_on_args import (

cirq-core/cirq/study/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Types and methods for running studies (repeated trials)."""
15+
"""Parameterized circuits and results."""
1616

1717
from cirq.study.flatten_expressions import (
1818
ExpressionMap,

cirq-core/cirq/transformers/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Circuit transformation utilities."""
15+
"""Classes and methods for transforming circuits."""
1616

1717
from cirq.transformers.analytical_decompositions import (
1818
compute_cphase_exponents_for_fsim_decomposition,

cirq-core/cirq/type_workarounds.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Module defining NotImplementedType."""
15+
"""Workarounds for deficiencies in python's typing system."""
16+
1617
from typing import Any
1718

1819
# At the moment there's no reliable way to say 'NotImplementedType'.

cirq-core/cirq/value/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Value conversion utilities and types for time and quantum states."""
15+
"""Value conversion utilities and classes for time and quantum states."""
1616
from cirq.value.abc_alt import (
1717
ABCMetaImplementAnyOneOf,
1818
alternative,

cirq-core/cirq/vis/__init__.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Visualization utilities."""
15+
"""Classes and methods for visualizing results, quantum states, and devices."""
1616

1717
from cirq.vis.heatmap import Heatmap
18+
1819
from cirq.vis.heatmap import TwoQubitInteractionHeatmap
1920

2021
from cirq.vis.histogram import integrated_histogram
2122

22-
from cirq.vis.state_histogram import get_state_histogram, plot_state_histogram
23+
from cirq.vis.state_histogram import (
24+
get_state_histogram,
25+
plot_state_histogram,
26+
)
27+
2328
from cirq.vis.density_matrix import plot_density_matrix
2429

2530
from cirq.vis.vis_utils import relative_luminance

0 commit comments

Comments
 (0)