German
Sprachen
English
Japanese
German
Korean
Shortcuts

qiskit.pulse.InstructionScheduleMap

class InstructionScheduleMap[Quellcode]

Mapping from QuantumCircuit qiskit.circuit.Instruction names and qubits to Schedule s. In particular, the mapping is formatted as type:

Dict[str, Dict[Tuple[int], Schedule]]

where the first key is the name of a circuit instruction (e.g. 'u1', 'measure'), the second key is a tuple of qubit indices, and the final value is a Schedule implementing the requested instruction.

These can usually be seen as gate calibrations.

Initialize a circuit instruction to schedule mapper instance.

__init__()[Quellcode]

Initialize a circuit instruction to schedule mapper instance.

Methods

__init__()

Initialize a circuit instruction to schedule mapper instance.

add(instruction, qubits, schedule)

Add a new known instruction for the given qubits and its mapping to a pulse schedule.

assert_has(instruction, qubits)

Error if the given instruction is not defined.

get(instruction, qubits, *params, **kwparams)

Return the defined Schedule for the given instruction on the given qubits.

get_parameters(instruction, qubits)

Return the list of parameters taken by the given instruction on the given qubits.

has(instruction, qubits)

Is the instruction defined for the given qubits?

pop(instruction, qubits, *params, **kwparams)

Remove and return the defined Schedule for the given instruction on the given qubits.

qubit_instructions(qubits)

Return a list of the instruction names that are defined by the backend for the given qubit or qubits.

qubits_with_instruction(instruction)

Return a list of the qubits for which the given instruction is defined.

remove(instruction, qubits)

Remove the given instruction from the listing of instructions defined in self.

Attributes

instructions

Return all instructions which have definitions.

add(instruction, qubits, schedule)[Quellcode]

Add a new known instruction for the given qubits and its mapping to a pulse schedule.

Parameter
  • instruction (str) – The name of the instruction to add.

  • qubits (Union[int, Iterable[int]]) – The qubits which the instruction applies to.

  • schedule (Union[Schedule, Callable[…, Schedule]]) – The Schedule that implements the given instruction.

Verursacht

PulseError – If the qubits are provided as an empty iterable.

Rückgabetyp

None

assert_has(instruction, qubits)[Quellcode]

Error if the given instruction is not defined.

Parameter
  • instruction (str) – The instruction for which to look.

  • qubits (Union[int, Iterable[int]]) – The specific qubits for the instruction.

Verursacht

PulseError – If the instruction is not defined on the qubits.

Rückgabetyp

None

get(instruction, qubits, *params, **kwparams)[Quellcode]

Return the defined Schedule for the given instruction on the given qubits.

Parameter
  • instruction (str) – Name of the instruction.

  • qubits (Union[int, Iterable[int]]) – The qubits for the instruction.

  • *params – Command parameters for generating the output schedule.

  • **kwparams – Keyworded command parameters for generating the schedule.

Rückgabetyp

Schedule

Rückgabe

The Schedule defined for the input.

get_parameters(instruction, qubits)[Quellcode]

Return the list of parameters taken by the given instruction on the given qubits.

Parameter
  • instruction (str) – Name of the instruction.

  • qubits (Union[int, Iterable[int]]) – The qubits for the instruction.

Rückgabetyp

Tuple[str]

Rückgabe

The names of the parameters required by the instruction.

has(instruction, qubits)[Quellcode]

Is the instruction defined for the given qubits?

Parameter
  • instruction (str) – The instruction for which to look.

  • qubits (Union[int, Iterable[int]]) – The specific qubits for the instruction.

Rückgabetyp

bool

Rückgabe

True iff the instruction is defined.

property instructions

Return all instructions which have definitions.

By default, these are typically the basis gates along with other instructions such as measure and reset.

Rückgabetyp

List[str]

Rückgabe

The names of all the circuit instructions which have Schedule definitions in this.

pop(instruction, qubits, *params, **kwparams)[Quellcode]

Remove and return the defined Schedule for the given instruction on the given qubits.

Parameter
  • instruction (str) – Name of the instruction.

  • qubits (Union[int, Iterable[int]]) – The qubits for the instruction.

  • *params – Command parameters for generating the output schedule.

  • **kwparams – Keyworded command parameters for generating the schedule.

Rückgabetyp

Schedule

Rückgabe

The Schedule defined for the input.

qubit_instructions(qubits)[Quellcode]

Return a list of the instruction names that are defined by the backend for the given qubit or qubits.

Parameter

qubits (Union[int, Iterable[int]]) – A qubit index, or a list or tuple of indices.

Rückgabetyp

List[str]

Rückgabe

All the instructions which are defined on the qubits.

For 1 qubit, all the 1Q instructions defined. For multiple qubits, all the instructions which apply to that whole set of qubits (e.g. qubits=[0, 1] may return ['cx']).

qubits_with_instruction(instruction)[Quellcode]

Return a list of the qubits for which the given instruction is defined. Single qubit instructions return a flat list, and multiqubit instructions return a list of ordered tuples.

Parameter

instruction (str) – The name of the circuit instruction.

Rückgabetyp

List[Union[int, Tuple[int]]]

Rückgabe

Qubit indices which have the given instruction defined. This is a list of tuples if the instruction has an arity greater than 1, or a flat list of ints otherwise.

Verursacht

PulseError – If the instruction is not found.

remove(instruction, qubits)[Quellcode]

Remove the given instruction from the listing of instructions defined in self.

Parameter
  • instruction (str) – The name of the instruction to add.

  • qubits (Union[int, Iterable[int]]) – The qubits which the instruction applies to.

Rückgabetyp

None