#NEWLINE# def test_basic_state( ) : #NEWLINE# #INDENT# ( i , j , n , m ) = symbols ( 'i,j,n,m' ) #NEWLINE# s = BosonState ( [ 0 , 1 , 2 , 3 , 4 ] ) #NEWLINE# assert ( len ( s ) == 5 ) #NEWLINE# assert ( s . args [ 0 ] == tuple ( range ( 5 ) ) ) #NEWLINE# assert ( s . up ( 0 ) == BosonState ( [ 1 , 1 , 2 , 3 , 4 ] ) ) #NEWLINE# assert ( s . down ( 4 ) == BosonState ( [ 0 , 1 , 2 , 3 , 3 ] ) ) #NEWLINE# for i in range ( 5 ) : #NEWLINE# #INDENT# assert ( s . up ( i ) . down ( i ) == s ) #NEWLINE# #UNINDENT# assert ( s . down ( 0 ) == 0 ) #NEWLINE# for i in range ( 5 ) : #NEWLINE# #INDENT# assert ( s [ i ] == i ) #NEWLINE# #UNINDENT# s = BosonState ( [ n , m ] ) #NEWLINE# assert ( s . down ( 0 ) == BosonState ( [ ( n - 1 ) , m ] ) ) #NEWLINE# assert ( s . up ( 0 ) == BosonState ( [ ( n + 1 ) , m ] ) )