SnapshotExpectationValue¶
- class SnapshotExpectationValue(label, op, single_shot=False, variance=False)[source]¶
Snapshot instruction for supported methods of Qasm simulator.
Create a probability snapshot instruction.
- Parameters
label (str) – the snapshot label.
op (Operator) – operator to snapshot.
single_shot (bool) – return list for each shot rather than average [Default: False]
variance (bool) – compute variance of probabilities [Default: False]
- Raises
ExtensionError – if snapshot is invalid.
Attributes
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
Return definition in terms of other basic gates.
Return snapshot label
return instruction params.
Return snapshot type
Methods
Add a decomposition of the instruction to the SessionEquivalenceLibrary.
Assemble a QasmQobjInstruction for snapshot_expectation_value.
Validation of the arguments.
SnapshotExpectationValue.c_if
(classical, val)Add classical condition on register classical and value val.
SnapshotExpectationValue.copy
([name])Copy of the instruction.
Defines qubits to snapshot for all snapshot methods
Special case.
Return True .IFF.
For a composite instruction, reverse the order of sub-gates.
Return a default OpenQASM string for the instruction.
Creates an instruction with gate repeated n amount of times.