<s> from sympy . combinatorics . named_groups import ( SymmetricGroup , CyclicGroup , <EOL> DihedralGroup , AlternatingGroup , AbelianGroup ) <EOL> def test_SymmetricGroup ( ) : <EOL> G = SymmetricGroup ( <NUM_LIT:5> ) <EOL> elements = list ( G . generate ( ) ) <EOL> assert ( G . generators [ <NUM_LIT:0> ] ) . size == <NUM_LIT:5> <EOL> assert len ( elements ) == <NUM_LIT> <EOL> assert G . is_solvable is False <EOL> assert G . is_abelian is False <EOL> assert G . is_nilpotent is False <EOL> assert G . is_transitive ( ) is True <EOL> H = SymmetricGroup ( <NUM_LIT:1> ) <EOL> assert H . order ( ) == <NUM_LIT:1> <EOL> L = SymmetricGroup ( <NUM_LIT:2> ) <EOL> assert L . order ( ) == <NUM_LIT:2> <EOL> def test_CyclicGroup ( ) : <EOL> G = CyclicGroup ( <NUM_LIT:10> ) <EOL> elements = list ( G . generate ( ) ) <EOL> assert len ( elements ) == <NUM_LIT:10> <EOL> assert ( G . derived_subgroup ( ) ) . order ( ) == <NUM_LIT:1> <EOL> assert G . is_abelian is True <EOL> assert G . is_solvable is True <EOL> assert G . is_nilpotent is True <EOL> H = CyclicGroup ( <NUM_LIT:1> ) <EOL> assert H . order ( ) == <NUM_LIT:1> <EOL> L = CyclicGroup ( <NUM_LIT:2> ) <EOL> assert L . order ( ) == <NUM_LIT:2> <EOL> def test_DihedralGroup ( ) : <EOL> G = DihedralGroup ( <NUM_LIT:6> ) <EOL> elements = list ( G . generate ( ) ) <EOL> assert len ( elements ) == <NUM_LIT:12> <EOL> assert G . is_transitive ( ) is True <EOL> assert G . is_abelian is False <EOL> assert G . is_solvable is True <EOL> assert G . is_nilpotent is False <EOL> H = DihedralGroup ( <NUM_LIT:1> ) <EOL> assert H . order ( ) == <NUM_LIT:2> <EOL> L = DihedralGroup ( <NUM_LIT:2> ) <EOL> assert L . order ( ) == <NUM_LIT:4> <EOL> assert L . is_abelian is True <EOL> assert L . is_nilpotent is True <EOL> def test_AlternatingGroup ( ) : <EOL> G = AlternatingGroup ( <NUM_LIT:5> ) <EOL> elements = list ( G . generate ( ) ) <EOL> assert len ( elements ) == <NUM_LIT> <EOL> assert [ perm . is_even for perm in elements ] == [ True ] * <NUM_LIT> <EOL> H = AlternatingGroup ( <NUM_LIT:1> ) <EOL> assert H . order ( ) == <NUM_LIT:1> <EOL> L = AlternatingGroup ( <NUM_LIT:2> ) <EOL> assert L . order ( ) == <NUM_LIT:1> <EOL> def test_AbelianGroup ( ) : <EOL> A = AbelianGroup ( <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:3> ) <EOL> assert A . order ( ) == <NUM_LIT> <EOL> assert A . is_abelian is True </s>
