Skip to main contentIBM Quantum Documentation Mirror

NoiseLearnerV3Results

class NoiseLearnerV3Results(data, metadata=None)

GitHub

Bases: object

The results of a noise learner experiment.

Parameters

  • data (Iterable[NoiseLearnerV3Result]) – The data in this result object.
  • metadata (Metadata | None) – A dictionary of metadata.

Methods

__getitem__

__getitem__(idx)

GitHub

Parameters

idx (int)

Return type

NoiseLearnerV3Result

__len__

__len__()

GitHub

Return type

int

to_dict

to_dict(instructions, require_refs=True)

GitHub

Convert to dictionary from InjectNoise.ref to PauliLindbladMap objects.

This function iterates over a sequence of instructions, extracts the ref value from the inject noise annotation of each instruction, and returns a dictionary mapping those refs to the corresponding noise data (in PauliLindbladMap format) stored in this NoiseLearnerV3Results object.

Parameters

  • instructions (Sequence[CircuitInstruction]) – The instructions to get the refs from.
  • require_refs (bool) – Whether to raise if some of the instructions do not own an inject noise annotation. If False, all the instructions that do not contain an inject noise annotations are simply skipped when constructing the returned dictionary.

Raises

  • ValueError – If instructions contains a number of elements that is not equal to the item in this NoiseLearnerV3Results object.
  • ValueError – If some of the instructions do not contain a box.
  • ValueError – If multiple instructions have the same ref.
  • ValueError – If some of the instructions have no inject noise annotation and require_refs if True.

Return type

dict[int, PauliLindbladMap]