NoiseLearnerV3Results

class NoiseLearnerV3Results(data, metadata=None)[source]

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__(idx)[source]
Parameters:

idx (int)

Return type:

NoiseLearnerV3Result

__len__()[source]
Return type:

int

to_dict(instructions, require_refs=True)[source]

Convert to a 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 (Iterable[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]