From 049e918c68ba4ad0097e9d33cb55414a92f1d460 Mon Sep 17 00:00:00 2001 From: Matt Beach Date: Fri, 12 Apr 2024 10:45:59 -0400 Subject: [PATCH] fix: spelling --- CHANGELOG.md | 2 +- doc/examples-adv-circuits-algorithms.rst | 2 +- doc/examples-braket-features.rst | 2 +- src/braket/annealing/problem.py | 2 +- src/braket/aws/aws_device.py | 2 +- src/braket/aws/aws_quantum_task.py | 2 +- src/braket/aws/aws_quantum_task_batch.py | 2 +- src/braket/aws/aws_session.py | 4 ++-- src/braket/circuits/circuit.py | 2 +- src/braket/circuits/gate_calibrations.py | 2 +- src/braket/circuits/moments.py | 2 +- src/braket/circuits/noise.py | 2 +- src/braket/circuits/noise_helpers.py | 8 ++++---- .../circuits/noise_model/qubit_initialization_criteria.py | 2 +- src/braket/circuits/quantum_operator_helpers.py | 2 +- .../text_diagram_builders/ascii_circuit_diagram.py | 2 +- .../text_diagram_builders/text_circuit_diagram.py | 4 ++-- .../text_diagram_builders/unicode_circuit_diagram.py | 2 +- src/braket/jobs/local/local_job_container.py | 2 +- .../analog_hamiltonian_simulation_quantum_task_result.py | 2 +- src/braket/timings/time_series.py | 2 +- src/braket/tracking/tracker.py | 4 ++-- 22 files changed, 28 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6449e1bea..ebd98edd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,7 +38,7 @@ ### Bug Fixes and Other Changes - * backwards compatiblity for local detuning + * backwards compatibility for local detuning ## v1.76.1 (2024-04-08) diff --git a/doc/examples-adv-circuits-algorithms.rst b/doc/examples-adv-circuits-algorithms.rst index b37e87e34..4a16c9cd6 100644 --- a/doc/examples-adv-circuits-algorithms.rst +++ b/doc/examples-adv-circuits-algorithms.rst @@ -2,7 +2,7 @@ Advanced circuits and algorithms ################################ -Learn more about working with advanced circuits and algoritms. +Learn more about working with advanced circuits and algorithms. .. toctree:: :maxdepth: 2 diff --git a/doc/examples-braket-features.rst b/doc/examples-braket-features.rst index 75361f172..004e2bfe3 100644 --- a/doc/examples-braket-features.rst +++ b/doc/examples-braket-features.rst @@ -27,7 +27,7 @@ selection for your circuits manually, when running on QPUs. *************************************************************************************************************************************************************************************************** This example shows how to interact with the Amazon Braket GetDevice API to -retrieve Amazon Braket devices (such as simulators and QPUs) programatically, +retrieve Amazon Braket devices (such as simulators and QPUs) programmatically, and how to gain access to their properties. *********************************************************************************************************************************************************************************** diff --git a/src/braket/annealing/problem.py b/src/braket/annealing/problem.py index d55de4e6e..9515cbfa6 100644 --- a/src/braket/annealing/problem.py +++ b/src/braket/annealing/problem.py @@ -39,7 +39,7 @@ def __init__( linear: dict[int, float] | None = None, quadratic: dict[tuple[int, int], float] | None = None, ): - """Initialzes a `Problem`. + """Initializes a `Problem`. Args: problem_type (ProblemType): The type of annealing problem diff --git a/src/braket/aws/aws_device.py b/src/braket/aws/aws_device.py index 43780aa38..390145aec 100644 --- a/src/braket/aws/aws_device.py +++ b/src/braket/aws/aws_device.py @@ -819,7 +819,7 @@ def _parse_calibration_json( Returns: dict[tuple[Gate, QubitSet], PulseSequence]: The - structured data based on a mapping of `tuple[Gate, Qubit]` to its calibration repesented as a + structured data based on a mapping of `tuple[Gate, Qubit]` to its calibration represented as a `PulseSequence`. """ # noqa: E501 diff --git a/src/braket/aws/aws_quantum_task.py b/src/braket/aws/aws_quantum_task.py index 54f544159..c386469b0 100644 --- a/src/braket/aws/aws_quantum_task.py +++ b/src/braket/aws/aws_quantum_task.py @@ -320,7 +320,7 @@ def metadata(self, use_cached_value: bool = False) -> dict[str, Any]: dict[str, Any]: The response from the Amazon Braket `GetQuantumTask` operation. If `use_cached_value` is `True`, Amazon Braket is not called and the most recently retrieved value is used, unless `GetQuantumTask` was never called, in which case - it wil still be called to populate the metadata for the first time. + it will still be called to populate the metadata for the first time. """ if not use_cached_value or not self._metadata: self._metadata = self._aws_session.get_quantum_task(self._arn) diff --git a/src/braket/aws/aws_quantum_task_batch.py b/src/braket/aws/aws_quantum_task_batch.py index 4d0d06b53..964fabe7e 100644 --- a/src/braket/aws/aws_quantum_task_batch.py +++ b/src/braket/aws/aws_quantum_task_batch.py @@ -432,7 +432,7 @@ def size(self) -> int: @property def unfinished(self) -> set[str]: - """Gets all the IDs of all the quantum tasks in teh batch that have yet to complete. + """Gets all the IDs of all the quantum tasks in the batch that have yet to complete. Returns: set[str]: The IDs of all the quantum tasks in the batch that have yet to complete. diff --git a/src/braket/aws/aws_session.py b/src/braket/aws/aws_session.py index d2f2099f4..6a1bd1ce8 100644 --- a/src/braket/aws/aws_session.py +++ b/src/braket/aws/aws_session.py @@ -731,7 +731,7 @@ def describe_log_streams( Would have been received in a previous call. Returns: - dict[str, Any]: Dicionary containing logStreams and nextToken + dict[str, Any]: Dictionary containing logStreams and nextToken """ log_stream_args = { "logGroupName": log_group, @@ -767,7 +767,7 @@ def get_log_events( Would have been received in a previous call. Returns: - dict[str, Any]: Dicionary containing events, nextForwardToken, and nextBackwardToken + dict[str, Any]: Dictionary containing events, nextForwardToken, and nextBackwardToken """ log_events_args = { "logGroupName": log_group, diff --git a/src/braket/circuits/circuit.py b/src/braket/circuits/circuit.py index 9bac39a6c..bf0ee07d8 100644 --- a/src/braket/circuits/circuit.py +++ b/src/braket/circuits/circuit.py @@ -276,7 +276,7 @@ def add_result_type( Raises: TypeError: If both `target_mapping` and `target` are supplied. - ValueError: If a meaure instruction exists on the current circuit. + ValueError: If a measure instruction exists on the current circuit. Examples: >>> result_type = ResultType.Probability(target=[0, 1]) diff --git a/src/braket/circuits/gate_calibrations.py b/src/braket/circuits/gate_calibrations.py index 7617493cb..69ff66254 100644 --- a/src/braket/circuits/gate_calibrations.py +++ b/src/braket/circuits/gate_calibrations.py @@ -27,7 +27,7 @@ class GateCalibrations: - """An object containing gate calibration data. The data respresents the mapping on a particular gate + """An object containing gate calibration data. The data represents the mapping on a particular gate on a set of qubits to its calibration to be used by a quantum device. This is represented by a dictionary with keys of `Tuple(Gate, QubitSet)` mapped to a `PulseSequence`. """ # noqa: E501 diff --git a/src/braket/circuits/moments.py b/src/braket/circuits/moments.py index 6622b3467..cf09f8284 100644 --- a/src/braket/circuits/moments.py +++ b/src/braket/circuits/moments.py @@ -290,7 +290,7 @@ def _max_time_for_qubit(self, qubit: Qubit) -> int: return self._max_times.get(qubit, -1) # - # Implement abstract methods, default to calling selfs underlying dictionary + # Implement abstract methods, default to calling self underlying dictionary # def keys(self) -> KeysView[MomentsKey]: diff --git a/src/braket/circuits/noise.py b/src/braket/circuits/noise.py index fe256f1da..0cad544e2 100644 --- a/src/braket/circuits/noise.py +++ b/src/braket/circuits/noise.py @@ -639,7 +639,7 @@ def __init__( qubit_count: Optional[int], ascii_symbols: Sequence[str], ): - """Initalizes a `DampingNoise`. + """Initializes a `DampingNoise`. Args: gamma (Union[FreeParameterExpression, float]): Probability of damping. diff --git a/src/braket/circuits/noise_helpers.py b/src/braket/circuits/noise_helpers.py index 6dda8130d..3b9dd3016 100644 --- a/src/braket/circuits/noise_helpers.py +++ b/src/braket/circuits/noise_helpers.py @@ -110,7 +110,7 @@ def check_noise_target_qubits( """Helper function to check whether all the target_qubits are positive integers. Args: - circuit (Circuit): A ciruit where `noise` is to be checked. + circuit (Circuit): A circuit where `noise` is to be checked. target_qubits (Optional[QubitSetInput]): Index or indices of qubit(s). Returns: @@ -141,7 +141,7 @@ def apply_noise_to_moments( `target_qubits`. Args: - circuit (Circuit): A ciruit where `noise` is applied to. + circuit (Circuit): A circuit where `noise` is applied to. noise (Iterable[type[Noise]]): Noise channel(s) to be applied to the circuit. target_qubits (QubitSet): Index or indices of qubits. `noise` is applied to. @@ -209,7 +209,7 @@ def _apply_noise_to_gates_helper( Returns: tuple[Iterable[Instruction], int, bool]: A tuple of three values: - new_noise_instruction: A list of noise intructions + new_noise_instruction: A list of noise instructions noise_index: The number of noise channels applied to the gate noise_applied: Whether noise is applied or not """ @@ -248,7 +248,7 @@ def apply_noise_to_gates( the same number of qubits as `noise.qubit_count`. Args: - circuit (Circuit): A ciruit where `noise` is applied to. + circuit (Circuit): A circuit where `noise` is applied to. noise (Iterable[type[Noise]]): Noise channel(s) to be applied to the circuit. target_gates (Union[Iterable[type[Gate]], ndarray]): List of gates, or a unitary matrix diff --git a/src/braket/circuits/noise_model/qubit_initialization_criteria.py b/src/braket/circuits/noise_model/qubit_initialization_criteria.py index eb8ea0f21..e1790fd21 100644 --- a/src/braket/circuits/noise_model/qubit_initialization_criteria.py +++ b/src/braket/circuits/noise_model/qubit_initialization_criteria.py @@ -54,7 +54,7 @@ def get_keys(self, key_type: CriteriaKey) -> Union[CriteriaKeyResult, set[Any]]: Returns: Union[CriteriaKeyResult, set[Any]]: The return value is based on the key type: - QUBIT will return a set of qubit targets that are relevant to this Critera, or + QUBIT will return a set of qubit targets that are relevant to this Criteria, or CriteriaKeyResult.ALL if the Criteria is relevant for all (possible) qubits. All other keys will return an empty set. """ diff --git a/src/braket/circuits/quantum_operator_helpers.py b/src/braket/circuits/quantum_operator_helpers.py index 8d64888ed..15cb8d1fd 100644 --- a/src/braket/circuits/quantum_operator_helpers.py +++ b/src/braket/circuits/quantum_operator_helpers.py @@ -88,7 +88,7 @@ def is_unitary(matrix: np.ndarray) -> bool: def is_cptp(matrices: Iterable[np.ndarray]) -> bool: - """Whether a transformation defined by these matrics as Kraus operators is a + """Whether a transformation defined by these matrices as Kraus operators is a completely positive trace preserving (CPTP) map. This is the requirement for a transformation to be a quantum channel. Reference: Section 8.2.3 in Nielsen & Chuang (2010) 10th edition. diff --git a/src/braket/circuits/text_diagram_builders/ascii_circuit_diagram.py b/src/braket/circuits/text_diagram_builders/ascii_circuit_diagram.py index 3106afc47..a633d318c 100644 --- a/src/braket/circuits/text_diagram_builders/ascii_circuit_diagram.py +++ b/src/braket/circuits/text_diagram_builders/ascii_circuit_diagram.py @@ -179,7 +179,7 @@ def _draw_symbol( Args: symbol (str): the gate name - symbols_width (int): size of the expected output. The ouput will be filled with + symbols_width (int): size of the expected output. The output will be filled with cls._qubit_line_character() if needed. connection (Literal["above", "below", "both", "none"]): character indicating if the gate also involve a qubit with a lower index. diff --git a/src/braket/circuits/text_diagram_builders/text_circuit_diagram.py b/src/braket/circuits/text_diagram_builders/text_circuit_diagram.py index c8bfa2650..e1dda5a3b 100644 --- a/src/braket/circuits/text_diagram_builders/text_circuit_diagram.py +++ b/src/braket/circuits/text_diagram_builders/text_circuit_diagram.py @@ -81,7 +81,7 @@ def _draw_symbol( Args: symbol (str): the gate name - symbols_width (int): size of the expected output. The ouput will be filled with + symbols_width (int): size of the expected output. The output will be filled with cls._qubit_line_character() if needed. connection (Literal["above", "below", "both", "none"]): specifies if a connection will be drawn above and/or below the box. @@ -229,7 +229,7 @@ def _create_output( qubits: QubitSet, global_phase: float | None, ) -> str: - """Creates the ouput for a single column: + """Creates the output for a single column: a. If there was one or more gphase gate, create a first line with the total global phase shift ending with the _vertical_delimiter() class attribute, e.g. 0.14| b. for each qubit, append the text representation produces by cls._draw_symbol diff --git a/src/braket/circuits/text_diagram_builders/unicode_circuit_diagram.py b/src/braket/circuits/text_diagram_builders/unicode_circuit_diagram.py index 9e1779cb7..0739724e9 100644 --- a/src/braket/circuits/text_diagram_builders/unicode_circuit_diagram.py +++ b/src/braket/circuits/text_diagram_builders/unicode_circuit_diagram.py @@ -203,7 +203,7 @@ def _draw_symbol( Args: symbol (str): the gate name - symbols_width (int): size of the expected output. The ouput will be filled with + symbols_width (int): size of the expected output. The output will be filled with cls._qubit_line_character() if needed. connection (Literal["above", "below", "both", "none"]): specifies if a connection will be drawn above and/or below the box. diff --git a/src/braket/jobs/local/local_job_container.py b/src/braket/jobs/local/local_job_container.py index c4432dcf7..04aeaff1a 100644 --- a/src/braket/jobs/local/local_job_container.py +++ b/src/braket/jobs/local/local_job_container.py @@ -45,7 +45,7 @@ def __init__( Default: AwsSession() logger (Logger): Logger object with which to write logs. Default: `getLogger(__name__)` - force_update (bool): Try to update the container, if an update is availble. + force_update (bool): Try to update the container, if an update is available. Default: False """ self._aws_session = aws_session or AwsSession() diff --git a/src/braket/tasks/analog_hamiltonian_simulation_quantum_task_result.py b/src/braket/tasks/analog_hamiltonian_simulation_quantum_task_result.py index ade8a0f79..0bc110b2c 100644 --- a/src/braket/tasks/analog_hamiltonian_simulation_quantum_task_result.py +++ b/src/braket/tasks/analog_hamiltonian_simulation_quantum_task_result.py @@ -116,7 +116,7 @@ def get_counts(self) -> dict[str, int]: Returns: dict[str, int]: number of times each state configuration is measured. Returns None if none of shot measurements are successful. - Only succesful shots contribute to the state count. + Only successful shots contribute to the state count. """ state_counts = Counter() states = ["e", "r", "g"] diff --git a/src/braket/timings/time_series.py b/src/braket/timings/time_series.py index a558bec71..7631f64de 100644 --- a/src/braket/timings/time_series.py +++ b/src/braket/timings/time_series.py @@ -151,7 +151,7 @@ def concatenate(self, other: TimeSeries) -> TimeSeries: Notes: Keeps the time points in both time series unchanged. Assumes that the time points in the first TimeSeries - are at earler times then the time points in the second TimeSeries. + are at earlier times then the time points in the second TimeSeries. Returns: TimeSeries: The concatenated time series. diff --git a/src/braket/tracking/tracker.py b/src/braket/tracking/tracker.py index 2f77eec66..47c13625a 100644 --- a/src/braket/tracking/tracker.py +++ b/src/braket/tracking/tracker.py @@ -122,7 +122,7 @@ def quantum_tasks_statistics(self) -> dict[str, dict[str, Any]]: Returns: dict[str, dict[str, Any]]: A dictionary where each key is a device arn, and maps to - a dictionary sumarizing the quantum tasks run on the device. The summary includes the + a dictionary summarizing the quantum tasks run on the device. The summary includes the total shots sent to the device and the most recent status of the quantum tasks created on this device. For finished quantum tasks on simulator devices, the summary also includes the duration of the simulation. @@ -271,7 +271,7 @@ def _get_simulator_task_cost(task_arn: str, details: dict) -> Decimal: product_family = "Simulator Task" operation = "CompleteTask" if details["status"] == "FAILED" and device_name == "TN1": - # Rehersal step of TN1 can fail and charges still apply. + # Rehearsal step of TN1 can fail and charges still apply. operation = "FailedTask" search_dict = {