SnapshotStabilizer

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

Snapshot instruction for stabilizer method of Qasm simulator.

Create a stabilizer 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

SnapshotStabilizer.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

SnapshotStabilizer.definition

Return definition in terms of other basic gates.

SnapshotStabilizer.label

Return snapshot label

SnapshotStabilizer.params

return instruction params.

SnapshotStabilizer.snapshot_type

Return snapshot type

Methods

SnapshotStabilizer.add_decomposition(…)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

SnapshotStabilizer.assemble()

Assemble a QasmQobjInstruction

SnapshotStabilizer.broadcast_arguments(…)

Validation of the arguments.

SnapshotStabilizer.c_if(classical, val)

Add classical condition on register classical and value val.

SnapshotStabilizer.copy([name])

Copy of the instruction.

SnapshotStabilizer.define_snapshot_register(…)

Defines qubits to snapshot for all snapshot methods

SnapshotStabilizer.inverse()

Special case.

SnapshotStabilizer.is_parameterized()

Return True .IFF.

SnapshotStabilizer.mirror()

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

SnapshotStabilizer.qasm()

Return a default OpenQASM string for the instruction.

SnapshotStabilizer.repeat(n)

Creates an instruction with gate repeated n amount of times.