def test_coherent_state(n=10): # Maximum "n" which is tested: # test whether coherent state is the eigenstate of annihilation operator alpha = Symbol("alpha") for i in range(n + 1): assert simplify(sqrt(n + 1) * coherent_state(n + 1, alpha)) == simplify( alpha * coherent_state(n, alpha))
def test_coherent_state(n=10): # Maximum "n" which is tested: # test whether coherent state is the eigenstate of annihilation operator alpha = Symbol("alpha") for i in range(n + 1): assert simplify(sqrt(n + 1) * coherent_state(n + 1, alpha)) == simplify(alpha * coherent_state(n, alpha))