Skip to content

Commit

Permalink
Removed code deprecated in qiskit-terra 0.21, released on June 2022 (#…
Browse files Browse the repository at this point in the history
…10754)

* Removed code and tests deprecated in 0.21

* Undone removal of optimizers/spsa.

* undo changes in spsa

* Added release note.

* Removed deprecated classes from docstrings.

* Improved release note.

* Added removed files to resolve conflict.

* Removed the conflicting files

* Added conflicting file but with no code

* Align measure class file

* Removed alap dynamical coupling class

* Resolving colflict with dynamical coupling

* Deleted dynamical coupling

* Fixed release note.

* Apply suggestions from code review

* Update qiskit/execute_function.py

* recover benchmark test

---------

Co-authored-by: Luciano Bello <[email protected]>
Co-authored-by: Luciano Bello <[email protected]>
  • Loading branch information
3 people authored Oct 18, 2023
1 parent 998b559 commit d86e708
Show file tree
Hide file tree
Showing 18 changed files with 79 additions and 2,632 deletions.
17 changes: 0 additions & 17 deletions qiskit/execute_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from qiskit.providers.backend import Backend
from qiskit.pulse import Schedule, ScheduleBlock
from qiskit.exceptions import QiskitError
from qiskit.utils.deprecation import deprecate_arg

logger = logging.getLogger(__name__)

Expand All @@ -36,8 +35,6 @@ def _log_submission_time(start_time, end_time):
logger.info(log_msg)


@deprecate_arg("qobj_id", since="0.21.0", additional_msg="This argument has no effect anymore.")
@deprecate_arg("qobj_header", since="0.21.0", additional_msg="This argument has no effect anymore.")
def execute(
experiments,
backend,
Expand All @@ -48,8 +45,6 @@ def execute(
seed_transpiler=None,
optimization_level=None,
pass_manager=None,
qobj_id=None,
qobj_header=None,
shots=None, # common run options
memory=None,
seed_simulator=None,
Expand Down Expand Up @@ -159,16 +154,6 @@ def execute(
arg is present, auto-selection of pass manager based on the transpile options
will be turned off and this pass manager will be used directly.
qobj_id (str): DEPRECATED: String identifier to annotate the Qobj. This has no effect
and the :attr:`~.QuantumCircuit.name` attribute of the input circuit(s) should be used
instead.
qobj_header (QobjHeader or dict): DEPRECATED: User input that will be inserted in Qobj
header, and will also be copied to the corresponding :class:`qiskit.result.Result`
header. Headers do not affect the run. Headers do not affect the run. This kwarg
has no effect anymore and the :attr:`~.QuantumCircuit.metadata` attribute of the
input circuit(s) should be used instead.
shots (int): Number of repetitions of each circuit, for sampling. Default: 1024
memory (bool): If True, per-shot measurement bitstrings are returned as well
Expand Down Expand Up @@ -279,8 +264,6 @@ def execute(
job = execute(qc, backend, shots=4321)
"""
del qobj_id
del qobj_header
if isinstance(experiments, (Schedule, ScheduleBlock)) or (
isinstance(experiments, list) and isinstance(experiments[0], (Schedule, ScheduleBlock))
):
Expand Down
25 changes: 1 addition & 24 deletions qiskit/pulse/transforms/alignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
"""A collection of passes to reallocate the timeslots of instructions according to context."""

import abc
from typing import Callable, Dict, Any, Union, Tuple
from typing import Callable, Union, Tuple

import numpy as np

from qiskit.circuit.parameterexpression import ParameterExpression, ParameterValueType
from qiskit.pulse.exceptions import PulseError
from qiskit.pulse.schedule import Schedule, ScheduleComponent
from qiskit.pulse.utils import instruction_duration_validation
from qiskit.utils.deprecation import deprecate_func


class AlignmentKind(abc.ABC):
Expand All @@ -45,11 +44,6 @@ def align(self, schedule: Schedule) -> Schedule:
"""
pass

@deprecate_func(since="0.21")
def to_dict(self) -> Dict[str, Any]:
"""Returns dictionary to represent this alignment."""
return {"alignment": self.__class__.__name__}

@property
@abc.abstractmethod
def is_sequential(self) -> bool:
Expand Down Expand Up @@ -330,11 +324,6 @@ def align(self, schedule: Schedule) -> Schedule:

return aligned

@deprecate_func(since="0.21")
def to_dict(self) -> Dict[str, Any]:
"""Returns dictionary to represent this alignment."""
return {"alignment": self.__class__.__name__, "duration": self.duration}


class AlignFunc(AlignmentKind):
"""Allocate instructions at position specified by callback function.
Expand Down Expand Up @@ -415,15 +404,3 @@ def align(self, schedule: Schedule) -> Schedule:
aligned.insert(_t0, child, inplace=True)

return aligned

@deprecate_func(since="0.21")
def to_dict(self) -> Dict[str, Any]:
"""Returns dictionary to represent this alignment.
.. note:: ``func`` is not presented in this dictionary. Just name.
"""
return {
"alignment": self.__class__.__name__,
"duration": self.duration,
"func": self.func.__name__,
}
2 changes: 0 additions & 2 deletions qiskit/qpy/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from qiskit.qpy import formats, common, binary_io, type_keys
from qiskit.qpy.exceptions import QpyError
from qiskit.version import __version__
from qiskit.utils.deprecation import deprecate_arg


# pylint: disable=invalid-name
Expand Down Expand Up @@ -72,7 +71,6 @@
VERSION_PATTERN_REGEX = re.compile(VERSION_PATTERN, re.VERBOSE | re.IGNORECASE)


@deprecate_arg("circuits", new_alias="programs", since="0.21.0")
def dump(
programs: Union[List[QPY_SUPPORTED_TYPES], QPY_SUPPORTED_TYPES],
file_obj: BinaryIO,
Expand Down
12 changes: 0 additions & 12 deletions qiskit/transpiler/passes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,9 @@
PadDynamicalDecoupling
PadDelay
ConstrainedReschedule
AlignMeasures
ValidatePulseGates
InstructionDurationCheck
SetIOLatency
ALAPSchedule
ASAPSchedule
DynamicalDecoupling
Circuit Analysis
================
Expand Down Expand Up @@ -164,9 +160,7 @@
:toctree: ../stubs/
CheckMap
CheckCXDirection
CheckGateDirection
CXDirection
GateDirection
MergeAdjacentBarriers
RemoveBarriers
Expand Down Expand Up @@ -267,11 +261,7 @@
from .scheduling import TimeUnitConversion
from .scheduling import ALAPScheduleAnalysis
from .scheduling import ASAPScheduleAnalysis
from .scheduling import ALAPSchedule
from .scheduling import ASAPSchedule
from .scheduling import PadDynamicalDecoupling
from .scheduling import DynamicalDecoupling
from .scheduling import AlignMeasures # Deprecated
from .scheduling import ValidatePulseGates
from .scheduling import PadDelay
from .scheduling import ConstrainedReschedule
Expand All @@ -280,8 +270,6 @@

# additional utility passes
from .utils import CheckMap
from .utils import CheckCXDirection # Deprecated
from .utils import CXDirection # Deprecated
from .utils import CheckGateDirection
from .utils import GateDirection
from .utils import BarrierBeforeFinalMeasurements
Expand Down
4 changes: 0 additions & 4 deletions qiskit/transpiler/passes/scheduling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

"""Module containing circuit scheduling passes."""

from .alap import ALAPSchedule
from .asap import ASAPSchedule
from .dynamical_decoupling import DynamicalDecoupling
from .scheduling import ALAPScheduleAnalysis, ASAPScheduleAnalysis, SetIOLatency
from .time_unit_conversion import TimeUnitConversion
from .padding import PadDelay, PadDynamicalDecoupling
Expand All @@ -24,4 +21,3 @@
from . import alignments as instruction_alignments

# TODO Deprecated pass. Will be removed after deprecation period.
from .alignments import AlignMeasures
155 changes: 0 additions & 155 deletions qiskit/transpiler/passes/scheduling/alap.py

This file was deleted.

1 change: 0 additions & 1 deletion qiskit/transpiler/passes/scheduling/alignments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,3 @@
from .check_durations import InstructionDurationCheck
from .pulse_gate_validation import ValidatePulseGates
from .reschedule import ConstrainedReschedule
from .align_measures import AlignMeasures
Loading

0 comments on commit d86e708

Please sign in to comment.