• 沒有找到結果。

Wave

在文檔中 Amazon Braket (頁 6-134)

About quantum computing and Amazon Braket

Quantum computing is in early developmental stages. It’s important to understand that no universal, fault-tolerant quantum computer exists at present. Therefore, certain types of quantum hardware are better suited for certain use cases, and it is crucial to have access to a variety of computing hardware.

Amazon Braket offers a variety of hardware, through third-party providers.

Existing quantum hardware is limited due to noise, which introduces errors. The industry is in the Noisy Intermediate Scale Quantum (NISQ) era. In the NISQ era, quantum computing devices are too noisy to sustain pure quantum algorithms, such as Shor’s algorithm or Grover’s algorithm. Until better quantum error correction is available, the most practical quantum computing requires the combination of classical (traditional) computing resources with quantum computers, to create hybrid algorithms. Amazon Braket helps you work with hybrid quantum algorithms.

Amazon Braket terms and concepts

In hybrid quantum algorithms, quantum processing units (QPUs) are used as co-processors for CPUs, thus speeding up specific calculations in a classical algorithm. These algorithms utilize iterative processing, in which computation moves between classical and quantum computers. For example, current applications of quantum computing in chemistry, optimization, and machine learning are based on variational quantum algorithms, which are a type of hybrid quantum algorithm. In variational quantum algorithms, classical optimization routines adjust the parameters of a parameterized quantum circuit iteratively, much in the same way the weights of a neural network are adjusted iteratively, based on the error in a machine learning training set. Amazon Braket offers access to the PennyLane open source software library, which assists you with variational quantum algorithms.

Quantum computing is gaining traction for computations in four main areas:

Number theory — including factoring and cryptography. (For example, Shor’s algorithm is a primary quantum method for number theory computations.)

Optimization — including constraint satisfaction, solving linear systems, and machine learning.

Oracular computing — including search, hidden subgroups, and order finding. (For example, Grover’s algorithm is a primary quantum method for oracular computations.)

Simulation — including direct simulation, knot invariants, and quantum approximate optimization algorithm (QAOA) applications.

Applications for these categories of computations can be found in financial services, biotechnology, manufacturing, and pharmaceuticals, to name a few. Amazon Braket offers capabilities and notebook examples that can apply to many proof of concept problems, and certain practical problems, today.

Amazon Braket terms and concepts

The following terms and concepts are used in Amazon Braket:

Braket

We named the Amazon Braket service after the bra-ket notation, a standard notation in quantum mechanics. It was introduced by Paul Dirac in 1939 to describe the state of quantum systems, and it is also known as the Dirac notation.

Quantum computer

A quantum computer is a physical device that uses quantum-mechanical phenomena such as superposition and entanglement to perform computations. There are different paradigms to quantum computing (QC), such as, gate-based QC or quantum annealing.

Qubit

The basic unit of information in a quantum computer is called a qubit (quantum bit), in analogy to classical bits. A qubit is a two-level quantum system that can be realized by different physical implementations, such as superconducting circuits, or individual ions and atoms. Other qubit types are based on photons, electronic or nuclear spins, or more exotic quantum systems.

Gate-based Quantum Computing

In gate-based QC (also called circuit-based QC), computations are broken down into elementary operations (gates). It can be shown that certain sets of gates are universal, meaning that every computation can be expressed as a finite sequence of those gates. Gates are the building blocks of quantum circuits, in analogy to the logic gates of classical digital circuits.

Quantum Annealing

Quantum annealing is a form of special purpose quantum computing that tries to utilize quantum fluctuations to find global minima of an objective function. In most approaches, the objective

Amazon Braket terms and concepts

function that is encoded directly in the physical couplings parameters of the qubits. Quantum annealing is mainly used for combinatorial optimization problems (e.g., QUBO problems), where one has a finite and discrete search space.

Device

In Amazon Braket, a device is a backend that can execute quantum tasks. A device can be a QPU or a quantum circuit simulator. To learn more, see Amazon Braket supported devices (p. 8).

Quantum Circuit Simulator

A quantum circuit simulator is a computer program that runs on classical computers and calculates the measurement outcomes of a quantum circuit. For general circuits, the resource requirements of a quantum simulation grows exponentially with the number of qubits to simulate. Amazon Braket provides access to both managed (accessed through the Braket API) and local (part of the Amazon Braket SDK) quantum circuit simulators.

Quantum Processing Unit (QPU)

A QPU is a physical quantum computing device that can execute a quantum task. QPUs can be based on different QC paradigms, e.g., gate-based QC or quantum annealing. To learn more, see Amazon Braket supported devices (p. 8).

Quantum Circuit

A quantum circuit is the instruction set that defines a computation on a gate-based quantum computer. A quantum circuit is a sequence of quantum gates (which are reversible transformations on a qubit register) together with measurement instructions.

Shots

Since quantum computing is inherently probabilistic, any circuit (or annealing schedule) needs to be evaluated multiple times to get an accurate results. A single circuit execution and measurement is called a shot. The number of shots (repeated executions) for circuit is chosen based on the desired accuracy for the result. The number of shots can range from 10 to 100,000 shots per task.

Quantum Task

In Amazon Braket, a quantum task is the atomic request to a device. For gate-based QC devices, this includes the quantum circuit (including the measurement instructions and number of shots), and other request metadata. You can create quantum tasks through Amazon Braket SDK or by using the CreateQuantumTask API operation directly. After you create a task, it will be queued until the requested device becomes available. You can view your quantum tasks on the Tasks page of the Amazon Braket console, or by using the GetQuantumTask or SearchQuantumTasks API operations.

Braket job

Amazon Braket has a feature called Amazon Braket Hybrid Jobs (or Braket Jobs for short) that provides fully managed executions of hybrid algorithms. A Braket job consists of three components:

1. The definition of your algorithm, which can be provided as a script, python module, or Docker container.

2. The job instance, based on Amazon EC2, on which to run your algorithm. The default is an ml.m5.xlarge instance.

3. The quantum device on which to execute the quantum tasks that are part of your algorithm. A single job typically contains a collection of many tasks.

QPU supported gates

QPU supported gates are the gates accepted by the QPU device. These gates might not be able to directly run on the QPU, meaning that they might need to be decomposed into native gates. You can find the supported gates of a device on the Devices page in the Amazon Braket console and through the Braket SDK.

AWS terminology and tips for Amazon Braket

QPU native gates

QPU native gates are the gates that can be directly mapped to control pulses by the QPU control system. Native gates can be run on the QPU device without further compilation. Subset of QPU supported gates. You can find the native gates of a device on the Devices page in the Amazon Braket console and through the Braket SDK.

AWS terminology and tips for Amazon Braket

IAM users

An IAM user is an identity that you create in AWS. It represents the person or application that interacts with AWS services and resources. It consists of a name and credentials. By default, when you create a new IAM user in AWS, it has no permissions associated with it. To allow the IAM user to perform specific actions in AWS, such as launching an Amazon EC2 instance or creating an Amazon S3 bucket, you must grant the IAM user the necessary permissions.

Best practice: We recommend that you create an individual IAM user for each person who needs access to AWS. Even if you have multiple employees who require the same level of access, create individual IAM users for each of them. This approach provides additional security by allowing each IAM user to have a unique set of security credentials.

IAM policies

An IAM policy is a document that allows or denies permissions to AWS services and resources. IAM policies enable you to customize users’ levels of access to resources. For example, you can allow users access to all of the Amazon S3 buckets within your AWS account, or only a specific bucket.

Best practice: Follow the security principle of least privilege when granting permissions. By following this principle, you help to prevent users or roles from having more permissions than needed to perform their tasks. For example, if an employee needs access to only a specific bucket, specify the bucket in the IAM policy. Do this instead of granting the employee access to all of the buckets in your AWS account.

IAM roles

An IAM role is an identity that you can assume to gain temporary access to permissions. Before an IAM user, application, or service can assume an IAM role, they must be granted permissions to switch to the role. When someone assumes an IAM role, they abandon all previous permissions that they had under a previous role and assume the permissions of the new role.

Best practice: IAM roles are ideal for situations in which access to services or resources needs to be granted temporarily, instead of long-term.

Amazon S3 bucket

Amazon Simple Storage Service (Amazon S3) is an AWS service that lets you store data as objects in buckets. Amazon S3 buckets offer unlimited storage space. The maximum size for an object in an Amazon S3 bucket is 5 TB. You can upload any type of file data to an Amazon S3 bucket, such as images, videos, text files, backup files, media files for a website, archived documents, and your Braket task results.

Best practice: You can set permissions to control access to your S3 bucket. For more information, see Bucket policies and user policies in the Amazon S3 documentation.

How Amazon Braket works

Amazon Braket provides on-demand access to quantum computing devices, including managed circuit simulators and different types of QPUs. In Amazon Braket, the atomic request to a device is a task. For gate-based QC devices, this includes the quantum circuit (including the measurement instructions and number of shots), and other request metadata. For annealing devices it includes the problem definition, the number of shots, and other optional parameters.

In this section, we are going to learn about the high-level flow of executing tasks on Amazon Braket.

Amazon Braket task flow

Amazon Braket task flow

To make it easy for customers to define, submit, and monitor their tasks, Amazon Braket provides managed Jupyter notebooks (1) that come pre-installed with the Amazon Braket SDK. You can build

Third-party data processing

your quantum circuits directly in the SDK or, for annealing devices, define the annealing problem and parameter. The Amazon Braket SDK also provides a plugin for D-Wave’s Ocean tool suite, so you can natively program the D-Wave device. After your task is defined, you can choose a device to execute it on, and submit it to the Amazon Braket API (2). Depending on the device you chose, the task is queued until the device becomes available and the task is sent to the QPU or simulator for execution (3). Amazon Braket gives you access to 3 different types of QPUs (D-Wave, IonQ, Rigetti) and one managed Simulator, SV1. To learn more, see Amazon Braket supported devices (p. 8).

After your task is processed, Amazon Braket returns the results to an Amazon S3 bucket, where the data is stored in your AWS account (4). At the same time, the SDK polls for the results in the background and loads them into the Jupyter notebook at task completion. You can also view and manage your tasks on the Tasks page in the Amazon Braket console, or by using the GetQuantumTask operation of the Amazon Braket API.

Of course, Amazon Braket is integrated with Amazon Identity and Access Management (IAM), Amazon CloudWatch, Amazon CloudTrail and Amazon EventBridge for user access management, monitoring and logging, as well as, for event based processing (5).

Third-party data processing

Tasks that are submitted to a QPU device, process on quantum computers located in facilities operated by third party providers. To learn more about Security and third-party processing in Amazon Braket, see Security of Amazon Braket Hardware Providers (p. 120).

Amazon Braket supported devices

In Amazon Braket, a device represents a QPU or simulator that you can call to run quantum tasks. That is, a device refers to a set of circuits for gate-based quantum computing, or it refers to an annealing problem for a quantum annealer device.

Amazon Braket provides access to four QPU devices—from D-Wave, IonQ, and Rigetti—and three simulator devices. For all devices, you can find further device properties, such as device topology,

calibration data, and native gate sets in the Amazon Braket console in the Devices tab or by means of the GetDevice API.

When constructing a circuit with the simulators, Amazon Braket currently requires that you use contiguous qubits/indices.

If you are working with the Amazon Braket SDK, you have access to device properties as shown in the following code example:

from braket.aws import AwsDevice

from braket.devices import LocalSimulator

device = AwsDevice('arn:aws:braket:::device/quantum-simulator/amazon/sv1') #SV1

# device = LocalSimulator() #Local

# device = AwsDevice('arn:aws:braket:::device/quantum-simulator/amazon/tn1') #TN1

# device = AwsDevice('arn:aws:braket:::device/quantum-simulator/amazon/dm1') #DM1

# device = AwsDevice('arn:aws:braket:::device/qpu/d-wave/DW_2000Q_6') #D-Wave 2000Q

# device = AwsDevice('arn:aws:braket:::device/qpu/d-wave/Advantage_system4') #D-Wave Advantage_system4.1

# device = AwsDevice('arn:aws:braket:::device/qpu/ionq/ionQdevice') #IonQ

# device = AwsDevice('arn:aws:braket:::device/qpu/rigetti/Aspen-11') #Aspen-11

# device = AwsDevice('arn:aws:braket:us-west-1::device/qpu/rigetti/Aspen-M-1') #Aspen M-1

# device = AwsDevice('arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy') #Lucy

# get device properties

Supported Simulators:

• Local state vector simulator (braket_sv) (p. 11) ('Default Simulator')

• Local density matrix simulator (braket_dm) (p. 11)

• State vector simulator (SV1) (p. 11)

• Density matrix simulator (DM1) (p. 12)

• Tensor network simulator (TN1) (p. 13)

NoteTo view the available AWS Regions for each device, you can scroll the following table horizontally toward the right.

Amazon Braket devices

Provider Device Name Paradigm Type Device ARN Region

D-Wave DW_2000Q_6 quantum

IonQ ionQdevice gate-based QPU arn:aws:braket:::device/

qpu/ionq/

ionQdevice

us-east-1

Rigetti Aspen-11 gate-based QPU arn:aws:braket:::device/

qpu/rigetti/

Aspen-11

us-west-1

Rigetti Aspen M-1 gate-based QPU

arn:aws:braket:us-west-1::device/

AWS braket_sv gate-based Simulator N/A (local

simulator in Braket SDK)

N/A

AWS braket_dm gate-based Simulator N/A (local

simulator in Braket SDK)

N/A

AWS SV1 gate-based Simulator arn:aws:braket:::device/

AWS DM1 gate-based Simulator arn:aws:braket:::device/

IonQ

Provider Device Name Paradigm Type Device ARN Region

AWS TN1 gate-based Simulator arn:aws:braket:::device/

quantum-simulator/

amazon/tn1

us-west-2 and us-east-1

To view additional details about the QPUs you can use with Amazon Braket, see Amazon Braket Hardware Providers.

IonQ

IonQ offers a gate-based QPU based on ion trap technology. IonQ’s trapped ion QPUs are built on a chain of trapped 171Yb+ ions, spatially confined by means of a microfabricated surface electrode trap within a vacuum chamber.

Quantum gates supported by the IonQ device:

'x', 'y', 'z', 'rx', 'ry', 'rz', 'h', 'cnot', 's', 'si', 't', 'ti', 'v', 'vi', 'xx', 'yy', 'zz', 'swap', 'i'

Rigetti

Rigetti quantum processors are universal, gate-model machines based on all-tunable superconducting qubits. The Rigetti 11 system is based on scalable 40-qubit node technology. The Rigetti Aspen-M-1 system leverages their proprietary multi-chip technology, and is assembled from two 40-qubit processors.

Quantum gates supported by the Aspen-11 device and Aspen-M-1:

'cz', 'xy', 'ccnot', 'cnot', 'cphaseshift', 'cphaseshift00', 'cphaseshift01',

'cphaseshift10', 'cswap', 'h', 'i', 'iswap', 'phaseshift', 'pswap', 'rx', 'ry', 'rz', 's', 'si', 'swap', 't', 'ti', 'x', 'y', 'z'

OQC

OQC quantum processors are universal, gate-model machines, built using scalable Coaxmon technology.

The OQC Lucy system is an 8-qubit device with a topology of a ring where each qubit is connected to its two nearest neighbors.

Quantum gates supported by the Lucy device:

i,rz,sx,x,ecr

D-Wave

D-Wave offers quantum annealers based on superconducting qubits. Quantum annealing processors naturally return low-energy solutions. This type of QPU is a specific-purpose machine, designed and

Local state vector simulator (braket_sv)

best suited to solve problems belonging to the class of Quadratic Unconstrained Optimization (QUBO) problems, such as optimization problems and probabilistic sampling problems.

Quantum annealers do not have to meet the strict engineering requirements that universal gate-based machines have to meet. Already today this technology features approximately 5000 superconducting qubits, compared to less than 100 qubits on gate-model quantum computers. Amazon Braket offers access to the superconducting quantum annealers provided by D-Wave Systems that can be programmed using the high-level, open source tool suite called Ocean.

For more information, see the quantum annealing example notebooks.

Local state vector simulator (braket_sv)

The local state vector simulator ("braket_sv") is part of the Amazon Braket SDK that runs locally in your environment. It 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.

The simulator supports all gates in the Amazon Braket SDK, but QPU devices support a smaller subset.

You can find the supported gates of a device in the device properties.

For more information about how to work with simulators, see the Amazon Braket examples.

Local density matrix simulator (braket_dm)

The local density matrix simulator ("braket_dm") is part of the Amazon Braket SDK that runs locally in your environment. It is well-suited for rapid prototyping on small circuits with noise, up to 12 qubits, depending on the hardware specifications of your Braket notebook instance or your local environment.

You can build common noisy circuits from the ground up using gate noise operations such as bit-flip and depolarizing error. You can also apply noise operations to specific qubits and gates of existing circuits that are intended to run both with and without noise.

The braket_dm local simulator can provide the following results, given the specified number of shots:

• Reduced density matrix: Shots = 0

To learn more about the local density matrix simulator, see the Braket introductory noise simulator example.

State vector simulator (SV1)

SV1 is a fully-managed, high-performance, universal state vector simulator. It can simulate circuits of up to 34 qubits. You can expect a 34-qubit, dense, and square circuit (circuit depth = 34) to take approximately 1 to 2 hours to complete, depending on the type of gates used and other factors. Circuits with all-to-all gates are well suited for SV1. It returns results in forms such as a full state vector or an array of amplitudes.

SV1 has a maximum runtime of 6 hours. It has a default of 35 concurrent tasks, and a maximum of 50 concurrent tasks.

SV1 Results

Density matrix simulator (DM1)

SV1 can provide the following results, given the specified number of shots:

• Sample: Shots > 0

• Expectation: Shots >= 0

• Variance: Shots >= 0

• Probability: Shots > 0

• Amplitude: Shots = 0

For more about results, see Result types.

SV1 is always available, it executes your circuits on demand, and it can run multiple circuits in parallel.

The runtime scales linearly with the number of operations and exponential with the number of qubits.

The number of shots has a small impact on the runtime. To learn more, visit Compare simulators.

The number of shots has a small impact on the runtime. To learn more, visit Compare simulators.

在文檔中 Amazon Braket (頁 6-134)

相關文件