Skip to content

Commit fdd5e96

Browse files
eliarbelElePTraynelfssmtreinish
authored
Remove pulse module files, pulse visualization and final cleanup (#13872)
* Handle ScheduleBlock and pulse gates loading * Add documentation and remove redundant code * Limit QPY version when generating circuits for compatibility test Fix some doc issues * Remove FakeBackend, FakeQasmBackend, FakePulseBackend, subclasses, any tests that checked V1 functionality, mitigators (independent removal). Update rest of unit tests to use GenericBackendV2 * Remove FakeBackend references from docs (these classes will be removed in 2.0 so no alternative is provided) * Generate visuals for test (DUMMY COMMIT) * Another attempt after fixing lint * Desperate measures until better measures are found * Handle QPY compatibility testing. Misc other fixes * Update qiskit/qpy/binary_io/circuits.py Co-authored-by: Raynel Sanchez <87539502+raynelfss@users.noreply.github.com> * Remove pulse from GenericBackendV2 This commit removes pulse-related functionality from GenericBackendV2, as part of Pulse removal in Qiskit 2.0. This includes the ability to initialize the backend with custom calibrations and query it for channel information. Also, various clean ups where made to accommodate for the updated API of GenericBackendV2. * First pass * Avoid generating pulse circuits in load_qpy & version >= 2.0 * Remove more stuff * Add renos * Fix scheduling tests * Add reno and some misc fixes * Remove BackendV1, converters, models, qobj and update tests. * Fix lint * Add recent changes from remove-pulse-qpy branch * Remove pulse module files, visualization & testing * Add reno * Raise QpyError when loading ScheduleBlock payloads * Clean up TODOs * Remove NormalizeRXAngle and rzx_templates And misc minor fixes * Unify transpiler renos w.r.t pulse removal * Update reno and minor cosmetic changes * Delete a test file that unintentionally got in * Update releasenotes/notes/remove-pulse-eb43f66499092489.yaml --------- Co-authored-by: Elena Peña Tapia <epenatap@gmail.com> Co-authored-by: Raynel Sanchez <87539502+raynelfss@users.noreply.github.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
1 parent 1b43c89 commit fdd5e96

102 files changed

Lines changed: 69 additions & 25990 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
# Qiskit folders (also their corresponding tests)
2626
providers/ @Qiskit/terra-core @jyu00
27-
pulse/ @Qiskit/terra-core @eggerdj @wshanks @nkanazawa1989
28-
scheduler/ @Qiskit/terra-core @eggerdj @wshanks @nkanazawa1989
2927
visualization/ @Qiskit/terra-core @nonhermitian
3028
primitives/ @Qiskit/terra-core @Qiskit/qiskit-primitives
3129
# Override the release notes directories to have _no_ code owners, so any review

crates/accelerate/src/basis/basis_translator/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ fn extract_basis_target(
367367
/// This needs to use a Python instance of `QuantumCircuit` due to it needing
368368
/// to access `has_calibration_for()` which is unavailable through rust. However,
369369
/// this API will be removed with the deprecation of `Pulse`.
370+
/// TODO: pulse is removed, we can use op.blocks
370371
fn extract_basis_target_circ(
371372
circuit: &Bound<PyAny>,
372373
source_basis: &mut IndexSet<GateIdentifier, ahash::RandomState>,

docs/apidoc/index.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ Serialization:
6868
qasm3
6969
qpy
7070

71-
Pulse-level programming:
72-
73-
.. toctree::
74-
:maxdepth: 1
75-
76-
pulse
77-
7871
Other:
7972

8073
.. toctree::

docs/apidoc/pulse.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.

qiskit/compiler/transpiler.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from qiskit.circuit.quantumcircuit import QuantumCircuit
2323
from qiskit.dagcircuit import DAGCircuit
2424
from qiskit.providers.backend import Backend
25-
from qiskit.pulse import Schedule
2625
from qiskit.transpiler import Layout, CouplingMap, PropertySet
2726
from qiskit.transpiler.basepasses import BasePass
2827
from qiskit.transpiler.exceptions import TranspilerError, CircuitTooWideForTarget
@@ -302,16 +301,7 @@ def callback_func(**kwargs):
302301
if not circuits:
303302
return []
304303

305-
# transpiling schedules is not supported yet.
306304
start_time = time()
307-
if all(isinstance(c, Schedule) for c in circuits):
308-
warnings.warn("Transpiling schedules is not supported yet.", UserWarning)
309-
end_time = time()
310-
_log_transpile_time(start_time, end_time)
311-
if arg_circuits_list:
312-
return circuits
313-
else:
314-
return circuits[0]
315305

316306
if optimization_level is None:
317307
# Take optimization level from the configuration or 1 as default.

qiskit/providers/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@
128128
a backend and its operation for the :mod:`~qiskit.transpiler` so that circuits
129129
can be compiled to something that is optimized and can execute on the
130130
backend. It also provides the :meth:`~qiskit.providers.BackendV2.run` method which can
131-
run the :class:`~qiskit.circuit.QuantumCircuit` objects and/or
132-
:class:`~qiskit.pulse.Schedule` objects. This enables users and other Qiskit
131+
run the :class:`~qiskit.circuit.QuantumCircuit` objects. This enables users and other Qiskit
133132
APIs to get results from
134133
executing circuits on devices in a standard
135134
fashion regardless of how the backend is implemented. At a high level the basic

qiskit/providers/backend.py

Lines changed: 4 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
from abc import ABC
1919
from abc import abstractmethod
2020
import datetime
21-
from typing import List, Union, Iterable, Tuple
21+
from typing import List, Union, Tuple
2222

2323
from qiskit.circuit.gate import Instruction
24-
from qiskit.utils.deprecate_pulse import deprecate_pulse_dependency
2524

2625

2726
class Backend:
@@ -202,7 +201,7 @@ def instruction_durations(self):
202201
@property
203202
@abstractmethod
204203
def max_circuits(self):
205-
"""The maximum number of circuits (or Pulse schedules) that can be
204+
"""The maximum number of circuits that can be
206205
run in a single job.
207206
208207
If there is no limit this will return None
@@ -267,18 +266,6 @@ def meas_map(self) -> List[List[int]]:
267266
"""
268267
raise NotImplementedError
269268

270-
@property
271-
@deprecate_pulse_dependency(is_property=True)
272-
def instruction_schedule_map(self):
273-
"""Return the :class:`~qiskit.pulse.InstructionScheduleMap` for the
274-
instructions defined in this backend's target."""
275-
return self._instruction_schedule_map
276-
277-
@property
278-
def _instruction_schedule_map(self):
279-
"""An alternative private path to be used internally to avoid pulse deprecation warnings."""
280-
return self.target._get_instruction_schedule_map()
281-
282269
def qubit_properties(
283270
self, qubit: Union[int, List[int]]
284271
) -> Union[QubitProperties, List[QubitProperties]]:
@@ -313,77 +300,6 @@ def qubit_properties(
313300
return self.target.qubit_properties[qubit]
314301
return [self.target.qubit_properties[q] for q in qubit]
315302

316-
@deprecate_pulse_dependency
317-
def drive_channel(self, qubit: int):
318-
"""Return the drive channel for the given qubit.
319-
320-
This is required to be implemented if the backend supports Pulse
321-
scheduling.
322-
323-
Returns:
324-
DriveChannel: The Qubit drive channel
325-
326-
Raises:
327-
NotImplementedError: if the backend doesn't support querying the
328-
measurement mapping
329-
"""
330-
raise NotImplementedError
331-
332-
@deprecate_pulse_dependency
333-
def measure_channel(self, qubit: int):
334-
"""Return the measure stimulus channel for the given qubit.
335-
336-
This is required to be implemented if the backend supports Pulse
337-
scheduling.
338-
339-
Returns:
340-
MeasureChannel: The Qubit measurement stimulus line
341-
342-
Raises:
343-
NotImplementedError: if the backend doesn't support querying the
344-
measurement mapping
345-
"""
346-
raise NotImplementedError
347-
348-
@deprecate_pulse_dependency
349-
def acquire_channel(self, qubit: int):
350-
"""Return the acquisition channel for the given qubit.
351-
352-
This is required to be implemented if the backend supports Pulse
353-
scheduling.
354-
355-
Returns:
356-
AcquireChannel: The Qubit measurement acquisition line.
357-
358-
Raises:
359-
NotImplementedError: if the backend doesn't support querying the
360-
measurement mapping
361-
"""
362-
raise NotImplementedError
363-
364-
@deprecate_pulse_dependency
365-
def control_channel(self, qubits: Iterable[int]):
366-
"""Return the secondary drive channel for the given qubit
367-
368-
This is typically utilized for controlling multiqubit interactions.
369-
This channel is derived from other channels.
370-
371-
This is required to be implemented if the backend supports Pulse
372-
scheduling.
373-
374-
Args:
375-
qubits: Tuple or list of qubits of the form
376-
``(control_qubit, target_qubit)``.
377-
378-
Returns:
379-
List[ControlChannel]: The multi qubit control line.
380-
381-
Raises:
382-
NotImplementedError: if the backend doesn't support querying the
383-
measurement mapping
384-
"""
385-
raise NotImplementedError
386-
387303
def set_options(self, **fields):
388304
"""Set the options fields for the backend
389305
@@ -433,9 +349,8 @@ def run(self, run_input, **options):
433349
class can handle either situation.
434350
435351
Args:
436-
run_input (QuantumCircuit or Schedule or ScheduleBlock or list): An
437-
individual or a list of :class:`.QuantumCircuit`,
438-
:class:`~qiskit.pulse.ScheduleBlock`, or :class:`~qiskit.pulse.Schedule` objects to
352+
run_input (QuantumCircuit or list): An
353+
individual or a list of :class:`.QuantumCircuit` objects to
439354
run on the backend.
440355
options: Any kwarg options to pass to the backend for running the
441356
config. If a key is also present in the options

qiskit/providers/fake_provider/generic_backend_v2.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,16 +308,13 @@ def run(self, run_input, **options):
308308
"""Run on the backend using a simulator.
309309
310310
This method runs circuit jobs (an individual or a list of :class:`~.QuantumCircuit`
311-
) and pulse jobs (an individual or a list of :class:`~.Schedule` or
312-
:class:`~.ScheduleBlock`) using :class:`~.BasicSimulator` or Aer simulator and returns a
311+
) using :class:`~.BasicSimulator` or Aer simulator and returns a
313312
:class:`~qiskit.providers.Job` object.
314313
315314
If qiskit-aer is installed, jobs will be run using the ``AerSimulator`` with
316315
noise model of the backend. Otherwise, jobs will be run using the
317316
``BasicSimulator`` simulator without noise.
318317
319-
Noisy simulations of pulse jobs are not yet supported in :class:`~.GenericBackendV2`.
320-
321318
Args:
322319
run_input (QuantumCircuit or list): An
323320
individual or a list of :class:`~qiskit.circuit.QuantumCircuit`
@@ -332,7 +329,8 @@ def run(self, run_input, **options):
332329
Job: The job object for the run
333330
334331
Raises:
335-
QiskitError: If a pulse job is supplied and qiskit_aer is not installed.
332+
QiskitError: If input is not :class:`~qiskit.circuit.QuantumCircuit` or a list of
333+
:class:`~qiskit.circuit.QuantumCircuit` objects.
336334
"""
337335
circuits = run_input
338336
if not isinstance(circuits, QuantumCircuit) and (

qiskit/pulse/__init__.py

Lines changed: 0 additions & 158 deletions
This file was deleted.

0 commit comments

Comments
 (0)