---
title: InstructionScheduleMap (v1.1)
description: API reference for qiskit.pulse.InstructionScheduleMap in qiskit v1.1
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/1.1/qiskit.pulse.InstructionScheduleMap
---

# InstructionScheduleMap

*class* `qiskit.pulse.InstructionScheduleMap`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/pulse/instruction_schedule_map.py#L51-L384)

Bases: [`object`](https://docs.python.org/3/library/functions.html#object)

Mapping from [`QuantumCircuit`](/docs/api/qiskit/1.1/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") [`qiskit.circuit.Instruction`](/docs/api/qiskit/1.1/qiskit.circuit.Instruction "qiskit.circuit.Instruction") names and qubits to [`Schedule`](/docs/api/qiskit/1.1/qiskit.pulse.Schedule "qiskit.pulse.Schedule") s. In particular, the mapping is formatted as type:

```python
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.

## Attributes

### instructions

Return all instructions which have definitions.

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

**Returns**

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

## Methods

### add

`add(instruction, qubits, schedule, arguments=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/pulse/instruction_schedule_map.py#L228-L273)

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

**Parameters**

- **instruction** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*circuit.instruction.Instruction*](/docs/api/qiskit/1.1/qiskit.circuit.Instruction "qiskit.circuit.instruction.Instruction")) – The name of the instruction to add.
- **qubits** ([*int*](https://docs.python.org/3/library/functions.html#int) *| Iterable\[*[*int*](https://docs.python.org/3/library/functions.html#int)*]*) – The qubits which the instruction applies to.
- **schedule** ([*Schedule*](/docs/api/qiskit/1.1/qiskit.pulse.Schedule "qiskit.pulse.Schedule")  *|*[*ScheduleBlock*](/docs/api/qiskit/1.1/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock")  *| Callable\[...,*[*Schedule*](/docs/api/qiskit/1.1/qiskit.pulse.Schedule "qiskit.pulse.Schedule")  *|*[*ScheduleBlock*](/docs/api/qiskit/1.1/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock")*]*) – The Schedule that implements the given instruction.
- **arguments** ([*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*] | None*) – List of parameter names to create a parameter-bound schedule from the associated gate instruction. If [`get()`](#qiskit.pulse.InstructionScheduleMap.get "qiskit.pulse.InstructionScheduleMap.get") is called with arguments rather than keyword arguments, this parameter list is used to map the input arguments to parameter objects stored in the target schedule.

**Raises**

[**PulseError**](/docs/api/qiskit/1.1/pulse#qiskit.pulse.PulseError "qiskit.pulse.PulseError") – If the qubits are provided as an empty iterable.

### assert\_has

`assert_has(instruction, qubits)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/pulse/instruction_schedule_map.py#L156-L177)

Error if the given instruction is not defined.

**Parameters**

- **instruction** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*circuit.instruction.Instruction*](/docs/api/qiskit/1.1/qiskit.circuit.Instruction "qiskit.circuit.instruction.Instruction")) – The instruction for which to look.
- **qubits** ([*int*](https://docs.python.org/3/library/functions.html#int) *| Iterable\[*[*int*](https://docs.python.org/3/library/functions.html#int)*]*) – The specific qubits for the instruction.

**Raises**

[**PulseError**](/docs/api/qiskit/1.1/pulse#qiskit.pulse.PulseError "qiskit.pulse.PulseError") – If the instruction is not defined on the qubits.

### get

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

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/pulse/instruction_schedule_map.py#L179-L200)

Return the defined [`Schedule`](/docs/api/qiskit/1.1/qiskit.pulse.Schedule "qiskit.pulse.Schedule") or [`ScheduleBlock`](/docs/api/qiskit/1.1/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") for the given instruction on the given qubits.

If all keys are not specified this method returns schedule with unbound parameters.

**Parameters**

- **instruction** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*circuit.instruction.Instruction*](/docs/api/qiskit/1.1/qiskit.circuit.Instruction "qiskit.circuit.instruction.Instruction")) – Name of the instruction or the instruction itself.
- **qubits** ([*int*](https://docs.python.org/3/library/functions.html#int) *| Iterable\[*[*int*](https://docs.python.org/3/library/functions.html#int)*]*) – The qubits for the instruction.
- **\*params** ([*complex*](https://docs.python.org/3/library/functions.html#complex)  *|*[*ParameterExpression*](/docs/api/qiskit/1.1/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression")) – Command parameters for generating the output schedule.
- **\*\*kwparams** ([*complex*](https://docs.python.org/3/library/functions.html#complex)  *|*[*ParameterExpression*](/docs/api/qiskit/1.1/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression")) – Keyworded command parameters for generating the schedule.

**Returns**

The Schedule defined for the input.

**Return type**

[Schedule](/docs/api/qiskit/1.1/qiskit.pulse.Schedule "qiskit.pulse.Schedule") | [ScheduleBlock](/docs/api/qiskit/1.1/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock")

### get\_parameters

`get_parameters(instruction, qubits)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/pulse/instruction_schedule_map.py#L344-L360)

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

**Parameters**

- **instruction** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*circuit.instruction.Instruction*](/docs/api/qiskit/1.1/qiskit.circuit.Instruction "qiskit.circuit.instruction.Instruction")) – Name of the instruction.
- **qubits** ([*int*](https://docs.python.org/3/library/functions.html#int) *| Iterable\[*[*int*](https://docs.python.org/3/library/functions.html#int)*]*) – The qubits for the instruction.

**Returns**

The names of the parameters required by the instruction.

**Return type**

[tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[[str](https://docs.python.org/3/library/stdtypes.html#str), …]

### has

`has(instruction, qubits)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/pulse/instruction_schedule_map.py#L141-L154)

Is the instruction defined for the given qubits?

**Parameters**

- **instruction** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*circuit.instruction.Instruction*](/docs/api/qiskit/1.1/qiskit.circuit.Instruction "qiskit.circuit.instruction.Instruction")) – The instruction for which to look.
- **qubits** ([*int*](https://docs.python.org/3/library/functions.html#int) *| Iterable\[*[*int*](https://docs.python.org/3/library/functions.html#int)*]*) – The specific qubits for the instruction.

**Returns**

True iff the instruction is defined.

**Return type**

[bool](https://docs.python.org/3/library/functions.html#bool)

### has\_custom\_gate

`has_custom_gate()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/pulse/instruction_schedule_map.py#L79-L85)

Return `True` if the map has user provided instruction.

**Return type**

[bool](https://docs.python.org/3/library/functions.html#bool)

### pop

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

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/pulse/instruction_schedule_map.py#L320-L342)

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

**Parameters**

- **instruction** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*circuit.instruction.Instruction*](/docs/api/qiskit/1.1/qiskit.circuit.Instruction "qiskit.circuit.instruction.Instruction")) – Name of the instruction.
- **qubits** ([*int*](https://docs.python.org/3/library/functions.html#int) *| Iterable\[*[*int*](https://docs.python.org/3/library/functions.html#int)*]*) – The qubits for the instruction.
- **\*params** ([*complex*](https://docs.python.org/3/library/functions.html#complex)  *|*[*ParameterExpression*](/docs/api/qiskit/1.1/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression")) – Command parameters for generating the output schedule.
- **\*\*kwparams** ([*complex*](https://docs.python.org/3/library/functions.html#complex)  *|*[*ParameterExpression*](/docs/api/qiskit/1.1/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression")) – Keyworded command parameters for generating the schedule.

**Returns**

The Schedule defined for the input.

**Return type**

[Schedule](/docs/api/qiskit/1.1/qiskit.pulse.Schedule "qiskit.pulse.Schedule") | [ScheduleBlock](/docs/api/qiskit/1.1/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock")

### qubit\_instructions

`qubit_instructions(qubits)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/pulse/instruction_schedule_map.py#L124-L139)

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

**Parameters**

**qubits** ([*int*](https://docs.python.org/3/library/functions.html#int) *| Iterable\[*[*int*](https://docs.python.org/3/library/functions.html#int)*]*) – A qubit index, or a list or tuple of indices.

**Returns**

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']`).

**Return type**

[list](https://docs.python.org/3/library/stdtypes.html#list)\[[str](https://docs.python.org/3/library/stdtypes.html#str)]

### qubits\_with\_instruction

`qubits_with_instruction(instruction)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/pulse/instruction_schedule_map.py#L99-L122)

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.

**Parameters**

**instruction** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*circuit.instruction.Instruction*](/docs/api/qiskit/1.1/qiskit.circuit.Instruction "qiskit.circuit.instruction.Instruction")) – The name of the circuit instruction.

**Returns**

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.

**Raises**

[**PulseError**](/docs/api/qiskit/1.1/pulse#qiskit.pulse.PulseError "qiskit.pulse.PulseError") – If the instruction is not found.

**Return type**

[list](https://docs.python.org/3/library/stdtypes.html#list)\[[int](https://docs.python.org/3/library/functions.html#int) | [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[[int](https://docs.python.org/3/library/functions.html#int), …]]

### remove

`remove(instruction, qubits)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/pulse/instruction_schedule_map.py#L299-L318)

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

**Parameters**

- **instruction** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*circuit.instruction.Instruction*](/docs/api/qiskit/1.1/qiskit.circuit.Instruction "qiskit.circuit.instruction.Instruction")) – The name of the instruction to add.
- **qubits** ([*int*](https://docs.python.org/3/library/functions.html#int) *| Iterable\[*[*int*](https://docs.python.org/3/library/functions.html#int)*]*) – The qubits which the instruction applies to.
