diff --git a/qupulse/pulses/parameters.py b/qupulse/pulses/parameters.py index 51b20e05..da381b05 100644 --- a/qupulse/pulses/parameters.py +++ b/qupulse/pulses/parameters.py @@ -12,6 +12,7 @@ from qupulse.serialization import AnonymousSerializable from qupulse.expressions import Expression from qupulse.parameter_scope import Scope, ParameterNotProvidedException +from qupulse.utils.sympy import sympify __all__ = ["ParameterNotProvidedException", "ParameterConstraintViolation", "ParameterConstraint"] @@ -22,9 +23,9 @@ def __init__(self, relation: Union[str, sympy.Expr]): super().__init__() if isinstance(relation, str) and '==' in relation: # The '==' operator is interpreted by sympy as exactly, however we need a symbolical evaluation - self._expression = sympy.Eq(*sympy.sympify(relation.split('=='))) + self._expression = sympy.Eq(*sympify(relation.split('=='))) else: - self._expression = sympy.sympify(relation) + self._expression = sympify(relation) if not isinstance(self._expression, sympy.logic.boolalg.Boolean): raise ValueError('Constraint is not boolean') self._expression = Expression(self._expression)