File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,10 +107,10 @@ def __init__(
107107 ValueError: If the supplied exponent is a complex number with an
108108 imaginary component.
109109 """
110- if not isinstance (exponent , ( numbers . Number , sympy . Expr ) ):
110+ if isinstance (exponent , str ):
111111 raise TypeError (
112112 "Gate exponent must be a number or sympy expression. "
113- f"Invalid type : { type ( exponent ). __name__ !r} "
113+ f"Received a string instead : { exponent !r} "
114114 )
115115 if isinstance (exponent , complex ):
116116 if exponent .imag :
@@ -293,10 +293,10 @@ def _period(self) -> float | None:
293293 return _approximate_common_period (real_periods )
294294
295295 def __pow__ (self , exponent : value .TParamVal ) -> EigenGate :
296- if not isinstance (exponent , ( numbers . Number , sympy . Expr ) ):
296+ if isinstance (exponent , str ):
297297 raise TypeError (
298298 "Gate exponent must be a number or sympy expression. "
299- f"Invalid type : { type ( exponent ). __name__ !r} "
299+ f"Received a string instead : { exponent !r} "
300300 )
301301 new_exponent = protocols .mul (self ._exponent , exponent , NotImplemented )
302302 if new_exponent is NotImplemented :
You can’t perform that action at this time.
0 commit comments