Snapshot

class Snapshot(label, snapshot_type='statevector', num_qubits=0, num_clbits=0, params=None)[source]

Simulator snapshot instruction.

Create new snapshot instruction.

Parameters
  • label (str) – the snapshot label for result data.

  • snapshot_type (str) – the type of the snapshot.

  • num_qubits (int) – the number of qubits for the snapshot type [Default: 0].

  • num_clbits (int) – the number of classical bits for the snapshot type [Default: 0].

  • params (list or None) – the parameters for snapshot_type [Default: None].

Raises

ExtensionError – if snapshot label is invalid.

Attributes

Snapshot.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

Snapshot.definition

Return definition in terms of other basic gates.

Snapshot.label

Return snapshot label

Snapshot.params

return instruction params.

Snapshot.snapshot_type

Return snapshot type

Methods

Snapshot.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

Snapshot.assemble()

Assemble a QasmQobjInstruction

Snapshot.broadcast_arguments(qargs, cargs)

Validation of the arguments.

Snapshot.c_if(classical, val)

Add classical condition on register classical and value val.

Snapshot.copy([name])

Copy of the instruction.

Snapshot.inverse()

Special case.

Snapshot.is_parameterized()

Return True .IFF.

Snapshot.mirror()

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

Snapshot.qasm()

Return a default OpenQASM string for the instruction.

Snapshot.repeat(n)

Creates an instruction with gate repeated n amount of times.