diff --git a/src/DirectProducts.jl b/src/DirectProducts.jl index d1fb3a4..b907274 100644 --- a/src/DirectProducts.jl +++ b/src/DirectProducts.jl @@ -58,7 +58,10 @@ end # ############################################################################### -×(G::Group, H::Group) = DirectProductGroup([G,H]) +function ×(G::Group, H::Group) + G == H || throw("Direct products are defined only for the same groups") + return DirectProductGroup(G,2) +end ############################################################################### # @@ -66,8 +69,6 @@ end # ############################################################################### -(G::DirectProductGroup)() = G([H() for H in G.factors]) - (G::DirectProductGroup)(g::DirectProductGroupElem) = G(g.elts) doc"""