#NEWLINE# def test_matrix_elements( ) : #NEWLINE# #INDENT# b = VarBosonicBasis ( 5 ) #NEWLINE# o = B ( 0 ) #NEWLINE# m = matrix_rep ( o , b ) #NEWLINE# for i in range ( 4 ) : #NEWLINE# #INDENT# assert ( m [ ( i , ( i + 1 ) ) ] == sqrt ( ( i + 1 ) ) ) #NEWLINE# #UNINDENT# o = Bd ( 0 ) #NEWLINE# m = matrix_rep ( b , b ) #NEWLINE# for i in range ( 4 ) : #NEWLINE# #INDENT# assert ( m [ ( ( i + 1 ) , i ) ] == sqrt ( ( i + 1 ) ) )