Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.
Important

IBM Quantum Platform is moving and this version will be sunset on July 1. To get started on the new platform, read the migration guide.

utils

Scheduling utility functions.

Functions

format_meas_map(meas_map)Return a mapping from qubit label to measurement group given the nested list meas_map returned by a backend configuration.
measure(qubits[, backend, inst_map, …])Return a schedule which measures the requested qubits according to the given instruction mapping and measure map, or by using the defaults provided by the backend.
measure_all(backend)Return a Schedule which measures all qubits of the given backend.

format_meas_map

format_meas_map(meas_map)

GitHub

Return a mapping from qubit label to measurement group given the nested list meas_map returned by a backend configuration. (Qubits can not always be measured independently.) Sorts the measurement group for consistency.

Parameters

meas_map (List[List[int]]) – Groups of qubits that get measured together, for example: [[0, 1], [2, 3, 4]]

Return type

Dict[int, List[int]]

Returns

Measure map in map format

measure

measure(qubits, backend=None, inst_map=None, meas_map=None, qubit_mem_slots=None, measure_name='measure')

GitHub

Return a schedule which measures the requested qubits according to the given instruction mapping and measure map, or by using the defaults provided by the backend.

By default, the measurement results for each qubit are trivially mapped to the qubit index. This behavior is overridden by qubit_mem_slots. For instance, to measure qubit 0 into MemorySlot(1), qubit_mem_slots can be provided as {0: 1}.

Parameters

  • qubits (List[int]) – List of qubits to be measured.
  • backend (BaseBackend) – A backend instance, which contains hardware-specific data required for scheduling.
  • inst_map (Optional[InstructionScheduleMap]) – Mapping of circuit operations to pulse schedules. If None, defaults to the instruction_schedule_map of backend.
  • meas_map (Union[List[List[int]], Dict[int, List[int]], None]) – List of sets of qubits that must be measured together. If None, defaults to the meas_map of backend.
  • qubit_mem_slots (Optional[Dict[int, int]]) – Mapping of measured qubit index to classical bit index.
  • measure_name (str) – Name of the measurement schedule.

Return type

Schedule

Returns

A measurement schedule corresponding to the inputs provided.

Raises

PulseError – If both inst_map or meas_map, and backend is None.

measure_all

measure_all(backend)

GitHub

Return a Schedule which measures all qubits of the given backend.

Parameters

backend (BaseBackend) – A backend instance, which contains hardware-specific data required for scheduling.

Return type

Schedule

Returns

A schedule corresponding to the inputs provided.

Was this page helpful?
Report a bug or request content on GitHub.