def coherent_state(n, alpha):
 return ((exp(((- (Abs(alpha) ** 2)) / 2)) * (alpha ** n)) / sqrt(factorial(n)))

def coherent_state ( n , alpha ) : return ( ( exp ( ( ( - ( Abs ( alpha ) ** 2 ) ) / 2 ) ) * ( alpha ** n ) ) / sqrt ( factorial ( n ) ) )
returns <n|alpha> for the coherent states of 1d harmonic oscillator .