SnapshotProbabilities

class SnapshotProbabilities(label, num_qubits, variance=False)[source]

Snapshot instruction for all methods of Qasm simulator.

Create a probability snapshot instruction.

Parameters
  • label (str) – the snapshot label.

  • num_qubits (int) – the number of qubits to snapshot.

  • variance (bool) – compute variance of probabilities [Default: False]

Raises

ExtensionError – if snapshot is invalid.

Attributes

SnapshotProbabilities.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

SnapshotProbabilities.definition

Return definition in terms of other basic gates.

SnapshotProbabilities.label

Return snapshot label

SnapshotProbabilities.params

return instruction params.

SnapshotProbabilities.snapshot_type

Return snapshot type

Methods

SnapshotProbabilities.add_decomposition(…)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

SnapshotProbabilities.assemble()

Assemble a QasmQobjInstruction

SnapshotProbabilities.broadcast_arguments(…)

Validation of the arguments.

SnapshotProbabilities.c_if(classical, val)

Add classical condition on register classical and value val.

SnapshotProbabilities.copy([name])

Copy of the instruction.

SnapshotProbabilities.define_snapshot_register(…)

Defines qubits to snapshot for all snapshot methods

SnapshotProbabilities.inverse()

Special case.

SnapshotProbabilities.is_parameterized()

Return True .IFF.

SnapshotProbabilities.mirror()

DEPRECATED: use instruction.reverse_ops().

SnapshotProbabilities.qasm()

Return a default OpenQASM string for the instruction.

SnapshotProbabilities.repeat(n)

Creates an instruction with gate repeated n amount of times.

SnapshotProbabilities.reverse_ops()

For a composite instruction, reverse the order of sub-instructions.