Snapshot

class Snapshot(label, snapshot_type='statevector', name=None)[source]

An instruction targeted for simulators, to capture a moment in the simulation.

Create new snapshot.

Parameters
  • label (str) – Snapshot label which is used to identify the snapshot in the output.

  • snapshot_type (str) – Type of snapshot, e.g., “state” (take a snapshot of the quantum state). The types of snapshots offered are defined by the simulator used.

  • name (Optional[str]) – Snapshot name which defaults to label. This parameter is only for display purposes and is not taken into account during comparison.

Attributes

Snapshot.channel

Return the Channel that this instruction is scheduled on; trivially, a SnapshotChannel.

Snapshot.channels

Returns channels that this schedule uses.

Snapshot.command

The associated command.

Snapshot.duration

Duration of this instruction.

Snapshot.id

Unique identifier for this instruction.

Snapshot.instructions

Iterable for getting instructions from Schedule tree.

Snapshot.label

Label of snapshot.

Snapshot.name

Name of this instruction.

Snapshot.operands

Return instruction operands.

Snapshot.start_time

Relative begin time of this instruction.

Snapshot.stop_time

Relative end time of this instruction.

Snapshot.timeslots

Occupied time slots by this instruction.

Snapshot.type

Type of snapshot.

Methods

Snapshot.__call__()

Deprecated.

Snapshot.append(schedule[, name])

Return a new Schedule with schedule inserted at the maximum time over all channels shared between self and schedule.

Snapshot.ch_duration(*channels)

Return duration of the supplied channels in this Instruction.

Snapshot.ch_start_time(*channels)

Return minimum start time for supplied channels.

Snapshot.ch_stop_time(*channels)

Return maximum start time for supplied channels.

Snapshot.draw([dt, style, filename, …])

Plot the instruction.

Snapshot.flatten()

Return itself as already single instruction.

Snapshot.insert(start_time, schedule[, name])

Return a new Schedule with schedule inserted within self at start_time.

Snapshot.shift(time[, name])

Return a new schedule shifted forward by time.

Snapshot.union(*schedules[, name])

Return a new schedule which is the union of self and schedule.