#19107: Do not count 4 times the same solution (up to rotations) in
QuantuminoSolver
-------------------------+-------------------------------------------------
Reporter: | Owner:
slabbe | Status: needs_review
Type: | Milestone: sage-6.9
enhancement | Resolution:
Priority: major | Merged in:
Component: | Reviewers:
combinatorics | Work issues:
Keywords: | Commit:
Authors: | 25ed836ab3fd20461bdfa509fdbb8e764c3458f7
Report Upstream: N/A | Stopgaps:
Branch: |
u/slabbe/19107 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by vdelecroix):
Salut,
This is bad
{{{
H = [h for h in G if all(i==j for (i,j) in
h.matrix().nonzero_positions())]
}}}
You are iterating through the whole group to get the subgroup of diagonal
matrices... but you know already what they are!
You can remove this line
{{{
assert MatrixGroup(H).cardinality() == len(H)
}}}
To build the cosets, you would better use something smarter
{{{#!python
G_set = set(G)
cosets = []
while G_set:
g = G_set.pop()
left_coset = sorted(h*g for h in H)
right_coset = sorted(g*h for h in H)
assert left_coset == right_coset # must be a normal subgroup
G_set.difference_update(left_coset)
cosets.append(left_coset)
}}}
There are some trailing whitespaces in ` _rows_modpi`
... more to come
--
Ticket URL: <http://trac.sagemath.org/ticket/19107#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.