Skip to content

Commit

Permalink
Better return type and better type comparison.
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandMacDoland committed Oct 24, 2024
1 parent f97f542 commit a3297eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qadence2_platforms/backends/pyqtorch/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from qadence2_platforms.backends.pyqtorch.utils import InputType, Support


def _get_op(op: InputType) -> Primitive:
if op.is_symbol is True: # needed to ensure the value (not the existence)
def _get_op(op: InputType) -> Primitive | None:
if op.is_symbol is True:
return getattr(pyq, op.head.upper(), None)

if op.is_quantum_operator is True: # needed to ensure the value (not the existence)
if op.is_quantum_operator is True:
op_args_item: InputType = op.args[0].args
return getattr(pyq, op_args_item[0].upper(), None)

Expand Down

0 comments on commit a3297eb

Please sign in to comment.