Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderivrii committed Jan 18, 2024
1 parent 4702925 commit 6559e88
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions qiskit/qpy/binary_io/circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,6 @@ def _read_instruction(
gate_class = getattr(circuit_mod, gate_name)
elif hasattr(controlflow, gate_name):
gate_class = getattr(controlflow, gate_name)
elif gate_name == "annotated":
gate_class = AnnotatedOperation
elif gate_name == "Clifford":
gate_class = Clifford
else:
Expand Down Expand Up @@ -625,7 +623,7 @@ def _write_instruction(file_obj, instruction, custom_operations, index_map, use_
not hasattr(library, gate_class_name)
and not hasattr(circuit_mod, gate_class_name)
and not hasattr(controlflow, gate_class_name)
and gate_class_name not in ["Clifford", "annotated"]
and gate_class_name not in ["Clifford", "AnnotatedOperation"]
)
or gate_class_name == "Gate"
or gate_class_name == "Instruction"
Expand All @@ -642,7 +640,7 @@ def _write_instruction(file_obj, instruction, custom_operations, index_map, use_
custom_operations[gate_class_name] = instruction.operation
custom_operations_list.append(gate_class_name)

elif gate_class_name in ["ControlledGate", "annotated"]:
elif gate_class_name in ["ControlledGate", "AnnotatedOperation"]:
# controlled or annotated gates can have the same name but different parameter
# values, the uuid is appended to avoid storing a single definition
# in circuits with multiple controlled gates.
Expand Down Expand Up @@ -824,8 +822,6 @@ def _write_custom_operation(file_obj, name, operation, custom_operations, use_sy
base_gate = operation.base_gate
elif type_key == type_keys.CircuitInstruction.ANNOTATED_OPERATION:
has_definition = False
# equivalently, could put modifiers into data
# data = common.data_to_binary(operation, _write_annotated_operation)
base_gate = operation.base_op
elif operation.definition is not None:
has_definition = True
Expand Down

0 comments on commit 6559e88

Please sign in to comment.