def imag(self):
        """Imaginary part"""
        if hasattr(self.val, 'imag'):
            return self.val.imag
        else:
            # SymPy
            return self.val.as_real_imag()[1]
def imag ( self ) : if hasattr ( self . val , 'imag' ) : return self . val . imag else : return self . val . as_real_imag ( ) [ 1 ]
Imaginary part