Skip to content

Commit

Permalink
delete meas_map as a Target attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
to24toro committed Apr 19, 2023
1 parent f31ae23 commit 3926200
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
3 changes: 1 addition & 2 deletions qiskit/providers/backend_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def convert_to_target(
target = Target(
num_qubits=configuration.n_qubits,
qubit_properties=qubit_properties,
meas_map=configuration.meas_map,
)
# Parse instructions
gates: Dict[str, Any] = {}
Expand Down Expand Up @@ -104,7 +103,7 @@ def convert_to_target(
target.add_instruction(Measure(), measure_props)
# Parse from configuration because properties doesn't exist
else:
target = Target(num_qubits=configuration.n_qubits, meas_map=configuration.meas_map)
target = Target(num_qubits=configuration.n_qubits)
for gate in configuration.gates:
name = gate.name
gate_props = (
Expand Down
2 changes: 1 addition & 1 deletion qiskit/providers/fake_provider/utils/backend_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def convert_to_target(conf_dict: dict, props_dict: dict = None, defs_dict: dict
qubit_props = None
if props_dict:
qubit_props = qubit_props_from_props(props_dict)
target = Target(qubit_properties=qubit_props, meas_map=conf_dict.get("meas_map"))
target = Target(qubit_properties=qubit_props)
# Parse from properties if it exsits
if props_dict is not None:
# Parse instructions
Expand Down
11 changes: 8 additions & 3 deletions qiskit/pulse/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,16 @@ def measure(

# backend is V2.
if hasattr(backend, "target"):
target = backend.target
try:
meas_map = backend.configuration().meas_map
except AttributeError:
# TODO add meas_map to Target in 0.25
meas_map = [list(range(backend.num_qubits))]

return _measure_v2(
qubits=qubits,
target=target,
meas_map=meas_map or target.meas_map,
target=backend.target,
meas_map=meas_map,
qubit_mem_slots=qubit_mem_slots or dict(zip(qubits, range(len(qubits)))),
measure_name=measure_name,
)
Expand Down
8 changes: 0 additions & 8 deletions qiskit/transpiler/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ class Target(Mapping):
"_non_global_strict_basis",
"qubit_properties",
"_global_operations",
"_meas_map",
)

@deprecate_arguments({"aquire_alignment": "acquire_alignment"}, since="0.23.0")
Expand All @@ -246,7 +245,6 @@ def __init__(
pulse_alignment=1,
acquire_alignment=1,
qubit_properties=None,
meas_map=None,
):
"""
Create a new Target object
Expand Down Expand Up @@ -318,7 +316,6 @@ def __init__(
"length of the input qubit_properties list"
)
self.qubit_properties = qubit_properties
self._meas_map = meas_map

def add_instruction(self, instruction, properties=None, name=None):
"""Add a new instruction to the :class:`~qiskit.transpiler.Target`
Expand Down Expand Up @@ -1049,11 +1046,6 @@ def build_coupling_map(self, two_q_gate=None):
else:
return None

@property
def meas_map(self):
"""Returns the grouping of measurements which are multiplexed"""
return self._meas_map

@property
def physical_qubits(self):
"""Returns a sorted list of physical_qubits"""
Expand Down

0 comments on commit 3926200

Please sign in to comment.