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

Little optimizations in CombinatorialFreeModule #12528

Closed
nthiery opened this issue Feb 17, 2012 · 10 comments
Closed

Little optimizations in CombinatorialFreeModule #12528

nthiery opened this issue Feb 17, 2012 · 10 comments

Comments

@nthiery
Copy link
Contributor

nthiery commented Feb 17, 2012

With the attached optimizations, the following typical calculation from Andrew Matthas goes twice faster (it involves a lot of arithmetic on module elements with very few terms)::

    sage: W = SymmetricGroup(4)
    sage: W.cartan_type = lambda: CartanType("A3")
    sage: R=FractionField(PolynomialRing(ZZ,'x')); x=R.gen()
    sage: H=IwahoriHeckeAlgebraT(W,x,base_ring = R)
    sage: L=[H.one()];                   # define Jucys-Murphy elements
    sage: for k in xrange(1,4): L.append(H._q1**-1*H.algebra_generators()[k]*L[k-1]*H.algebra_generators()[k])

    sage: content=[0,1,-1,0]   # content vector for Tableau([[1,2],[3,4]])

    sage: %time prod( (L[k]-x**c)/(x**content[k]-x**c) for k in xrange(len(content)) for c in xrange(-k,k+1) if c<>content[k])
    CPU times: user 2.26 s, sys: 0.00 s, total: 2.27 s
    Wall time: 2.27 s

Was 4.5s before the patch.

The patch also involve two changes in the Iwahori Hecke Algebra code to use better primitives of CombinatorialFreeModule.

(trivial syntactical dependency upon #12484)

Depends on #12484

CC: @sagetrac-sage-combinat @jhpalmieri

Component: linear algebra

Author: Nicolas M. Thiéry

Reviewer: Florent Hivert, John Palmieri

Merged: sage-5.0.beta6

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

@nthiery
Copy link
Contributor Author

nthiery commented Feb 17, 2012

Dependencies: #12484

@nthiery

This comment has been minimized.

@nthiery
Copy link
Contributor Author

nthiery commented Feb 17, 2012

comment:3

The new patch fixes a (trivial?) doctest failure in sage.algebra/steenrod_algebra/steenrod_algebra.py (John, please double check it!), and includes further review improvements from Florent.

All test pass. I let Florent put the final positive review once John will have given his green light.

@nthiery
Copy link
Contributor Author

nthiery commented Feb 17, 2012

Reviewer: Florent Hivert, John Palmieri

@hivert
Copy link

hivert commented Feb 18, 2012

comment:4

Replying to @nthiery:

All test pass. I let Florent put the final positive review once John will have given his green light.

While we are waiting for John, can you add a proper commit message ? Jeroen will ask you to do so anyway...

@nthiery
Copy link
Contributor Author

nthiery commented Feb 18, 2012

@nthiery
Copy link
Contributor Author

nthiery commented Feb 18, 2012

comment:5

Replying to @hivert:

While we are waiting for John, can you add a proper commit message ? Jeroen will ask you to do so anyway...

Shoot, I was sure I had done it. Well, now its done :-)

@jhpalmieri
Copy link
Member

comment:6

The Steenrod algebra change looks fine to me.

@hivert
Copy link

hivert commented Feb 18, 2012

comment:7

Replying to @jhpalmieri:

The Steenrod algebra change looks fine to me.

Then it's good to go !

@jdemeyer
Copy link

Merged: sage-5.0.beta6

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

6 participants