Results
- class pulser.backend.Results(atom_order, total_duration)
Bases:
object
A collection of results.
- Parameters:
atom_order (
tuple
[str
,...
]) – The order of the atoms/qudits in the results.total_duration (
int
) – The total duration of the sequence, in ns.
Attributes
Returns the bitstrings at the end of the sequence, if available.
Returns the state at the end of the sequence, if available.
atom_order
total_duration
Methods
Aggregate a Sequence of Results objects into a single Results.
Deserializes a Results object from json.
Get the a specific result at a given time.
Get a list of results tags present in this object.
Get a list of times for which the given result has been stored.
Gets the results for every tag.
Serializes this object into a json string.
Signatures
- classmethod aggregate(results_to_aggregate, **aggregation_functions)
Aggregate a Sequence of Results objects into a single Results.
This is meant to accumulate the results of several runs with different noise trajectories into a single averaged Results. By default, results are averaged, with the exception of BitStrings, where the counters are joined. StateResult and EnergyVariance are not supported by default.
- Parameters:
results_to_aggregate (
Sequence
[Results
]) – The list of Results to aggregate- Keyword Arguments:
observable_tag – Overrides the default aggregator. The argument name should be the tag of the Observable. The value is a Callable taking a list of the type to aggregate. Note that this does not override the default aggregation behaviour of the aggregated results.
- Return type:
- Returns:
The averaged Results object
- classmethod from_abstract_repr(repr)
Deserializes a Results object from json.
- Return type:
- Returns:
The deserialized Results object.
- get_result(observable, time)
Get the a specific result at a given time.
- Parameters:
observable (
Observable
|str
) – The observable instance used to calculate the result or its tag.time (
float
) – Relative time at which to get the result.
- Return type:
Any
- Returns:
The result.
- get_result_tags()
Get a list of results tags present in this object.
- Return type:
list
[str
]
- get_result_times(observable)
Get a list of times for which the given result has been stored.
- Parameters:
observable (
Observable
|str
) – The observable instance used to calculate the result or its tag.- Return type:
list
[float
]- Returns:
List of relative times.
- get_tagged_results()
Gets the results for every tag.
- Return type:
dict
[str
,list
[Any
]]- Returns:
A mapping between a tag and the results associated to it, at every evaluation time.
- to_abstract_repr(skip_validation=False)
Serializes this object into a json string.
Numpy arrays and torch Tensors are converted into lists, and their original class is lost forever.
- Parameters:
skip_validation (
bool
, default:False
) – Whether to skip validating the json against the schema used for deserialization.- Return type:
str
- Returns:
The json string
- property final_bitstrings: dict[str, int]
Returns the bitstrings at the end of the sequence, if available.
- property final_state: State
Returns the state at the end of the sequence, if available.