Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DirectProduct incorrectly adding identity #342

Closed
mtorpey opened this issue Jun 23, 2017 · 5 comments
Closed

DirectProduct incorrectly adding identity #342

mtorpey opened this issue Jun 23, 2017 · 5 comments
Assignees
Labels
bug Label for issues or PR which report or fix bugs

Comments

@mtorpey
Copy link
Collaborator

mtorpey commented Jun 23, 2017

DirectProduct is not behaving correctly. It appears to be appending the identity transformation when it shouldn't. Consider the following example (found by @ffloresbrito):

gap> S := Semigroup([Transformation([1, 2, 3, 3, 3])]);;
gap> CC := Semigroup([Transformation([2, 1])]);;
gap> Size(S); Size(CC);
1
2
gap> DP := DirectProduct(S, CC);;
gap> Elements(DP);
[ Transformation( [ 1, 2, 3, 3, 3 ] ), 
  Transformation( [ 1, 2, 3, 3, 3, 7, 6 ] ), IdentityTransformation, 
  Transformation( [ 1, 2, 3, 4, 5, 7, 6 ] ) ]
gap> Size(DP);
2

As you can see, the function seems to be treating S as though it contains IdentityTransformation, which it doesn't. Hence two extra elements are ending up in the direct product, even though the size is being calculated correctly.

While I was at it, I noticed that DirectProduct for semigroups is not documented, meaning that the only manual entry for it is in the GAP manual, where it just talks about groups. This should be rectified as well (I'll add it to Issue #298).

@mtorpey mtorpey added the bug Label for issues or PR which report or fix bugs label Jun 23, 2017
@james-d-mitchell
Copy link
Collaborator

Hmm, something is for sure not right here...

@ChrisJefferson
Copy link
Contributor

What was the error?

@james-d-mitchell
Copy link
Collaborator

Don't know but a semigroup of size 2 shouldn't have 4 elements

@james-d-mitchell james-d-mitchell self-assigned this Jun 29, 2017
@james-d-mitchell
Copy link
Collaborator

I've fixed this in PR #343

@mtorpey
Copy link
Collaborator Author

mtorpey commented Jun 30, 2017

Merged and fixed!

@mtorpey mtorpey closed this as completed Jun 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Label for issues or PR which report or fix bugs
Projects
None yet
Development

No branches or pull requests

3 participants