From 6b40da38f4ecd14d1e5acba1c91d9ea0157a27f2 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Wed, 26 Apr 2023 16:59:20 -0700 Subject: [PATCH] Apply suggestions from CommonTypos checker --- cirq-aqt/cirq_aqt/aqt_device_metadata.py | 2 +- cirq-core/cirq/circuits/circuit.py | 6 +++--- cirq-core/cirq/contrib/acquaintance/executor.py | 2 +- cirq-core/cirq/ops/identity.py | 2 +- cirq-core/cirq/ops/linear_combinations.py | 2 +- cirq-core/cirq/ops/raw_types.py | 4 ++-- cirq-core/cirq/protocols/apply_channel_protocol.py | 2 +- cirq-core/cirq/protocols/circuit_diagram_info_protocol.py | 2 +- cirq-core/cirq/sim/mux.py | 2 +- cirq-core/cirq/sim/state_vector.py | 2 +- cirq-core/cirq/study/flatten_expressions.py | 2 +- cirq-core/cirq/study/result.py | 2 +- cirq-core/cirq/testing/circuit_compare.py | 2 +- cirq-core/cirq/testing/consistent_act_on.py | 2 +- cirq-core/cirq/testing/logs.py | 2 +- cirq-core/cirq/transformers/expand_composite.py | 2 +- cirq-core/cirq/transformers/routing/route_circuit_cqc.py | 4 ++-- cirq-core/cirq/transformers/stratify.py | 2 +- cirq-core/cirq/transformers/transformer_primitives.py | 2 +- cirq-core/cirq/value/product_state.py | 2 +- cirq-core/cirq/vis/heatmap.py | 2 +- cirq-google/cirq_google/api/v2/batch.proto | 2 +- cirq-google/cirq_google/calibration/phased_fsim.py | 2 +- cirq-google/cirq_google/engine/abstract_local_engine.py | 2 +- cirq-google/cirq_google/engine/abstract_processor.py | 2 +- cirq-google/cirq_google/engine/engine.py | 2 +- cirq-google/cirq_google/engine/engine_client.py | 2 +- cirq-google/cirq_google/engine/engine_processor.py | 2 +- cirq-google/cirq_google/engine/runtime_estimator.py | 2 +- cirq-google/cirq_google/experimental/__init__.py | 2 +- cirq-google/cirq_google/ops/fsim_gate_family.py | 6 +++--- .../cirq_google/serialization/circuit_serializer.py | 2 +- cirq-ionq/cirq_ionq/calibration.py | 2 +- cirq-ionq/cirq_ionq/serializer.py | 4 ++-- cirq-web/cirq_ts/src/bloch_sphere/bloch_sphere_test.ts | 2 +- cirq-web/cirq_ts/src/circuit/grid_circuit.ts | 2 +- docs/build/circuits.ipynb | 4 ++-- docs/build/interop.ipynb | 2 +- docs/build/pauli_observables.ipynb | 4 ++-- docs/build/protocols.ipynb | 2 +- docs/experiments/fourier_checking.ipynb | 6 +++--- docs/experiments/quantum_walks.ipynb | 8 ++++---- docs/experiments/textbook_algorithms.ipynb | 2 +- docs/hardware/aqt/getting_started.ipynb | 4 ++-- docs/hardware/azure-quantum/getting_started_ionq.ipynb | 2 +- docs/hardware/ionq/getting_started.ipynb | 2 +- docs/hardware/pasqal/getting_started.ipynb | 2 +- docs/start/install.md | 2 +- docs/start/intro.ipynb | 2 +- docs/tutorials/google/identifying_hardware_changes.ipynb | 2 +- docs/tutorials/google/spin_echoes.ipynb | 2 +- 51 files changed, 66 insertions(+), 66 deletions(-) diff --git a/cirq-aqt/cirq_aqt/aqt_device_metadata.py b/cirq-aqt/cirq_aqt/aqt_device_metadata.py index 3c443c7e505..676537aefb7 100644 --- a/cirq-aqt/cirq_aqt/aqt_device_metadata.py +++ b/cirq-aqt/cirq_aqt/aqt_device_metadata.py @@ -91,7 +91,7 @@ def twoq_gates_duration(self) -> 'cirq.DURATION_LIKE': return self._twoq_gates_duration def duration_of(self, operation: 'cirq.Operation') -> 'cirq.DURATION_LIKE': - """Return the maximum duration of the specifed gate operation. + """Return the maximum duration of the specified gate operation. Args: operation: The `cirq.Operation` for which to determine its duration. diff --git a/cirq-core/cirq/circuits/circuit.py b/cirq-core/cirq/circuits/circuit.py index a51b8802dd8..a23f8b4afed 100644 --- a/cirq-core/cirq/circuits/circuit.py +++ b/cirq-core/cirq/circuits/circuit.py @@ -1458,7 +1458,7 @@ def concat_ragged( are placed one after the other and then moved inward until just before their operations would collide. If any of the circuits do not share qubits and so would not collide, the starts or ends of the circuits will - be aligned, acording to the given align parameter. + be aligned, according to the given align parameter. Beware that this method is *not* associative. For example: @@ -2736,7 +2736,7 @@ def get_earliest_accommodating_moment_index( ckey_indices: Dict['cirq.MeasurementKey', int], length: Optional[int] = None, ) -> int: - """Get the index of the earliest moment that can accomodate the given moment or operation. + """Get the index of the earliest moment that can accommodate the given moment or operation. Updates the dictionaries keeping track of the last moment index addressing a given qubit, measurement key, and control key. @@ -2751,7 +2751,7 @@ def get_earliest_accommodating_moment_index( `mkey_indices`, and `ckey_indices`. Returns: - The integer index of the earliest moment that can accomodate the given moment or operation. + The integer index of the earliest moment that can accommodate the given moment or operation. """ mop_qubits = moment_or_operation.qubits mop_mkeys = protocols.measurement_key_objs(moment_or_operation) diff --git a/cirq-core/cirq/contrib/acquaintance/executor.py b/cirq-core/cirq/contrib/acquaintance/executor.py index b618135284b..a2b27d068f3 100644 --- a/cirq-core/cirq/contrib/acquaintance/executor.py +++ b/cirq-core/cirq/contrib/acquaintance/executor.py @@ -34,7 +34,7 @@ class ExecutionStrategy(metaclass=abc.ABCMeta): - """Tells `StrategyExecutorTransormer` how to execute an acquaintance strategy. + """Tells `StrategyExecutorTransformer` how to execute an acquaintance strategy. An execution strategy tells `StrategyExecutorTransformer` how to execute an acquaintance strategy, i.e. what gates to implement at the available diff --git a/cirq-core/cirq/ops/identity.py b/cirq-core/cirq/ops/identity.py index f7782ec8858..c13d8208620 100644 --- a/cirq-core/cirq/ops/identity.py +++ b/cirq-core/cirq/ops/identity.py @@ -42,7 +42,7 @@ def __init__( """Inits IdentityGate. Args: - num_qubits: The number of qubits for the idenity gate. + num_qubits: The number of qubits for the identity gate. qid_shape: Specifies the dimension of each qid the measurement applies to. The default is 2 for every qubit. diff --git a/cirq-core/cirq/ops/linear_combinations.py b/cirq-core/cirq/ops/linear_combinations.py index f9335d10379..469f3c6555d 100644 --- a/cirq-core/cirq/ops/linear_combinations.py +++ b/cirq-core/cirq/ops/linear_combinations.py @@ -440,7 +440,7 @@ def _value_equality_values_(self): def wrap(val: PauliSumLike) -> 'PauliSum': """Convert a `cirq.PauliSumLike` object to a PauliSum - Attemps to convert an existing int, float, complex, `cirq.PauliString`, + Attempts to convert an existing int, float, complex, `cirq.PauliString`, `cirq.PauliSum` or `cirq.SingleQubitPauliStringGateOperation` into a `cirq.PauliSum` object. For example: diff --git a/cirq-core/cirq/ops/raw_types.py b/cirq-core/cirq/ops/raw_types.py index 3bdf3bc9a58..e3cba4bc530 100644 --- a/cirq-core/cirq/ops/raw_types.py +++ b/cirq-core/cirq/ops/raw_types.py @@ -360,7 +360,7 @@ def __call__(self, *qubits: Qid, **kwargs): return self.on(*qubits) def with_probability(self, probability: 'cirq.TParamVal') -> 'cirq.Gate': - """Creates a probabalistic channel with this gate. + """Creates a probabilistic channel with this gate. Args: probability: floating point value between 0 and 1, giving the @@ -601,7 +601,7 @@ def controlled_by( return ops.controlled_operation.ControlledOperation(control_qubits, self, control_values) def with_probability(self, probability: 'cirq.TParamVal') -> 'cirq.Operation': - """Creates a probabalistic channel with this operation. + """Creates a probabilistic channel with this operation. Args: probability: floating point value between 0 and 1, giving the diff --git a/cirq-core/cirq/protocols/apply_channel_protocol.py b/cirq-core/cirq/protocols/apply_channel_protocol.py index 067615dd36e..ca52651003f 100644 --- a/cirq-core/cirq/protocols/apply_channel_protocol.py +++ b/cirq-core/cirq/protocols/apply_channel_protocol.py @@ -142,7 +142,7 @@ def _apply_channel_( `args.target_tensor` and the given buffers. Returns: - If the receiving object is not able to apply a chanel, None + If the receiving object is not able to apply a channel, None or NotImplemented should be returned. If the receiving object is able to work inline, it should directly diff --git a/cirq-core/cirq/protocols/circuit_diagram_info_protocol.py b/cirq-core/cirq/protocols/circuit_diagram_info_protocol.py index 00d1e5b65de..5f9c5bbda39 100644 --- a/cirq-core/cirq/protocols/circuit_diagram_info_protocol.py +++ b/cirq-core/cirq/protocols/circuit_diagram_info_protocol.py @@ -73,7 +73,7 @@ def __init__( could be mistaken for an identity wire). Defaults to True. Raises: - ValueError: If `wire_symbols` is a string, and not an interable + ValueError: If `wire_symbols` is a string, and not an iterable of strings. """ if isinstance(wire_symbols, str): diff --git a/cirq-core/cirq/sim/mux.py b/cirq-core/cirq/sim/mux.py index 9a185b329f0..b35216903e3 100644 --- a/cirq-core/cirq/sim/mux.py +++ b/cirq-core/cirq/sim/mux.py @@ -139,7 +139,7 @@ def final_state_vector( Returns: The state vector resulting from applying the given unitary operations to the desired initial state. Specifically, a numpy array containing the - the amplitudes in np.kron order, where the order of arguments to kron + amplitudes in np.kron order, where the order of arguments to kron is determined by the qubit order argument (which defaults to just sorting the qubits that are present into an ascending order). diff --git a/cirq-core/cirq/sim/state_vector.py b/cirq-core/cirq/sim/state_vector.py index 62947a81ca2..2beea5539f5 100644 --- a/cirq-core/cirq/sim/state_vector.py +++ b/cirq-core/cirq/sim/state_vector.py @@ -35,7 +35,7 @@ def __init__(self, qubit_map: Optional[Mapping['cirq.Qid', int]] = None, *args, """Inits StateVectorMixin. Args: - qubit_map: A map from the Qubits in the Circuit to the the index + qubit_map: A map from the Qubits in the Circuit to the index of this qubit for a canonical ordering. This canonical ordering is used to define the state (see the state_vector() method). *args: Passed on to the class that this is mixed in with. diff --git a/cirq-core/cirq/study/flatten_expressions.py b/cirq-core/cirq/study/flatten_expressions.py index 9c3892dc1d8..d532b4bcf09 100644 --- a/cirq-core/cirq/study/flatten_expressions.py +++ b/cirq-core/cirq/study/flatten_expressions.py @@ -40,7 +40,7 @@ def flatten(val: Any) -> Tuple[Any, 'ExpressionMap']: the name to avoid collision: `sympy.Symbol('_1')`. This function also creates a dictionary mapping from expressions and symbols - in `val` to the new symbols in the flattened copy of `val`. E.g + in `val` to the new symbols in the flattened copy of `val`. E.g. `cirq.ExpressionMap({sympy.Symbol('x')+1: sympy.Symbol('')})`. This `ExpressionMap` can be used to transform a sweep over the symbols in `val` to a sweep over the flattened symbols e.g. a sweep over `sympy.Symbol('x')` diff --git a/cirq-core/cirq/study/result.py b/cirq-core/cirq/study/result.py index a7a53e550d5..53158848d3a 100644 --- a/cirq-core/cirq/study/result.py +++ b/cirq-core/cirq/study/result.py @@ -140,7 +140,7 @@ def dataframe_from_measurements(measurements: Mapping[str, np.ndarray]) -> pd.Da basis = 2 ** np.arange(n, dtype=dtype)[::-1] converted_dict[key] = np.sum(basis * bitstrings, axis=1) - # Use objects to accomodate more than 64 qubits if needed. + # Use objects to accommodate more than 64 qubits if needed. dtype = object if any(bs.shape[1] > 63 for _, bs in measurements.items()) else np.int64 return pd.DataFrame(converted_dict, dtype=dtype) diff --git a/cirq-core/cirq/testing/circuit_compare.py b/cirq-core/cirq/testing/circuit_compare.py index a6047c75eab..2e71c8ef4be 100644 --- a/cirq-core/cirq/testing/circuit_compare.py +++ b/cirq-core/cirq/testing/circuit_compare.py @@ -237,7 +237,7 @@ def assert_circuits_have_same_unitary_given_final_permutation( ValueError: if 'qubit_map' does not have the same set of keys and values. """ if set(qubit_map.keys()) != set(qubit_map.values()): - raise ValueError("'qubit_map' must have the same set of of keys and values.") + raise ValueError("'qubit_map' must have the same set of keys and values.") if not set(qubit_map.keys()).issubset(actual.all_qubits()): raise ValueError( diff --git a/cirq-core/cirq/testing/consistent_act_on.py b/cirq-core/cirq/testing/consistent_act_on.py index 0bab03b9005..2942b40b1fa 100644 --- a/cirq-core/cirq/testing/consistent_act_on.py +++ b/cirq-core/cirq/testing/consistent_act_on.py @@ -68,7 +68,7 @@ def assert_all_implemented_act_on_effects_match_unitary( Checks that act_on with CliffordTableau or StabilizerStateCHForm behaves consistently with act_on through final state vector. Does not work with Operations or Gates expecting non-qubit Qids. If either of the - assert_*_implmented args is true, fails if the corresponding method is not + assert_*_implemented args is true, fails if the corresponding method is not implemented for the test circuit. Args: diff --git a/cirq-core/cirq/testing/logs.py b/cirq-core/cirq/testing/logs.py index 9c2ecd8550c..f93baad58d6 100644 --- a/cirq-core/cirq/testing/logs.py +++ b/cirq-core/cirq/testing/logs.py @@ -48,7 +48,7 @@ def assert_logs( module for valid levels. By default this captures at the `logging.WARNING` level and above, so this does not capture `logging.INFO` or `logging.DEBUG` logs by default. - max_level: The maxium level at which to capture the logs. See the python logging + max_level: The maximum level at which to capture the logs. See the python logging module for valid levels. By default this captures to the `logging.CRITICAL` level thus, all the errors and critical messages will be captured as well. capture_warnings: Whether warnings from the python's `warnings` module diff --git a/cirq-core/cirq/transformers/expand_composite.py b/cirq-core/cirq/transformers/expand_composite.py index ef15d06537c..b11b758d91c 100644 --- a/cirq-core/cirq/transformers/expand_composite.py +++ b/cirq-core/cirq/transformers/expand_composite.py @@ -33,7 +33,7 @@ def expand_composite( """A transformer that expands composite operations via `cirq.decompose`. For each operation in the circuit, this pass examines if the operation can - be decomposed. If it can be, the operation is cleared out and and replaced + be decomposed. If it can be, the operation is cleared out and replaced with its decomposition using a fixed insertion strategy. Transformation is applied using `cirq.map_operations_and_unroll`, which preserves the diff --git a/cirq-core/cirq/transformers/routing/route_circuit_cqc.py b/cirq-core/cirq/transformers/routing/route_circuit_cqc.py index 32868af9338..66d86245c9e 100644 --- a/cirq-core/cirq/transformers/routing/route_circuit_cqc.py +++ b/cirq-core/cirq/transformers/routing/route_circuit_cqc.py @@ -129,7 +129,7 @@ def __call__( context: transformer context storing common configurable options for transformers. Returns: - The routed circuit, which is equivalent to original circuit upto a final qubit + The routed circuit, which is equivalent to original circuit up to a final qubit permutation and where each 2-qubit operation is between adjacent qubits in the `device_graph`. @@ -183,7 +183,7 @@ def route_circuit( context: transformer context storing common configurable options for transformers. Returns: - The routed circuit, which is equivalent to original circuit upto a final qubit + The routed circuit, which is equivalent to original circuit up to a final qubit permutation and where each 2-qubit operation is between adjacent qubits in the `device_graph`. The initial mapping from logical to physical qubits used as part of the routing diff --git a/cirq-core/cirq/transformers/stratify.py b/cirq-core/cirq/transformers/stratify.py index 6761f0b26b8..04e130c4a78 100644 --- a/cirq-core/cirq/transformers/stratify.py +++ b/cirq-core/cirq/transformers/stratify.py @@ -117,7 +117,7 @@ def _stratify_circuit( num_classes = len(classifiers) + 1 # include one "extra" category for ignored operations new_moments: List[List['cirq.Operation']] = [] - # Keep track of the the latest time index for each qubit, measurement key, and control key. + # Keep track of the latest time index for each qubit, measurement key, and control key. qubit_time_index: Dict['cirq.Qid', int] = {} measurement_time_index: Dict['cirq.MeasurementKey', int] = {} control_time_index: Dict['cirq.MeasurementKey', int] = {} diff --git a/cirq-core/cirq/transformers/transformer_primitives.py b/cirq-core/cirq/transformers/transformer_primitives.py index 75bb6e71ef6..489c82038d4 100644 --- a/cirq-core/cirq/transformers/transformer_primitives.py +++ b/cirq-core/cirq/transformers/transformer_primitives.py @@ -296,7 +296,7 @@ def merge_operations( The method iterates on the input circuit moment-by-moment from left to right and attempts to repeatedly merge each operation in the latest moment with all the corresponding merge-able - operations to it's left. + operations to its left. If op1 and op2 are merged, both op1 and op2 are deleted from the circuit and the resulting `merged_op` is inserted at the index corresponding to the larger diff --git a/cirq-core/cirq/value/product_state.py b/cirq-core/cirq/value/product_state.py index 80544400d4b..bc5a7cc36c5 100644 --- a/cirq-core/cirq/value/product_state.py +++ b/cirq-core/cirq/value/product_state.py @@ -322,4 +322,4 @@ def stabilized_by(self) -> Tuple[int, 'cirq.Pauli']: ) PAULI_STATES = [KET_PLUS, KET_MINUS, KET_IMAG, KET_MINUS_IMAG, KET_ZERO, KET_ONE] -document(PAULI_STATES, """All one-qubit states stabalized by the pauli operators.""") +document(PAULI_STATES, """All one-qubit states stabilized by the pauli operators.""") diff --git a/cirq-core/cirq/vis/heatmap.py b/cirq-core/cirq/vis/heatmap.py index eeec9379fe3..e5598f59450 100644 --- a/cirq-core/cirq/vis/heatmap.py +++ b/cirq-core/cirq/vis/heatmap.py @@ -316,7 +316,7 @@ def __init__(self, value_map: Mapping[QubitTuple, SupportsFloat], **kwargs): Args: value_map: A map from a qubit tuple location to a value. - **kwargs: Optinal kwargs including + **kwargs: Optional kwargs including coupler_margin: float, default = 0.03 coupler_width: float, default = 0.6 """ diff --git a/cirq-google/cirq_google/api/v2/batch.proto b/cirq-google/cirq_google/api/v2/batch.proto index d9640b505c3..2645d91a6d8 100644 --- a/cirq-google/cirq_google/api/v2/batch.proto +++ b/cirq-google/cirq_google/api/v2/batch.proto @@ -16,7 +16,7 @@ option java_multiple_files = true; // Note: Batching is done on a best-effort basis. // Circuits will be be bundled together, but the size // of the total batch and different hardware constraints may -// cause the programs to be executed seperately on the hardware. +// cause the programs to be executed separately on the hardware. message BatchProgram { // The circuits that should be bundled together as one program diff --git a/cirq-google/cirq_google/calibration/phased_fsim.py b/cirq-google/cirq_google/calibration/phased_fsim.py index 1b974d91b9e..fbad49611cf 100644 --- a/cirq-google/cirq_google/calibration/phased_fsim.py +++ b/cirq-google/cirq_google/calibration/phased_fsim.py @@ -271,7 +271,7 @@ def override(self, parameters: PhasedFSimCharacterization) -> 'PhasedFSimCalibra which are not None will be used to replace current parameters for every pair stored. Returns: - New instance of PhasedFSimCalibrationResult with certain parameters overriden. + New instance of PhasedFSimCalibrationResult with certain parameters overridden. """ return PhasedFSimCalibrationResult( parameters={ diff --git a/cirq-google/cirq_google/engine/abstract_local_engine.py b/cirq-google/cirq_google/engine/abstract_local_engine.py index c5a9f81e3df..1aa0d959b33 100644 --- a/cirq-google/cirq_google/engine/abstract_local_engine.py +++ b/cirq-google/cirq_google/engine/abstract_local_engine.py @@ -37,7 +37,7 @@ def __init__(self, processors: List[AbstractLocalProcessor]): self._processors = {proc.processor_id: proc for proc in processors} def get_program(self, program_id: str) -> AbstractProgram: - """Returns an exsiting AbstractProgram given an identifier. + """Returns an existing AbstractProgram given an identifier. Iteratively checks each processor for the given id. diff --git a/cirq-google/cirq_google/engine/abstract_processor.py b/cirq-google/cirq_google/engine/abstract_processor.py index fb1006cd68d..23d5bd88473 100644 --- a/cirq-google/cirq_google/engine/abstract_processor.py +++ b/cirq-google/cirq_google/engine/abstract_processor.py @@ -234,7 +234,7 @@ async def run_calibration_async( program_description: An optional description to set on the program. program_labels: Optional set of labels to set on the program. job_description: An optional description to set on the job. - job_labels: Optional set of labels to set on the job. By defauly, + job_labels: Optional set of labels to set on the job. By default, this will add a 'calibration' label to the job. Returns: An AbstractJob whose results can be retrieved by calling diff --git a/cirq-google/cirq_google/engine/engine.py b/cirq-google/cirq_google/engine/engine.py index 6004e877be2..3b889df0378 100644 --- a/cirq-google/cirq_google/engine/engine.py +++ b/cirq-google/cirq_google/engine/engine.py @@ -451,7 +451,7 @@ async def run_calibration_async( program_description: An optional description to set on the program. program_labels: Optional set of labels to set on the program. job_description: An optional description to set on the job. - job_labels: Optional set of labels to set on the job. By defauly, + job_labels: Optional set of labels to set on the job. By default, this will add a 'calibration' label to the job. Returns: diff --git a/cirq-google/cirq_google/engine/engine_client.py b/cirq-google/cirq_google/engine/engine_client.py index d9520ea122d..a3c93b72a1e 100644 --- a/cirq-google/cirq_google/engine/engine_client.py +++ b/cirq-google/cirq_google/engine/engine_client.py @@ -444,7 +444,7 @@ async def create_job_async( Tuple of created job id and job. Raises: - ValueError: If the priority is not betwen 0 and 1000. + ValueError: If the priority is not between 0 and 1000. """ # Check program to run and program parameters. if priority and not 0 <= priority < 1000: diff --git a/cirq-google/cirq_google/engine/engine_processor.py b/cirq-google/cirq_google/engine/engine_processor.py index 9a04061f126..38245ab1f65 100644 --- a/cirq-google/cirq_google/engine/engine_processor.py +++ b/cirq-google/cirq_google/engine/engine_processor.py @@ -208,7 +208,7 @@ async def run_calibration_async( program_description: An optional description to set on the program. program_labels: Optional set of labels to set on the program. job_description: An optional description to set on the job. - job_labels: Optional set of labels to set on the job. By defauly, + job_labels: Optional set of labels to set on the job. By default, this will add a 'calibration' label to the job. Returns: An AbstractJob whose results can be retrieved by calling diff --git a/cirq-google/cirq_google/engine/runtime_estimator.py b/cirq-google/cirq_google/engine/runtime_estimator.py index 9468cc0625b..66a018e0106 100644 --- a/cirq-google/cirq_google/engine/runtime_estimator.py +++ b/cirq-google/cirq_google/engine/runtime_estimator.py @@ -17,7 +17,7 @@ estimate_run_batch_time to retrieve approximations of runtime on QCS of various sizes and shapes of circuits. -Times were extrapolated from actual runs on Sycamore processors duing +Times were extrapolated from actual runs on Sycamore processors during November 2021. These times should only be used as a rough guide. Your experience may vary based on many factors not captured here. diff --git a/cirq-google/cirq_google/experimental/__init__.py b/cirq-google/cirq_google/experimental/__init__.py index 7ede4123e87..9822028eaee 100644 --- a/cirq-google/cirq_google/experimental/__init__.py +++ b/cirq-google/cirq_google/experimental/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Experimental features. Their API can be broken without any warning and might be in an work-in +"""Experimental features. Their API can be broken without any warning and might be in a work-in progress state""" from cirq_google.experimental.noise_models import ( PerQubitDepolarizingWithDampedReadoutNoiseModel, diff --git a/cirq-google/cirq_google/ops/fsim_gate_family.py b/cirq-google/cirq_google/ops/fsim_gate_family.py index 813b872dcb0..ec598ad186c 100644 --- a/cirq-google/cirq_google/ops/fsim_gate_family.py +++ b/cirq-google/cirq_google/ops/fsim_gate_family.py @@ -82,7 +82,7 @@ class FSimGateFamily(cirq.GateFamily): >>> assert gf.convert(cirq.FSimGate(-np.pi/2, sympy.Symbol("t")), cirq.ISwapPowGate) is None 2. To convert to/from any of the parameterized `POSSIBLE_FSIM_GATES` types (assuming correct - value of the parameter would be filled in during paramter resolution): + value of the parameter would be filled in during parameter resolution): >>> gf = cirq_google.FSimGateFamily(allow_symbols = True) >>> theta, phi = sympy.Symbol("theta"), sympy.Symbol("phi") >>> assert gf.convert(cirq.FSimGate(-np.pi/4, phi), cirq.ISwapPowGate) == cirq.SQRT_ISWAP @@ -311,7 +311,7 @@ def convert(self, gate: cirq.Gate, target_gate_type: Type[T]) -> Optional[T]: The method can also be used for converting parameterized gate instances, by setting `allow_symbols=True` in the gate family constructor. Note that, conversion of - paramaterized gate instances tries to be lenient and assumes that the correct + parameterized gate instances tries to be lenient and assumes that the correct parameters would eventually be filled during parameter resolution. This can also result in dropping extra parameters during type conversion, assuming the dropped parameters would be supplied the correct values. For example: @@ -326,7 +326,7 @@ def convert(self, gate: cirq.Gate, target_gate_type: Type[T]) -> Optional[T]: target_gate_type: One of `POSSIBLE_FSIM_GATES` types to which the given gate should be converted to. Returns: - The converted gate instances if the converion is possible, else None. + The converted gate instances if the conversion is possible, else None. Raises: ValueError: If `target_gate_type` is not one of `POSSIBLE_FSIM_GATES`. """ diff --git a/cirq-google/cirq_google/serialization/circuit_serializer.py b/cirq-google/cirq_google/serialization/circuit_serializer.py index fc1e15dff51..17e8d6af4f0 100644 --- a/cirq-google/cirq_google/serialization/circuit_serializer.py +++ b/cirq-google/cirq_google/serialization/circuit_serializer.py @@ -312,7 +312,7 @@ def deserialize(self, proto: v2.program_pb2.Program) -> cirq.Circuit: The deserialized Circuit Raises: - ValueError: If the given proto has no language or the langauge gate set mismatches + ValueError: If the given proto has no language or the language gate set mismatches that specified in as the name of this serialized gate set. Also if deserializing a schedule is attempted. NotImplementedError: If the program proto does not contain a circuit or schedule. diff --git a/cirq-ionq/cirq_ionq/calibration.py b/cirq-ionq/cirq_ionq/calibration.py index 96872092858..427f531e865 100644 --- a/cirq-ionq/cirq_ionq/calibration.py +++ b/cirq-ionq/cirq_ionq/calibration.py @@ -53,7 +53,7 @@ def fidelities(self) -> dict: return self._calibration_dict['fidelity'] def timings(self) -> dict: - """Returns the gate, measurement, and reseting timings.""" + """Returns the gate, measurement, and resetting timings.""" return self._calibration_dict['timing'] def connectivity(self) -> Set[Tuple[cirq.LineQubit, cirq.LineQubit]]: diff --git a/cirq-ionq/cirq_ionq/serializer.py b/cirq-ionq/cirq_ionq/serializer.py index 249105d6b37..5864ffe0827 100644 --- a/cirq-ionq/cirq_ionq/serializer.py +++ b/cirq-ionq/cirq_ionq/serializer.py @@ -33,7 +33,7 @@ class SerializedProgram: """A container for the serialized portions of a `cirq.Circuit`. Attributes: - body: A dictionary which containts the number of qubits and the serialized circuit + body: A dictionary which contains the number of qubits and the serialized circuit minus the measurements. metadata: A dictionary whose keys store information about the measurements in the circuit. """ @@ -242,7 +242,7 @@ def _serialize_measurements(self, meas_ops: Iterator) -> Dict[str, str]: Each key and targets are serialized into a string of the form `key` + the ASCII unit separator (chr(31)) + targets as a comma separated value. These are then combined - into a string with a seperator character of the ASCII record separator (chr(30)). + into a string with a separator character of the ASCII record separator (chr(30)). Finally this full string is serialized as the values in the metadata dict with keys given by `measurementX` for X = 0,1, .. 9 and X large enough to contain the entire string. diff --git a/cirq-web/cirq_ts/src/bloch_sphere/bloch_sphere_test.ts b/cirq-web/cirq_ts/src/bloch_sphere/bloch_sphere_test.ts index 24d9fa89ad2..65dc6c9b5cd 100644 --- a/cirq-web/cirq_ts/src/bloch_sphere/bloch_sphere_test.ts +++ b/cirq-web/cirq_ts/src/bloch_sphere/bloch_sphere_test.ts @@ -201,7 +201,7 @@ describe('BlochSphere (with valid custom constructor values)', () => { describe('handles vectors correctly by', () => { it('adding three unique vectors without failing', () => { // Adding multiple vectors is supported in the prototype, - // but the front end isn't yet formatted to accomodate this. + // but the front end isn't yet formatted to accommodate this. // The next PR will contain this additional support. bloch_sphere.addVector(1, 0, 0); diff --git a/cirq-web/cirq_ts/src/circuit/grid_circuit.ts b/cirq-web/cirq_ts/src/circuit/grid_circuit.ts index 3fb894e658d..1061cb4373c 100644 --- a/cirq-web/cirq_ts/src/circuit/grid_circuit.ts +++ b/cirq-web/cirq_ts/src/circuit/grid_circuit.ts @@ -21,7 +21,7 @@ import {Symbol3D, SymbolInformation} from './components/types'; * displayed using three.js */ export class GridCircuit extends Group { - // A nested map where the the outer map correlates + // A nested map where the outer map correlates // rows to pairs. private qubit_map: Map>; private padding_factor: number; diff --git a/docs/build/circuits.ipynb b/docs/build/circuits.ipynb index 2a00d7dde34..07a448cb3d1 100644 --- a/docs/build/circuits.ipynb +++ b/docs/build/circuits.ipynb @@ -142,7 +142,7 @@ }, "outputs": [], "source": [ - "# This is an Pauli X gate. It is an object instance.\n", + "# This is a Pauli X gate. It is an object instance.\n", "x_gate = cirq.X\n", "# Applying it to the qubit at location (0, 0) (defined above)\n", "# turns it into an operation.\n", @@ -454,7 +454,7 @@ "id": "6633b1d21176" }, "source": [ - "![Insert Stategies](/cirq/images/InsertStrategy.png)" + "![Insert Strategies](/cirq/images/InsertStrategy.png)" ] }, { diff --git a/docs/build/interop.ipynb b/docs/build/interop.ipynb index f01d4cb460c..671c326fd1c 100644 --- a/docs/build/interop.ipynb +++ b/docs/build/interop.ipynb @@ -95,7 +95,7 @@ "source": [ "## Exporting and importing to JSON\n", "\n", - "For storing circuits or for transfering them between collaborators, JSON can be a good choice. Many objects in cirq can be serialized as JSON and then stored as a text file for transfer, storage, or for posterity.\n", + "For storing circuits or for transferring them between collaborators, JSON can be a good choice. Many objects in cirq can be serialized as JSON and then stored as a text file for transfer, storage, or for posterity.\n", "\n", "Any object that can be serialized, which includes circuits, moments, gates, operations, and many other cirq constructs, can be turned into JSON with the protocol `cirq.to_json(obj)`. This will return a string that contains the serialized JSON.\n", "\n", diff --git a/docs/build/pauli_observables.ipynb b/docs/build/pauli_observables.ipynb index 2a7f9c40f63..17d92975d47 100644 --- a/docs/build/pauli_observables.ipynb +++ b/docs/build/pauli_observables.ipynb @@ -146,7 +146,7 @@ "source": [ "## `PauliString` construction\n", "\n", - "An empty `cirq.PauliString` by itself is representative of the identity operation `I`, applied to any and all available qubits. A no-op, where no transformation of any qubits is occuring. \n", + "An empty `cirq.PauliString` by itself is representative of the identity operation `I`, applied to any and all available qubits. A no-op, where no transformation of any qubits is occurring. \n", "\n", "This also means that `PauliString`s only represent combinations of the non-identity operations `cirq.X`, `cirq.Y` and `cirq.Z`. Any `cirq.I` operations added are dropped from a `PauliString`. Additionally, any qubits in the expression that have operations that cancel out to the identity are completely dropped. To reinforce this, `cirq.I` is not a `SingleQubitPauliStringGateOperation`, unlike `X`, `Y` and `Z`." ] @@ -378,7 +378,7 @@ "id": "g9iLmoZ4dIBL" }, "source": [ - "It may be useful for you to think of this as normal algebra where each Pauli operator applied to each distinct qubit is a different variable, but with the Pauli anti-commutation relations between the three varaibles for each qubit." + "It may be useful for you to think of this as normal algebra where each Pauli operator applied to each distinct qubit is a different variable, but with the Pauli anti-commutation relations between the three variables for each qubit." ] }, { diff --git a/docs/build/protocols.ipynb b/docs/build/protocols.ipynb index fb641e53d1b..918ed5844c6 100644 --- a/docs/build/protocols.ipynb +++ b/docs/build/protocols.ipynb @@ -206,7 +206,7 @@ "\n", "### Quantum operator representation protocols\n", "\n", - "The following family of protocols is an important and frequently used set of features of Cirq and it is worthwhile mentioning them and and how they interact with each other. They are, in the order of increasing generality:\n", + "The following family of protocols is an important and frequently used set of features of Cirq and it is worthwhile mentioning them and how they interact with each other. They are, in the order of increasing generality:\n", "\n", "* `*unitary`\n", "* `*kraus`\n", diff --git a/docs/experiments/fourier_checking.ipynb b/docs/experiments/fourier_checking.ipynb index 335dbb8db28..8ec3d1e31f8 100644 --- a/docs/experiments/fourier_checking.ipynb +++ b/docs/experiments/fourier_checking.ipynb @@ -448,7 +448,7 @@ " =& \\frac{ \\langle u, \\widehat{v} \\rangle }{\\|u\\| \\|v\\|}.\n", "\\end{align}\n", "where the second equality is due to the Parseval's identity.\n", - "Since in this tutorial we are interesed in Boolean function, we replace the arbitary vector $u$ and $v$ by the output of Boolean function $f$ and $g$. Now we can further simplify the above definition:\n", + "Since in this tutorial we are interesed in Boolean function, we replace the arbitrary vector $u$ and $v$ by the output of Boolean function $f$ and $g$. Now we can further simplify the above definition:\n", "\n", "$$\n", "\\begin{align}\n", @@ -682,7 +682,7 @@ "id": "ddJVURrobh8g" }, "source": [ - "It is clear that the probablity of observation $|0\\rangle^{\\otimes n}$ equals the quantity:\n", + "It is clear that the probability of observation $|0\\rangle^{\\otimes n}$ equals the quantity:\n", "\\begin{align}\n", " p(f,g) := \\frac{1}{N^3} \\left(\\sum_{x, y \\in \\{0,1\\}^n}f(x)(-1)^{x \\cdot y}g(y)\\right)^2\n", "\\end{align}\n", @@ -904,7 +904,7 @@ "source": [ "# Further reading\n", "\n", - "The Forrelation problem was originally introduced in [1]. Later, a **$k$-fold Forrelation** problem was introduced in [2], which considered the forrelation between $k$ oracle functions. In that paper, it also improved the proof about the seperation of forrelation problem from $\\Omega\\left(\\sqrt[4]{N}\\right)$ to $\\tilde{\\Omega}\\left(\\sqrt{N}\\right)$, which can not be further improved. Thus, resolving an open question of Buhrman et al., there is NO partial\n", + "The Forrelation problem was originally introduced in [1]. Later, a **$k$-fold Forrelation** problem was introduced in [2], which considered the forrelation between $k$ oracle functions. In that paper, it also improved the proof about the separation of forrelation problem from $\\Omega\\left(\\sqrt[4]{N}\\right)$ to $\\tilde{\\Omega}\\left(\\sqrt{N}\\right)$, which can not be further improved. Thus, resolving an open question of Buhrman et al., there is NO partial\n", "Boolean function whose quantum query complexity is constant and whose randomized query complexity is linear. \n", "\n", "[1] *Scott Aaronson. BQP and the Polynomial Hierarchy. STOC ’10, page 141–150, New York, NY, USA, 2010.* [arXiv](https://arxiv.org/pdf/0910.4698.pdf)\n", diff --git a/docs/experiments/quantum_walks.ipynb b/docs/experiments/quantum_walks.ipynb index 1591f5db71c..966253aacf9 100644 --- a/docs/experiments/quantum_walks.ipynb +++ b/docs/experiments/quantum_walks.ipynb @@ -500,15 +500,15 @@ "id": "cVLaX59jeSIf" }, "source": [ - "Now we can get back to creating the addition and substraction operators. Starting with the addition operator, \n", + "Now we can get back to creating the addition and subtraction operators. Starting with the addition operator, \n", "the idea is:\n", "\n", "\n", "\n", - "1. Have a $CNOT$ gate controlled by the coin qubit targetting the least significant qubit. This means that if the coin qubit is in the \"move forward\" state, the addition operator will be activated.\n", + "1. Have a $CNOT$ gate controlled by the coin qubit targeting the least significant qubit. This means that if the coin qubit is in the \"move forward\" state, the addition operator will be activated.\n", "\n", "\n", - "2. Apply an $X$ gate to the qubit that was just targetted by the $CNOT$ gate.\n", + "2. Apply an $X$ gate to the qubit that was just targeted by the $CNOT$ gate.\n", "\n", "\n", "3. Apply a Toffoli gate controlled by the coin qubit and the qubit on which the $X$ gate was just placed, targetting the second least-significant qubit. This acts as a \"carry operation\", meaning that if the coin qubit is in the addition state, and the least significant qubit is in the $|0\\rangle$ state (meaning it was in the $|1\\rangle$ state, but had the $CNOT$ operation applied to it, we had to apply the $X$ gate to flip it back to the $|1\\rangle$ state so it can activate the Toffoli gate), then flip the value of the next qubit, signifying that the addition mod $2$ carried over a one to the next digit of the number.\n", @@ -571,7 +571,7 @@ "\n", " yield cirq.X.on(cirq.GridQubit(0, number_qubits))\n", "\n", - " # Implement the Substraction Operator\n", + " # Implement the Subtraction Operator\n", "\n", " for i in range(1, number_qubits+1):\n", "\n", diff --git a/docs/experiments/textbook_algorithms.ipynb b/docs/experiments/textbook_algorithms.ipynb index 0949421cf64..182a91e5ff2 100644 --- a/docs/experiments/textbook_algorithms.ipynb +++ b/docs/experiments/textbook_algorithms.ipynb @@ -364,7 +364,7 @@ "id": "RJhjgemX8QXe" }, "source": [ - "Let's define a generator which produces the QFT circuit. It should accept a list of qubits as input and `yield`s the gates to construct the QFT in the right order. A useful observation is that the the QFT circuit \"repeats\" smaller versions of itself as you move from left to right across the diagram." + "Let's define a generator which produces the QFT circuit. It should accept a list of qubits as input and `yield`s the gates to construct the QFT in the right order. A useful observation is that the QFT circuit \"repeats\" smaller versions of itself as you move from left to right across the diagram." ] }, { diff --git a/docs/hardware/aqt/getting_started.ipynb b/docs/hardware/aqt/getting_started.ipynb index 5d4d12dbeee..3b204b928f9 100644 --- a/docs/hardware/aqt/getting_started.ipynb +++ b/docs/hardware/aqt/getting_started.ipynb @@ -111,7 +111,7 @@ "id": "63a64281ca4e" }, "source": [ - "Where `MY_TOKEN` is your access token for a specific AQT device. You need to subscribe to an AQT backend at the [AQT Gateway Portal](https://gateway-portal.aqt.eu) and retreive the access token. Then you can access the AQT device by:" + "Where `MY_TOKEN` is your access token for a specific AQT device. You need to subscribe to an AQT backend at the [AQT Gateway Portal](https://gateway-portal.aqt.eu) and retrieve the access token. Then you can access the AQT device by:" ] }, { @@ -212,7 +212,7 @@ "source": [ "Where `BACKEND_URL` is the API URL of the AQT backend as specified in your subscription.\n", "\n", - "**Note:** At the moment, the ```run()``` method of the AQTSampler implicitly performs measurements on all qubits at the end of the circuit, so explicit measurement operations aren't required. In fact, using explicit measurements will cause the the AQTSampler to fail. More fine-grained measuement operations will be added to the AQT API in the future." + "**Note:** At the moment, the ```run()``` method of the AQTSampler implicitly performs measurements on all qubits at the end of the circuit, so explicit measurement operations aren't required. In fact, using explicit measurements will cause the AQTSampler to fail. More fine-grained measuement operations will be added to the AQT API in the future." ] }, { diff --git a/docs/hardware/azure-quantum/getting_started_ionq.ipynb b/docs/hardware/azure-quantum/getting_started_ionq.ipynb index c7fd639ecca..35b7763cb52 100644 --- a/docs/hardware/azure-quantum/getting_started_ionq.ipynb +++ b/docs/hardware/azure-quantum/getting_started_ionq.ipynb @@ -264,7 +264,7 @@ " program=circuit,\n", " repetitions=100,\n", " target=\"ionq.qpu\",\n", - " timeout_seconds=500 # Set timeout to 500 seconds to accomodate current queue time on QPU\n", + " timeout_seconds=500 # Set timeout to 500 seconds to accommodate current queue time on QPU\n", ")" ] }, diff --git a/docs/hardware/ionq/getting_started.ipynb b/docs/hardware/ionq/getting_started.ipynb index d2c58863b13..fc95c159185 100644 --- a/docs/hardware/ionq/getting_started.ipynb +++ b/docs/hardware/ionq/getting_started.ipynb @@ -346,7 +346,7 @@ "\n", "[How to use the service API](/cirq/hardware/ionq/jobs.md)\n", "\n", - "[Learn how to query the performace of a processor by accessing IonQ calibrations](/cirq/hardware/ionq/calibrations.md)" + "[Learn how to query the performance of a processor by accessing IonQ calibrations](/cirq/hardware/ionq/calibrations.md)" ] } ], diff --git a/docs/hardware/pasqal/getting_started.ipynb b/docs/hardware/pasqal/getting_started.ipynb index 8df15ba2b98..89449a52c67 100644 --- a/docs/hardware/pasqal/getting_started.ipynb +++ b/docs/hardware/pasqal/getting_started.ipynb @@ -217,7 +217,7 @@ "id": "DkHu3gfNpe2J" }, "source": [ - "When inserting into circuits designed for Pasqal devices, be sure to insert each operation into its own `Moment` (for example, using `cirq.InsertStrategy.NEW`). You may need to do this in a seperate step, as in the below example that converts two simultaneous Hadamard gates." + "When inserting into circuits designed for Pasqal devices, be sure to insert each operation into its own `Moment` (for example, using `cirq.InsertStrategy.NEW`). You may need to do this in a separate step, as in the below example that converts two simultaneous Hadamard gates." ] }, { diff --git a/docs/start/install.md b/docs/start/install.md index 139ebe127c4..86790354969 100644 --- a/docs/start/install.md +++ b/docs/start/install.md @@ -10,7 +10,7 @@ If you want to create a development environment, see the [development page](/cir --- -## Python version supprt +## Python version support Cirq currently supports python 3.7 and later. We follow numpy's schedule for python version support defined in [NEP 29](https://numpy.org/neps/nep-0029-deprecation_policy.html), diff --git a/docs/start/intro.ipynb b/docs/start/intro.ipynb index fb18a19affa..a21935d2296 100644 --- a/docs/start/intro.ipynb +++ b/docs/start/intro.ipynb @@ -947,7 +947,7 @@ "\n", "> David Deutsch, \"[Quantum Theory, the Church-Turing Principle and the Universal Quantum Computer](https://www.daviddeutsch.org.uk/wp-content/deutsch85.pdf)\" *Proc. R. Soc. Lond.* A **400** 97–117. http://doi.org/10.1098/rspa.1985.0070\n", "\n", - "This algorithm was extended by Deutsch and Richard Jozsa to a more convincing algorithmic seperation and what is now called the Deutsch-Jozsa algorithm. In this section we will show how to write circuits for the Deutsch algorithm and then as an exercise in using Cirq for algorithms for a small version of the Deutsch-Jozsa algorithm.\n", + "This algorithm was extended by Deutsch and Richard Jozsa to a more convincing algorithmic separation and what is now called the Deutsch-Jozsa algorithm. In this section we will show how to write circuits for the Deutsch algorithm and then as an exercise in using Cirq for algorithms for a small version of the Deutsch-Jozsa algorithm.\n", "\n", "Let's begin with the Deutsch algorithm. In Deutsch's algorithm you are given access to a box which computes a one bit boolean function. That is it is a box which takes in a bit and outputs a bit. If we want to be a mathematician or theoretical computer scientist we write the function $f$ as $f: \\{0, 1\\} \\rightarrow \\{0, 1\\}$. There are exactly four such boolean functions which we can write out in a table\n", "\n", diff --git a/docs/tutorials/google/identifying_hardware_changes.ipynb b/docs/tutorials/google/identifying_hardware_changes.ipynb index 2049441512b..ef7df5258df 100644 --- a/docs/tutorials/google/identifying_hardware_changes.ipynb +++ b/docs/tutorials/google/identifying_hardware_changes.ipynb @@ -351,7 +351,7 @@ } ], "source": [ - "# Retreive maintenance calibration data.\n", + "# Retrieve maintenance calibration data.\n", "calibration = cg.get_engine_calibration(processor_id=processor_id)\n", "\n", "# Heatmap the two metrics.\n", diff --git a/docs/tutorials/google/spin_echoes.ipynb b/docs/tutorials/google/spin_echoes.ipynb index b40d1a70b3d..379257198b6 100644 --- a/docs/tutorials/google/spin_echoes.ipynb +++ b/docs/tutorials/google/spin_echoes.ipynb @@ -1337,7 +1337,7 @@ "id": "omR0mlzl_kGN" }, "source": [ - "After removing unecessary gates (optimization) and aligning gates, the same circuit looks like this:" + "After removing unnecessary gates (optimization) and aligning gates, the same circuit looks like this:" ] }, {