Quanlse/QOperator.py
def coef(self, coef: Union[float, complex] = 1.0):
        """
        Setter for the coefficient

        :param: coefficient to be set to
        """
        if coef is None:
            self._coef = 1.0
        else:
            if not (isinstance(coef, float) or isinstance(coef, complex)):
                raise Error.ArgumentError(f"coef must be a float or complex, instead of {type(coef)}!")
            self._coef = coef

        Setter for the coefficient

        :param: coefficient to be set to
        
Setter for the coefficient
:param: coefficient to be set to
Setter for the coefficient : param : coefficient to be set to
def coef(self, coef: Union[float, complex] = 1.0):
        if coef is None:
            self._coef = 1.0
        else:
            if not (isinstance(coef, float) or isinstance(coef, complex)):
                raise Error.ArgumentError(f"coef must be a float or complex, instead of {type(coef)}!")
            self._coef = coef
def coef ( self , coef : Union [ float , complex ] = 1.0 ) : if coef is None : self . _coef = 1.0 else : if not ( isinstance ( coef , float ) or isinstance ( coef , complex ) ) : raise Error . ArgumentError ( f"coef must be a float or complex, instead of {type(coef)}!" ) self . _coef = coef
Setter for the coefficient
:param: coefficient to be set to
Setter for the coefficient : param : coefficient to be set to
"""
        Setter for the coefficient

        :param: coefficient to be set to
        """
self
coef
Union[float, complex]