From 90ba867f7231a678af182ff9853f6dbca07bbcc8 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Thu, 14 Nov 2024 20:55:30 +0000 Subject: [PATCH] cleanup --- pennylane_lightning/core/_serialize.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pennylane_lightning/core/_serialize.py b/pennylane_lightning/core/_serialize.py index b1b538746..126666578 100644 --- a/pennylane_lightning/core/_serialize.py +++ b/pennylane_lightning/core/_serialize.py @@ -451,15 +451,13 @@ def get_wires(operation, single_op): if isinstance(single_op, qml.QubitUnitary): params.append([0.0]) mats.append(matrix(single_op)) - elif inverse and not hasattr(self.sv_type, single_op.base.name): - params.append([]) - mats.append(matrix(single_op)) - elif not inverse and not hasattr(self.sv_type, name): - params.append([]) - mats.append(matrix(single_op)) else: - params.append(single_op.parameters) - mats.append([]) + if hasattr(self.sv_type, single_op.base.name if inverse else name): + params.append(single_op.parameters) + mats.append([]) + else: + params.append([]) + mats.append(matrix(single_op)) controlled_values.append(controlled_values_list) controlled_wires.append(