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
Update a missing important speed improvement for subword complexes #20943
Comments
comment:1
I will provide code in a minute; any suggestions how to properly do get the number of reflections in the fastest way for |
comment:2
For Weyl groups, I get
and for Coxeter groups, I get
so I leave the current implementation for those (though this is not as clean as it should be). |
Branch: u/stumpc5/20943 |
comment:4
with the fix, I get
and without the fix, I get
For types E, it becomes obviously much worse. |
comment:5
I tried to push and to set the branch by hand, but I am not sure it actually worked... |
This comment has been minimized.
This comment has been minimized.
comment:7
Sorry, but I do not understand the logic of your change. What is this attribute One should also replace the default code for
that avoid to use rank. New commits:
|
Commit: |
comment:8
the doctests are missing the |
comment:9
Okay, I guess you are right. I should and will do it properly:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:12
ok. Looks much better. Have you re-done the timings to compare the new "number_of_reflections" |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:14
The timings should still be the old as the change
should not make any difference... (just checked, no change there). It would be better if we either do a speed improvement of the |
comment:15
But I think that should go into a different ticket. |
comment:16
Replying to @stumpc5:
ok, indeed. |
comment:17
An idea: why not make |
comment:18
That is now #20956. |
comment:19
Replying to @fchapoton:
Why not, we could also do that. Maybe that's even the "right" solution, as the caching doesn't take any memory while avoids recomputing a bigger computation again and again. |
comment:20
If you do not object, I would add this here to this ticket and make the other a duplicate. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:22
ok, then you can get rid of the attribute and the method in reflection_group_complex |
comment:23
Replying to @fchapoton:
Out of curiosity: is it faster to use a cached method, or to use an attribute? Or is that difference never important? |
comment:24
I do not know, sorry. I guess both are fast enough for our purposes, but we can aim |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:26
ok, let it be. |
Reviewer: Frédéric Chapoton |
comment:27
Replying to @fchapoton:
thanks! |
comment:28
Just FYI - calling a sage: class Foo(object):
....: def __init__(self, x):
....: self.x = x
....: self._y = x
....: @cached_method
....: def y(self):
....: return self._y
....:
sage: F = Foo(5)
sage: %timeit F.x
The slowest run took 73.41 times longer than the fastest. This could mean that an intermediate result is being cached.
10000000 loops, best of 3: 42.2 ns per loop
sage: %timeit F.y()
The slowest run took 2799.35 times longer than the fastest. This could mean that an intermediate result is being cached.
10000000 loops, best of 3: 57.1 ns per loop However, it is better code (IMO) to use the cached method mechanism, and it makes it easier to change/override it. |
Changed branch from u/stumpc5/20943 to |
The method
_flip_c
currently useswhich drastically slows down computations (here: the construction of cluster complexes using subword complexes through the greedy flip algorithm).
CC: @tscrim @fchapoton @nthiery
Component: combinatorics
Keywords: reflection group, coxeter group, subword complex, days80
Author: Christian Stump
Branch/Commit:
6f2172b
Reviewer: Frédéric Chapoton
Issue created by migration from https://trac.sagemath.org/ticket/20943
The text was updated successfully, but these errors were encountered: