quri_parts.algo.mitigation.readout_mitigation.readout_mitigation module#
- create_filter_matrix(qubit_count, sampler, shots)#
Generate a filter matrix for readout mitigation.
- Parameters:
qubit_count (int) – Number of qubits of the target circuit.
sampler (ConcurrentSampler) –
ConcurrentSampler
for the target backend.shots (int) – Number of shots at each sampling.
- Return type:
npt.NDArray[np.float64]
- readout_mitigation(counts, filter_matrix)#
Apply readout mitigation to the sampling result.
- Parameters:
counts (Iterable[MeasurementCounts]) – Sampling result as a
MeasurementCounts
.filter_matrix (npt.NDArray[np.float64]) – Filter matrix for the target circuit created by the
create_filter_matrix
function.
- Return type:
Iterable[MeasurementCounts]
- create_readout_mitigation_concurrent_sampler(qubit_count, sampler, shots)#
Wrap the given
ConcurrentSampler
to create aConcurrentSampler
where readout mitigation is automatically applied to the result.- Parameters:
qubit_count (int) – Number of qubits of the target circuit.
sampler (core.sampling.ConcurrentSampler) –
ConcurrentSampler
for the target backend.shots (int) – Number of shots for each sampling to create the filter matrix.
- Return type:
core.sampling.ConcurrentSampler
- create_readout_mitigation_sampler(qubit_count, sampler, shots)#
Wrap the given
ConcurrentSampler
to create aSampler
where readout mitigation is automatically applied to the result.- Parameters:
qubit_count (int) – Number of qubits of the target circuit.
sampler (core.sampling.ConcurrentSampler) –
ConcurrentSampler
for the target backend.shots (int) – Number of shots for each sampling to create the filter matrix.
- Return type:
core.sampling.Sampler