PipelineResult¶
- class PipelineResult[source]¶
Bases:
dictPipeline result dict with convenience access for single-result pipelines.
Behaves exactly like a regular
dictkeyed byNodeKeytuples. For the common single-circuit case, use thevalueproperty instead ofresult[()].Attributes Summary
Return the single result value, unwrapped at the boundary.
Attributes Documentation
- value¶
Return the single result value, unwrapped at the boundary.
Pipelines store expectation values in a canonical
list[float]shape indexed by observable position. This accessor squeezes a length-1 list (single-observable expval) to a scalarfloatso casual callers get the natural shape — mirroring the scalar-in/scalar-out symmetry of higher-level programs likeTimeEvolution. Probability and count dicts pass through unchanged; multi-observable lists are returned as-is. For the canonical raw form regardless of length, useresult[()].When the source MetaCircuit was constructed with
_was_multi_obs=True(e.g. the user wroteobservable=[O]), the pipeline disables the squeeze and a length-1 list is returned as-is.- Raises:
ValueError – If the result contains more than one key.