#NEWLINE# def test_complex( ) : #NEWLINE# #INDENT# a = Symbol ( 'a' , real = True ) #NEWLINE# b = Symbol ( 'b' , real = True ) #NEWLINE# e = ( ( a + ( I * b ) ) * ( a - ( I * b ) ) ) #NEWLINE# assert ( e . expand ( ) == ( ( a ** 2 ) + ( b ** 2 ) ) ) #NEWLINE# assert ( sqrt ( I ) == ( ( - 1 ) ** Rational ( 1 , 4 ) ) )