Imaginary part

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