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

Weyl group optimizations #7754

Closed
nthiery opened this issue Dec 23, 2009 · 9 comments
Closed

Weyl group optimizations #7754

nthiery opened this issue Dec 23, 2009 · 9 comments

Comments

@nthiery
Copy link
Contributor

nthiery commented Dec 23, 2009

  • faster hash method calling the hash of the underlying matrix
    (which is set as immutable for that purpose)
  • new __eq__ method
  • action on the weight lattice realization:
    optimization of the matrix multiplication

Depends (trivially) on #7753

This indirectly improve most Weyl group routines:

Without the patch:

sage: W = WeylGroup(["F",4])
sage: W.cardinality()
1152
sage: time l=list(W)
CPU times: user 12.14 s, sys: 0.06 s, total: 12.20 s Wall time: 12.20 s

sage: W = WeylGroup(["E",8])
sage: time w0 = W.long_element()
CPU times: user 1.71 s, sys: 0.01 s, total: 1.72 s Wall time: 1.72 s

With the patch:

sage: W = WeylGroup(["F",4])
sage: W.cardinality()
1152
sage: time l=list(W)
CPU times: user 7.96 s, sys: 0.04 s, total: 8.00 s Wall time: 8.01 s

sage: W = WeylGroup(["E",8])
sage: time w0 = W.long_element()
CPU times: user 1.40 s, sys: 0.00 s, total: 1.41 s Wall time: 1.42 s

Honestly, this is still ridiculously slow; luckily there still is much room left for improvements by improved caching and optimizations of the underlying tools (CombinatorialFreeModules, ...).

CC: @dwbump

Component: combinatorics

Keywords: Weyl groups

Author: Nicolas M. Thiéry

Reviewer: Daniel Bump

Merged: sage-4.3.1.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/7754

@nthiery

This comment has been minimized.

@nthiery
Copy link
Contributor Author

nthiery commented Dec 23, 2009

comment:1

Attachment: trac_7754_weyl_group_optimizations-nt.patch.gz

@dwbump
Copy link
Mannequin

dwbump mannequin commented Jan 1, 2010

comment:2

I tested this patch without #7753. I tested it with and without the
patch in #7751.

It is a very substantial speedup. It cuts a few
seconds off sage -t weyl_groups.py but more importantly it about doubles the speed of computing the reduced word of a Weyl group element, which is the basis of most combinatorial algorithms.

There are three patch fragments, one replacing the hash method with the hash of the underlying matrix, one replacing the __eq__ method, and
one unraveling some unnecessary complexity in the Weyl group action. I tested each patch fragment separately and found that they are all speedups, the last one being very significant.

@dwbump dwbump mannequin added s: positive review and removed s: needs review labels Jan 1, 2010
@dwbump dwbump mannequin changed the title Weyl group optimizations Weyl group optimizations [with patch, positive review] Jan 1, 2010
@nthiery
Copy link
Contributor Author

nthiery commented Jan 3, 2010

comment:3

Thanks Dan for the review!

@nthiery nthiery added this to the sage-4.3.1 milestone Jan 3, 2010
@mwhansen
Copy link
Contributor

mwhansen commented Jan 3, 2010

Merged: sage-4.3.1.alpha0

@mwhansen mwhansen closed this as completed Jan 3, 2010
@sagetrac-mvngu sagetrac-mvngu mannequin changed the title Weyl group optimizations [with patch, positive review] Weyl group optimizations Jan 7, 2010
@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jan 12, 2010

comment:6

Replying to @dwbump:

It is a very substantial speed-up. It cuts a few
seconds off sage -t weyl_groups.py but more importantly it about doubles the speed of computing the reduced word of a Weyl group element, which is the basis of most combinatorial algorithms.

Hi Dan and Nicolas,

I'm doing a release tour of the features of this ticket, see the Sage wiki page. Is there some sample code I could use to show the speed-up implemented by this ticket?

@nthiery

This comment has been minimized.

@nthiery
Copy link
Contributor Author

nthiery commented Jan 12, 2010

comment:8

Hi Dan and Nicolas,

I'm doing a release tour of the features of this ticket, see the Sage wiki page. Is there some sample code I could use to show the speed-up implemented by this ticket?

Yup, see the updated description!

@nthiery

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants