Skip to content

Commit 2b5e499

Browse files
committed
better expression treatment in gray synth gate objects
1 parent 98c76b5 commit 2b5e499

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/qrisp/logic_synthesis/gray_synthesis.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
"""
1818

1919
import numpy as np
20+
import sympy as sp
21+
2022
from qrisp.misc import array_as_int, gate_wrap, int_as_array
2123
from qrisp.circuit import QuantumCircuit, Operation, PTControlledOperation, ControlledOperation, fast_append
2224

@@ -433,7 +435,7 @@ def __init__(self, target_phases, phase_tolerant = False):
433435

434436
self.abstract_params = set()
435437
for i in range(len(target_phases)):
436-
if not isinstance(target_phases[i], (int, float, np.float64)):
438+
if isinstance(target_phases[i], sp.Expr):
437439
self.abstract_params = self.abstract_params.union(target_phases[i].free_symbols)
438440

439441
def control(self, num_ctrl_qubits=1, ctrl_state=-1, method=None):

0 commit comments

Comments
 (0)