Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Correct miscellaneous spelling mistakes in docstrings #952

Merged
merged 4 commits into from
Apr 15, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

### Bug Fixes and Other Changes

* backwards compatiblity for local detuning
* backwards compatibility for local detuning

## v1.76.1 (2024-04-08)

Expand Down
2 changes: 1 addition & 1 deletion doc/examples-adv-circuits-algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/examples-braket-features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

***********************************************************************************************************************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/braket/annealing/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/braket/aws/aws_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/braket/aws/aws_quantum_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/braket/aws/aws_quantum_task_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/braket/aws/aws_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/braket/circuits/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion src/braket/circuits/gate_calibrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/braket/circuits/moments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`'s underlying dictionary
#

def keys(self) -> KeysView[MomentsKey]:
Expand Down
2 changes: 1 addition & 1 deletion src/braket/circuits/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/braket/circuits/noise_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 to `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.
Expand Down Expand Up @@ -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
"""
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/braket/circuits/quantum_operator_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/braket/jobs/local/local_job_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion src/braket/timings/time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,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.
Expand Down
4 changes: 2 additions & 2 deletions src/braket/tracking/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 = {
Expand Down