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
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Before sending us a pull request, please ensure that:

1. If you do not already have one, create a GitHub account by following the prompts at [Join Github](https://github.com/join).
1. Create a fork of this repository on GitHub. You should end up with a fork at `https://github.com/<username>/amazon-braket-sdk-python`.
1. Follow the instructions at [Fork a Repo](https://help.github.com/en/articles/fork-a-repo) to fork a GitHub repository.
1. Follow the instructions at [Fork a Repo](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) to fork a GitHub repository.
1. Clone your fork of the repository: `git clone https://github.com/<username>/amazon-braket-sdk-python` where `<username>` is your github username.


Expand All @@ -72,7 +72,7 @@ You can also pass in various pytest arguments `tox -e unit-tests -- your-argumen

Run the integration tests to make sure that the system as a whole still works.

1. Follow the instructions at [Set Up the AWS Command Line Interface (AWS CLI)](https://docs.aws.amazon.com/polly/latest/dg/setup-aws-cli.html).
1. Follow the instructions at [Set Up the AWS Command Line Interface (AWS CLI)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html).
1. Set the `AWS_PROFILE` information
```bash
export AWS_PROFILE=Your_Profile_Name
Expand All @@ -97,7 +97,7 @@ You can also pass in various pytest arguments `tox -e integ-tests -- your-argume

### Send a Pull Request

GitHub provides additional documentation on [Creating a Pull Request](https://help.github.com/articles/creating-a-pull-request/).
GitHub provides additional documentation on [Creating a Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).

Please remember to:
* Use PR titles that follow the guidelines under [PR Title Format](#pr-title-format).
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Follow the installation [instructions](https://boto3.amazonaws.com/v1/documentat
**Note:** Make sure that your AWS region is set to one supported by Amazon Braket. You can check this in your AWS configuration file, which is located by default at `~/.aws/config`.

### Configure your AWS account with the resources necessary for Amazon Braket
If you are new to Amazon Braket, onboard to the service and create the resources necessary to use Amazon Braket using the [AWS console](https://console.aws.amazon.com/braket/home ).
If you are new to Amazon Braket, onboard to the service and create the resources necessary to use Amazon Braket using the [AWS console](https://console.aws.amazon.com/braket/home).

## Installing the Amazon Braket Python SDK

Expand Down Expand Up @@ -89,7 +89,7 @@ task = device.run(bell, shots=100)
print(task.result().measurement_counts)
```

The code sample imports the Amazon Braket framework, then defines the device to use (the SV1 AWS simulator). It then creates a Bell Pair circuit, executes the circuit on the simulator and prints the results of the hybrid job. This example can be found in `../examples/bell.py`.
The code sample imports the Amazon Braket framework, then defines the device to use (the SV1 AWS simulator). It then creates a Bell Pair circuit, executes the circuit on the simulator and prints the results of the quantum task. This example can be found in `examples/bell.py`.

### Running multiple quantum tasks at once

Expand Down Expand Up @@ -125,13 +125,13 @@ The code sample imports the Amazon Braket framework, then creates a hybrid job w
Amazon Braket provides access to two types of simulators: fully managed simulators, available through the Amazon Braket service, and the local simulators that are part of the Amazon Braket SDK.

- Fully managed simulators offer high-performance circuit simulations. These simulators can handle circuits larger than circuits that run on quantum hardware. For example, the SV1 state vector simulator shown in the previous examples requires approximately 1 or 2 hours to complete a 34-qubit, dense, and square circuit (circuit depth = 34), depending on the type of gates used and other factors.
- The Amazon Braket Python SDK includes an implementation of quantum simulators that can run circuits on your local, classic hardware. For example the braket_sv local simulator is well suited for rapid prototyping on small circuits up to 25 qubits, depending on the hardware specifications of your Braket notebook instance or your local environment. An example of how to execute the quantum task locally is included in the repository `../examples/local_bell.py`.
- The Amazon Braket Python SDK includes an implementation of quantum simulators that can run circuits on your local, classic hardware. For example the braket_sv local simulator is well suited for rapid prototyping on small circuits up to 25 qubits, depending on the hardware specifications of your Braket notebook instance or your local environment. An example of how to execute the quantum task locally is included in the repository `examples/local_bell.py`.

For a list of available simulators and their features, consult the [Amazon Braket Developer Guide](https://docs.aws.amazon.com/braket/latest/developerguide/braket-devices.html).

### Debugging logs

Quantum tasks sent to QPUs don't always run right away. To view quantum task status, you can enable debugging logs. An example of how to enable these logs is included in repo: `../examples/debug_bell.py`. This example enables quantum task logging so that status updates are continuously printed to the terminal after a quantum task is executed. The logs can also be configured to save to a file or output to another stream. You can use the debugging example to get information on the quantum tasks you submit, such as the current status, so that you know when your quantum task completes.
Quantum tasks sent to QPUs don't always run right away. To view quantum task status, you can enable debugging logs. An example of how to enable these logs is included in repo: `examples/debug_bell.py`. This example enables quantum task logging so that status updates are continuously printed to the terminal after a quantum task is executed. The logs can also be configured to save to a file or output to another stream. You can use the debugging example to get information on the quantum tasks you submit, such as the current status, so that you know when your quantum task completes.

### Running a Quantum Algorithm on a Quantum Computer
With Amazon Braket, you can run your quantum circuit on a physical quantum computer.
Expand Down Expand Up @@ -170,7 +170,7 @@ See [PUBLICATIONS.md](PUBLICATIONS.md) for a list of recent arXiv preprints that

## Braket Python SDK API Reference Documentation

The API reference, can be found on [Read the Docs](https://amazon-braket-sdk-python.readthedocs.io/en/latest/).
The API reference can be found on [Read the Docs](https://amazon-braket-sdk-python.readthedocs.io/en/latest/).

**To generate the API Reference HTML in your local environment**

Expand All @@ -191,7 +191,7 @@ This repository has both unit and integration tests.
To run the tests, make sure to install test dependencies first:

```bash
pip install -e "amazon-braket-sdk-python[test]"
pip install -e ".[test]"
```

### Unit Tests
Expand Down
2 changes: 1 addition & 1 deletion doc/cheat_sheet/Translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TL;DR:

- See `_config.yml`, `index.fr.html` and `_includes/`

The translation of this cheat-sheet requires the followings steps:
The translation of this cheat-sheet requires the following steps:

- Choose a tag for your language, such as `en` for English or `fr` for French;
- On [`_config.yml`](_config.yml), add your tag and translate the given phrases;
Expand Down
2 changes: 1 addition & 1 deletion doc/cheat_sheet/_includes/en/LLDC.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
| Shift frequency | `pulse_sequence.shift_frequency(frame, detuning)` |
| Set phase | `pulse_sequence.set_phase(frame, phase)` |
| Shift phase | `pulse_sequence.shift_phase(frame, phi)` |
| Get the time series | `pulse_sequence.to_time_traces()` |
| Get the time series | `pulse_sequence.to_time_trace()` |
2 changes: 1 addition & 1 deletion doc/cheat_sheet/_includes/fr/LLDC.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
| Décaler la fréquence | `pulse_sequence.shift_frequency(frame, detuning)` |
| Définir la phase | `pulse_sequence.set_phase(frame, phase)` |
| Décaler la phase | `pulse_sequence.shift_phase(frame, phi)` |
| Obtenir la série temporelle | `pulse_sequence.to_time_traces()` |
| Obtenir la série temporelle | `pulse_sequence.to_time_trace()` |
2 changes: 1 addition & 1 deletion doc/cheat_sheet/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<div class="github-info">
{{ site.t[page.lang]["github-1"] }}
<a href="https://github.com/amazon-braket/amazon-braket-sdk-python/doc/cheat_sheet">
<a href="https://github.com/amazon-braket/amazon-braket-sdk-python/tree/main/doc/cheat_sheet">
{{ site.t[page.lang]["github-2"] }}
</a>.
{{ site.t[page.lang]["github-3"] }}
Expand Down
2 changes: 1 addition & 1 deletion doc/genai_cheat_sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ DragGaussianWaveform(length, width, amplitude, beta, zero_at_edges)

***Get the time series:***

`pulse_sequence.to_time_traces()`
`pulse_sequence.to_time_trace()`

**Analog Hamiltonian Simulation**

Expand Down
4 changes: 2 additions & 2 deletions src/braket/ahs/analog_hamiltonian_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def from_ir(source: ir.Program) -> AnalogHamiltonianSimulation:
the Analog Hamiltonian Simulation.

Args:
source (ir.Program): The IR representation of the circuit.
source (ir.Program): The IR representation of the AHS program.

Returns:
AnalogHamiltonianSimulation: The Analog Hamiltonian Simulation.
Expand Down Expand Up @@ -107,7 +107,7 @@ def to_ir(self) -> ir.Program:
representation.

Returns:
ir.Program: A representation of the circuit in the IR format.
ir.Program: A representation of the AHS program in the IR format.
"""
return ir.Program(
setup=ir.Setup(ahs_register=self._register_to_ir()),
Expand Down
4 changes: 2 additions & 2 deletions src/braket/ahs/driving_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ def stitch(
) -> DrivingField:
"""Stitches two driving fields based on TimeSeries.stitch method.
The time points of the second DrivingField are shifted such that the first time point of
the second DrifingField coincides with the last time point of the first DrivingField.
the second DrivingField coincides with the last time point of the first DrivingField.
The boundary point value is handled according to StitchBoundaryCondition argument value.

Args:
other (DrivingField): The second shifting field to be stitched with.
other (DrivingField): The second driving field to be stitched with.
boundary (StitchBoundaryCondition): {"mean", "left", "right"}. Boundary point handler.

Possible options are
Expand Down
2 changes: 1 addition & 1 deletion src/braket/ahs/pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, series: list[Number]):
"""Represents the spatial dependence of a Field.

Args:
series (list[Number]): A series of numbers representing the the local
series (list[Number]): A series of numbers representing the local
pattern of real numbers.
"""
self._series = series
Expand Down
14 changes: 7 additions & 7 deletions src/braket/aws/aws_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ def run(
IR. If the IR supports inputs, the inputs will be updated with this value.
Default: {}.
gate_definitions (dict[tuple[Gate, QubitSet], PulseSequence] | None): A
`dict[tuple[Gate, QubitSet], PulseSequence]]` for a user defined gate calibration.
`dict[tuple[Gate, QubitSet], PulseSequence]` for a user defined gate calibration.
The calibration is defined for a particular `Gate` on a particular `QubitSet`
and is represented by a `PulseSequence`.
Default: None.
reservation_arn (str | None): The reservation ARN provided by Braket Direct
to reserve exclusive usage for the device to run the quantum task on.
Note: If you are creating tasks in a job that itself was created reservation ARN,
those tasks do not need to be created with the reservation ARN.
Note: If you are creating tasks in a job that itself was created with a
reservation ARN, those tasks do not need to be created with the reservation ARN.
Default: None.
experimental_capabilities (str | None): Experimental capabilities
to enable for the quantum task. Supported values are "ALL" to enable all
Expand Down Expand Up @@ -273,13 +273,13 @@ def run_batch(
passed along with the IR. If the IR supports inputs, the inputs will be updated
with this value. Default: {}.
gate_definitions (dict[tuple[Gate, QubitSet], PulseSequence] | None): A
`dict[tuple[Gate, QubitSet], PulseSequence]]` for a user defined gate calibration.
`dict[tuple[Gate, QubitSet], PulseSequence]` for a user defined gate calibration.
The calibration is defined for a particular `Gate` on a particular `QubitSet`
and is represented by a `PulseSequence`. Default: None.
reservation_arn (str | None): The reservation ARN provided by Braket Direct
to reserve exclusive usage for the device to run the quantum task on.
Note: If you are creating tasks in a job that itself was created reservation ARN,
those tasks do not need to be created with the reservation ARN.
Note: If you are creating tasks in a job that itself was created with a
reservation ARN, those tasks do not need to be created with the reservation ARN.
Default: None.
experimental_capabilities (str | None): Experimental capabilities
to enable for the quantum task. Supported values are "ALL" to enable all
Expand Down Expand Up @@ -419,7 +419,7 @@ def arn(self) -> str:

@property
def gate_calibrations(self) -> GateCalibrations | None:
"""Calibration data for a QPU. Calibration data is shown for gates on particular gubits.
"""Calibration data for a QPU. Calibration data is shown for gates on particular qubits.
If a QPU does not expose these calibrations, None is returned.

Returns:
Expand Down
2 changes: 1 addition & 1 deletion src/braket/aws/aws_quantum_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def create(

copy_checkpoints_from_job (str | None): A str that specifies the hybrid job ARN whose
checkpoint you want to use in the current hybrid job. Specifying this value will
copy over the checkpoint data from `use_checkpoints_from_job`'s checkpoint_config
copy over the checkpoint data from `copy_checkpoints_from_job`'s checkpoint_config
s3Uri to the current hybrid job's checkpoint_config s3Uri, making it available at
checkpoint_config.localPath during the hybrid job execution. Default: None

Expand Down
4 changes: 2 additions & 2 deletions src/braket/aws/aws_quantum_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ def create(

reservation_arn (str | None): The reservation ARN provided by Braket Direct
to reserve exclusive usage for the device to run the quantum task on.
Note: If you are creating tasks in a job that itself was created reservation ARN,
those tasks do not need to be created with the reservation ARN.
Note: If you are creating tasks in a job that itself was created with a
reservation ARN, those tasks do not need to be created with the reservation ARN.
Default: None.

experimental_capabilities (str | None): Experimental capabilities
Expand Down
6 changes: 3 additions & 3 deletions src/braket/aws/aws_quantum_task_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def __init__(
particular `QubitSet` and is represented by a `PulseSequence`. Default: None.
reservation_arn (str | None): The reservation ARN provided by Braket Direct
to reserve exclusive usage for the device to run the quantum task on.
Note: If you are creating tasks in a job that itself was created reservation ARN,
those tasks do not need to be created with the reservation ARN.
Note: If you are creating tasks in a job that itself was created with a
reservation ARN, those tasks do not need to be created with the reservation ARN.
Default: None.
experimental_capabilities (str | None): Experimental capabilities
to enable for the quantum task. Supported values are "ALL" to enable all
Expand Down Expand Up @@ -265,7 +265,7 @@ def _execute(
for future in task_futures:
future.cancel()

# Signal to the workers that there is no mork work to do
# Signal to the workers that there is no more work to do
remaining.clear()

raise
Expand Down
6 changes: 3 additions & 3 deletions src/braket/circuits/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1287,13 +1287,13 @@ def apply_readout_noise(

>>> noise = Noise.Depolarizing(probability=0.1)
>>> circ = Circuit().x(0).y(1).z(0).x(1).cnot(0, 1)
>>> print(circ.apply_initialization_noise(noise))
>>> print(circ.apply_readout_noise(noise))

>>> circ = Circuit().x(0).y(1).z(0).x(1).cnot(0, 1)
>>> print(circ.apply_initialization_noise(noise, target_qubits=1))
>>> print(circ.apply_readout_noise(noise, target_qubits=1))

>>> circ = Circuit()
>>> print(circ.apply_initialization_noise(noise, target_qubits=[0, 1]))
>>> print(circ.apply_readout_noise(noise, target_qubits=[0, 1]))

"""
if (len(self.qubits) == 0) and (target_qubits is None):
Expand Down
2 changes: 1 addition & 1 deletion src/braket/circuits/circuit_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def validate_circuit_and_shots(circuit: Circuit, shots: int) -> None:

Raises:
ValueError: If circuit has no instructions; if circuit has a non-gphase instruction; if no
result types specified for circuit and `shots=0`. See `braket.circuit.result_types`;
result types specified for circuit and `shots=0`. See `braket.circuits.result_types`;
if circuit has observables that cannot be simultaneously measured and `shots>0`;
or, if `StateVector` or `Amplitude` are specified as result types when `shots>0`.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/braket/circuits/compiler_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, ascii_symbols: Sequence[str]):
"""Inits a `CompilerDirective`.

Args:
ascii_symbols (Sequence[str]): ASCII string symbols for the compiler directiver.
ascii_symbols (Sequence[str]): ASCII string symbols for the compiler directive.
These are used when printing a diagram of circuits.
"""
if ascii_symbols is None:
Expand Down
8 changes: 4 additions & 4 deletions src/braket/circuits/gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ def ry(
Default 1.

Returns:
Iterable[Instruction]: Rx instruction.
Iterable[Instruction]: Ry instruction.


Examples:
Expand Down Expand Up @@ -1301,7 +1301,7 @@ def rz(
Default 1.

Returns:
Iterable[Instruction]: Rx instruction.
Iterable[Instruction]: Rz instruction.

Examples:
>>> circ = Circuit().rz(0, 0.15)
Expand Down Expand Up @@ -2579,7 +2579,7 @@ class ECR(Gate):

Unitary matrix:

.. math:: \mathtt{ECR} = \begin{bmatrix}
.. math:: \mathtt{ECR} = \frac{1}{\sqrt{2}} \begin{bmatrix}
0 & 0 & 1 & i \\
0 & 0 & i & 1 \\
1 & -i & 0 & 0 \\
Expand Down Expand Up @@ -2626,7 +2626,7 @@ def ecr(
) -> Instruction:
r"""An echoed RZX(pi/2) gate (ECR gate).

.. math:: \mathtt{ECR} = \begin{bmatrix}
.. math:: \mathtt{ECR} = \frac{1}{\sqrt{2}} \begin{bmatrix}
0 & 0 & 1 & i \\
0 & 0 & i & 1 \\
1 & -i & 0 & 0 \\
Expand Down
4 changes: 2 additions & 2 deletions src/braket/circuits/instruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ def __init__(
Examples:
>>> Instruction(Gate.CNot(), [0, 1])
Instruction('operator': CNOT, 'target': QubitSet(Qubit(0), Qubit(1)))
>>> instr = Instruction(Gate.CNot()), QubitSet([0, 1])])
>>> instr = Instruction(Gate.CNot(), QubitSet([0, 1]))
Instruction('operator': CNOT, 'target': QubitSet(Qubit(0), Qubit(1)))
>>> instr = Instruction(Gate.H(), 0)
Instruction('operator': H, 'target': QubitSet(Qubit(0),))
>>> instr = Instruction(Gate.Rx(0.12), 0)
Instruction('operator': Rx, 'target': QubitSet(Qubit(0),))
>>> instr = Instruction(Gate.Rx(0.12, control=1), 0)
>>> instr = Instruction(Gate.Rx(0.12), 0, control=1)
Instruction(
'operator': Rx,
'target': QubitSet(Qubit(0),),
Expand Down
Loading
Loading