SnapshotStatevector

class SnapshotStatevector(label, num_qubits=0)[source]

Snapshot instruction for statevector snapshot type

Create a statevector state snapshot instruction.

Parameters
  • label (str) – the snapshot label.

  • num_qubits (int) – the instruction barrier size [Default: 0].

Raises

ExtensionError – if snapshot is invalid.

Additional Information:

This snapshot is always performed on all qubits in a circuit. The number of qubits parameter specifies the size of the instruction as a barrier and should be set to the number of qubits in the circuit.

Attributes

SnapshotStatevector.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

SnapshotStatevector.definition

Return definition in terms of other basic gates.

SnapshotStatevector.label

Return snapshot label

SnapshotStatevector.params

return instruction params.

SnapshotStatevector.snapshot_type

Return snapshot type

Methods

SnapshotStatevector.add_decomposition(…)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

SnapshotStatevector.assemble()

Assemble a QasmQobjInstruction

SnapshotStatevector.broadcast_arguments(…)

Validation of the arguments.

SnapshotStatevector.c_if(classical, val)

Add classical condition on register classical and value val.

SnapshotStatevector.copy([name])

Copy of the instruction.

SnapshotStatevector.define_snapshot_register(…)

Defines qubits to snapshot for all snapshot methods

SnapshotStatevector.inverse()

Special case.

SnapshotStatevector.is_parameterized()

Return True .IFF.

SnapshotStatevector.mirror()

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

SnapshotStatevector.qasm()

Return a default OpenQASM string for the instruction.

SnapshotStatevector.repeat(n)

Creates an instruction with gate repeated n amount of times.