Re: [sage-combinat-devel] git

2018-05-30 Thread Darij Grinberg
On Wed, May 30, 2018 at 11:46 AM, Bruce  wrote:
> I am still missing something basic. I now have one local branch.
> There was a second which I deleted (I hope that was safe.).
>
> At no point after the commit have I been able to see the files I have
> committed on
> my file system.

Then something weird must have happened. Is your one local branch in
sync with the remote branch "develop"?

If so, create a new branch called "path_tableaux" (or whatever else
you want to call it) by
"git checkout -b path_tableaux".
This automatically moves you onto that branch. Now, call
"git pull trac u/Bruce/path_tableaux"
to get your files home.

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] git

2018-05-30 Thread Darij Grinberg
Hi Bruce,

On Wed, May 30, 2018 at 10:19 AM, Bruce  wrote:
> I think I have my branches sorted out. However I still don't see
> any of the three files I committed in my local system.

Then you are perhaps on the wrong branch currently. You can switch
branches (provided that you don't have uncommitted/unstaged changes)
by using "git checkout [the branch you want to switch to]".

>> > Third, moving forward, could someone please tell me the
>> > correct usage of git commit and git push commands?
>
>
> Yes, I understand how to use git add and git commit locally.
> I am not confident about working with a remote branch.

Ah, I forgot about git push. So "git push trac [local branch]:[remote
branch]" pushes your local branch to a remote branch on the trac
server. In your case, [remote branch] is "u/Bruce/path_tableaux", so
you should do "git push trac [local branch]:u/Bruce/path_tableaux".

There are shortcuts for this, but I never habituated myself to them.

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] git

2018-05-29 Thread Darij Grinberg
Hi Bruce,

On Tue, May 29, 2018 at 10:34 PM, Bruce  wrote:
> I have opened a ticket #25434. I believe I have commited three files.
> However, I think I have more than one branch and that all but one
> have nothing on them. If this is a situation it is a mess. I want
> to work on this but I am nervous about making the situation worse.
>
> First, could someone please confirm that the three files,
> pathtableaux.py, catalan.py, semistandard.py are present?

The ticket looks right: The branch you've submitted (which is known as
u/Bruce/path_tableaux on the trac server) indeed has the three files
you've mentioned.

(This is not to say anything about the content of the files -- one
thing they clearly need is documentation defining the object they're
meant to model. Also, I wouldn't put them in combinat/ but rather in
combinat/path_tableaux/ or some subfolder like that, as otherwise
their names are too general.)

> Second, could someone tell me the name of the branch I
> should be using

You mean the local branch (i.e., the branch on your machine) or the
remote branch (i.e., u/Bruce/path_tableaux)? The latter you've gotten
right already. The former doesn't matter -- call it whatever you want.
Well, almost; the name occasionally is reflected in merge commits, so
you don't want it to be too obscene...

> and tell me how to get rid of any others?

"git branch -D [branch name]" deletes a local branch. "git push trac
:[branch name]" deletes a remote branch, provided that the remote
server is known to your git installation as "trac" (which I think it
is, if you followed the git-the-hard-way instructions).

Also, this is occasionally useful:
https://stackoverflow.com/questions/6127328/how-can-i-delete-all-git-branches-which-have-been-merged

> Third, moving forward, could someone please tell me the
> correct usage of git commit and git push commands?

"git commit" commits all files that have been staged (i.e., added
using "git add"). It asks you for a commit message. Alternatively, you
can say "git commit -m '[commit message]'" to give the message right
away (if the message fits in one line).

Of course, we often prefer not to manually add files. So "git commit
-a" is like "git commit", except that it also stages (= adds) files
that it's aware of (a.k.a. files that have already been created in
earlier commits, and merely modified since then). But it doesn't add
files that you have just created; you still need to add them yourself.
"git add [file name]" does the trick. I suspect you know this, though,
as you have successfully committed 3 new files.

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] Re: CombinatorialFreeModule relies on implementation details of elements

2015-08-26 Thread Darij Grinberg
Hi,

just wanted to mention that Travis has started a ticket on this a while ago:
http://trac.sagemath.org/ticket/18066
IMHO we really need to do some proper OOP here, with contracts and
abstract methods, if we want people to keep adding combinatorial Hopf
algebras and the likes to Sage without having to bug Nicolas for
private lessons. This is also important for tickets like
http://trac.sagemath.org/ticket/17096 where I'm trying to figure out
what methods we can rely on a ModuleWithBasis to have.

  Best regards,
  Darij

On Wed, Aug 26, 2015 at 4:46 PM, Simon King simon.k...@uni-jena.de wrote:
 Hi Nicolas,

 On 2015-08-26, Nicolas M. Thiery nicolas.thi...@u-psud.fr wrote:
 So far CombinatorialFreeModule has been meant as a concrete
 implementation of a ModulesWithBasis, with a specific data structure
 for its elements.

 Seriously? Then please do
   grep CombinatorialFreeModule) -R src/sage
 and
   grep CombinatorialFreeModule, -R src/sage
 and you will see how many classes are derived from CombinatorialFreeModule.

 So, the reality seems to be that people consider CombinatorialFreeModule as a
 base class.

 In this context, generic methods that don't depend
 on the data structure should be in ModulesWithBasis and the others
 should be in CombinatorialFreeModule. And your parent would just be in
 ModulesWithBasis, without inheriting from CombinatorialFreeModule.

 If CombinatorialFreeModule would officially be recognised in its current
 rôle (i.e., as a parent base class), then the approach should be to cythonise
 it, so that all the operations on the elements that use code provided by
 the parent base class get a decent speed, and additionally the code provided
 by the parent base class should not rely on a specific implementation of an
 element class.

 I see two reasons why this latter point could be annoying:

 ...

 - There is code in CombinatorialFreeModule that does not depend on the
   data structure of the elements but can't be easily moved up to the
   category. Typically initialization code (category, base ring,
   customization of the string rep of elements, ...)

 Customisation of the string rep of elements should be the job of a base
 class for elements, relying on a public API of the parent. But please
 let this element base class by cythoned, because speed and cdef
 attributes typically matter for elements.

   Maybe this is calling for an additional class above
   CombinatorialFreeModule that would factor out this code? This would
   be similar in flavor to the Adapter Classes pattern in java (see
   http://stackoverflow.com/a/10170811). Note that this is already
   partially done by the IndexedGenerators class.

 If the code in the methods of CombinatorialFreeModule would not rely on
 implementation details (i.e., underscore attributes) of
 CombinatorialFreeModule.Element but on proper methods (that may very well
 be required abstract methods), then we wouldn't need an adapter.

 So, in short, it is convenient that CombinatorialFreeModule comes with
 CombinatorialFreeModule.Element, so that it is fairly easy to create a
 new combinatorial free module. However, it would be more convenient to
 allow for freedom in the implementation of its elements.

 Best regards,
 Simon


 --
 You received this message because you are subscribed to the Google Groups 
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-combinat-devel] Re: problems with hash for tableaux

2015-08-19 Thread Darij Grinberg
Hi Anne,

On Wed, Aug 19, 2015 at 12:23 PM, Anne Schilling a...@math.ucdavis.edu wrote:
 Nicolas and I just did some experiments with Sage and stumbled upon the
 following:

 sage: t = StandardTableaux([3,2,1]).an_element()
 sage: tt = Tableau(t[:])
 sage: t == tt
 True
 sage: hash(t) == hash(tt)
 False

Good catch! This is http://trac.sagemath.org/ticket/19055#ticket now.

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] weird behavior under combining remove and for loop

2015-06-28 Thread Darij Grinberg
On Sun, Jun 28, 2015 at 12:05 PM, Nicolas Borie pout...@gmail.com wrote:
 i is a free variable and exist in a single piece of memory...

Gods. This is worse than I thought...

The only reason why this doesn't happen for, say, L = [2**i for i in
range(5)], is that 2**i is eagerly evaluated, I guess?

 What about this one :
 True is False
 False
 False is False
 True
 True is False is False
 False
 (True is False) is False
 True
 True is (False is False)
 True

 This last one is easy but still tricky the first time you see it...

This one I actually find pretty reasonable.

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: Copying installations on SMC (was: [sage-combinat-devel] Sage Days 65 mini report)

2015-06-13 Thread Darij Grinberg
Hi Franco,

thank you! I'm trying to follow the instructions now.

Step 3: maybe explain how to tell when the copying is complete? I
think it took more than 3min for me (I used du -s to check on it).

Step 4:
IOError: [Errno 122] Disk quota exceeded

What should I do?

  Best regards,
  Darij

On Sat, Jun 13, 2015 at 4:33 PM, Franco Saliola sali...@gmail.com wrote:


 On Saturday, June 13, 2015 at 6:15:44 AM UTC-5, Darij Grinberg wrote:

 Hi Anne,

 On Sat, Jun 13, 2015 at 3:13 AM, Anne Schilling an...@math.ucdavis.edu
 wrote:
  The SageMathCloud was great for those who had trouble installing Sage on
  their own computer. Sometimes we had connection issues to the SMC (the 
  wheel
  was just spinning). Franco gave a nice talk on how to copy the latest
  version onto one's own Sage developer project. That saves to actually run
  the install (so Darij, your complaints are not really valid since copying
  only takes a few minutes).

 This could simplify my life a lot! Is there a tutorial on this somewhere?


 I posted something on the SMC wiki (with a link to it in the FAQ). It is the
 result of a few iterations of the process.


 https://github.com/sagemathinc/smc/wiki/SageMath-Development-on-SageMathCloud

 I've used this for a few reviews now from start to finish. It works quite
 well. Coupled with the fact that you can ssh into a project (not necessary,
 but I find it useful), I'm very happy with this on my 6 year old laptop.
 This even works well on Chromebooks.

 A big thanks to William for SMC and upgrading accounts for development, and
 thanks to Rob Beezer for maintaining the Sage Development Images public
 project.

 Franco

 --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] Re: Copying installations on SMC

2015-06-13 Thread Darij Grinberg
Hi Anne,

ah, this got updated while I wasn't looking :) Thanks for the reminder!

  Best regards,
  Darij

On Sat, Jun 13, 2015 at 5:58 PM, Anne Schilling a...@math.ucdavis.edu wrote:
 Hi Darij,

 Step 3: maybe explain how to tell when the copying is complete? I
 think it took more than 3min for me (I used du -s to check on it).

 Step 4:
 IOError: [Errno 122] Disk quota exceeded

 What should I do?

 Perhaps you skipped Step 1??

 1. Open the SMC project that you intend to use for development, or create a 
 new project. Send an email with THE LINK TO YOUR PROJECT (under Settings) to 
 h...@sagemath.com and say that you are using
 this project for legit Sage development. Wait for the reply before 
 continuing. You MUST DO THIS SINCE DEFAULT PROJECTS DO NOT HAVE SUFFICIENT 
 DISK SPACE.

 Best,

 Anne

 --
 You received this message because you are subscribed to the Google Groups 
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] Re: Copying installations on SMC

2015-06-13 Thread Darij Grinberg
Hi,

thanks to both of you for your help on step 3, but I've got another
problem on step 4 now:

~/sage-dev-images/sage-6.8.beta3$ git trac config --user darij --pass [redacted]
Saved trac username.
Saved trac password.
Trac xmlrpc URL:
http://trac.sagemath.org/xmlrpc (anonymous)
http://trac.sagemath.org/login/xmlrpc (authenticated)
realm sage.math.washington.edu
Username: darij
Password: [redacted]
Retrieving SSH keys...
2048 36:4d:d2:0b:a6:04:cc:81:7b:6c:1d:4d:96:bb:ab:25 /tmp/tmpL7uXNr (RSA)
2048 a7:ae:0b:32:5f:0a:fe:56:31:f5:78:60:a9:d8:cc:73 /tmp/tmpL7uXNr (RSA)
2048 cc:e7:fe:32:17:32:a1:c3:e0:1d:40:8e:ed:55:5f:84 /tmp/tmpL7uXNr (RSA)
2048 ae:3a:a6:d6:7c:3f:d5:53:ed:a0:f8:90:6e:c4:68:5e /tmp/tmpL7uXNr (RSA)
line 1 too long: ssh-rsa B3NzaC1yc2EDAQABAAABAQCo...
Traceback (most recent call last):
  File /usr/local/bin/git-trac, line 18, in module
cmdline.launch()
  File /usr/local/lib/python2.7/dist-packages/git_trac/cmdline.py,
line 252, in launch
app.print_config()
  File /usr/local/lib/python2.7/dist-packages/git_trac/app.py, line
344, in print_config
for key in self.trac.get_ssh_fingerprints():
  File /usr/local/lib/python2.7/dist-packages/git_trac/trac_server.py,
line 91, in get_ssh_fingerprints
out = subprocess.check_output(['ssh-keygen', '-lf', tmp])
  File /usr/lib/python2.7/subprocess.py, line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['ssh-keygen', '-lf',
'/tmp/tmpL7uXNr']' returned non-zero exit status 1

The too long line unfortunately is precisely the key from the SMC
project. It is the last key on trac; see
https://dl.dropboxusercontent.com/u/83265276/bugs/smc-trac-pubs.txt .
Do you have an idea what could have gone wrong there, and is there
some lesson to be learnt that is worth adding into the tutorials?
Invisible whitespaces? Windows vs. Linux newlines?

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] Re: Copying installations on SMC

2015-06-13 Thread Darij Grinberg
On Sat, Jun 13, 2015 at 8:08 PM, Volker Braun vbraun.n...@gmail.com wrote:
 The last public key is invalid, there is no space to set off the comment
 from the b64'ed key.

Ah, thank you! I was overzealous in deleting whitespaces that came
from the copypasting.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] Sage Days 65 mini report

2015-06-12 Thread Darij Grinberg
On Sat, Jun 13, 2015 at 1:26 AM, William Stein wst...@gmail.com wrote:
 This is a bummer.  It gives me even more motivation to make
 SageMathCloud Sage-developer friendly.I'm also curious if anybody
 has any -- possibly *radical* -- suggestions about how to address this
 problem using new ideas.

+1 for a friendlier SMC; I definitely wouldn't mind it not falling
asleep on compile :)

If you are asking for ideas, I'm wondering: how hard would it be to
give the user better information and better options in the case when a
Sage install fails due to a package? In many cases the actual errors
are laughable and the packages far from crucial; particularly optional
packages shouldn't be causing a build to break! I don't know how
flexible makefiles are, but I would love it to wrap the installation
of a package in a way like this:
- If the package installs fine, do nothing extra.
- If it does not, add a clear error at the end of the log, naming the
package and the version. Name the other packages which depend on the
one that didn't install. Tell the user how to sidestep the
installation of the package (at their own risk). Mention the email
addresses of the people that should care about the problem (package
maintainer, build manager, sagedevel?) and what to send them.
- Allow the user to pull an older version of the package.

Would this be difficult?

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] Re: map_coefficients factor

2015-04-18 Thread Darij Grinberg
On Sat, Apr 18, 2015 at 7:04 AM, Mike Zabrocki mike.zabro...@gmail.com
wrote:

 Let me give you another example of how I think Sage is not good at being a
 CAS:
 sage: (q,t)=QQ['q','t'].fraction_field().gens()
 sage: a = (-q^5)/(-t^3)
 sage: expand(a)
 (-q^5)/(-t^3)
 sage: simplify(a)
 (-q^5)/(-t^3)

 How do I get Sage to realize the output is not right?


This is #15470 ( http://trac.sagemath.org/ticket/15470 ). I must say I
understand the logic behind it -- cancelling polynomials should not require
cancelling elements of their base ring, as the latter might be impossible
or not implemented --, but I would be happy to see a function which deep
cancels a fraction.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] Re: Order of Partitions()

2015-03-18 Thread Darij Grinberg
Hi,

please don't make a distinction based on the n being less than 15! That
would make a really bad pitfall.

  Best regards,
  Darij

On Wed, Mar 18, 2015 at 6:28 AM, Viviane Pons p...@univ-mlv.fr wrote:



 2015-03-18 12:40 GMT+01:00 Mike Zabrocki mike.zabro...@gmail.com:

 That would make sense.  My preference is that (at least for values less
 than 15) the default is that the output is sorted and this can be
 controlled by the optional parameter.

 I think about how many times that I test symmetric function identities on
 partitions and realize that patterns that indicate a relation to dominance
 order will be a lot less clear if the order is not something natural.  I
 wouldn't want the interface to be too complicated, but the more I think
 about it the more I realize that my personal use of partitions is very
 dependent on this order.


 I would tend to agree with you. The order wasn't documented but I'm pretty
 sure many people writing some personal code using partitions still rely on
 the order somehow. I feel a good choice would be to give the nice order
 by default and some parameter to obtain the optimized one.




 On Wednesday, 18 March 2015 04:20:15 UTC-4, Samuel Lelievre wrote:

 Nathann Cohen wrote:

 Hello,

  I think that Partitions should be output in either lex (or possibly
 reverse
  lex) since this order is compatible with dominance order.

 I only want to bring to your attention that deciding in which order
 the partitions should be returned is not free in terms of
 computational time.

 The current implementation returns them in lex order, but returns
 *many* wrong answers too (see #17548).

 In order to fix that, Jeroen is re-implementing this feature through a
 routine that enumerates the integer points of a polytope (see #17920),
 probably without any control over the order in which they are
 returned.

 Thus, in order for Partition/Composition to return them in a specific
 order we must list them *all* before returning the first of them. This
 can really mean hours (or no results at all) instead of seconds on big
 instances.


 So would it make sense to have an optional parameter sorted=None,
 which one could set to 'lex' or 'revlex' to get them in a desired order.
 The documentation could warn about the issues you just raised.

  --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com
 .
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] Tutte polynomial error?

2015-02-21 Thread Darij Grinberg
Hi Sam and everyone,

thanks @Sam for bringing this up. src/sage/graphs/tutte_polynomial.py has
been scaring me for some time and I hope this will lead to its becoming
better.

One thing that goes wrong in your example (but I am unsure if it is the
main issue!) is this:

sage: G = Graph();
sage: G.allow_multiple_edges(True);
sage: #edges are (u,v,l), where (u,v) is the edge and l is the label, which
determines edge order
sage:
G.add_edges([(0,1,1),(1,5,2),(5,3,3),(5,2,4),(2,4,5),(0,2,6),(0,3,7),(0,4,8),(0,5,9)]);
sage: g = G.tutte_polynomial();
sage: G.edges()
[(0, 1, 1),
 (0, 2, 6),
 (0, 3, 7),
 (0, 4, 8),
 (0, 5, 9),
 (1, 5, 2),
 (2, 4, 5),
 (2, 5, 4),
 (3, 5, 3)]
sage: with removed_edge(G, (1,5)):
show(G)
:
sage: G.edges()
[(0, 1, 1),
 (0, 2, 6),
 (0, 3, 7),
 (0, 4, 8),
 (0, 5, 9),
 (1, 5, None),
 (2, 4, 5),
 (2, 5, 4),
 (3, 5, 3)]

The removed_edge context manager was supposed to either re-insert the
removed edge upon finishing, or not removing it in the original G to begin
with. From what we see, it has *tried* to re-insert it, but it forgot the
label. This is doubly strange because the contract_edge context manager
in the same file is well aware of labels.

I am not sure if this explains the bug, however.

  Best regards,
  Darij

On Sat, Feb 21, 2015 at 5:09 PM, Sam Hopkins samuelfhopk...@gmail.com
wrote:

 I believe there must be some error in the code that implements the Tutte
 polynomial of a graph in Sage. For example, the code

 G = Graph();
 G.allow_multiple_edges(True);
 #edges are (u,v,l), where (u,v) is the edge and l is the label, which
 determines edge order

 G.add_edges([(0,1,1),(1,5,2),(5,3,3),(5,2,4),(2,4,5),(0,2,6),(0,3,7),(0,4,8),(0,5,9)]);
 g = G.tutte_polynomial();
 print g(1,1);
 print G.spanning_trees_count();

 produces

 T(1,1): 60 Number of spanning trees: 52

 But of course T_G(1,1) should be equal to the number of spanning trees.
 And I am tending to believe that the error is with the Tutte polynomial
 computation and not the second spanning_trees_count() method.

 --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] Product of schur functions/schur positivity

2014-07-18 Thread Darij Grinberg
Hi Sam,

I don't use Sage Notebook, but both my own sage install and the cell
server show True as the result. I suspect this is the right answer.

There have been updates to symmetric functions in the recent history
of Sage, particularly #16560: http://trac.sagemath.org/ticket/16560 .
If your Sage Notebook is older than 8 months, it might be a case of
#15397 as well: http://trac.sagemath.org/ticket/15397

  Best regards,
  Darij

On Fri, Jul 18, 2014 at 8:53 PM, Sam Hopkins samuelfhopk...@gmail.com wrote:
 Hi all,

 (First time posting to these forums)

 Sage is giving me inconsistent results about the Schur positivity of a
 certain expression involving products of Schur functions. In the Sage Cloud,
 I type:

 s = SymmetricFunctions(QQ).schur()
 (s([8, 6, 5, 4, 3, 3, 1])*s([8, 7, 5, 3, 3, 2, 1]) - s([9, 6, 6, 5, 4, 3,
 1])*s([7, 7, 4, 2, 2, 2, 1])).is_schur_positive()

 and get output: True

 But in the Sage Notebook running on my own computer I type:

 s = SymmetricFunctions(QQ).schur()
 (s([8, 6, 5, 4, 3, 3, 1])*s([8, 7, 5, 3, 3, 2, 1]) - s([9, 6, 6, 5, 4, 3,
 1])*s([7, 7, 4, 2, 2, 2, 1])).is_schur_positive()

 and get output: False

 I guess this could just be the result of the fact that this procedure is
 memory intensive and the result on the Notebook is slower so I am inclined
 to believe it is the one that is incorrect. Do you know which result I
 should trust? The computation in question is very relevant to a conjecture
 about general conditions for an expression of this form to be Schur
 positive.

 Thanks a lot,
 Sam Hopkins

 --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] Re: sum(Composition([1,2,3])) # broken

2014-05-20 Thread Darij Grinberg
Hi,

sorry, guys; I woke up to 20 replies and I probably need to catch up
first, but as I need to catch a plane, let me throw in my 2 cents now.

Can we make Composition.sum() a classmethod rather than a
staticmethod? I don't understand why it is not currently a
classmethod. This isn't sane:

sage: Composition([1,2]).sum([Composition([3]),Composition([4])])
[3, 4]

This is not to say that Sage's overriding of sum() (the global
function, not the Composition method) is good craftsmanship. This
piece of code in sage/misc/functional.py:

if hasattr(expression, 'sum'):
return expression.sum(*args, **kwds)

is basically a heuristic. There should be no heuristics involved in a
sum method.

What again is the difference between Python's add() and Python's sum()
? Or is add() a Sage alias for sum() ? And how exactly does overriding
__add__ sabotage coercion? By not letting the return value be coerced
into the right class? If so, this might be intended. At least on
partitions, there are many operations which explicitly should not cast
their return value into the same subclass their input values came
from; I imagine the same making sense on compositions (the
concatenation of two compositions-of-length-less-or-equal-3 needs not
be a such).

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] Re: sum(Composition([1,2,3])) # broken

2014-05-19 Thread Darij Grinberg
Hi,

See also http://trac.sagemath.org/ticket/15163 .

  Best regards,
  Darij

On Mon, May 19, 2014 at 12:01 PM, Simon King simon.k...@uni-jena.de wrote:
 Hi Nicolas,

 On 2014-05-19, Nicolas M. Thiery nicolas.thi...@u-psud.fr wrote:
 That being said, since Composition seems to be the single
 combinatorial object having a sum method, we could think of renaming
 it to something more appropriate that would not conflict with Sage's
 sum syntax and semantic. What's the syntax for n-ary concatenation of
 words?

 Multiplication? I always think of words as elements of a free group, of
 course multiplicatively written. Hence, concatenation of words w1,...,wn
 would be prod([w1,w2,...,wn]).

 Best regards,
 Simon


 --
 You received this message because you are subscribed to the Google Groups 
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] trac's automerging failed

2014-03-25 Thread Darij Grinberg
Hi Vit,

I just answered on trac. Basically, your branch had a conflict with
the new develop version of sage because both you and someone else made
(different) edits to the same chunk of code. This asks for a manual
merge. You can still pull the branch from trac and then merge it
locally, but I've done that in this particular ticket. You should
still make sure that everything makes sense, because I don't have much
of an idea about what the patch is doing.

  Best regards,
  Darij

On Tue, Mar 25, 2014 at 6:39 PM, Vít Tuček vit.tu...@gmail.com wrote:
 Hi!

  I am working on ticket #15272 and the branch I've created is red, there's
 no cummulative patch and mouseover information says trac's automerging
 failed

 What is wrong and how do I fix it?

 Also the patch is basically finished and the only missing things are some
 doctests. Could somebody take a look and tell me whether it is acceptable?

 Best regards,
   Vit

 --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-combinat-devel] expanding in symmetric functions (revisited)

2014-03-04 Thread Darij Grinberg
Hi Mark,

 Someone correct me if I am ignorant, but
 even after fixing syntax errors, the problem will be that multivariate 
 polynomials
 don't know when they are divisible by things like x_i - x_j.

Really?

sage: P
Multivariate Polynomial Ring in x, y over Rational Field
sage: P.inject_variables()
Defining x, y
sage: (x^3-y^3)/(x-y)
x^2 + x*y + y^2
sage: parent((x^3-y^3)/(x-y))
Fraction Field of Multivariate Polynomial Ring in x, y over Rational Field
sage: P((x^3-y^3)/(x-y))   # this wqill actually be a polynomial
x^2 + x*y + y^2
sage: Q = PowerSeriesRing(QQ, 'x,y')
sage: Q.inject_variables()
Defining x, y
sage: Q((x^3-y^3)/(x-y))
/scratch/sage-6.1.1/local/lib/python2.7/site-packages/sage/rings/multi_power_series_ring_element.py:541:

Warning: Comparison of power series may be wrong if certain
coefficients are zero. The padded_list method can be used to give
correct comparisons.
This issue is being tracked at http://trac.sagemath.org/sage_trac/ticket/9457.

x^2 + x*y + y^2 + O(x, y)^11

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Computing the action of S_n over standard Tableaux

2014-02-17 Thread Darij Grinberg
Hi,

I'm highly in favor of adding more meat to the representations of the
Specht modules in Sage. Currently, the way I understand them, they're
but a container for matrices.

There is a Modules(R) in Sage, but it seems to be tailored for
commutative rings. Can we use it for noncommutative R?

  Best regards,
  Darij

On Mon, Feb 17, 2014 at 12:30 PM, Nicolas Borie
nicolas.bo...@univ-mlv.fr wrote:
 Second answers on myself,

 Does the catgeory guys already think the possibility or utility to define
 the category of :

 Representations( ring )

 Whose Parents belonging to this catgeory would be a king of meet (think meet
 in terms of category construction) between :

 A set with an action
 A modules with basis over the ring whose keys form the set with the defined
 action

 Perhaps that is not very relevant or we do not have currently enough
 use-cases to design that...


 Cheers,
 Nicolas B.

 --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Le diagrams and permutation tableaux

2014-02-05 Thread Darij Grinberg
Hi Christian,

On Wed, Feb 5, 2014 at 4:15 PM, Christian Stump
christian.st...@gmail.com wrote:
 Thanks for your comments, Darij! My impression is that I also do not quite
 answer to your mail:

 What I would like to have:

 Given a partition \lambda (or something more general, even a BadShape
 without knowing what that is), I would like a class of all Le diagrams of

What I call bad shape (I do think the terminology comes from James,
Peel and related authors, although I'm not sure anymore) is just a
subset of {1,2,3,...} x {1,2,3,...}.

 shape \lambda. I.e., a class that mimics the behaviour of all 0/1 fillings
 of \lambda satisfying an additional property (if the shape is something more
 general than a partition, than I obviously want this property to be
 well-defined). Call such a filling of \lambda Le filling.

 As a set, such fillings should thus be a subset of BadShapeFilling and
 inherit say the drawing, repr, latex methods.

 Then, I want a containment test: easy to check, and an iterator: more
 difficult, I wouldn't have any non-brute-force idea currently (but I don't
 know the literature on Le diagrams...)

 Finally, I want a class PermutationTableaux with parameters n and k
 mimicking the set of all Le fillings of shapes of partitions fitting inside
 the rectangle k x (n-k), again with easy containment test and probably
 harder iterator.

 @Darij How would that fit your framework?

With some force, it would. The way I understood, Postnikov defines
Le-tableaux as fillings(!) of the cells filled with 1's in a
Le-diagram. From this perspective, Le-diagrams should be regarded as
shapes, not as fillings. On the other hand, you regard them as
fillings (with 0's and 1's). I fear the answer will have to be two
distinct classes for Le diagrams.

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Le diagrams and permutation tableaux

2014-02-04 Thread Darij Grinberg
Hi Christian,

I fear I'm going to derail this a bit but I actually care about
hearing answers to these questions...

The way you speak of Le-diagrams, they are fillings of partitions with
0's and 1's. But from a quick look at Postnikov's paper, it seems that
they are better regarded as subsets of partition shapes, because there
are also Le-tableaux, and *those* are *really* fillings, and it would
be very confusing to have a filling of a filling. This makes me wonder
whether the ambient partition shape is really important, and how
these diagrams should be implemented.

Months ago we (Nicolas, Anne, me) started planning a rewrite of the
Tableaux class hierarchy to allow for fillings of arbitrary shapes
(something like: Partition inherits from SkewPartition inherits from
BadShape, and Tableau inherits from SkewTableau inherits from
BadShapeFilling); however I have yet to write an actual line of code
for this. (Apart from my laziness and technical issues that are over
my head, a reason for this is that the fillings I need to study are
not even bad shape fillings; they are cylindric tableaux and I have no
idea how to fit them into the hierarchy.) The way I understand you,
Le-diagrams could inherit from BadShape (but have the additional
information of the ambient tableau), and so could Rothe diagrams,
column-convex diagrams, %-avoiding shapes etc. (but these are probably
best encoded just as bad shapes with nice properties rather than as
extra classes).

What do you think?

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Russian

2014-01-18 Thread Darij Grinberg
Hi,

On Sat, Jan 18, 2014 at 4:04 AM, William Stein wst...@gmail.com wrote:
  - Combinatorics: tableau - I'm wondering if I should translate it
 generically as 'table' (which is a term in Russian combinatorics) or
 is it something more specific - maybe if you gave more of a
 description I could figure it out.

I'm seeing both табло and таблица, but it seems that the latter is
more widespread (e. g., used by Jucys of Young-Jucys-Murphy fame:
www.mathnet.ru/mzm6519 ).

  - Combinatorics: word - is that a special term or does it literally
 mean 'word'?

Just слово.

  - Combinatorics: root system - IDK. Which area of combinatorics is
 it related to?

http://ru.wikipedia.org/wiki/%D0%A1%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%B0_%D0%BA%D0%BE%D1%80%D0%BD%D0%B5%D0%B9
says систе́ма корне́й (корнева́я систе́ма). Dynkin himself uses
система корней for the root system of a Lie algebra. For a root
system existing in isolation, he says (П)-система, but I have never
seen that notion ever since.

  - Combinatorics: crystals - I'm assuming this literally means
 'crystals' and is related to physical structures.

No idea about this...
BTW I am not very convinced about physical meaning (in this subject,
not even the word quantum tends to come from physics), although Anne
probably can say more about this than I ever could.

  - Lattice polytope - IDK. Tried to google different things in Russian
 but didn't get anything meaningful.

I'd translate lattice as целочисленный, but care should be taken
about polytope -- the meaning of this and of polyhedron are often
switched even within one language. Context is important here.

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Russian

2014-01-18 Thread Darij Grinberg
On Sun, Jan 19, 2014 at 2:32 AM, Anne Schilling a...@math.ucdavis.edu wrote:
 Yes, it does! The quantized universal enveloping algebra U_q(g) contains a 
 parameter
 q, which is related to the temperature in 2-dimensional solvable models.
 Crystal bases are bases in the limit q-0, so in fact correspond to absolute 
 temperature
 zero. This explains the name crystal since everything crystalizes at zero 
 temperature.

Nice! I can confirm the translation кристалл, by the way; it appears
in the Russian original of Danilov-Koshevoi's Arrays and the
combinatorics of Young tableaux.

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Re: About Free Algebras, infinite Words and equality

2014-01-05 Thread Darij Grinberg
Hi Nathann,

You are right. Infinite words don't belong into an algebra; you cannot
multiply them. Barring hack reasons, the change is correct.

  Best regards,
  Darij

On Sun, Jan 5, 2014 at 3:32 PM, Nathann Cohen nathann.co...@gmail.com wrote:
 Or possibly : you know that your algebras can break at any moment if you
 play with the wrong words, but you want to be able to define this anyway
 when you know what you are doing ?...

 Nathann


 On Sunday, January 5, 2014 3:30:40 PM UTC+1, Nathann Cohen wrote:

 Hello everybody !!

 Because of broken doctests in #12867, I find myself opening the file
 sage/categories/examples/algebras_with_basis.py, and about to do something
 potentially  big.

 I am about to remplace this
 CombinatorialFreeModule.__init__(self, R, Words(alphabet), category =
 AlgebrasWithBasis(R))

 By this:
 CombinatorialFreeModule.__init__(self, R, Words(alphabet, infinite=False),
 category = AlgebrasWithBasis(R))

 And I would like to know what you think of it. Because I wondered : can
 you really define (in Sage) an algebra over (Finite+Infinite) Words, given
 that you cannot even check whether two infinite words are ... equal ?

 This is my problem. And if there is no reason to create (in Sage) an
 algebra over infiinite words, my problem is settled :-P

 Tell me what you think !

 Nathann

 --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Re: About Free Algebras, infinite Words and equality

2014-01-05 Thread Darij Grinberg
Oops, I've just realized that you *can* multiply infinite words,
though I'm not sure if this has ever been used. (No, you cannot take
their shuffle product.)

On Sun, Jan 5, 2014 at 4:29 PM, Nathann Cohen nathann.co...@gmail.com wrote:
 Okay, I just created an element manually instead of calling an_element().

 Nathann


 On 5 January 2014 15:59, Nathann Cohen nathann.co...@gmail.com wrote:

 You are right. Infinite words don't belong into an algebra; you cannot
 multiply them. Barring hack reasons, the change is correct.


 HMmm... And what do you think of Shuffle Algebras on infinite words ? Is
 this one correct or not ?

 It looks okay to me.. But if you tell me that it is not for yet another
 reason it will make my debugging *much* easier :-P

 Nathann

 --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-combinat-devel group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-combinat-devel/zdN44XJZu5s/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 sage-combinat-devel+unsubscr...@googlegroups.com.

 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/groups/opt_out.


 --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Re: About Free Algebras, infinite Words and equality

2014-01-05 Thread Darij Grinberg
On Sun, Jan 5, 2014 at 5:54 PM, Vincent Delecroix
20100.delecr...@gmail.com wrote:
 How do you define multiplication ?! If it is concatenation then uv = u...

Yes, but it's associative, so it works... (Except I don't expect it to
have much of a use.)

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Dear Poset Users, tell me what you like

2013-12-30 Thread Darij Grinberg
Hi Nathann,

I certainly can recall dealing with lots and lots of small posets
(typical for algebraic combinatorics: your combinatorial objects are
small, but you are often considering all of them at once because you
are talking formal linear combinations of them and likewise). I also
have dealt with medium-size posets (30 to 40 vertices), but in those
cases I don't think the comparisons were much of a bottleneck. I don't
recall ever dealing with huge posets (as in thousands of vertices),
but I can imagine myself doing that every once in a while.

On another note: I remember the __init__ of Poset (well, FinitePoset)
being way slower than it reasonably should be. I think this is related
to it ducktyping the input (which IMHO is a bad thing anyway but seems
standard in Sage). It would be nice to have quicker ways to initialize
a poset from an already sanitized/predigested input datastructure.

This all said, I'd very much like to see things not getting slower in
the less-used regime while the more popular regime gets optimized.

  Best regards and thanks for working on this,
  Darij

On Mon, Dec 30, 2013 at 11:36 PM, Nathann Cohen nathann.co...@gmail.com wrote:
 Yo !

 I would like to look at huge posets

 Would you mind telling me what huge means ? It does make a difference when
 one writes the code.

 and define a random walk on its
 linear extensions (or eventually run through its linear extensions
 using a Markov chain derived from this one). The methods involved
 currently are

 sage: P = Poset(([1,2,3],[[1,2]]))
 sage: L = P.linear_extensions()
 sage: G = L.markov_chain_digraph()
 sage: G
 Looped multi-digraph on 3 vertices

 I see. Well, the backend can make a difference but if you want some speed
 what you should do is rewrite this linearextension code in Cython.

 sage: view(G)

 On huge digraphs ? I don't think so :-P

 Nathann

 --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Fast Implementation for Character Values of Symmetric Groups

2013-12-21 Thread Darij Grinberg
Hi Nicolas,

the question is, I think, the one of doing it for one partition vs.
doing it for all partitions of n. In the latter case, I think we
should do what we say (replace Symmetrica if we can do it better, or
leave it be if we can't), but Amri has been talking about the former
case and there is definitely room for improvement there when n is
large. And I think it conceptually fits into partition.py, although
most people like myself probably won't ever use n's greater than 20 or
so.

  Best regards,
  Darij

On Fri, Dec 20, 2013 at 3:11 PM, Nicolas M. Thiery
nicolas.thi...@u-psud.fr wrote:
 Hi!

 On Fri, Dec 20, 2013 at 12:37:51PM +0100, Darij Grinberg wrote:
But you are right in saying that this is not an optimal solution, and it
might be better to implement the Murnaghan-Nakayama rule directly as a
hook-removal algorithm rather than by building the whole s and p bases of
Sym.

 Well, building the whole s and p bases of Sym is not a deal as big
 as the formulation may suggest :-) On a fresh Sage session:

 sage: %time SymmetricFunctions(QQ).s()
 CPU times: user 0.19 s, sys: 0.03 s, total: 0.23 s
 Wall time: 0.27 s
 Symmetric Functions over Rational Field in the Schur basis
 sage: %time SymmetricFunctions(QQ).p()
 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
 Wall time: 0.00 s
 Symmetric Functions over Rational Field in the powersum basis

 And from now on the overhead of going through Sym to compute
 characters is essentially negligible. If really you want to save on
 this minimal overhead, look at the symmetric functions code, and call
 Symmetrica directly.

 On the other hand, what would be costly would be to have to maintain
 two implementations of the MN rules just because they are used in
 different places. If someone has an alternative implementation of MN
 that is more efficient than that of Symmetrica, then we should drop
 that piece of Symmetrica, and have the symmetric function code use the
 alternative implementation.

 Cheers,
 Nicolas
 --
 Nicolas M. Thiéry Isil nthi...@users.sf.net
 http://Nicolas.Thiery.name/

 --
 You received this message because you are subscribed to the Google Groups 
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Fast Implementation for Character Values of Symmetric Groups

2013-12-20 Thread Darij Grinberg
Oops, coefficient(mu), not coefficient([mu]).

On Fri, Dec 20, 2013 at 11:38 AM, Darij Grinberg
darijgrinb...@gmail.com wrote:
 Hi Amri,

 On Fri, Dec 20, 2013 at 11:33 AM, Amri amripra...@gmail.com wrote:
 Is there a fast implementation for characters values of symmetric groups in
 Sage? It looks like sage.combinat.symmetric_group_representations.py
 constructs the representation explicitly to compute the character values.

 More precisely, I think it computes the representation matrices.

 I am looking for a function which, when fed two partitions ``la`` and ``mu``
 returns the value of the character of the Specht module corresponding to
 ``la`` at a class with cycle type ``mu``.

 I think your best bet is

 Sym = SymmetricFunctions(QQ)
 p = Sym.p()
 s = Sym.s()
 p(s[la]).coefficient([mu])

 which is precisely the Murnaghan-Nakayama formula and uses relatively
 fast tools (either symmetrica or lrcalc) to compute its result.

   Best regards,
   Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Fast Implementation for Character Values of Symmetric Groups

2013-12-20 Thread Darij Grinberg
Hi Amri,

On Fri, Dec 20, 2013 at 11:33 AM, Amri amripra...@gmail.com wrote:
 Is there a fast implementation for characters values of symmetric groups in
 Sage? It looks like sage.combinat.symmetric_group_representations.py
 constructs the representation explicitly to compute the character values.

More precisely, I think it computes the representation matrices.

 I am looking for a function which, when fed two partitions ``la`` and ``mu``
 returns the value of the character of the Specht module corresponding to
 ``la`` at a class with cycle type ``mu``.

I think your best bet is

Sym = SymmetricFunctions(QQ)
p = Sym.p()
s = Sym.s()
p(s[la]).coefficient([mu])

which is precisely the Murnaghan-Nakayama formula and uses relatively
fast tools (either symmetrica or lrcalc) to compute its result.

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Fast Implementation for Character Values of Symmetric Groups

2013-12-20 Thread Darij Grinberg
Hi Amri,

Oops, I made a mistake: it should be s(p[la]), not p(s[la]). Sorry!

Generally, any basis of Sym is implemented as a *ring in its own*. So when
you write p(s[la]), it understands compute the Schur function
corresponding to partition la, and then convert it to the power-sum ring.
And once it's in the power-sum ring, coefficient means coefficient of
the corresponding power-sum symmetric function, not coefficient of a
monomial (actually, the computation I suggested never goes through
considering monomials).

But you are right in saying that this is not an optimal solution, and it
might be better to implement the Murnaghan-Nakayama rule directly as a
hook-removal algorithm rather than by building the whole s and p bases of
Sym. If you want to change this, I'd say the best place to do it would be
sage/combinat/partition.py.

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] number_of_partitions and PartitionTuples

2013-11-29 Thread Darij Grinberg
Hi Nathann,

I think the deprecation message is plain wrong, and it should be
Partitions(n, length=k).cardinality().
However, this is nowhere near the speed of the deprecated
number_of_partitions(n, k)... no idea what happened here!

  Best regards,
  Dairj

On Fri, Nov 29, 2013 at 1:13 PM, Nathann Cohen nathann.co...@gmail.com wrote:
 Hello everybody !

 Because of my previous message on this forum I am now fixing doctests in the
 combinat/ folder. I have a problem with the following which appears in
 partition.py :

 sage: number_of_partitions(10,2)
 doctest:1: DeprecationWarning:
 sage.combinat.number_of_partitions(size, level) is deprecated. Use
 PartitionTuples(level, size).cardinality() instead.
 See http://trac.sagemath.org/13072 for details.
 5

 How can PartitionsTuples be used instead of number_of_partitions ?

 I tried that :

 sage: PartitionTuples(10,2).cardinality()
 65
 sage: PartitionTuples(2,10).cardinality()
 481

 None of them seems to fit. Plus I have no idea on earth what the doc of
 PartitionTuples means, and I have no idea on earth why anybody would look
 for PartitionTuples instead of number_of_partitions.

 Soo.. Help please. I'm stuck again :-P

 Nathann

 --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Re: StandardTableaux broken

2013-10-17 Thread Darij Grinberg
Hi Jean-Yves and everyone,

OK, so it seems that some patch on the sage-combinat queue as of
sage-5.4.1 solved the descents() problem in a more radical way than my
sage-main patch. When my patch got merged into sage-main, the
sage-combinat page would no longer apply, and so descents() once again
became the old weird faux-descents function, while the correct
descents function was now named standard_descents().

I wish I could confirm this but there seems to be no way to see the
sage-combinat patches without being on the queue, let alone to see the
old patches that are no longer in the queue.

Either way, we should think about descents() when we rewrite tableau.py.

  Best regards,
  Darij

On Thu, Oct 17, 2013 at 2:06 AM, Jean-Yves Thibon jythi...@gmail.com wrote:
 Hi Darij,


 I still have a sage-5.4.1 with all combinat patches up to december 2012 on
 another machine, and t.descents()
 does what I expect. I admit that descents is a bad name for this (these
 are the descents of the inverse
 permutation of the row reading in French convention, in French we use
 reculs ( = recoils, or backsteps),
 but it is traditional to use descents in English.

 Btw, the name major index comes from the military rank of McMahon (Foata
 and Schutzenberger called it the major's index) ,
 so there is only one major index 

 All the best,
 Jean-Yves

 Le mercredi 16 octobre 2013 22:07:38 UTC+2, Andrew Mathas a écrit :

 Hi Darij,

 I've not yet needed descent sets of tableaux in sage so I don't know what
 the code did previously or what it does now in this respect. I would hope,
 however, that a descents method for tableaux would return the descent set of
 a tableau, so if you have ensured that this is now happening I think that's
 great!

 Andrew

 On Wednesday, 16 October 2013 20:32:11 UTC+2, darijgrinberg wrote:

 Hello Jean-Yves, hello Andrew,

 I guess I should have something to say about this but I don't really
 understand what is happening. When I wrote the #7983 patch, I was
 being annoyed by the fact that there was no method on the Tableaux
 class computing what everyone in combinatorics calls the descents,
 whereas the descents() method on tableaux was computing something
 rather unrelated (that, moreover, depends only on the shape if the
 tableau is semistandard). I suspect the descents() method was some
 kind of helper function for Jack or H-L related code. Anyway, I
 decided to rename the old descents() method into a less ambiguous name
 and to make descents() compute the actual descents. But I've quickly
 got talked out of this, as this would deprecate some userbase code, so
 instead I added a standard_descents() method and left descents()
 untouched (only adding the warning to its doc). I was working on
 sage-main all the time.

 Now, Jean-Yves (who, as far as I understand, has been using
 sage-combinat) is saying he has been using descents() all the time and
 since he is talking about standard tableaux, I assume that function
 has been computing the actual descents rather than whatever it has
 been computing on sage-main. Does this mean that the descents()
 function on sage-combinat has been doing something completely
 different from that on sage-main all the time before my #7983 patch?
 That someone had done what I first had in mind (rename the old
 descents() and reuse the name for the actual descents) long ago, and
 now that my #7983 got merged in, the roles have switched?

 Either way, sorry for contributing to this muckup and thanks a lot for
 any help in understanding it.

   Best regards,
   Darij

 --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Permutations and #14772

2013-08-19 Thread Darij Grinberg
Hi Mike,

what is your queue, and what is the exact traceback you're getting?

  Best regards,
  Darij

On Mon, Aug 19, 2013 at 2:18 PM, Mike Zabrocki mike.zabro...@gmail.com wrote:
 Travis,

 I am trying to figure out why the Permutation class stopped working with
 #14772.  The description of the patch is that is part of #12913.  That to me
 means the user should not notice any changes due to this patch.

 I tried computing Permutation([1,2,3]) and it failed (error message:
 TypeError: __init__() got multiple values for keyword argument 'parent')
 and so now I don't even know how to create this permutation.

 The patch was reviewed and is about to go into Sage and a large number of
 patches have a dependency.

 -Mike

 --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-combinat-devel] Re: parabolic roots

2013-07-05 Thread Darij Grinberg
Hi Nicolas and everyone,

That's a nice suggestion (although I nearly deleted your mail due to
its subject line...). Maybe some briefing on the advantages and
disadvantages of WordLikeObject, ClonableArray and ClonableIntArray
would be good to have before embarking on a journey like this.

Another question: should we piggyback on any of the functionality in
the crystals framework, or rewrite stuff from scratch? I'm a bit
scared of having to work with crystals since I don't even know their
definition, but if we already have a good __iter__ for the crystal of
semistandard skew tableaux, it would probably be a waste of time to
rewrite it from scratch...

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-combinat-devel] disabled patch

2013-07-05 Thread Darij Grinberg
Hi Anne, hi Jean-Yves (sorry for not answering your mail long ago!),

On Thu, Jul 4, 2013 at 9:00 PM, Anne Schilling a...@math.ucdavis.edu wrote:
 I just disabled the patch

 descents_composition_of_empty_permutation_jyt.patch

 in the sage-combinat queue since several people sent me personal e-mails
 complaining that the queue did not apply. I suppose the patch needs to be
 rebased. Jean-Yves, are you going to do that? Else, whoever touched the
 permutation file recently should probably go ahead and rebase this patch.

Did this patch set Permutation([]).descents_composition() to [] as
opposed to [0] ? If so, I did the same in trac #14808. Sorry for
causing this conflict.

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-combinat-devel] disabled patch

2013-07-05 Thread Darij Grinberg
Hi Anne,

 If your patch makes the same change,

Yes, it did.

 Usually, before you push changes to the queue, you are supposed to run

 hg qpush -a
 sage -br

It was Travis who pushed my patch into the queue because I wanted him
to rebase his patch on top of mine. I know, I should install
combinat... eventually...

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-combinat-devel] Skew tableaux

2013-07-01 Thread Darij Grinberg
Hi all (Travis in particular since he's working on the file),

A few days ago, the lack of functionality in combinat/skew_tableau.py
(as opposed to combinat/tableau.py) bit me: I was trying to generate
all skew semistandard tableaux of a given shape with a given
max_entry, and noticed that there is no such option. This isn't the
only thing missing, and it seems that skew_tableau.py never got the
love that tableau.py received during development. Are there any
updates to the file floating around between combinat people? I am
aware of trac #14101 (which depends on #14772, which conflicts with
#14808; but even without #14808, the #14101 patch fails on my
sage-5.11beta3 at patching sage/combinat/integer_vector_weighted.py
for some reason). But as far as I understand, this mainly changes the
OOP structure, while leaving the functionality as it is; right,
Travis?

Anyway, I'm assuming this is the wrong time for me to mess with the
file, but once Travis's stuff is positively reviewed, would it be a
good idea to basically copypaste the structure of tableau.py into
skew_tableau.py (with the appropriate changes to the algorithms), or
do you think tableau.py is a mess and should not be imitated? (I'm
asking because such things were told to me about some parts of the
code; I don't have particular reservations about tableau.py.)

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-combinat-devel] Re: docstrings and overloaded methods

2013-06-29 Thread Darij Grinberg
Hi Travis,

thanks. This comes too late for my patch, but I'll think about it in
the future (I didn't think about splitting the summary into a one-line
and a detailed part). BTW, is there a way to refer to
:meth:`SuperClass.foo` without giving the whole path
(sage.combinat..) to SuperClass?

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-combinat-devel] docstrings and overloaded methods

2013-06-28 Thread Darij Grinberg
Hi,

here's a quick question: I'm defining some method on a class and then
redefining it on a subclass for speed improvement. (Concretely, it is
a map on the symmetric functions which I redefine on the power-sum
basis because it's easier to compute there.) What should I do with the
docstring? Copy-paste it so that it is in both classes?

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-combinat-devel] Re: docstrings and overloaded methods

2013-06-28 Thread Darij Grinberg
Hi Simon,

thanks -- but the doctests are the least of my worries (I was going to
do what you suggested). I am trying to figure out what to do with the
docstring text that explains what the function does. If I don't
copypaste it, then calling ?? on the function won't always return the
text. If I copypaste it, then every change will have to be made
several times. What is the right way here?

  Best regards,
  Darij

On Fri, Jun 28, 2013 at 7:37 PM, Simon King simon.k...@uni-jena.de wrote:
 Hi Darij,

 On 2013-06-28, Darij Grinberg darijgrinb...@gmail.com wrote:
 here's a quick question: I'm defining some method on a class and then
 redefining it on a subclass for speed improvement. (Concretely, it is
 a map on the symmetric functions which I redefine on the power-sum
 basis because it's easier to compute there.) What should I do with the
 docstring? Copy-paste it so that it is in both classes?

 No, I think copy-paste is wrong. The reason is the doc tests. You need
 to make sure that the old method of the super-class is *still* tested
 (hence, if the old test happens to be using the class for which you
 overload the method, then please change the old test!), and the new
 method requires a doc test that really uses the new method.

 Best regards,
 Simon

 --
 You received this message because you are subscribed to the Google Groups 
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-combinat-devel] bug in poset

2012-05-22 Thread Darij Grinberg
Hi Anne,

 Did you make the changes in the source code? Then you can just do

 sage -br

Thanks - I got that wrong (thought this is what upgrade would do)!

 and test your function.

 If you are happy with your changes and want to put them under mercurial 
 supervision
 do

 hg qnew rank-dg.patch
 hg qrefresh
 hg qcommit

Hmm. I can't get this to work:

darij@travis-virtualbox:~/sage-5.0.rc1$ hg qnew rank-dg.patch
abort: requirement 'dotencode' not supported!
darij@travis-virtualbox:~/sage-5.0.rc1$ ./sage -hg qnew rank-dg.patch
darij@travis-virtualbox:~/sage-5.0.rc1$ ./sage -hg qrefresh
darij@travis-virtualbox:~/sage-5.0.rc1$ ./sage -hg qcommit
abort: no queue repository

  Best regards,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-combinat-devel] bug in poset

2012-05-21 Thread Darij Grinberg
Hi Anne,

 Isn't the following a big bug in posets in sage:

 sage: P = Poset(([1,2,3,4],[[1,4],[2,3],[3,4]]), facade = True)
 sage: P.is_graded()
 False

 The definition of grading is that all maximal chains of every interval
 have the same length. This is given in the above poset, but sage says
 it is not graded.

The code seems to assume that the poset has a least element. It uses
the level_sets() function of sage/graphs/digraph.py to compute the
level sets of the Hasse diagram of the poset; then it assumes that the
0-th level set (i. e., the set of vertices having no predecessor) must
be the 0-th rank of the grading, that the 1-st level set (i. e., the
set of vertices having all their predecessors in the 0-th level set
but not lying therein themselves) must be the 1-th rank, that the 2-nd
level set (i. e., the set of vertices having all their predecessors in
the =1-st level sets but not lying therein themselves) must be the
2-nd rank, etc. In the case of your P, the 0-th level set is {1,2},
and then we get a rank mismatch at vertex 4.

 How should this be fixed?

I am wondering about that too. My first idea would be Gaussian
elimination, with each covering relation (P.cover_relations()) giving
an equation of the form a_i - a_j = 1. Not sure this is anywhere near
optimal, though. The nice thing about systems of linear equations with
every equation containing only 2 nonzero coefficients is that, if you
perform Gaussian elimination on such a system, it retains this
property (that every equation has only 2 nonzero coefficients) all the
way through (this is even true for Gröbner basis, keyword binomial
basis IIRC), so it is a very sparse-matrix problem, but I don't know
whether Sage has any code optimized for this case.

  Best regards, and sorry if this was all known already,
  Darij

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.