Skip to content

Commit ab1fa67

Browse files
committed
Continue removal: use of FakePulseBackends in tests, classes that depend on functionality that depends on qobj, related tests.
1 parent 29f10d6 commit ab1fa67

46 files changed

Lines changed: 214 additions & 9216 deletions

Some content is hidden

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

qiskit/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127

128128
_config = _user_config.get_config()
129129

130-
from qiskit.compiler import transpile, schedule, sequence
130+
from qiskit.compiler import transpile
131131
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
132132
from .version import __version__
133133

@@ -138,8 +138,6 @@
138138
"QiskitError",
139139
"QuantumCircuit",
140140
"QuantumRegister",
141-
"schedule",
142-
"sequence",
143141
"transpile",
144142
"generate_preset_pass_manager",
145143
]

qiskit/compiler/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,8 @@
2020
Circuit and Pulse Compilation Functions
2121
=======================================
2222
23-
.. autofunction:: schedule
2423
.. autofunction:: transpile
25-
.. autofunction:: sequence
2624
2725
"""
2826

2927
from .transpiler import transpile
30-
from .scheduler import schedule
31-
from .sequencer import sequence

qiskit/compiler/scheduler.py

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

qiskit/compiler/sequencer.py

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

qiskit/compiler/transpiler.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,10 @@
6666
additional_msg="The `target` parameter should be used instead. You can build a `Target` instance "
6767
"with defined properties with Target.from_configuration(..., backend_properties=...)",
6868
)
69-
@deprecate_pulse_arg("inst_map", predicate=lambda inst_map: inst_map is not None)
7069
def transpile( # pylint: disable=too-many-return-statements
7170
circuits: _CircuitT,
7271
backend: Optional[Backend] = None,
7372
basis_gates: Optional[List[str]] = None,
74-
inst_map: Optional[List[InstructionScheduleMap]] = None,
7573
coupling_map: Optional[Union[CouplingMap, List[List[int]]]] = None,
7674
backend_properties: Optional[BackendProperties] = None,
7775
initial_layout: Optional[Union[Layout, Dict, List]] = None,
@@ -105,7 +103,7 @@ def transpile( # pylint: disable=too-many-return-statements
105103
106104
The prioritization of transpilation target constraints works as follows: if a ``target``
107105
input is provided, it will take priority over any ``backend`` input or loose constraints
108-
(``basis_gates``, ``inst_map``, ``coupling_map``, ``backend_properties``, ``instruction_durations``,
106+
(``basis_gates``, ``coupling_map``, ``backend_properties``, ``instruction_durations``,
109107
``dt`` or ``timing_constraints``). If a ``backend`` is provided together with any loose constraint
110108
from the list above, the loose constraint will take priority over the corresponding backend
111109
constraint. This behavior is independent of whether the ``backend`` instance is of type
@@ -120,7 +118,6 @@ def transpile( # pylint: disable=too-many-return-statements
120118
**basis_gates** target basis_gates basis_gates
121119
**coupling_map** target coupling_map coupling_map
122120
**instruction_durations** target instruction_durations instruction_durations
123-
**inst_map** target inst_map inst_map
124121
**dt** target dt dt
125122
**timing_constraints** target timing_constraints timing_constraints
126123
**backend_properties** target backend_properties backend_properties
@@ -133,12 +130,6 @@ def transpile( # pylint: disable=too-many-return-statements
133130
will override the backend's.
134131
basis_gates: List of basis gate names to unroll to
135132
(e.g: ``['u1', 'u2', 'u3', 'cx']``). If ``None``, do not unroll.
136-
inst_map: DEPRECATED. Mapping of unrolled gates to pulse schedules. If this is not provided,
137-
transpiler tries to get from the backend. If any user defined calibration
138-
is found in the map and this is used in a circuit, transpiler attaches
139-
the custom gate definition to the circuit. This enables one to flexibly
140-
override the low-level instruction implementation. This feature is available
141-
iff the backend supports the pulse gate experiment.
142133
coupling_map: Directed coupling map (perhaps custom) to target in mapping. If
143134
the coupling map is symmetric, both directions need to be specified.
144135
@@ -394,14 +385,8 @@ def callback_func(**kwargs):
394385
# Edge cases require using the old model (loose constraints) instead of building a target,
395386
# but we don't populate the passmanager config with loose constraints unless it's one of
396387
# the known edge cases to control the execution path.
397-
# Filter instruction_durations, timing_constraints, backend_properties and inst_map deprecation
388+
# Filter instruction_durations, timing_constraints, backend_properties deprecation
398389
with warnings.catch_warnings():
399-
warnings.filterwarnings(
400-
"ignore",
401-
category=DeprecationWarning,
402-
message=".*``inst_map`` is deprecated as of Qiskit 1.3.*",
403-
module="qiskit",
404-
)
405390
warnings.filterwarnings(
406391
"ignore",
407392
category=DeprecationWarning,
@@ -429,7 +414,6 @@ def callback_func(**kwargs):
429414
instruction_durations=instruction_durations,
430415
backend_properties=backend_properties,
431416
timing_constraints=timing_constraints,
432-
inst_map=inst_map,
433417
initial_layout=initial_layout,
434418
layout_method=layout_method,
435419
routing_method=routing_method,

qiskit/providers/fake_provider/utils/backend_converter.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@
2424
from qiskit.circuit.delay import Delay
2525
from qiskit.circuit.measure import Measure
2626
from qiskit.circuit.reset import Reset
27-
from qiskit.providers.models.pulsedefaults import PulseDefaults
2827

2928

30-
def convert_to_target(conf_dict: dict, props_dict: dict = None, defs_dict: dict = None) -> Target:
29+
def convert_to_target(conf_dict: dict, props_dict: dict = None) -> Target:
3130
"""Uses configuration, properties and pulse defaults dicts
3231
to construct and return Target class.
3332
"""
@@ -107,25 +106,7 @@ def convert_to_target(conf_dict: dict, props_dict: dict = None, defs_dict: dict
107106
target.pulse_alignment = conf_dict["timing_constraints"].get("pulse_alignment")
108107
target.acquire_alignment = conf_dict["timing_constraints"].get("acquire_alignment")
109108
# If pulse defaults exists use that as the source of truth
110-
if defs_dict is not None:
111-
# TODO remove the usage of PulseDefaults as it will be deprecated in the future
112-
pulse_defs = PulseDefaults.from_dict(defs_dict)
113-
inst_map = pulse_defs.instruction_schedule_map
114-
for inst in inst_map.instructions:
115-
for qarg in inst_map.qubits_with_instruction(inst):
116-
try:
117-
qargs = tuple(qarg)
118-
except TypeError:
119-
qargs = (qarg,)
120-
# Do NOT call .get method. This parses Qpbj immediately.
121-
# This operation is computationally expensive and should be bypassed.
122-
calibration_entry = inst_map._get_calibration_entry(inst, qargs)
123-
if inst in target:
124-
if inst == "measure":
125-
for qubit in qargs:
126-
target[inst][(qubit,)].calibration = calibration_entry
127-
elif qargs in target[inst]:
128-
target[inst][qargs].calibration = calibration_entry
109+
129110
target.add_instruction(
130111
Delay(Parameter("t")), {(bit,): None for bit in range(target.num_qubits)}
131112
)

qiskit/transpiler/passes/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
RemoveFinalReset
8686
HoareOptimizer
8787
TemplateOptimization
88-
EchoRZXWeylDecomposition
8988
ResetAfterMeasureSimplification
9089
OptimizeCliffords
9190
ElidePermutations
@@ -237,7 +236,6 @@
237236
from .optimization import HoareOptimizer
238237
from .optimization import TemplateOptimization
239238
from .optimization import InverseCancellation
240-
from .optimization import EchoRZXWeylDecomposition
241239
from .optimization import CollectAndCollapse
242240
from .optimization import CollectLinearFunctions
243241
from .optimization import CollectCliffords

qiskit/transpiler/passes/optimization/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from .template_optimization import TemplateOptimization
3030
from .inverse_cancellation import InverseCancellation
3131
from .collect_1q_runs import Collect1qRuns
32-
from .echo_rzx_weyl_decomposition import EchoRZXWeylDecomposition
3332
from .collect_linear_functions import CollectLinearFunctions
3433
from .reset_after_measure_simplification import ResetAfterMeasureSimplification
3534
from .optimize_cliffords import OptimizeCliffords

0 commit comments

Comments
 (0)