#NEWLINE# def test_riemann_invariants( ) : #NEWLINE# #INDENT# ( baser , gensr ) = riemann_bsgs #NEWLINE# g = Permutation ( [ 0 , 2 , 3 , 1 , 4 , 5 ] ) #NEWLINE# can = canonicalize ( g , list ( range ( 2 , 4 ) ) , 0 , ( baser , gensr , 1 , 0 ) ) #NEWLINE# assert ( can == [ 0 , 2 , 1 , 3 , 5 , 4 ] ) #NEWLINE# can = canonicalize ( g , list ( range ( 2 , 4 ) ) , 0 , ( [ 2 , 0 ] , [ Permutation ( [ 1 , 0 , 2 , 3 , 5 , 4 ] ) , Permutation ( [ 2 , 3 , 0 , 1 , 4 , 5 ] ) ] , 1 , 0 ) ) #NEWLINE# assert ( can == [ 0 , 2 , 1 , 3 , 5 , 4 ] ) #NEWLINE# '\n    The following tests in test_riemann_invariants and in\n    test_riemann_invariants1 have been checked using xperm.c from XPerm in\n    in [1] and with an older version contained in [2]\n\n    [1] xperm.c part of xPerm written by J. M. Martin-Garcia\n        http://www.xact.es/index.html\n    [2] test_xperm.cc in cadabra by Kasper Peeters, http://cadabra.phi-sci.com/\n    ' #NEWLINE# g = Permutation ( [ 23 , 2 , 1 , 10 , 12 , 8 , 0 , 11 , 15 , 5 , 17 , 19 , 21 , 7 , 13 , 9 , 4 , 14 , 22 , 3 , 16 , 18 , 6 , 20 , 24 , 25 ] ) #NEWLINE# can = canonicalize ( g , list ( range ( 24 ) ) , 0 , ( baser , gensr , 6 , 0 ) ) #NEWLINE# assert ( can == [ 0 , 2 , 4 , 6 , 1 , 3 , 8 , 10 , 5 , 7 , 12 , 14 , 9 , 11 , 16 , 18 , 13 , 15 , 20 , 22 , 17 , 19 , 21 , 23 , 24 , 25 ] ) #NEWLINE# can = canonicalize ( g , list ( range ( 24 ) ) , 0 , ( [ 2 , 0 ] , [ Permutation ( [ 1 , 0 , 2 , 3 , 5 , 4 ] ) , Permutation ( [ 2 , 3 , 0 , 1 , 4 , 5 ] ) ] , 6 , 0 ) ) #NEWLINE# assert ( can == [ 0 , 2 , 4 , 6 , 1 , 3 , 8 , 10 , 5 , 7 , 12 , 14 , 9 , 11 , 16 , 18 , 13 , 15 , 20 , 22 , 17 , 19 , 21 , 23 , 24 , 25 ] ) #NEWLINE# g = Permutation ( [ 0 , 2 , 5 , 7 , 4 , 6 , 9 , 11 , 8 , 10 , 13 , 15 , 12 , 14 , 17 , 19 , 16 , 18 , 21 , 23 , 20 , 22 , 25 , 27 , 24 , 26 , 29 , 31 , 28 , 30 , 33 , 35 , 32 , 34 , 37 , 39 , 36 , 38 , 1 , 3 , 40 , 41 ] ) #NEWLINE# can = canonicalize ( g , list ( range ( 40 ) ) , 0 , ( baser , gensr , 10 , 0 ) ) #NEWLINE# assert ( can == [ 0 , 2 , 4 , 6 , 1 , 3 , 8 , 10 , 5 , 7 , 12 , 14 , 9 , 11 , 16 , 18 , 13 , 15 , 20 , 22 , 17 , 19 , 24 , 26 , 21 , 23 , 28 , 30 , 25 , 27 , 32 , 34 , 29 , 31 , 36 , 38 , 33 , 35 , 37 , 39 , 40 , 41 ] )