def conjugate(self) -> "ParameterExpression": """Return the conjugate.""" if HAS_SYMENGINE: conjugated = ParameterExpression( self._parameter_symbols, symengine.conjugate(self._symbol_expr) ) else: conjugated = ParameterExpression(self._parameter_symbols, self._symbol_expr.conjugate()) return conjugated
def test_conjugate(): assert conjugate(pi) == pi assert conjugate(I) == -I