qrunch.quantum.error_mitigation.sampler.hamming_weight_post_selection

Module containing the fermionic symmetry selection post processor.

Classes

HammingWeightPostSelectionSamplerErrorMitigator

Error mitigator for handling post-processing and error correction of quantum measurements using the Hamming weight.

SamplerErrorMitigatorSubCreator

SubCreator for error mitigator selection.

class HammingWeightPostSelectionSamplerErrorMitigator

Bases: SamplerErrorMitigator

Error mitigator for handling post-processing and error correction of quantum measurements using the Hamming weight.

This error mitigator removes all states with an incorrect Hamming weight, i.e., an incorrect number of 1’s. The correct Hamming weight is extracted from the corresponding circuit. Currently, the error mitigator has two options

  • The total Hamming weight of the state is used for post selection.

  • The Hamming weight for the first and second part are constant separately, allowing for better error mitigation.

The latter is preferred if the circuit has this stronger symmetry. If neither of the two options are valid, the measurements are not processed.

__init__(*args, **kwargs)
decode_error_mitigation(measurement_circuits: Sequence[MeasurementCircuit], measurements: Sequence[QuantumMeasurement]) tuple[QuantumMeasurement, ...]

Retrieve measurements after post selection.

Parameters:
  • measurement_circuits (Sequence[MeasurementCircuit]) – Encoded circuits measured to obtain the measurements.

  • measurements (Sequence[QuantumMeasurement]) – Measurements to be decoded.

Return type:

tuple[QuantumMeasurement, …]

encode_error_mitigation(measurement_circuits: Sequence[MeasurementCircuit]) tuple[MeasurementCircuit, ...]

Apply the error mitigation scheme by encoding the information in the circuits in new circuits.

Parameters:

measurement_circuits (Sequence[MeasurementCircuit]) – Circuits to be encoded.

Return type:

tuple[MeasurementCircuit, …]

class SamplerErrorMitigatorSubCreator

Bases: Generic[T]

SubCreator for error mitigator selection.

__init__(parent: T, field_name: str) None

Initialize the sub-creator.

Parameters:
  • parent (T) – The parent object to which the backend will be added.

  • field_name (str) – The name of the field in the parent object to which the backend will be

Return type:

None

hamming_weight_post_selection() T

Error mitigator for Hamming-weight-based correction of quantum measurements.

Error mitigator for handling post-processing and error correction of quantum measurements using the Hamming weight.

This error mitigator removes all states with an incorrect Hamming weight, i.e., an incorrect number of 1’s. The correct Hamming weight is extracted from the corresponding circuit. Currently, the error mitigator has two options

  • The total Hamming weight of the state is used for post selection.

  • The Hamming weight for the first and second part are constant separately, allowing for better error mitigation.

The latter is preferred if the circuit has this stronger symmetry. If neither of the two options are valid, the measurements are not processed.

Return type:

T