<s> from __future__ import print_function , division <EOL> from sympy . matrices . expressions import MatrixExpr <EOL> from sympy import S , I , sqrt , exp <EOL> class DFT ( MatrixExpr ) : <EOL> """<STR_LIT>""" <EOL> n = property ( lambda self : self . args [ <NUM_LIT:0> ] ) <EOL> shape = property ( lambda self : ( self . n , self . n ) ) <EOL> def _entry ( self , i , j ) : <EOL> w = exp ( - <NUM_LIT:2> * S . Pi * I / self . n ) <EOL> return w ** ( i * j ) / sqrt ( self . n ) <EOL> def _eval_inverse ( self ) : <EOL> return IDFT ( self . n ) <EOL> class IDFT ( DFT ) : <EOL> """<STR_LIT>""" <EOL> def _entry ( self , i , j ) : <EOL> w = exp ( - <NUM_LIT:2> * S . Pi * I / self . n ) <EOL> return w ** ( - i * j ) / sqrt ( self . n ) <EOL> def _eval_inverse ( self ) : <EOL> return DFT ( self . n ) </s>
