quri_parts.algo.mitigation.readout_mitigation package#

quri_parts.algo.mitigation.readout_mitigation.create_filter_matrix(qubit_count: int, sampler: Callable[[Iterable[tuple[NonParametricQuantumCircuit, int]]], Iterable[Mapping[int, int | float]]], shots: int) npt.NDArray[np.float64]#

Generate a filter matrix for readout mitigation.

Parameters:
  • qubit_count – Number of qubits of the target circuit.

  • samplerConcurrentSampler for the target backend.

  • shots – Number of shots at each sampling.

quri_parts.algo.mitigation.readout_mitigation.readout_mitigation(counts: Iterable[Mapping[int, int | float]], filter_matrix: npt.NDArray[np.float64]) Iterable[Mapping[int, int | float]]#

Apply readout mitigation to the sampling result.

Parameters:
  • counts – Sampling result as a MeasurementCounts.

  • filter_matrix – Filter matrix for the target circuit created by the create_filter_matrix function.

quri_parts.algo.mitigation.readout_mitigation.create_readout_mitigation_sampler(qubit_count: int, sampler: Callable[[Iterable[tuple[NonParametricQuantumCircuit, int]]], Iterable[Mapping[int, int | float]]], shots: int) Callable[[NonParametricQuantumCircuit, int], Mapping[int, int | float]]#

Wrap the given ConcurrentSampler to create a Sampler where readout mitigation is automatically applied to the result.

Parameters:
  • qubit_count – Number of qubits of the target circuit.

  • samplerConcurrentSampler for the target backend.

  • shots – Number of shots for each sampling to create the filter matrix.

quri_parts.algo.mitigation.readout_mitigation.create_readout_mitigation_concurrent_sampler(qubit_count: int, sampler: Callable[[Iterable[tuple[NonParametricQuantumCircuit, int]]], Iterable[Mapping[int, int | float]]], shots: int) Callable[[Iterable[tuple[NonParametricQuantumCircuit, int]]], Iterable[Mapping[int, int | float]]]#

Wrap the given ConcurrentSampler to create a ConcurrentSampler where readout mitigation is automatically applied to the result.

Parameters:
  • qubit_count – Number of qubits of the target circuit.

  • samplerConcurrentSampler for the target backend.

  • shots – Number of shots for each sampling to create the filter matrix.

Submodules#