Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed code deprecated in qiskit-terra 0.21, released on June 2022 #10754

Merged
merged 22 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions qiskit/execute_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from qiskit.providers.backend import Backend
from qiskit.pulse import Schedule, ScheduleBlock
from qiskit.exceptions import QiskitError
from qiskit.utils.deprecation import deprecate_arg

1ucian0 marked this conversation as resolved.
Show resolved Hide resolved

logger = logging.getLogger(__name__)

Expand All @@ -36,8 +36,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 +46,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 @@ -160,16 +156,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 @@ -280,8 +266,7 @@ def execute(

job = execute(qc, backend, shots=4321)
"""
del qobj_id
del qobj_header

1ucian0 marked this conversation as resolved.
Show resolved Hide resolved
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
13 changes: 1 addition & 12 deletions qiskit/transpiler/passes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,10 @@
PadDynamicalDecoupling
PadDelay
ConstrainedReschedule
AlignMeasures
ValidatePulseGates
InstructionDurationCheck
SetIOLatency
ALAPSchedule
ASAPSchedule
DynamicalDecoupling

1ucian0 marked this conversation as resolved.
Show resolved Hide resolved

Circuit Analysis
================
Expand Down Expand Up @@ -161,9 +158,7 @@
:toctree: ../stubs/

CheckMap
CheckCXDirection
CheckGateDirection
CXDirection
GateDirection
MergeAdjacentBarriers
RemoveBarriers
Expand Down Expand Up @@ -261,11 +256,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 @@ -274,8 +265,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
5 changes: 1 addition & 4 deletions qiskit/transpiler/passes/scheduling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

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

from .alap import ALAPSchedule
from .asap import ASAPSchedule
from .dynamical_decoupling import DynamicalDecoupling

1ucian0 marked this conversation as resolved.
Show resolved Hide resolved
from .scheduling import ALAPScheduleAnalysis, ASAPScheduleAnalysis, SetIOLatency
from .time_unit_conversion import TimeUnitConversion
from .padding import PadDelay, PadDynamicalDecoupling
Expand All @@ -24,4 +22,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.

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