Skip to content

Commit

Permalink
Are Isomorphic
Browse files Browse the repository at this point in the history
  • Loading branch information
aidevnn committed Sep 27, 2022
1 parent c7e60fe commit 3b3a684
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# FuriousGenius
Small Groups study in Julia.

Small Groups study in Julia. The hard way.
6 changes: 6 additions & 0 deletions src/ConcreteGroup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,10 @@ function CayleyTable(g::CGroup)::Bool
end

return true
end

function AreIsomorphic(g1::CGroup, g2::CGroup)::Bool
orders1 = sort(collect(values(GetOrders(g1))))
orders2 = sort(collect(values(GetOrders(g2))))
return all(isequal.(orders1, orders2))
end
2 changes: 1 addition & 1 deletion src/FuriousGenius.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export GetElements, SetElements, GetMonogenics, SetMonogenics,

export Gp, Ep

export Generate, Monogenic, Generators, ElementOrder, IsAbelian, ConcreteGroup
export Generate, Monogenic, Generators, ElementOrder, IsAbelian, ConcreteGroup, AreIsomorphic

export CreateGroupByGenerators, DisplayElements, DisplayTable,
DisplayHead, DisplayHeadElements, DisplayHeadTable, DisplayDetails
Expand Down
22 changes: 22 additions & 0 deletions test/cgrouptest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,26 @@
@test length(GetElements(Q)) == 5
@test length(GetElements(G2)) == 10
end

@testset "Semi-direct Product" begin
s4 = Sn(4)
S3 = CreateGroupByGenerators(s4, s4([1, 2]), s4([1, 2, 3]))
@test length(GetElements(S3)) == 6
D8 = CreateGroupByGenerators(s4, s4([1, 2], [3, 4]), s4([1, 2, 3, 4]))
@test length(GetElements(D8)) == 8

z2 = Zn(2)
z3 = Zn(3)
z4 = Zn(4)
Z2 = CreateGroupByGenerators(z2, z2(1))
Z3 = CreateGroupByGenerators(z3, z3(1))
Z4 = CreateGroupByGenerators(z4, z4(1))
Z3sdpZ2 = CreateSemiDirectProduct(Z3, Z2)
@test length(GetElements(Z3sdpZ2)) == 6
Z4sdpZ2 = CreateSemiDirectProduct(Z4, Z2)
@test length(GetElements(Z4sdpZ2)) == 8

@test AreIsomorphic(S3, Z3sdpZ2)
@test AreIsomorphic(D8, Z4sdpZ2)
end
end

0 comments on commit 3b3a684

Please sign in to comment.