quri_parts.braket.backend package#
- class BraketSamplingBackend(device, circuit_converter=<function convert_circuit>, circuit_transpiler=<quri_parts.braket.circuit.BraketSetTranspiler object>, enable_shots_roundup=True, qubit_mapping=None, run_kwargs={})#
Bases:
SamplingBackend
A Braket backend for a sampling measurement.
- Parameters:
device (Device) – A Braket
braket.devices.Device
for circuit execution.circuit_converter (BraketCircuitConverter) – A function converting
NonParametricQuantumCircuit
to a Braketbraket.circuits.Circuit
.circuit_transpiler (Optional[CircuitTranspiler]) – A transpiler applied to the circuit before running it.
BraketSetTranspiler
is used when not specified.enable_shots_roundup (bool) – If True, when a number of shots specified to
sample()
is smaller than the minimum number of shots supported by the device, it is rounded up to the minimum. In this case, it is possible that shots more than specified are used. If it is strictly not allowed to exceed the specified shot count, set this argument to False.qubit_mapping (Optional[Mapping[int, int]]) – If specified, indices of qubits in the circuit are remapped before running it on the backend. It can be used when you want to use specific backend qubits, e.g. those with high fidelity. The mapping should be specified with “from” qubit indices as keys and “to” qubit indices as values. For example, if you want to map qubits 0, 1, 2, 3 to backend qubits as 0 → 4, 1 → 2, 2 → 5, 3 → 0, then the
qubit_mapping
should be{0: 4, 1: 2, 2: 5, 3: 0}
.run_kwargs (Mapping[str, Any]) – Additional keyword arguments for
braket.devices.Device.run()
method.
- sample(circuit, n_shots)#
Perform a sampling measurement of a circuit.
- Parameters:
circuit (NonParametricQuantumCircuit) –
n_shots (int) –
- Return type:
- class BraketSamplingJob(braket_task)#
Bases:
SamplingJob
A job for a Braket sampling measurement.
- Parameters:
braket_task (QuantumTask) –
- result()#
Returns the result of the sampling job.
If the job is not complete, this method waits until the job finishes.
- Return type:
- class BraketSamplingResult(braket_result)#
Bases:
SamplingResult
A result of a Braket sampling job.
- Parameters:
braket_result (GateModelQuantumTaskResult) –
- property counts: backend.SamplingCounts#
Measurement counts obtained by a sampling measurement.
- device_connectivity_graph(device)#
- Parameters:
device (AwsDevice) –
- Return type:
Graph