quri_parts.backend package

SamplingCounts

SamplingCounts represents count statistics of repeated sampling or the measurement probabilities of a quantum circuit. Keys are observed bit patterns encoded in integers and values are counts of observation or the probabilities of the corresponding bit patterns.

class SamplingResult(*args, **kwargs)

Bases: Protocol

A result of a sampling job.

abstract property counts: backend.SamplingCounts

Measurement counts obtained by a sampling measurement.

class CompositeSamplingResult(results)

Bases: SamplingResult

A sampling result generated by merging multiple sampling results.

Parameters:

results (Collection[SamplingResult])

results: Collection[SamplingResult]
property counts: backend.SamplingCounts

Measurement counts obtained by a sampling measurement.

class SamplingJob(*args, **kwargs)

Bases: Protocol

A job for a sampling measurement.

abstract result()

Returns the result of the sampling job.

If the job is not complete, this method waits until the job finishes.

Return type:

SamplingResult

class CompositeSamplingJob(jobs)

Bases: SamplingJob

A sampling job containing multiple sampling jobs.

Parameters:

jobs (Collection[SamplingJob])

jobs: Collection[SamplingJob]
result()

Returns the result of the sampling job.

If the job is not complete, this method waits until the job finishes.

Return type:

SamplingResult

class SamplingBackend(*args, **kwargs)

Bases: Protocol

A quantum computing backend that can perform a sampling measurement.

abstract sample(circuit, n_shots)

Perform a sampling measurement of a circuit.

Parameters:
Return type:

SamplingJob

exception BackendError

Bases: Exception

BackendError represents an error caused by a quantum computing backend.

Subpackages

Submodules