Re: [sage-combinat-devel] How to compute the orbits?

2016-02-29 Thread Nicolas Borie
One more time,

Since I want to sell such code (I really don't know how use it ? only me 
?)...

Here is another example : C = {a, b, c} with a > b > c and G = < 
((1,4),(2,3)), ((1,2), (1,4)) >

***
sage: C = FiniteEnumeratedSet(['a', 'b', 'c'])
sage: def to_my_vect(v):
: ans = []
: for i in v:
: if i == 0:
: ans.append('a')
: elif i == 1:
: ans.append('b')
: else:
: ans.append('c')
: return ans
: 
sage: G = PermutationGroup([[(1,2), (3,4)],[(1,4),(2,3)]])
sage: I = IntegerVectorsModPermutationGroup(G, max_part=2)
sage: it = iter(I)
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['a', 'a', 'a', 'a'], [['a', 'a', 'a', 'a']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['b', 'a', 'a', 'a'],
 [['b', 'a', 'a', 'a'],
  ['a', 'b', 'a', 'a'],
  ['a', 'a', 'b', 'a'],
  ['a', 'a', 'a', 'b']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'a', 'a', 'a'],
 [['a', 'c', 'a', 'a'],
  ['c', 'a', 'a', 'a'],
  ['a', 'a', 'a', 'c'],
  ['a', 'a', 'c', 'a']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['b', 'b', 'a', 'a'], [['a', 'a', 'b', 'b'], ['b', 'b', 'a', 'a']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['b', 'a', 'b', 'a'], [['a', 'b', 'a', 'b'], ['b', 'a', 'b', 'a']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['b', 'a', 'a', 'b'], [['b', 'a', 'a', 'b'], ['a', 'b', 'b', 'a']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'b', 'a', 'a'],
 [['a', 'a', 'b', 'c'],
  ['a', 'a', 'c', 'b'],
  ['b', 'c', 'a', 'a'],
  ['c', 'b', 'a', 'a']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'a', 'b', 'a'],
 [['a', 'b', 'a', 'c'],
  ['a', 'c', 'a', 'b'],
  ['b', 'a', 'c', 'a'],
  ['c', 'a', 'b', 'a']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'a', 'a', 'b'],
 [['c', 'a', 'a', 'b'],
  ['a', 'c', 'b', 'a'],
  ['b', 'a', 'a', 'c'],
  ['a', 'b', 'c', 'a']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['b', 'b', 'b', 'a'],
 [['b', 'b', 'b', 'a'],
  ['b', 'a', 'b', 'b'],
  ['b', 'b', 'a', 'b'],
  ['a', 'b', 'b', 'b']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'c', 'a', 'a'], [['c', 'c', 'a', 'a'], ['a', 'a', 'c', 'c']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'b', 'b', 'a'],
 [['c', 'b', 'b', 'a'],
  ['b', 'c', 'a', 'b'],
  ['a', 'b', 'b', 'c'],
  ['b', 'a', 'c', 'b']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'b', 'a', 'b'],
 [['a', 'b', 'c', 'b'],
  ['b', 'a', 'b', 'c'],
  ['c', 'b', 'a', 'b'],
  ['b', 'c', 'b', 'a']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'a', 'c', 'a'], [['c', 'a', 'c', 'a'], ['a', 'c', 'a', 'c']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'a', 'b', 'b'],
 [['a', 'c', 'b', 'b'],
  ['b', 'b', 'c', 'a'],
  ['c', 'a', 'b', 'b'],
  ['b', 'b', 'a', 'c']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'a', 'a', 'c'], [['c', 'a', 'a', 'c'], ['a', 'c', 'c', 'a']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['b', 'b', 'b', 'b'], [['b', 'b', 'b', 'b']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'c', 'b', 'a'],
 [['b', 'a', 'c', 'c'],
  ['c', 'c', 'a', 'b'],
  ['a', 'b', 'c', 'c'],
  ['c', 'c', 'b', 'a']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'b', 'c', 'a'],
 [['b', 'c', 'a', 'c'],
  ['a', 'c', 'b', 'c'],
  ['c', 'a', 'c', 'b'],
  ['c', 'b', 'c', 'a']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'b', 'b', 'b'],
 [['c', 'b', 'b', 'b'],
  ['b', 'b', 'b', 'c'],
  ['b', 'b', 'c', 'b'],
  ['b', 'c', 'b', 'b']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'b', 'a', 'c'],
 [['b', 'c', 'c', 'a'],
  ['a', 'c', 'c', 'b'],
  ['c', 'a', 'b', 'c'],
  ['c', 'b', 'a', 'c']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'c', 'c', 'a'],
 [['c', 'c', 'a', 'c'],
  ['c', 'a', 'c', 'c'],
  ['a', 'c', 'c', 'c'],
  ['c', 'c', 'c', 'a']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'c', 'b', 'b'], [['b', 'b', 'c', 'c'], ['c', 'c', 'b', 'b']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'b', 'c', 'b'], [['b', 'c', 'b', 'c'], ['c', 'b', 'c', 'b']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'b', 'b', 'c'], [['b', 'c', 'c', 'b'], ['c', 'b', 'b', 'c']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'c', 'c', 'b'],
 [['c', 'c', 'c', 'b'],
  ['c', 'b', 'c', 'c'],
  ['b', 'c', 'c', 'c'],
  ['c', 'c', 'b', 'c']])
sage: v = it.next(); to_my_vect(v), map(to_my_vect, I.orbit(v))
(['c', 'c', 'c', 'c'], [['c'

Re: [sage-combinat-devel] How to compute the orbits?

2016-02-29 Thread Nicolas Borie

Le 29/02/2016 16:23, Simon King a écrit :

Hi!

I have a finite set C, and I have a finite group that acts
on the n-fold Cartesian product of C by permutation of positions, wher
n is a fixed number.

At sage.combinat.enumeration_mod_permgroup, I see how I can compute the
orbit of one element of the n-fold Cartesian product of C. But how can I
compute the set of all orbits, or better a set containing exactly one
representative for each orbit?

Hello,

sage.combinat.enumeration_mod_permgroup contains tools to enumerate 
integer vectors modulo the action of a permutation group.


I think it can be adapted to any finite set C (you just need a total 
order on C, the enumeration order of your finite set should work fine). 
The representative of each orbit are defined as the maximun for the 
lexicographic order for your n-tuples of elements of C.


The easiest way should be to use a bijection between {0..n-1} and C and 
extend it to n-tuples of C. You can thus apply this bijection as a 
post_process to the following parent :


If C has for cardinality 4 and you play with tuples of 5 elements :

If you think such tuples as monomial (the vectors of exponents of x1,x2, 
..., xn), it is the deglex order for enumeration !


* 


sage: G = TransitiveGroup(5,3)
sage: I = IntegerVectorsModPermutationGroup(G, max_part=3)
sage: I
Integer vectors of length 5 whose entries is in {0, ..., 3} enumerated 
up to the action of Transitive group number 3 of degree 5

sage: I.cardinality()
76
sage: it = iter(I)
sage: v = it.next(); v, I.orbit(v)
([0, 0, 0, 0, 0], {[0, 0, 0, 0, 0]})
sage: v = it.next(); v, I.orbit(v)
([1, 0, 0, 0, 0],
 {[0, 0, 0, 0, 1],
  [0, 0, 0, 1, 0],
  [0, 0, 1, 0, 0],
  [0, 1, 0, 0, 0],
  [1, 0, 0, 0, 0]})
sage: v = it.next(); v, I.orbit(v)
([2, 0, 0, 0, 0],
 {[0, 0, 0, 0, 2],
  [0, 0, 0, 2, 0],
  [0, 0, 2, 0, 0],
  [0, 2, 0, 0, 0],
  [2, 0, 0, 0, 0]})
sage: v = it.next(); v, I.orbit(v)
([1, 1, 0, 0, 0],
 {[0, 0, 0, 1, 1],
  [0, 0, 1, 0, 1],
  [0, 0, 1, 1, 0],
  [0, 1, 0, 0, 1],
  [0, 1, 0, 1, 0],
  [0, 1, 1, 0, 0],
  [1, 0, 0, 0, 1],
  [1, 0, 0, 1, 0],
  [1, 0, 1, 0, 0],
  [1, 1, 0, 0, 0]})
sage: v = it.next(); v, I.orbit(v)
([3, 0, 0, 0, 0],
 {[0, 0, 0, 0, 3],
  [0, 0, 0, 3, 0],
  [0, 0, 3, 0, 0],
  [0, 3, 0, 0, 0],
  [3, 0, 0, 0, 0]})
sage: v = it.next(); v, I.orbit(v)
([2, 1, 0, 0, 0],
 {[0, 0, 0, 1, 2],
  [0, 0, 0, 2, 1],
  [0, 0, 1, 0, 2],
  [0, 0, 1, 2, 0],
  [0, 0, 2, 0, 1],
  [0, 0, 2, 1, 0],
  [0, 1, 0, 0, 2],
  [0, 1, 0, 2, 0],
  [0, 1, 2, 0, 0],
  [0, 2, 0, 0, 1],
  [0, 2, 0, 1, 0],
  [0, 2, 1, 0, 0],
  [1, 0, 0, 0, 2],
  [1, 0, 0, 2, 0],
  [1, 0, 2, 0, 0],
  [1, 2, 0, 0, 0],
  [2, 0, 0, 0, 1],
  [2, 0, 0, 1, 0],
  [2, 0, 1, 0, 0],
  [2, 1, 0, 0, 0]})
sage: v = it.next(); v, I.orbit(v)
([1, 1, 1, 0, 0],
 {[0, 0, 1, 1, 1],
  [0, 1, 0, 1, 1],
  [0, 1, 1, 0, 1],
  [0, 1, 1, 1, 0],
  [1, 0, 0, 1, 1],
  [1, 0, 1, 0, 1],
  [1, 0, 1, 1, 0],
  [1, 1, 0, 0, 1],
  [1, 1, 0, 1, 0],
  [1, 1, 1, 0, 0]})
sage: v = it.next(); v, I.orbit(v)
([3, 1, 0, 0, 0],
 {[0, 0, 0, 1, 3],
  [0, 0, 0, 3, 1],
  [0, 0, 1, 0, 3],
  [0, 0, 1, 3, 0],
  [0, 0, 3, 0, 1],
  [0, 0, 3, 1, 0],
  [0, 1, 0, 0, 3],
  [0, 1, 0, 3, 0],
  [0, 1, 3, 0, 0],
  [0, 3, 0, 0, 1],
  [0, 3, 0, 1, 0],
  [0, 3, 1, 0, 0],
  [1, 0, 0, 0, 3],
  [1, 0, 0, 3, 0],
  [1, 0, 3, 0, 0],
  [1, 3, 0, 0, 0],
  [3, 0, 0, 0, 1],
  [3, 0, 0, 1, 0],
  [3, 0, 1, 0, 0],
  [3, 1, 0, 0, 0]})
sage: v = it.next(); v, I.orbit(v)
([2, 2, 0, 0, 0],
 {[0, 0, 0, 2, 2],
  [0, 0, 2, 0, 2],
  [0, 0, 2, 2, 0],
  [0, 2, 0, 0, 2],
  [0, 2, 0, 2, 0],
  [0, 2, 2, 0, 0],
  [2, 0, 0, 0, 2],
  [2, 0, 0, 2, 0],
  [2, 0, 2, 0, 0],
  [2, 2, 0, 0, 0]})
sage: v = it.next(); v, I.orbit(v)
([2, 1, 1, 0, 0],
 {[0, 0, 1, 1, 2],
  [0, 0, 2, 1, 1],
  [0, 1, 0, 1, 2],
  [0, 1, 0, 2, 1],
  [0, 1, 1, 2, 0],
  [0, 1, 2, 0, 1],
  [0, 2, 1, 0, 1],
  [0, 2, 1, 1, 0],
  [1, 0, 0, 2, 1],
  [1, 0, 1, 0, 2],
  [1, 0, 1, 2, 0],
  [1, 0, 2, 1, 0],
  [1, 1, 0, 0, 2],
  [1, 1, 2, 0, 0],
  [1, 2, 0, 0, 1],
  [1, 2, 0, 1, 0],
  [2, 0, 0, 1, 1],
  [2, 0, 1, 0, 1],
  [2, 1, 0, 1, 0],
  [2, 1, 1, 0, 0]})
* 



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 https://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 Nicolas Borie

Le 28/06/2015 22:47, Anne Schilling a écrit :

Hi Nicolas B.,

Thank you for your explanations! It was a little difficult
to find this bug since in some cases it actually works
{{{
sage: positions=[1,2,3,4,5,6]
sage: for j in positions:
 if is_even(j):
 positions.remove(j)
:
sage: positions
[1, 3, 5]
}}}
{{{
sage: positions=[1,2,3,4,5,6]
sage: for j in positions:
 if is_odd(j):
 positions.remove(j)
:
sage: positions
[2, 4, 6]
}}}
This is very very very tricky  In fact, the bug is silent with odd 
and even number just because they alternate during enumeration... The 
side effect of removing a value in Python List (which is a single 
segment of different address in memory) forces the Python iterator to 
ignore a value. As odd and even numbers alternate, we ignore the right 
ones and dealt with all the good ones. Look at your example when sorting 
odd and even :


*
$ L = [1,2,3,4,5,6] # alternate odd and even
$ for j in L:
... if j%2 == 0:
... L.remove(j)
...
$ L
[1, 3, 5]
$ L = [2,4,6,1,3,5] # sort odd and even
$ for j in L:
... if j%2 == 0:
... L.remove(j)
...
$ L
[4, 1, 3, 5]
*
In the first example :
1 : test fail
2 : test ok and removed
3 : ignore because the remove of 2 produce a non wanted side effect on 
the iterator (As 3 is odd, we can't see the bug)

4 : test ok and removed
5 : ignore because of the remove of 4 produce a side effect (As 5 is 
odd, the bug stay silent...)

6 : test ok and removed

in the second exemple :
2 : test ok and removed
4 : ignored (Here the bug appears really on the result)
6 : test of and removed
1 : ignored
3 : test fail
5 : test fail

All this is very silent...

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/d/optout.


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

2015-06-28 Thread Nicolas Borie

Le 28/06/2015 11:42, Darij Grinberg a écrit :

On Sun, Jun 28, 2015 at 10:07 AM, Nicolas Borie  wrote:

PS: The last entry of my collection of Python tricky codes was danger from
free variables :  (MAKE A LIST OF FIRST POWER FUNCTION (1, X, X^2, X^3,
X^4))

L = [lambda x : x**i for i in range(5)] # BAD
[L[j](2) for j in range(5)]

[16, 16, 16, 16, 16]

Ouch! What exactly went wrong here, and how to avoid it?

i is a free variable and exist in a single piece of memory...

There is not a copy of i with its current value that build the current 
lambda each step, no. In fact, all lambda use the same i in memory and 
the value of i is changing each step. At the end, since the value of i 
at last iteration is 4, it returns a list containing 5 times the same 
function...


Initialization, we have []
i = 0, we have [x->1]
i = 1, we have [x->x, x->x]
i = 2, we have [x->x^2, x->x^2, x->x^2]
...
i=4, we have [x->x^4, x->x^4, x->x^4, x->x^4,x->x^4]

change i change the lambdas :
>>> L = [lambda x: x**i for i in range(5)]
>>> [L[j](2) for j in range(5)]
[16, 16, 16, 16, 16]
>>> i = 7
>>> [L[j](2) for j in range(5)]
[128, 128, 128, 128, 128]

So much trick in Python

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...

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/d/optout.


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

2015-06-28 Thread Nicolas Borie

Le 28/06/2015 06:55, Anne Schilling a écrit :

Hi!

Is this what I should expect from this code:

sage: positions=[1,2,3,4,5,6]
sage: for j in positions:
: positions.remove(j)
:
sage: positions
[2, 4, 6]
Wha this one will increase my collection of tricky examples... There 
is a war in my university : "C language against Python language, what is 
the best for computer sciences education ?"


This is pure Python code and Python comes from C...

A C for loop works like that : for ( initialization ; stopping condition 
; incrementation ). But in python, everything is objects, thus is 
manipulated with a pointer (an address) to a real part of the memory... 
From that when you iterate over a list, I would be not surprise that 
the python iteration over a list is translated into a C for loop that do 
: for ( first address of the tableau ; end of the tableau ; go an 
address more far). From that, finally, you see only half of the element 
of the list since you delete the first ones...


In C, there is a rule that say : NEVER MORE THAN A SINGLE SIDE EFFECT 
BETWEEN TWO SEQUENCE POINTS. This means, in particular, you can't use 
and modify (several times) the same part of the memory is a single 
instruction (like a for loop using and modifying the same list)...


In Python, I don't know exactly, and the piece of Python code you 
present chocks my intuition but Python is tricky... (A lot of things can 
be written as we think them, but just sometimes, it does not what we 
think). I will be not surprised if the Python references includes 
something like :


for elem in List:
 NO SIDE EFFECT ON THE List ALLOWED 

Tricky piece of code but probably correct with a big flag : "Don't do that!"
Cheers,
Nicolas B.

PS: The last entry of my collection of Python tricky codes was danger 
from free variables :  (MAKE A LIST OF FIRST POWER FUNCTION (1, X, X^2, 
X^3, X^4))

>>> L = [lambda x : x**i for i in range(5)] # BAD
>>> [L[j](2) for j in range(5)]
[16, 16, 16, 16, 16]
>>> L = [lambda x, i=i : x**i for i in range(5)] # THE FIX IS HORRIBLE
>>> [L[j](2) for j in range(5)]
[1, 2, 4, 8, 16]

--
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] A small hint in Symmetric Functions

2014-11-20 Thread Nicolas Borie

Hello all,

As I was constructing some Free Modules over the symmetric functions, I 
fall on this (sage 6.4.beta2 for my version (yes, that's probably old)):


sage: SymmetricFunctions(QQ) in CommutativeRings()
False
sage: SymmetricFunctions(QQ).a_realization() in CommutativeRings()
True

I would have loved that the two lines return True. If I say no mistakes, 
the symmetric functions should be an abstract parent with severals 
realizations. The category is *probably* initialized in sf.py with the line:


Parent.__init__(self, category = GradedHopfAlgebras(R).WithRealizations())

Is this enought to change this category for the following one (with QQ 
replaced by R in the source code naturally) ?


sage: GradedHopfAlgebras(QQ).Commutative().WithRealizations()
Join of Category of hopf algebras over Rational Field and Category of 
graded algebras over Rational Field and Category of commutative algebras 
over Rational Field and Category of monoids with realizations and 
Category of coalgebras over Rational Field with realizations


Perhaps this question is relatively empty but I didn't contribute to 
Sage for something like a year. I just reviewed 2 tickets the last 6 
month and I am still scared of using git (don't laugh please!). So I 
asked before since a such one line patch cost 10 minutes for git lovers 
but probably 2 hours with the cheat-sheet of Volker for me. Ok, I just 
heard someone saying that it will need one than one line since it could 
be nice to add the proper test in the documentation... Rhoo


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/d/optout.


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

2014-02-17 Thread Nicolas Borie

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.


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

2014-02-17 Thread Nicolas Borie

On 17/02/2014 17:52, Nicolas Borie wrote:

Hi all,

Is there currently a way in Sage-combinat to compute the action of a 
permutation over standard tableaux ?


For example, I would like something like :

Permutation([2,1,3,4]) * B([[1,2],[3,4]]) = B([[1,2],[3,4]]) - 
B([[1,3],[2,4]])


This thing is called in French "algorithme de redressement" (In the 
same time, what is the equivalent in English ?) and is related to 
Ganir identity (Or Garnir rules...). They are a lot of thing in 
combinat but I didn't find it... Can someone confirm that or give my a 
pointer otherwise...


Cheers,
Nicolas B.


One more time,

Currently, I see that :

sage: R = SymmetricGroupRepresentation([3,2,2,1])
sage: R.category()
Category of objects

Would someone be surprised if we could have that :

sage: R = SymmetricGroupRepresentation([3,2,2,1])
sage: R.category()
Category of Category of finite dimensional modules with basis over 
Rational Field (imagine there is a optionnal argument ring=QQ)

sage: R.basis().keys()
Standard tableaux of shape [3, 2, 2, 1]

Or perhaps the analogy between the representation and the S_n-module is 
too much and someone prefers to get this CombinatorialFreeModule via a 
method from the representation object like :


SymmetricGroupRepresentation([3,2,2,1]).ambient_space() --> return the 
Specht module where the keys are standard tableaux and not polynomials


What do you think about 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.


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

2014-02-17 Thread Nicolas Borie

Hi all,

Is there currently a way in Sage-combinat to compute the action of a 
permutation over standard tableaux ?


For example, I would like something like :

Permutation([2,1,3,4]) * B([[1,2],[3,4]]) = B([[1,2],[3,4]]) - 
B([[1,3],[2,4]])


This thing is called in French "algorithme de redressement" (In the same 
time, what is the equivalent in English ?) and is related to Ganir 
identity (Or Garnir rules...). They are a lot of thing in combinat but I 
didn't find it... Can someone confirm that or give my a pointer otherwise...


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.


Re: [sage-combinat-devel] Re: [sage-devel] cartesian products

2013-11-15 Thread Nicolas Borie

On 15/11/2013 23:04, Nicolas M. Thiery wrote:

On Fri, Nov 15, 2013 at 02:43:29PM -0500, Vincent Delecroix wrote:

Thanks for taking care of it. I would like cartesian products to be
smarter about iteration... especially when one of the factor is
infinite. I have a working implementation of the iterator that you can
use on the sage-combinat misc repo.

I assume this is some diagonal iterator, right? IIRC, Nicolas B. also
has some similar stuff (Nicolas?). I guess this is a good candidate to
go in EnumeratedSets.Infinite.CartesianProducts.ParentMethods.

Hello,

In fact, my use case was a little different : I wanted a smart iterator 
on a SearchForest having an infinite number of roots and each node has 
also an infinite number of children. This is still an enumerated set but 
both deep first search and breadth first search produced dummy 
iterables. So the strategy was to manipulate a growing to infinity stack 
of iterables. Elements were pondered by the sum of their generation and 
their position between their brotherhood. I am also afraid this code is 
perhaps lost (not enougth backup with laptop change...)


For CartesianProduct build on n atoms: (A_1 x A_2 x A_3 x ... x A_n), a 
way consist in setting a SearchForest with a single root: (A_1.first(), 
A_2.first(), ... A_n.first()) and use a breadth first search with the 
following children function :
for an element : (x_1, x_2, ... x_i, ... , x_n) wherein x_i IS THE PART 
THE MOST ON THE RIGHT WHICH IS NOT THE FIRST OF ITS ATOM A_i, we set its 
children to be the iterable on

[(x_1, x_2, ... A_i.next(x_i), ... , x_n),
 (x_1, x_2, ... x_i, A_{i+1}.next(x_{i+1}) ... , x_n)
 , ... ,
 (x_1, x_2, ... x_i, ... , A_n.next(x_n))]
That will produce a kind of deglex iterator in which the degree is the 
sum of the generation (= number of time you need to call next from first 
before seeing it) of each part.


I don't know if there exist not something better. Perhaps not, but 
defining a SearchForest just for an iterable is perhaps a little bit 
loud. I don't know. My X.next() method was consisting in add +1 to an 
integer but if the method X.next(a) reroll an iterable from begining, 
this is probably not very efficient Perhaps there is no way to 
genericaly do it smarter. Hope that can help...


Cheers,
Nicolas B.

P.S. : Sorry for my English. I don't love to post drafty and old stuff 
but as you asked for... I just grab it from my trash... The following 
code (2 or 3 years old) enumerate along the integer vectors of any 
length. This is still in the old combinat queue. 
(refactor_interger_vectors-nb.patch)


1797 
 
+cpdef list all_children(IntegerVector_class v):
1798 
 
+ r"""
1799 
 
+ Returns all the children of an integer vector (ClonableIntArray) ``v``
1800 
 
+ in the tree of enumeration by lexicographic order. The children of
1801 
 
+ an integer vector ``v`` whose entries have for sum `n` are all integer
1802 
 
+ vectors of sum `n+1` which follow ``v`` in the lexicographic order.
1803 
 
+
1804 
 
+ That means this function adds `1` on the last non zero entries and the
1805 
 
+ following ones. For an integer vector `v` such that
1806 
 
+
1807 
 
+ .. math::
1808 
 
+
1809 
 
+ v = [ \dots, a , 0, 0 ] \text{ with } a \neq 0,
1810 
 
+
1811 
 
+ then, the list of children is
1812 
<

Re: [sage-combinat-devel] Re: Inversion of matrix...

2013-09-05 Thread Nicolas Borie

Hi all,

Thanks you Simon for the time you spent to give answers. Thanks you also 
Vincent for the suggestion. I have now a trac number : 
http://trac.sagemath.org/ticket/15160


Feel free to rephrase the ticket description or modify anything (still 
my English...). This is far from final but partial results may interest 
some people in the combinat community. The suggestion and advises can 
now go to the trac ticket. I am still motivated to do the job but alone, 
It will remains too hard for me so thanks you Simon for having describe 
how attack this problem.


I just uploaded a drafty patch with some tests but no documentation. 
Before this small patch, once cannot multiply a scalar and a matrix if 
the coefficient didn't inherit from RingElement. Now, here is a small 
log of what can be done :


*
sage: from sage.matrix.matrix_space import test_special_ring
sage: test_special_ring(verbose=True)
Test with : An example of an algebra with basis: the free algebra on the 
generators ('a', 'b', 'c') over Rational Field

Let M be an invertible matrix:
[  B[word: ]  B[word: b]  B[word: a]]
[  0   B[word: ] B[word: ab]]
[  0   0   B[word: ]]
Here is the invert computed:
[ B[word: ]-B[word: b] -B[word: a] + 
B[word: bab]]

[ 0  B[word: ] -B[word: ab]]
[ 0 0  B[word: ]]
inversion OK
   
Test with : Symmetric Functions over Rational Field in the Schur basis
Let M be an invertible matrix:
[ s[] s[2]  s[]]
[   0  s[] s[1]]
[   00  s[]]
Here is the invert computed:
[  s[] -s[2] -s[] + s[2, 1] + s[3]]
[0   s[] -s[1]]
[0 0   s[]]
inversion OK
   
Test with : An example of Hopf algebra with basis: the group algebra of 
the Dihedral group of order 6 as a permutation group over Rational Field

Let M be an invertible matrix:
[ B[()] B[(1,2,3)] B[(1,3,2)]]
[ 0  B[()]   B[(1,3)]]
[ 0  0  B[()]]
Here is the invert computed:
[B[()]   -B[(1,2,3)] B[(1,2)] - B[(1,3,2)]]
[0 B[()] -B[(1,3)]]
[0 0 B[()]]
inversion OK
   
Test with : Group algebra of Symmetric group of order 4! as a 
permutation group over Rational Field

Let M be an invertible matrix:
[ B[()]  0  0]
[B[(2,3,4)]  B[()]  0]
[B[(2,4,3)]   B[(2,4)]  B[()]]
Here is the invert computed:
[B[()] 0 0]
[  -B[(2,3,4)] B[()] 0]
[B[(3,4)] - B[(2,4,3)] -B[(2,4)] B[()]]
inversion OK
   
Test with : Non-Commutative Symmetric Functions over the Rational Field 
in the Phi basis

Let M be an invertible matrix:
[   Phi[] Phi[2, 1, 2]   Phi[3]]
[   0Phi[] Phi[1, 0, 1]]
[   00Phi[]]
Here is the invert computed:
[ Phi[]  -Phi[2, 1, 2] Phi[2, 1, 
2, 1, 0, 1] - Phi[3]]

[ 0 Phi[]  -Phi[1, 0, 1]]
[ 0 0  Phi[]]
inversion OK
   
*

Inversion OK means that the result was the right answer. Note also that 
the first and last example are in the non-commutative world.


Feel free to comments (ok on the trac or on this list if you prefer) 
what I already done to allows me to continue in a good way.


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.


Re: [sage-combinat-devel] Re: Inversion of matrix...

2013-09-04 Thread Nicolas Borie

On 03/09/2013 22:48, Simon King wrote:

PS:


- I recommend to *try* (no guarantee it will work) to create a new type
   of action "A" (inherit from sage.categories.action.Action). You need to
   implement its _call_ and _repr_name_, and I think that's all what is to do
   (but perhaps you'll find other examples of Action in Sage, so, try to
   learn from existing code).
   Typically, the _call_ method of the action A._call_(a,b) will rely on
   methods of a and b (in our application, "a" is element of the
   base ring and "b" is a matrix).
   And then, let MatrixSpace._get_action_ return A.

Hello Simon et al,

This way works ! But it overwrite the scalar multiplication for the 
other usuals ring. I just did a drafty implementation to check the 
coercion catch it... I also learn a lot about action, thanks for all 
your pointers Simon.


For information, my drafty way to did it was exactly how Simon suggested 
but not in a very efficient way and using a new diagonal_matrix (should 
be homothétie in French but I doesn't know in English) :

***
+def _get_action_(self, S, op=operator.mul, self_on_left=True):
+r"""
+"""
+if self.has_coerce_map_from(self.base_ring()):
+return None
+if S == self.base_ring():
+return ActionFromBaseRing(self.base_ring(), self)
+return None
+
+from sage.categories.action import Action
+
+class ActionFromBaseRing(Action):
+r"""
+"""
+def _call_(self, elem, mat):
+r"""
+"""
+P = mat.parent()
+return P.diagonal_matrix(elem)*mat
+
***


I have now a scalar multiplication which is *really more* generic ( but 
ok, I should multiply each entries by the right scalar after having 
generated a copy ). However, I really think that polish Sage matrix 
spaces and matrices is a very hard job. I already fix two small 
problems, here is a status of Sage with this new action concerning some 
rings coming from Combinat:


***
sage: C = AlgebrasWithBasis(QQ).example(); C
An example of an algebra with basis: the free algebra on the generators 
('a', 'b', 'c') over Rational Field

sage: SF = SymmetricFunctions(QQ).schur(); SF
Symmetric Functions over Rational Field in the Schur basis
sage: SFx. = PolynomialRing(SF, 'y')
sage: Cz. = PolynomialRing(C, 'z')
sage: Id = identity_matrix(C, 2); C.an_element()*Id
[B[word: ] + 2*B[word: a] + 3*B[word: 
b]   0]
[  0 B[word: ] + 2*B[word: a] + 
3*B[word: b]]

sage: Id = identity_matrix(SF, 2); SF.an_element()*Id
[2*s[] + 2*s[1] + 3*s[2]   0]
[  0 2*s[] + 2*s[1] + 3*s[2]]
sage: Id = identity_matrix(SFx, 2); SFx.an_element()*Id
[s[]*y 0]
[0 s[]*y]
sage: Id = identity_matrix(Cz, 2); Cz.an_element()*Id
[B[word: ]*z   0]
[  0 B[word: ]*z]
***

Let us try to call the adjoint of the identity matrix :
Free algebra with 3 generators :
***
sage: Id = identity_matrix(C, 2);
sage: Id.adjoint()
---
AttributeErrorTraceback (most recent call last)
 in ()
> 1 Id.adjoint()

/home/nborie/sage/local/lib/python2.7/site-packages/sage/matrix/matrix2.so 
in sage.matrix.matrix2.Matrix.adjoint (sage/matrix/matrix2.c:40809)()


/home/nborie/sage/local/lib/python2.7/site-packages/sage/matrix/matrix2.so 
in sage.matrix.matrix2.Matrix._adjoint (sage/matrix/matrix2.c:40996)()


/home/nborie/sage/local/lib/python2.7/site-packages/sage/matrix/matrix2.so 
in sage.matrix.matrix2.Matrix.charpoly (sage/matrix/matrix2.c:11016)()


/home/nborie/sage/local/lib/python2.7/site-packages/sage/structure/parent.so 
in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c:6888)()


/home/nborie/sage/local/lib/python2.7/site-packages/sage/structure/misc.so 
in sage.structure.misc.getattr_from_other_class 
(sage/structure/misc.c:1606)()


AttributeError: 'FreeAlgebra_with_category' object has no attribute 
'is_field'

***

Schur functions :
***
sage: Id = identity_matrix(SF, 2);
sage: Id.adjoint()
---
TypeError Traceback (most recent call last)
 in ()
> 1 Id.adjoint()

/home/nborie/sage/local/lib/python2.7/site-packages/sage/matrix/matrix2.so 
in sage.matrix.matrix2.Matrix.adjoint (sage/matrix/matrix2.c:40809)()


/home/nborie/sage/local/lib/python2.7/site-packages/sage/matrix/matrix2.so 
in sage.matrix.matrix2.Matrix._adjoint (sage/m

Re: [sage-combinat-devel] Re: Inversion of matrix...

2013-09-03 Thread Nicolas Borie

On 03/09/2013 22:48, Simon King wrote:

PS:

On 2013-09-03, Simon King  wrote:

Shouldn't there always be a coercion from the base ring into a
unital algebra? It seems to me that the underlying problem is that
matrix spaces do not properly use the new coercion model (in particular,
they define their own __call__, how nasty!).

Looking at what I wrote later in my previous post, I think this is *not* the
problem. Since the previous post was so long, here is a summary:
- For efficience reasons, we do not want full category initialisation
   during __init__ (please don't change this, unless you want to mess
   with the number theorists...)
   => __init_extra__ of Algebras.ParentMethods is not called
   => one needs to establish an action from the base ring "manually"
- The category *is* initialised for CategoryObject, but just not for Parent.
   It would be a good idea to check whether IntegralDomains() could be
   used in the category, since this is needed for FractionField to be
   defined.
- The usual framework for actions of a base ring on a module relies on
   cpdef methods _rmul_ and _lmul_. Problem: These expect their input of
   a particular type, that is often *not* used in sage.combinat.
- I recommend to *try* (no guarantee it will work) to create a new type
   of action "A" (inherit from sage.categories.action.Action). You need to
   implement its _call_ and _repr_name_, and I think that's all what is to do
   (but perhaps you'll find other examples of Action in Sage, so, try to
   learn from existing code).
   Typically, the _call_ method of the action A._call_(a,b) will rely on
   methods of a and b (in our application, "a" is element of the
   base ring and "b" is a matrix).
   And then, let MatrixSpace._get_action_ return A.

Hope the short version of my post was helpful :)

Best regards,
Simon

Thanks you very much for these two long and detailed posts... I will try 
to reread them carefully tomorrow and propose some patch shortly...


I will post a patch number on this thread when I will have something 
interesting.


Thanks you Simon.
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.


[sage-combinat-devel] Inversion of matrix...

2013-09-03 Thread Nicolas Borie

Hi all,

I am fighting with the same problem for too much time... I want to 
invert matrices (squares and invertibles especially because they 
represent basis change of a finite dimensional quotient : K[X] / 
Sym(X)^+ ). We begin to have a large bunch of combinatorial ring in 
sage-combinat and most of them use a combinatorial free module data 
structure but the sage matrices doesn't like combinatorial free modules...


For all such matrix M, in a perfect world : I just want : 
(1/M.det)*M.adjoint()  ( --> and all algorithms are already here and 
work fine, It is just a branching question between different features).


For now :
***
sage: SF = SymmetricFunctions(QQ).schur()
sage: Id = identity_matrix(SF, 2); Id
[s[]   0]
[  0 s[]]
sage: Id.inverse()
Traceback (most recent call last):
...
AttributeError: 'SymmetricFunctionAlgebra_schur_with_category' object 
has no attribute 'fraction_field'

sage: ~Id.det()
s[]
sage: ~Id.det()*Id.adjoint()
Traceback (most recent call last):
...
TypeError: unsupported operand parent(s) for '*': 'Symmetric Functions 
over Rational Field in the Schur basis' and 'Full MatrixSpace of 2 by 2 
dense matrices over Symmetric Functions over Rational Field in the Schur 
basis'

***

Perhaps due to the fact that :
***
sage: Id
[s[]   0]
[  0 s[]]
sage: P = Id.parent(); P
Full MatrixSpace of 2 by 2 dense matrices over Symmetric Functions over 
Rational Field in the Schur basis

sage: P.has_coerce_map_from(SF)
False
***

Let's fix some compatibility bug with Combinatorial free module (because 
SF['x'] doesn't means polynomial in x over SF in combinat world but 
return a ValueError explaining that ['x'] is not a valid partition) and 
had a nice coercion, I still have the same error. But the sage matrix 
spaces use "some" category (the "some" is very important I guess but 
that already go further than my knowledge... I do not know anything with 
old category framework...):

***
sage: SF = SymmetricFunctions(QQ).schur()
sage: Id = identity_matrix(SF, 2); Id
[s[]   0]
[  0 s[]]
sage: P = Id.parent()
sage: P.category()
Category of algebras over Symmetric Functions over Rational Field in the 
Schur basis

sage: P.__class__.mro()
[sage.matrix.matrix_space.MatrixSpace,
 sage.structure.unique_representation.UniqueRepresentation,
 sage.structure.unique_representation.CachedRepresentation,
 sage.misc.fast_methods.WithEqualityById,
 sage.structure.parent_gens.ParentWithGens,
 sage.structure.parent_base.ParentWithBase,
 sage.structure.parent_old.Parent,
 sage.structure.parent.Parent,
 sage.structure.category_object.CategoryObject,
 sage.structure.sage_object.SageObject,
 object]
sage: SF(1)
s[]
sage: SF(1)*Id
Traceback (most recent call last):
...
TypeError: unsupported operand parent(s) for '*': 'Symmetric Functions 
over Rational Field in the Schur basis' and 'Full MatrixSpace of 2 by 2 
dense matrices over Symmetric Functions over Rational Field in the Schur 
basis'

***

So, I need some advises to fix that... And currently, I find very hard 
to evaluate the difficulty to do it without an horrible hack since :
- the class sage/matric/matrix_space.MatrixSpace seems to present 
problem with inheritance...

- this code seems to not be new category framework compatible
- tests in this file only concerns : ZZ, QQ, GF(11), GF(2), SR, RDF, 
CDF, CyclotomicField(7), QQ['x,y'] (inversion tests are at the end of 
the file matrix_space.py) (not any combinatorial free module ring...)


I also didn't find where was implemented usual coercions between rings 
and their corresponding matrix_space (ZZ, QQ, ...) and I do not manage 
to find where (internal/external) products are implemented. I am lost in 
a lot of code. If someone can help, feel free to give me some advises. I 
will still try to dig in...


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.


[sage-combinat-devel] Re: [sage-devel] Inverse a matrix over a ring with a unit determinant

2013-07-10 Thread Nicolas Borie

Le 10/07/2013 17:10, David Roe a écrit :



I think the right solution is to define a method inverse_of_unit for 
general square matrices, implemented exactly as you suggest (it should 
go in matrix0.pyx). Unlike __invert__, this would not change base 
rings and would fail for matrices with non-unit determinant.  Such a 
function already exists a few places in Sage (integers, p-adics, 
polynomials).


def inverse_of_unit(self):
R = self.base_ring()
d = R(~self.det())
return d*self.adjoint()

Thanks you very much. I Just realized that there everything already in 
Sage (Division free algorithms for charpoly, thus adjoint, thus 
inverse).


I just add Sage-combinat-devel for the following issue :

The first problem appearing when I try to invert is that a method : 
change_variable_name rename the variable used in the charpoly :


*
def change_variable_name(self, var):
"""
Return a new polynomial over the same base ring but in a different
variable.
...
"""
R = self.parent().base_ring()[var]    NOT COMBINATORIAL 
FREE MODULE COMPATIBLE 

return R(self.list())
*

Which gives the following error for rings and algebras using the 
CombinatorialFreeModule data structure (Because the call try to build an 
element basis from a combinatorial object (Partition, Permutation, 
Composition, ...))


*
ValueError: ['x'] is not an element of Partitions
*

So, can someone confirm it is ok to change the line in the 
change_variable_name method for:

R = PolynomialRing(self.parent().base_ring(), var)

Anyway, after that, everything should work fine :

*
sage: SF = SymmetricFunctions(QQ).schur()
sage: Id = identity_matrix(SF, 6);
sage: Id
[s[]   0   0   0   0   0]
[  0 s[]   0   0   0   0]
[  0   0 s[]   0   0   0]
[  0   0   0 s[]   0   0]
[  0   0   0   0 s[]   0]
[  0   0   0   0   0 s[]]
sage: Id._charpoly_df()
s[]*x^6 - 6*s[]*x^5 + 15*s[]*x^4 - 20*s[]*x^3 + 15*s[]*x^2 - 6*s[]*x + s[]
sage: Id.charpoly()
Traceback (most recent call last):
...
ValueError: ['x'] is not an element of Partitions
*********

Cheers,
Nicolas Borie.

--
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: queue broken on 5.6 (fixed)

2013-02-22 Thread Nicolas Borie

Le 22/02/2013 16:59, Travis Scrimshaw a écrit :

Hey Franco,
   I noticed that this morning and fixed it (about an hour ago and it 
was an error on every version caused by me).



I confirm that both of you are right!!!

This is fixed! But the sage -combinat script stop when applying the 
queue (telling to rebase the int_vect_reviewpatch). Once it has 
stop, an "hg qpush -a" can apply all the queue... This is a strange 
behavior.


Thanks Travis for all your work (In general (queue and cleaning basic 
combinatorial objects...)).


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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-combinat-devel] Re: how to rebase a patch ?

2012-07-16 Thread Nicolas Borie

Le 16/07/2012 12:45, Simon King a écrit :
While we are at it: One thing that prevents me from working with the 
combinat queue is that I never understood what I need to set up in 
order to push my local changes to the "official" combinat queue. Best 
regards, Simon 

Hi,

Pushing - Pulling on the official combinat repository can be set in your 
~/.hgrc file : look the documentation at :

http://wiki.sagemath.org/combinat/MercurialStepByStep#Mercurial_configuration

I currently have something like ten different mercurial local 
repositories on my computer and just being located in 
/opt/sage/devel/sage-combinat/.hg/patches/ is enought for my hg command 
to select the right place to push/pull.


Best regards,
Nicolas B.

--
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] breakage of k-Schur function code

2012-04-22 Thread Nicolas Borie

Le 22/04/2012 17:21, Anne Schilling a écrit :

Hi Christian, Nicolas, Mike, 

I still get problems with k-Schur functions with the whole sage-combinat queue 
applied.
Without the queue, everything works fine.

Best,

Anne

--

sage: ks3 = kSchurFunctions(QQ,3,1)
sage: h = SFAHomogeneous(QQ)
sage: h(ks3[3,2,1])
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (387, 0))

---
TypeError Traceback (most recent call last)

/Applications/sage-5.0.beta7/local/lib/python2.7/site-packages/sage/combinat/integer_vector.pyc
 in __call__(self, sum, length, policy, **kwargs)
 633 return IntegerVectors_of_sum_and_length(sum 
,length, policy)
 634 else:
-->  635 return 
IntegerVectors_of_sum_and_length_with_constraints(sum, length, policy, **kwargs)
 636 elif isinstance(length, tuple):
 637 return IntegerVectors_of_sum_with_non_descents(sum, 
length, policy)

/Applications/sage-5.0.beta7/local/lib/python2.7/site-packages/sage/misc/classcall_metaclass.so
 in sage.misc.classcall_metaclass.ClasscallType.__call__ 
(sage/misc/classcall_metaclass.c:775)()


Hello,

This was broken by my "try of" refactoring integer vectors. I just 
guarded severals patches related on this... I can't apply all the queue 
now but until the patch kshape-om.patch (which needs rebase on 
5.0.beta12), it should work now :


--
| Sage Version 5.0.beta12, Release Date: 2012-04-04  |
| Type notebook() for the GUI, and license() for information.|
--
**
**
* Warning: this is a prerelease version, and it may be unstable. *
**
**
Loading Sage library. Current Mercurial branch is: combinat

sage: ks3 = kSchurFunctions(QQ,3,1)
sage: h = SFAHomogeneous(QQ)
sage: h(ks3[3,2,1])
h[3, 2, 1] - h[3, 3]

Cheers,
Nicolas B.

--
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.



[sage-combinat-devel] Spirit of Facades

2012-04-12 Thread Nicolas Borie
Hello,

I would like to have some precision about Facades. In the Facade code,
the documentation say :
**
A *facade set* is a parent ``P`` whose elements actually belong to some
other parent
**
I don't want to play with the sense of words and especially the sense of
the word 'belong' in the previous quoted sentence.

If P is a parent with an element class E and F is another parent whose
elements can't be mathematically seen as element of P(i.e. can't belong
to P) but can be 'built', 'ordered' or 'described' by (some) elements of
P. Is it possible, coherent, good to implement F as a facade set of P ?

Example : Let P a set with an element class E. Let ~ be an binary
equivalence relation over elements of P and F the quotient of P by the
equivalence relation ~. If P is ordered, we can use the order to set a
representative of each equivalence class. So any element of F(the
quotient) can be represented by an element of P, but mathematically, an
equivalence class can't be seen as an element of P (but as a subset of
P). I would have think the facade feature is appropriated in such case,
do you have any opinion or advise ?

I don't think the documentation of facade is bad but I did remember (or
perhaps listened...) that facade was made also for sharing data
structure for elements. If there are some specifications for facades, I
find very hard to access to them in the documentation.

If you allow me to implement my quotient set with facade, I will be very
happy to add it as an exemple in the facade documentation.

sage: Posets().Facade().Finite() is  Posets().Finite().Facade()
True
HHAA
Incredible a such thing works!

Cheers, 
Nicolas B.

-- 
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] Re: Sage-Combinat queue fixed for 4.8

2012-04-04 Thread Nicolas Borie
Le mercredi 04 avril 2012 à 18:44 +0200, Nicolas M. Thiery a écrit :
>   Hi Nicolas, Florent!
> 
> On Wed, Apr 04, 2012 at 06:23:57PM +0200, Nicolas Borie wrote:
> > I am using the 5.0.beta2 (The Cernay2012 version) and the sage -combinat
> > update give me :
> > ...
> > Is there anything to be fixed or should I go directly to the beta11 ?
> 
> Please go to beta11; I have just updated the queue, and it seems to
> apply smoothly. It's likely to apply fine on beta12 as well (I am
> compiling it right now).

Ok, thanks for the answer! Half is already downloaded...

Cheers, 
Nicolas B.

-- 
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] Re: Sage-Combinat queue fixed for 4.8

2012-04-04 Thread Nicolas Borie
Hello,

I am using the 5.0.beta2 (The Cernay2012 version) and the sage -combinat
update give me :


patching file sage/graphs/digraph.py
Hunk #2 FAILED at 294
Hunk #4 succeeded at 601 with fuzz 1 (offset -10 lines).
1 out of 4 hunks FAILED -- saving rejects to file
sage/graphs/digraph.py.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working dir
errors during apply, please fix and refresh
trac_12653-graph_from_dictionary_of_iterables-nt.patch
Abort


Is there anything to be fixed or should I go directly to the beta11 ?

Cheers, 
Nicolas B.

-- 
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 Partitions

2012-03-13 Thread Nicolas Borie
Le mardi 13 mars 2012 à 14:57 +0100, Nicolas M. Thiery a écrit :
> On Tue, Mar 13, 2012 at 02:11:10PM +0100, Martin Rubey wrote:
> > "Nicolas M. Thiery"  writes:
> > In the code at hand I'd prefer to have the empty list.  Currently I need
> > to have a case distinction...
> > 
> > With keyword argument min_part, we also get the empty list, by the way.
> 
> Thanks for the feedback. Any preference anyone?

Hello,

I do not have any preference but I really think that this question is
very important. Such corner case appears in all basic combinatoric
objects and it could be fine to fix a general rule for such cases,
especially since we intend to refactor basic some combinatorial objects
with Cython, ClonableIntArray, SetFactories and Selectors...

>From my point of view, the problem is the following :
You have a Constructor or SetFactory which have a lot of possible
arguments and your code have to dealt with combination of arguments that
make your set empty:

Exemple :
IntegerVectors(inner=[3,3,2], outer=[1,1,1])
Partitions(-1)
Combinations(min_part=3, max_part=2)
...

I could be fine to adopt the same behaviour every times :

(1) - I consider each argument as a mathematical condition thus if two
arguments make the set empty, it is the problem of the user and I return
the EmptySet (better than the empty list, doing the same than the empty
list but category compatible).

(2) - I need to inform the user that he is asking for a absurdity
because  (3 <= size_part <= 2) ==> (3 <= 2) is a mathematical absurdity.
I return a ValueError.

(3) - Choosing (1) or (2) following the case.

***

Extra question : What should return 
IntegerVectors(inner=[1,1,1], outer=[1,1]) ?
(1) An error ?
(2) An infinite set {[1,1,1], [1,1,2], [1,1,3], [1,1,4], ... }

I do not have a strong experience for the long run on that but I played
a lot with. It is not easy to choose a behaviour especially when one
doesn't know so much use cases.

Cheers,
Nicolas B.

-- 
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] comments/questions on poset code

2012-02-24 Thread Nicolas Borie
Le vendredi 24 février 2012 à 00:30 -0800, Anne Schilling a écrit :
> ---
> 
> sage: strongTableau([[-1, -2, -3], [3]],2,[3] )

You also should try : 
strongTableau([[-1,-2,-3],[3]], 2, 3)

In the __init__ of strongTableaux, the error message is not properly
displayed... Look at :

sage: t = (3,)
sage: type(t)

sage: "%s should be a tuple"%t   
'3 should be a tuple'
sage: "%s should be a tuple"%(t,)
'(3,) should be a tuple'

This will avoid the non-sense message :
ValueError: 3 is not a positive integer

Cheers,
Nicolas B.

-- 
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] comments/questions on poset code

2012-02-24 Thread Nicolas Borie
Le vendredi 24 février 2012 à 00:30 -0800, Anne Schilling a écrit :
> Hi Florent,
> 
> I changed this over to ClonableList, but still get the same error. Could you
> please have a look to see what is wrong.
> ---
> 
> sage: strongTableau([[-1, -2, -3], [3]],2,[3] )
> ---
> TypeError Traceback (most recent call last)
..
> 
> TypeError: unhashable type: 'list'

Hello,

For a thirst element of answer (because i am not able to give a full
answer), as your the parent of your elements inherit from
UniqueRepresentation, you need to give hashable argument to the parent.

So, when your code call strongTableux( bla, bli, blo, ...), all bla, bli
and blo must be hashable. This this reason, python list are not an
option here. You should convert them to tuple.

I just try to run :
strongTableau( [[-1, -2, -3], [3]], 2, (3,) ) <-- tuple for the last
argument.

You will see the error has change. But as I never read this code, I
don't really know if it is an advance or not... I hope this will help
you.

Cheers,
Nicolas B. 

-- 
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] comments/questions on poset code

2012-02-18 Thread Nicolas Borie
Le samedi 18 février 2012 à 09:29 -0800, Anne Schilling a écrit :
> Which patch is ClonableIntArray in? For me it is not defined (and I am 
> hesitant to base my
> code on something not yet in sage):
> 
> sage: class toto(ClonableIntArray):
> : def check(self): pass
> :
> ---
> NameError Traceback (most recent call last)
> 
> /Applications/sage-5.0.beta3/devel/sage-combinat/sage/combinat/posets/  console> in ()
> 
> NameError: name 'ClonableIntArray' is not defined

Hello,

I think it is already in Sage. You just have to import it. As Nicolas T.
show us during the last Cernay meeting, you can use the
'import_statements' function to get the path.

sage: import_statements(ClonableIntArray)
from sage.structure.list_clone import ClonableIntArray

I really love this function... I already spend so much time searching in
the sources for any object.

Cheers,
Nicolas.

-- 
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] Re: [sage-devel] Free groups, feedback wanted.

2012-01-23 Thread Nicolas Borie
Le lundi 23 janvier 2012 à 03:58 -0800, Dima Pasechnik a écrit :
> Given that Chevie needs Maple, it can be regarded as "highly
> optional". 

Hello Dima,

If you are a Chevie lover, you can already have it in Sage in a fully
open-source way. As Jean pointed out, Chevie is also a GAP'3' <--
package. For this reason, Franco took the time to implement an optional
interface to Gap3 (see #8380 and thanks to Franco one more time). That
still optional but that's not a Maple constraint...

Cheers,
Nicolas.

-- 
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.



[sage-combinat-devel] Re: [sage-devel] Free groups, feedback wanted.

2012-01-22 Thread Nicolas Borie
Le dimanche 22 janvier 2012 à 11:37 -0800, mmarco a écrit :
> I am trying to implement free groups, finitely presented groups and
> braid groups in sage. So far i have writen a proof of concept for the
> free groups (see ticket 12339), but i don't have any experience with
> the category and coercion frameworks.
> 
> Any feedback and/or colaboration would be most welcome.

Hello,

Some veterans of the sage combinat community have probably already
"think" about adding free groups and braid groups in Sage. It was
perhaps discussed during the sage-gap_chevie meeting last year, I don't
remember. For this reason, I also send this topic to
sage-combinat-devel.

You should look at some examples already in Sage (and there is not
enough example for now...). I added an example of group using the
category framework some time ago (with an expert under my shoulder (my
thesis advisor : Nicolas Thiéry)). Categories are in the file :
sage/categories/...your...category...py
and some of these categories have example in the file :
sage/categories/examples/...your...category...py

You should look in examples how to initialize properly the category of
the parent and where place the element class, look also at the
conventional name of methods (I think identity_element() should be
one()), ...

A nice entrance point for the categories is:
sage: sage.categories.primer?
I can assure you that the authors will be VERY VERY happy to get some
comments about this primer, feel free to post them on
sage-combinat-devel.

The first time with categories will cost you some time to adapt your
code to the framework but it produced a more robust code, more
factorized code and better tests. 

Look at the Dihedral groups in the file : 
sage/categories/examples/finite_coxeter_groups.py
250 lines allows you to benefit of functorial construction as follows
(here the group algebra of a group):

sage: D5 = DihedralGroup(5); D5
Dihedral group of order 10 as a permutation group
sage: TestSuite(D5).run(verbose=True)
running ._test_an_element() . . . pass
running ._test_associativity() . . . pass
running ._test_category() . . . pass
running ._test_elements() . . .
  Running the test suite of self.an_element()
  running ._test_category() . . . pass
  running ._test_eq() . . . pass
  running ._test_not_implemented_methods() . . . pass
  running ._test_pickling() . . . pass
  pass
running ._test_elements_eq() . . . pass
running ._test_enumerated_set_contains() . . . pass
running ._test_enumerated_set_iter_cardinality() . . . pass
running ._test_enumerated_set_iter_list() . . . pass
running ._test_eq() . . . pass
running ._test_inverse() . . . pass
running ._test_len() . . . pass
running ._test_not_implemented_methods() . . . pass
running ._test_one() . . . pass
running ._test_pickling() . . . pass
running ._test_prod() . . . pass
running ._test_some_elements() . . . pass
sage: GA_D5 = D5.algebra(QQ); GA_D5
Group algebra of Dihedral group of order 10 as a permutation group over
Rational Field
sage: p = GA_D5.an_element(); p
B[()] + 2*B[(2,5)(3,4)] + 3*B[(1,2)(3,5)] + B[(1,2,3,4,5)]
sage: (p+1)^2
17*B[()] + 11*B[(2,5)(3,4)] + 14*B[(1,2)(3,5)] + 10*B[(1,2,3,4,5)] +
3*B[(1,3)(4,5)] + B[(1,3,5,2,4)] + 6*B[(1,5,4,3,2)] + 2*B[(1,5)(2,4)]
sage: TestSuite(GA_D5).run(verbose=True)
running ._test_additive_associativity() . . . pass
running ._test_an_element() . . . pass
running ._test_associativity() . . . pass
running ._test_category() . . . pass
running ._test_distributivity() . . . pass
running ._test_elements() . . .
  Running the test suite of self.an_element()
  running ._test_category() . . . pass
  running ._test_eq() . . . pass
  running ._test_not_implemented_methods() . . . pass
  running ._test_pickling() . . . pass
  pass
running ._test_elements_eq() . . . pass
running ._test_eq() . . . pass
running ._test_len() . . . pass
running ._test_not_implemented_methods() . . . pass
running ._test_one() . . . pass
running ._test_pickling() . . . pass
running ._test_prod() . . . pass
running ._test_some_elements() . . . pass
running ._test_zero() . . . pass


Checking the TestSuite is an excellent way to verify you correctly use
the category framework. (necessary but not sufficient)

This was just a small tour about the categories and some expert will
probably tell better advises than me. Also sorry for my English.

Cheers,
Nicolas Borie.

-- 
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] min-part, max-part

2012-01-19 Thread Nicolas Borie
Le jeudi 19 janvier 2012 à 09:30 +, Vincent Delecroix a écrit :
> sage: c = Composition([2,2,1])
> sage: C1 = Compositions(5,outer=c); C1
> Compositions of the integer 5 satisfying constraints outer=[2, 2, 1]
> sage: C1.list()
> ---
> TypeError Traceback (most recent call last)
> ...
> TypeError: 'Composition_class' object is not callable
> sage: C2 = Compositions(5,outer=list(c)); C2
> Compositions of the integer 5 satisfying constraints outer=[2, 2, 1]
> sage: C2.list()
> [[2, 2, 1]]
> }}}

Hello Vincent,

I think we should record such things for the week at Cernay during which
we intend to speak about basic object in combinatorics.

Feel free to create a wiki page about weirdness in basics objects of
combinatorics. I will also try to add some comments about integer
vectors. I think you are clearly right about the fact that inner/outer
can be elements of the parent as the feature is related to a (partial)
order relation between elements.

We will have exactly the same problem with integer vectors (inner and
outer are also options when define the parent). Currently integer
vectors are Python lists and thus the problem did not appear but when we
will have an element class for integer vectors, we will have to dealt
the same problem.

For a parent P, should the option allows anything bla such that
P.__call__(bla) return an element of P ?

I don't know but we should set a good spec (secure and user friendly)
for such arguments.

For now, as we perhaps plan the refactoring (and cythonizing) of
compositions, I don't know if it is important to create the ticket now
but yes, we should record a such bug.

Cheers,
Nicolas.

-- 
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] Reject in the queue

2011-11-21 Thread Nicolas Borie
Le lundi 21 novembre 2011 à 10:27 +0100, Florent Hivert a écrit :
> Dear Nicolas,
> 
> On sage-4.7.2, I got the following reject:
> 
> application de iter_method_for_integer_vectors-nb.patch
...
> Can you check it ?

Done.

It was a very old stuff I shoud have removed before you got this
rejection.

Cheers,
Nicolas B.

-- 
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.



[sage-combinat-devel] IntegerVectors and ClonableIntArray

2011-11-20 Thread Nicolas Borie
Hello,

I am currently developing an experimental refactoring of the
IntegerVectors with a data structure for elements inheriting from
ClonableIntArray.

Among the different Goals of this refactoring, there are :
- Use properly the categories ((Infinite)EnumeratedSets())
- Speed up computation by using Cython.
- Make IntegerVector being hashable to index element basis of some nice
module.
- Enjoy of the clone method.

I implemented several classes. Firstly IntegerVectors_all() (with all
optional arguments set to None) will contains all IntegerVectors and
other subset with constraints which are facades of the first one.

Although that not natural, I gave to all these set an iterator given
freely by SearchForest. This choice is motivated by the plug of post
process in subsets of IntegerVectors. There is not a really canonical
way to enumerated all integer vectors but I think it is very convenient
that the user can define any post process of his choice (think about a
test which modify the vector or destroy it(by returning None) ) and
obtains the corresponding facade subset with category of all
IntegerVectors.

For now, I have :

IntegerVectors_all --> (Infinite)EnumeratedSet
with a deglex iterator for which the degree of an integer vector v is
the sum of the length plus the sum of all entries of v.

IntegerVectors_of_length --> (Infinite)EnumeratedSet
with a classical deglex iterator if you see a integer vector v codding
for the exponents of a monomials in n variable where n is the length

IntegerVectors_of_length_and_sum --> FiniteEnumeratedSet
with a classical lexicographic iterator (the set is here finite...)

IntegerVectors_of_sum --> (Infinite)EnumeratedSet
with an iterator containing the iterator coming from
IntegerVectors_of_length_and_sum beginning by vectors of length 0 and
increasing it step by step.

When a post process is defined, the cardinality is often unknown unless
the set was already finite before.

Here is an example of use : Enumerated all integer vectors in which the
second entry, if it exists, is not the integer '1' :
*
sage: def pp(v):
: if len(v) >= 2:
: if v[1] == 1:
: return None
: return v
: 
sage: C = IntegerVectors2(post_process = pp)
sage: p = iter(C)
sage: for i in range(30): p.next()
: 
[]
[0]
[1]
[0, 0]
[2]
[1, 0]
[0, 0, 0]
[3]
[2, 0]
[0, 2]
[1, 0, 0]
[0, 0, 1]
[0, 0, 0, 0]
[4]
[3, 0]
[1, 2]
[0, 3]
[2, 0, 0]
[1, 0, 1]
[0, 2, 0]
[0, 0, 2]
[1, 0, 0, 0]
[0, 0, 1, 0]
[0, 0, 0, 1]
[0, 0, 0, 0, 0]
[5]
[4, 0]
[2, 2]
[1, 3]
[0, 4]
sage: TestSuite(C).run()
Failure in _test_pickling:
Traceback (most recent call last):
...

The following tests failed: _test_pickling

Warning : That's pickable if and only if your post process if
pickable... exactly like in SearchForest...

*

Now comes the questions :
- Does that seems coherent to you ?
- What do you think about the design ?
- Do you think all such classes deserves to have an __iter__ method ?
- What are the most crucial features for IntegerVectors ?
- What did you used more often from the old IntegerVectors module ?
- Does, with time, the old implementation be overwrite by a kind of this
refactoring ?
- Florent, when you developed ClonableIntArray, I am sure you had
thinking a little about a such refactoring for the futur. Do you have
any advise ? any suggestion ? 

IntegerVectors are currenty imported in the following files :
sage/rings/polynomial/multi_polynomial_ring_generic.pyx
sage/combinat/subset.py
sage/combinat/crystals/kirillov_reshetikhin.py
sage/combinat/combination.py
sage/combinat/partition.py
sage/combinat/skew_tableau.py
sage/combinat/words/shuffle_product.py
sage/combinat/tableau.py
sage/combinat/lyndon_word.py
sage/crypto/mq/sbox.py

I hope a such refactoring is not a too much hard task for me. The more
basic is the feature, harder are the choice for the design... Here,
there is a relatively strong impact on the rest of combinat, therefore
my experimental patch will remains garded in the queue.

Cheers,
Nicolas B.

-- 
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] ClonableElement and Parent compatibility

2011-10-17 Thread Nicolas Borie
Hello, 

I am very sorry, All was already in the doc!


def _element_constructor_from_element_class(self, *args,
**keywords):
"""
... 

Caveat: ``self`` is passed to the constructor of the
element class as a keyword argument ``parent``. Many
element classes in Sage, in particular those implemented
by mean of extension types, take ``parent`` as first
mandatory argument instead.

This incompatibility will be fixed soon (Fall 2009?) by
having all element classes take ``parent`` as first
mandatory argument, and updating this default
implementation of :meth:`_element_constructor_`.
...
"""

So I could have find myself the answer.

Cheers, 
Nicolas.


-- 
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] ClonableElement and Parent compatibility

2011-10-17 Thread Nicolas Borie
Le dimanche 16 octobre 2011 à 23:58 +0200, Florent Hivert a écrit :
> Also I can't reproduce you behavior:
> 
> --
> | Sage Version 4.7.1, Release Date: 2011-08-11   |
> | Type notebook() for the GUI, and license() for information.|
> --
> sage: class MyParent(Parent):
> : class Element(ClonableIntArray):
> : def check(self):
> : pass
> : 
> sage: B = MyParent()
> sage: B([0,0,0])
> ---
> NotImplementedError   Traceback (most recent call last)
> 
> /home/florent/ in ()
> 
> /home/florent/src/Sage/sage/local/lib/python2.6/site-packages/sage/structure/parent.so
>  in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:6915)()
> 
> NotImplementedError: 

Hello

I find the error well placed here. I am very ok with a Not Implemented
Error instead of problem of positional arguments.

I try to reproduce the code to get the NotImplementedError. And it was
very difficult, because, every times, I use the element_class to be
convinced that the piece of code is working well. But using it probably
modify something somewhere, look:

sage: class Myparent(Parent):
: class Element(ClonableIntArray):
: def check(self):
: pass
: 
sage: B = Myparent()
sage: B([0,0,0,0])  # First call
---
NotImplementedError   Traceback (most recent call
last)
...
NotImplementedError: 
sage: B.element_class(B, [0,0,0,0])
[0, 0, 0, 0]
sage: B([0,0,0,0])  # Call after using element_class
---
TypeError Traceback (most recent call
last)
...
TypeError: __init__() takes at least 2 positional arguments (1 given)

I don't think that so much disturbing, but when you meet only the second
error (because of any reason) without seeing the first one, I was
thinking the _element_constructor_from_element_class method of set_cat
was incompatible with the __init__ of ClonableIntArray. 

Anyway, I didn't find any obstruction of the use of ClonableIntArray.

Sorry for the noise.

Cheers,
Nicolas.



-- 
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] ClonableElement and Parent compatibility

2011-10-17 Thread Nicolas Borie
Le dimanche 16 octobre 2011 à 23:58 +0200, Florent Hivert a écrit :
> Also I can't reproduce you behavior:
> 
> --
> | Sage Version 4.7.1, Release Date: 2011-08-11   |
> | Type notebook() for the GUI, and license() for information.|
> --
> sage: class MyParent(Parent):
> : class Element(ClonableIntArray):
> : def check(self):
> : pass
> : 
> sage: B = MyParent()
> sage: B([0,0,0])
> ---
> NotImplementedError   Traceback (most recent call last)
> 
> /home/florent/ in ()
> 
> /home/florent/src/Sage/sage/local/lib/python2.6/site-packages/sage/structure/parent.so
>  in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:6915)()
> 
> NotImplementedError: 

Hello

I find the error well placed here. I am very ok with a Not Implemented
Error instead of problem of positional arguments.

I try to reproduce the code to get the NotImplementedError. And it was
very difficult, because, every times, I use the element_class to be
convinced that the piece of code is working well. But using it probably
modify something somewhere, look:

sage: class Myparent(Parent):
: class Element(ClonableIntArray):
: def check(self):
: pass
: 
sage: B = Myparent()
sage: B([0,0,0,0])  # First call
---
NotImplementedError   Traceback (most recent call
last)
...
NotImplementedError: 
sage: B.element_class(B, [0,0,0,0])
[0, 0, 0, 0]
sage: B([0,0,0,0])  # Call after using element_class
---
TypeError Traceback (most recent call
last)
...
TypeError: __init__() takes at least 2 positional arguments (1 given)

I don't think that so much disturbing, but when you meet only the second
error (because of any reason) without seeing the first one, I was
thinking the _element_constructor_from_element_class method of set_cat
was incompatible with the __init__ of ClonableIntArray. 

Anyway, I didn't find any obstruction of the use of ClonableIntArray.

Sorry for the noise.

Cheers,
Nicolas.


-- 
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] ClonableElement and Parent compatibility

2011-10-16 Thread Nicolas Borie
Le dimanche 16 octobre 2011 à 23:58 +0200, Florent Hivert a écrit :
> Which version of sage are you using ?

I use the 4.7.1 with combinat...

nicolas@lancelot:/opt/sage/devel/sage-combinat$ hg qtop
trac_6812_integer_vectors_mod_permgroup.patch
nicolas@lancelot:/opt/sage/devel/sage-combinat$ sage -br

--
sage: Building and installing modified Sage library files.
...
...
--
| Sage Version 4.7.1, Release Date: 2011-08-11   |
| Type notebook() for the GUI, and license() for information.|
--
Loading Sage library. Current Mercurial branch is: combinat
sage: class Myparent(Parent):
: class Element(ClonableIntArray):
: def check(self):
: pass
: 
sage: B = Myparent()
sage: B.element_class(B, [0,0,0,0])
[0, 0, 0, 0]
sage: B([0,0,0,0])
---
TypeError Traceback (most recent call
last)

/opt/sage/devel/sage-combinat/ in ()

/opt/sage/local/lib/python2.6/site-packages/sage/structure/parent.so in
sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7149)()

/opt/sage/local/lib/python2.6/site-packages/sage/structure/coerce_maps.so in 
sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
(sage/structure/coerce_maps.c:3254)()

/opt/sage/local/lib/python2.6/site-packages/sage/structure/coerce_maps.so in 
sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
(sage/structure/coerce_maps.c:3157)()

/opt/sage/local/lib/python2.6/site-packages/sage/categories/sets_cat.pyc
in _element_constructor_from_element_class(self, *args, **keywords)
307 17
308 """
--> 309 return self.element_class(parent = self, *args,
**keywords)
310 
311 def is_parent_of(self, element):

/opt/sage/local/lib/python2.6/site-packages/sage/structure/list_clone.so
in sage.structure.list_clone.ClonableIntArray.__init__
(sage/structure/list_clone.c:6591)()

TypeError: __init__() takes at least 2 positional arguments (1 given)
sage: 

I am surprised we don't have the same error returned. Even when I unapply all 
patches, I still have the same error about the mismatching of positional 
arguments.

Cheers,
Nicolas.


-- 
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.



[sage-combinat-devel] ClonableElement and Parent compatibility

2011-10-16 Thread Nicolas Borie
Hello,

I am trying to finalise the module enumerating integer vectors modulo
the action of a permutation group. In order to benefit as much as I can
of the useful features already available, I was converting my integer
vectors in nice ClonableIntArray instead of simple python lists.

I just found a micro incompatibility between ClonableIntArray and
Parent. Here is a minimal example:

*
sage: class Myparent(Parent):
: class Element(ClonableIntArray):
: def check(self):
: pass
: 
sage: B = Myparent()
sage: B.element_class(B, [0,0,0])
[0, 0, 0]
sage: B.element_class(parent=B, [0,0,0])

   File "", line 1
SyntaxError: non-keyword arg after keyword arg (, line
1)
sage: B([0,0,0])
---
TypeError Traceback (most recent call
last)

/opt/sage/devel/sage-combinat/ in ()

/opt/sage/local/lib/python2.6/site-packages/sage/structure/parent.so in
sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7149)()

/opt/sage/local/lib/python2.6/site-packages/sage/structure/coerce_maps.so in 
sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
(sage/structure/coerce_maps.c:3254)()

/opt/sage/local/lib/python2.6/site-packages/sage/structure/coerce_maps.so in 
sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
(sage/structure/coerce_maps.c:3157)()

/opt/sage/local/lib/python2.6/site-packages/sage/categories/sets_cat.pyc
in _element_constructor_from_element_class(self, *args, **keywords)
307 17
308 """
--> 309 return self.element_class(parent = self, *args,
**keywords)
310 
311 def is_parent_of(self, element):

/opt/sage/local/lib/python2.6/site-packages/sage/structure/list_clone.so
in sage.structure.list_clone.ClonableIntArray.__init__
(sage/structure/list_clone.c:6591)()

TypeError: __init__() takes at least 2 positional arguments (1 given)
*

B([0,0,0]) call B.element_class(parent=B, [0,0,0]) which returns an
error because it is probably not compatible with the :
def __init__(self, Parent parent, lst, check=True) (cython file!)
of ClonableIntArray.

I was thinking it needed something like :
def __init__(self, Parent parent=parent, lst, check=True)
but I do not know if Cython allows type declaration of optional
arguments. I try to search a little but I don't think that possible.

So Florent or anyone, please tell me how to fix that in a nice way.

I really want to use this feature for my elements!!! (I also think any
class modelling a subset of integer vectors with a nice check method
should use ClonableIntArray...)

Cheers,
Nicolas (the little).

-- 
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.



[sage-combinat-devel] Re: [sage-devel] where to put Sidon g-sets?

2011-07-25 Thread Nicolas Borie
Le lundi 25 juillet 2011 à 04:47 -0700, Martin Raum a écrit :
> Hello all,

Hello Martin,

> I happened to think about Sidon g-sets and to do some computations I
> implemented a recursive enumeration of such sets. Clearly, this would
> go into the combinatorics tree. I am not an expert in combinatorics.
> Since the code doesn't seem to fit in any of the files in sage/
> combinat, please could anybody point out the right place put it? I
> will then open a ticket with an according patch.

Creating a new file sidon_sets.py in root_sage/sage/combinat/ seems a
nice solution for such an enhancement. There are a lot of files inside
the folder but I think it is the first place anybody would search in
first.

Although a lot of people are in holidays, if you need more advises for
this implementation, you can also post to the sage-combinat-devel google
group.

Cheers,
Nicolas B.

-- 
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.



[sage-combinat-devel] Re: [sage-devel] Re: Coxter Groups

2011-07-25 Thread Nicolas Borie
Le dimanche 24 juillet 2011 à 15:38 -0700, Dima Pasechnik a écrit :
> On Sunday, 24 July 2011 22:37:05 UTC+1, Rafael T wrote:
> 
> The gap-system already has the ability to work with Coxeter
> groups: 
> http://www.gap-system.org/Gap3/Manual3/C075S005.htm Maybe I
> could use 
> some of their code? 

> GAP 3 (not the current GAP 4) has it, as an interface to a package
> called Chevie (written mostly in Maple, if I recall right),  but it's
> rather old unmaintained stuff.

I can't manage to use it now... So, it is perhaps broken these days (the
sage-combinat queue of patches is relatively experimental...).

To get the implementation of Coxeter groups in Sage, there is a lot of
things to do yourself.


See : 

print gap3._install_hints()

Your attempt to start GAP3 failed, either because you do not have
have GAP3 installed, or because it is not configured correctly.

- If you do not have GAP3 installed, then you must download and
  install it yourself because it is not distrubuted with Sage.
  Here are some ways to obtain GAP3:

- There is an optional Sage package providing GAP3 pre-packaged
  with several GAP3 packages:
http://trac.sagemath.org/sage_trac/ticket/8906

- Frank Luebeck maintains a GAP3 Linux executable, optimized
  for i686 and statically linked for jobs of 2 GByte or more:
http://www.math.rwth-aachen.de/~Frank.Luebeck/gap/GAP3

- Jean Michel maintains a version of GAP3 pre-packaged with
  CHEVIE and VKCURVE. It can be obtained here:
http://people.math.jussieu.fr/~jmichel/chevie/chevie.html

- Finally, you can download GAP3 from the GAP website below.
Since
  GAP3 is no longer an officially supported distribution of GAP,
it
  may not be easy to install this version.
http://www.gap-system.org/Gap3/Download3/download.html

- If you have GAP3 installed, then perhaps it is not configured
  correctly. Sage assumes that you can start GAP3 with the command
  /opt/gap3r4p4/bin/gap.sh. Alternatively, you can use the following
command
  to point Sage to the correct command for your system.

  gap3 = Gap3(command='/usr/local/bin/gap3')



Once you will have gap3 on your computer, it is not still ended. You
will have to make Sage know there Gap3 and chevie available.

On my computer, gap3 is at /opt/gap3r4p4/ . I tell it to sage like :

gap3 = Gap3(command='/opt/gap3r4p4/bin/gap.sh')

after that, i can do :
sage: gap3.console()
 
 Lehrstuhl D fuer
Mathematik 
   ###   RWTH
Aachen 
  ##
##  
 ##  # ###
#  
###  ##  ## #
## 
##   #   #   ## #
##
##   ##   # #
##
 # ###   ##  ## ##
## 
   # ##
###  
 #
#
##   Version 3
#
   ###   Release 4.4
#
  ## #   18 Apr 97
#
 ##
#   
##   #  Alice Niemeyer, Werner Nickel,  Martin
Schoenert 
   ###  Johannes Meier, Alex Wegner,Thomas
Bischops  
  ## #  Frank Celler,   Juergen Mnich,  Udo
Polis
  ###   ##  Thomas Breuer,  Goetz Pfeiffer, Hans U.
Besche   
   ##   Volkmar Felsch, Heiko Theissen, Alexander
Hulpke 
Ansgar Kaup,Akos Seress,Erzsebet
Horvath 
Bettina
Eick 
For help
enter: ?
gap> RequirePackage("chevie"); 

  Welcome  to  the  CHEVIE  package,  Version 4.devel (Feb 2010)
http://www.math.rwth-aachen.de/~CHEVIE for the stable version 3.1
http://www.math.jussieu.fr/~jmichel/chevie for this version

 Meinolf Geck,  Frank Luebeck,   Gerhard Hiss, 
 Gunter Malle,  Jean Michel, Goetz Pfeiffer
 Lehrstuhl D fuer Mathematik, RWTH Aachen
 Universit'e Paris VII
 AG Computational Mathematics Universit"at Kassel
 Galway University

   This replaces the former weyl package. For first help type
  ?CHEVIE Version 4 -- a short introduction

gap> quit;;
sage: 

***

Re: [sage-combinat-devel] Reject on sage-4.7

2011-04-27 Thread Nicolas Borie
Le mercredi 27 avril 2011 à 17:05 -0400, Nicolas M. Thiery a écrit :
> Option 3: add a guard +power_zero on your patch, and use
> 
> > sage -combinat qselect power_zero
> 
> to use it without bothering Vincent.

Yes, but I am only a mercurial adventurer of level 2. 

This is a nice option! I will try to manage the use of qselect and reach
the level 3... I will guard it tonight (GMT) after my last push.

Sorry for the noise.

Cheers,

Nicolas.


-- 
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] Reject on sage-4.7

2011-04-27 Thread Nicolas Borie
Le mercredi 27 avril 2011 à 20:24 +0200, Florent Hivert a écrit :
> Hi there,
> 
> I've a rejection both in sage-4.7-alpha5 and sage-4.7rc0:
> 
> application de sl2z_decomposition-vd.patch
> patching file sage/modular/arithgroup/arithgroup_perm.py
...
> 5 out of 10 hunks FAILED -- saving rejects to file 
> sage/modular/arithgroup/arithgroup_perm.py.rej
> l'application du patch a échoué, impossible de continuer (essayez avec -v)
> patch failed, rejects left in working dir
> des erreurs se sont produites durant l'application, veuillez corriger puis 
> rafraîchir sl2z_decomposition-vd.patch
> 
> Vincent, can you investigate it ?

Oups!!!

It is probably my fault. I created the patch :
trac_11257_avoid_coercion_power_zero-nb.patch

I put it very early in the queue, hopping this critical relatively small
patch could go in sage in a short time. As SL2Z didn't have a one()
method, I just had it in my patch.

I am a little afraid because my patch is not final and I will probably
modify it in the days to come. Anyway, #11257 is a kind of patch which
have influences to half of the objects in Sage (a modification on
generic_power of sage.structure.element). I also don't have a strong
experience on patching basic structure. So, for these reasons, I would
say propose two solutions:

1 - If sl2z_decomposition-vd.patch is not crucial for your current
research Vincent (or you don't intend to use it the days to come), we
can guard it until #11257 is final and I will try to deal with the
ticket as fast as I can. I don't want to give warranties I can't stand
but if some war veterans have time to check, give advises and review the
patch, it can be done in 2 or 3 days... It is one of my priority with
week.

2 - I will work on a separate branch, and you should rebase your patch
if #11257 go in sage before your work...

The point is just avoid rebase to each push. It is up to you.

Cheers,

Nicolas (the little).

-- 
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] Re: Big cleanup in partitions and permutations

2011-04-13 Thread Nicolas Borie
Hi,

I don't know if you intend to touch it but I have a modification in 
sage/groups/perm_gps/permgroup_element.pyx

I had the following method:
cpdef list _act_on_list_on_position(self, list x): 
""" 
Returns the right action of ``self`` on the list ``x``. This is the
action on positions. 

EXAMPLES::

sage: G = PermutationGroup([[(1,2,3,4,5,6)]]) 
sage: p = G.gen()^2; p 
(1,3,5)(2,4,6)
sage: p._act_on_list_on_position([1,2,3,4,5,6]) 
[3, 4, 5, 6, 1, 2] 
sage: p._act_on_list_on_position(['a','b','c','d','e','f']) 
['c', 'd', 'e', 'f', 'a', 'b']


Permutation have also a clone method of this one: 

sage: P = Permutation([3,4,5,6,1,2])
sage: P.action([1,2,3,4,5,6])
[3, 4, 5, 6, 1, 2]
sage: P.action(['a','b','c','d','e','f'])
['c', 'd', 'e', 'f', 'a', 'b']

This add is currently in the patch:
trac_6812_integer_vectors_mod_permgroup.patch
I had it in PermutationGroupElement to avoid systematic conversions.

I don't know if that will disturb you. You perhaps don't want to touch
PermutationGroupElement...

Good luck for everything! It's not going to be a simple work. I choice
the name "_act_on_list_on_position" with Nicolas but it is perhaps not
optimal... For sure the name of the method "action" for Permutation is
not really precise.

Thank for assigning to yourself this task.

Cheers, 
Nicolas (the little).

P.S. : For everyone! If you have any request / information / suggestion
to this task, it is time to say it on :
http://wiki.sagemath.org/combinat/Weirdness


-- 
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] Question(s) about Integer vectors mod permgroup

2011-04-11 Thread Nicolas Borie
> More precisely, before processing, I make the list of subgroups up to
> conjugation. Then I want to be able to sort the vectors depending on
> the conjugacy class of the stabilizer (I do not care about the class
> of the group).

There probably a lot of different strategy, I don't know the canonical
and efficient algorithm to build (or iddentify) the stabilizer. I
developed the integer vectors mod a permgroup for invariant theory. But,
it is not my goal to build strong support to group action. I just don't
know even if it exist in GAP (It is close for sure inside but I never
play with it).

So, if you want such feature, you should try dig this way. The only
thing `important` in the feature IntegerVectorsModPermGroup is the use
of categories and SearchForest (See sage/combinat/backtrack.py).
SearchForest allows the user to customize enumerated structure very
easily.

> A new question : is this the faster option ? Do we need to compute the
> orbit explicitely to get the answer to "is the stabilizer trivial ?" ?
> The typical input that i will give to the iterator corresponds to
> vectors of length around 20 and sum around 30... I need fast
> generation.

First thing, the current main cost of IntegerVectorsModPermGroup is due
to the GAP interface. Convert in Sage the Strong Generating System is
just horrible. see : 
sage: %time SymmetricGroup(20).strong_generating_system()
Wall time: 24.95 s
After, IntegerVectorsModPermGroup is optimized to call the function
`is_canonical` as least as possible. `is_canonical` return True if and
only if an integer vector is maximum for the lexicographic order in its
orbit under the action of a given permutation group. Let us imagine you
have another criteria `is_stabilizer_trivial` which have a very very
light cost. You should run it before testing if the integer vector is
canonical and thus, this engine of enumeration is no more optimized for
your case.

To the question : "Do we need to compute the orbit explicitely to get
the answer to "is the stabilizer trivial ?", I don't know. I guess not
but I really don't know the usual algorithm. It is probably in GAP
somewhere...

Anyway, you have SearchForest and you have an easy access to 
from sage.combinat.enumeration_mod_permgroup import is_canonical
which is a polymorph function : 
sage: G = PermutationGroup([[(1,2,3)]])
sage: sgs = G.strong_generating_system()
sage: is_canonical(sgs, [3,0,0])
True
sage: is_canonical(sgs, ['b','a','a'])
True
sage: is_canonical(sgs, ['a','b','a'])
False
sage: is_canonical(sgs, [5/2,3/2,1/2])
True
sage: is_canonical(sgs, [12.34, 6.12, 2.1])
True
With that, you can enumerate anything comparable up to the action of a
permutation group. WARNING : the action is on list on position!

If the memory of your computer can contains all, vectors of length
around 20 and sum around 30 can be possible. There are a lot of such
object especially for small group. For the cyclic group of order 20, the
order of highness is around 10^12 different integer vectors.

Cheers,
Nicolas.


-- 
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] Question(s) about Integer vectors mod permgroup

2011-04-10 Thread Nicolas Borie
Le dimanche 10 avril 2011 à 10:36 +, Vincent Delecroix a écrit :
> Hello Nicolas (the little),

Hello,

>   1) iteration of couples "(vector, stabilizer of the vector)"

It depend on what kind of information you want in `stabilizer of the
vector`. If you want it to be a sage or gap permutation group, it can be
very very painful (especially for speed...). The orbit is `very easy` to
get, for more, there is some work to be done.

>   2) iteration through vectors such that the stabilizer is trivial

As Florent wanted in the design of SearchForest a post_processing, 2) is
relatively simple to do:

First apply the patch in the combinat queue..
and test :

sage: from sage.combinat.integer_vectors_mod_permgroup import
IntegerVectorsModPermutationGroup_All
sage: class
IntVectModPermGroup_noStab(IntegerVectorsModPermutationGroup_All):
: def post_process(self, x):
: d = len(self.orbit(x))
: if d == self.permutation_group().cardinality():
: return x
: else:
: return None
: 
sage: I =
IntVectModPermGroup_noStab(PermutationGroup([[(1,2,3)],[(4,5)]]))
sage: p = iter(I)
sage: for i in range(15): p.next()
: 
[1, 0, 0, 1, 0]
[2, 0, 0, 1, 0]
[1, 1, 0, 1, 0]
[1, 0, 0, 2, 0]
[3, 0, 0, 1, 0]
[2, 1, 0, 1, 0]
[2, 0, 1, 1, 0]
[2, 0, 0, 2, 0]
[1, 1, 0, 2, 0]
[1, 0, 0, 3, 0]
[1, 0, 0, 2, 1]
[4, 0, 0, 1, 0]
[3, 1, 0, 1, 0]
[3, 0, 1, 1, 0]
[3, 0, 0, 2, 0]

I hope I understood what you want.

Cheers,
Nicolas (the little).


-- 
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.



[sage-combinat-devel] Integer Vectors, a non hashable type (list)

2011-04-09 Thread Nicolas Borie
Hello all,

I have a choice behind me and I need the advices of the veterans.

I am currently developing a module to enumerate things (integer vectors
for now) modulo the action of a finite permutation group. My new parent
will be : IntegerVectorsModPermGroup.

Once I will have this feature, I will create an algebra with a basis
indexed by elements of my new parent IntegerVectorsModPermGroup. For
this thing, CombinatorialFreeModule is my friend. But
CombinatorialFreeModule requires hashable basis keys, so it can't be
list of integers.

For now, in sage, integer vectors are list of integers. Is this supposed
to change ? Does there is in the wish-list of sage-combinat the
refactoring of these objects to an hashable version ? Construct algebra
with basis indexed with IntListLex, Combinations or IntegerVectors seems
to my very natural, but all of these are not hashable...

I see two options for my problem :

1 - Implement elements of my IntegerVectorsModPermGroup as tuple, it is
also possible to change the printing if some really want to see the
brackets.

2 - Leave elements of IntegerVectorsModPermGroup as list of integers and
implement a small hack of it for my algebra.


I prefer 1 but I don't know if the design of integer vectors is supposed
to change in the futur. 2 is better with that is already in sage...

Thanks for your comments.
Nicolas (the little)

-- 
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.



[sage-combinat-devel] Lazy linear algebra

2011-01-21 Thread Nicolas Borie
Hello,

For my current research, I need to do some "Lazy" Linear algebra.

For example, I have a family of 20 vectors living in a vector space of
dimension 10^10. I know mathematically that this family contains 5
vectors independents and I want to get them!

So I consider vectors like lazy vectors (or functions) defined on a
(finite(but big)/infinite) enumerated set. I just want to extract a
rectangular matrix formed by some evaluations of rank `n` and stated the
`n` corresponding lines (or vectors) are thus independents.

This is a very hard problem of design... And I have a single use case
with my invariants of finite groups. In spite of my light experience, I
think that Sage (and Sage-combinat in particular) already contains big
parts of such technology. Very draftly, I need something between
LazyFamily and CombinatorialFreeModule.

I push a very first prototype on Sage-combinat :
lazy_combi_free_module-nb.patch

Here is a log of what I did to fix ideas:

##
Here is a big case (still finite)

I give already (but not echelonized) independents vector to the
method : echelon_form_extract
##

sage: C = LazyCombinatorialFreeModule(QQ,
IntegerRange(1,10001))
sage: V1 = C.monomial(1)
sage: V2 = C.monomial(2)+V1
sage: V3 = C.monomial(3)+V2
sage: V4 = C.monomial(4)
sage: V5 = C.monomial(5)+V3
sage: for i in C.echelon_form_extract([V1,V2,V3,V4,V5]): i
: 
(V_{1}(x))_{x in {1, .., 1}}
(((V_{2}+V_{1})-(1V_{1}))(x))_{x in {1, .., 1}}
V_{3}+(V_{2}+V_{1}))-(1V_{1}))-(1((V_{2}+V_{1})-(1V_{1}(x))_{x
in {1, .., 1}}
(V_{4}(x))_{x in {1, .., 1}}
(V_{5}+(V_{3}+(V_{2}+V_{1})))-(1V_{1}))-(1((V_{2}+V_{1})-(1V_{1}-(1(((V_{3}+(V_{2}+V_{1}))-(1V_{1}))-(1((V_{2}+V_{1})-(1V_{1}))(x))_{x
 in {1, .., 1}}


##
Here is an infinite case

I give 7 vectors to the method : echelon_form_extract
But as I know that they span a space of dimension 5, I give
an extra argument named `up_to_rank` which will have value
5 in this example
##

sage: C = LazyCombinatorialFreeModule(QQ, NN)
sage: X = C(lambda x:x, 'X')
sage: X2 = C(lambda x:x**2, 'X2')
sage: X3 = C(lambda x:x**3, 'X3')
sage: Xc = C(lambda x:x, 'Xc')
sage: X4 = C(lambda x:x**4, 'X4')
sage: X2c = C(lambda x:x**2, 'X2c')
sage: X5 = C(lambda x:x**5, 'X5')
sage: for i in C.echelon_form_extract([X,X2,X3,Xc,X4,X2c,X5], 5): i
: 
(X(x))_{x in Non negative integer semiring}
((X2-(1X))(x))_{x in Non negative integer semiring}
(((X3-(1X))-(3(X2-(1X(x))_{x in Non negative integer semiring}
X4-(1X))-(7(X2-(1X-(6((X3-(1X))-(3(X2-(1X))(x))_{x in Non
negative integer semiring}
(X5-(1X))-(15(X2-(1X-(25((X3-(1X))-(3(X2-(1X))-(10(((X4-(1X))-(7(X2-(1X-(6((X3-(1X))-(3(X2-(1X(x))_{x
 in Non negative integer semiring}
(((X2c-(1X))-(1(X2-(1X(x))_{x in Non negative integer semiring}
((Xc-(1X))(x))_{x in Non negative integer semiring}

On this last example, the 5 first vectors returned are echelonized.

I you already feed the need of such feature or if you want to use it or
if you can give me some advises Go on!

I just did it to check it was feasible with the category framework and
the last (and finalized) feature of LazyFamily.

Thanks for your further comments,
Nicolas (the little).

-- 
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] authenticating to the combinat patch server

2010-11-29 Thread Nicolas Borie
Hello Samuel,

> I'm trying to push my first patch to the combinat patch server. It
> seems I need to authenticate. How do I get/choose a username and
> password?

Yes, to push to the combinat repository, once must use the login and the
password of the Trac server. If you have no trac account, it is time to
ask for one. For that, just follow the three first lines of this page.

http://trac.sagemath.org/sage_trac

Once you have a valid trac account, use the same login and password with
mercurial to push to the server. You also caught edit your .hgrc to
avoid typing you password every times. You can add the following lines
at the end of your .hgrc and customize the two last entries :

[auth]
combinat_patches.prefix = http://combinat.sagemath.org/patches/
combinat_patches.username = trac_login
combinat_patches.password = trac_password


> Once I get that sorted, I'll update the "Notes" in section 1.1 of the
> "step by step tutorial" at
>   http://wiki.sagemath.org/combinat/MercurialStepByStep
> which states:
>   For simplicity, the server is currently configured with open read-
> write access (no login/password required). Please do not abuse.

Good point! I will edit it shortly. Thanks for using the doc (and
improve it in the same time.)

Cheers,
Nicolas the little.



-- 
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-de...@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.



[sage-combinat-devel] which groups deverve to have a major_index method ?

2010-11-28 Thread Nicolas Borie
Hello all,

I implemented a method major_index for FinitePermutationGroups. This
method returns the major index polynomial. This is a gadget counting the
elements of the group by major index.

For the first implementation, i got :
sage: DihedralGroup(5).major_index()
q^10 + q^9 + q^8 + q^7 + q^6 + q^4 + q^3 + q^2 + q + 1
sage: PermutationGroup([[(1,2,3,4,5)]]).major_index()
q^4 + q^3 + q^2 + q + 1
sage: SymmetricGroup(3).major_index()
q^3 + 2*q^2 + 2*q + 1
sage: TransitiveGroup(5,3).major_index()
q^10 + q^9 + 2*q^8 + 2*q^7 + 3*q^6 + 2*q^5 + 3*q^4 + 2*q^3 + 2*q^2 + q +
1

In the symmetric group of order n. We can give to each descent a number
which is just the position of the descent. So, in S_n, there is a
possible descent in position 1 or 2 or .. or n-1. The major_index of a
permutation is the sum of 'i' where the permutation has a descent in
position 'i'.

This feature is well know for finite symmetric groups S_n. My questions
come now : 
- Does anyone know if it is raisonnable to define the major_index for
any subgroup of S_n ?  
- Does anyone meet in the literature a major index polynomial of a
subgroup of S_n ? And if yes, how it was properly defined ?
- What about having this method in the category of Finite Permutation
Group ?
- Should this method only live for SymmetricGroup ?

I thank Mike for his reviewer patch on trac for this feature...

Thanks in advance for advises and opinions.

Cheers,
Nicolas the little.

-- 
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-de...@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] error in queue

2010-10-24 Thread Nicolas Borie
Le dimanche 24 octobre 2010 à 08:07 -0700, Anne Schilling a écrit :
> Hello Nicolas le Petit,
> 
> Thank you!
> 
> Now I have another question: I made added a new module
> rigged_configurations and put the line
> from rigged_configurations.all import *
> in all.py in /combinat and an all.py file in the new module.
> 
> However, when starting sage I get an error
> `ImportError: No module named rigged_configurations.all`
> 
> Do I need to specify this somewhere else as well?
> Also, why do we do
> from sage.combinat.crystals.all import *
> but
> from root_system.all import *
> without the sage.combinat.?
> 
> Best,
> 
> Anne

I am not an expert with that. It seems to me that you added a new module
in a new folder. I am not sure it fix fix your problem but you should
try to declare this new folder (if it is the case)
in /sage/devel/sage-combinat/sage/setup.py
Look at the lines around line 790 and add your folder there.

For the import :
from rigged_configurations.all import * --> in all.py in /combinat
from filename import bla --> all.py in the new module.

Also don't forget an __init__.py file in your new folder (with just a
space inside this file...)

For your extra question :
from sage.combinat.crystals.all import *
or
from crystals.all import *
if the folder crystals is in combinat, I was thinking both works... (But
I never try to change it...). So I don't know.

I hope that will help.

Cheers,

Nicolas.


-- 
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-de...@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] error in queue

2010-10-24 Thread Nicolas Borie
Le samedi 23 octobre 2010 à 18:56 -0700, Anne Schilling a écrit :
> Hi!
> 
> With sage-4.5.3 there currently seems to be an error when applying the queue:
> 
> applying permgroup_cleanup-mh.patch
> applying permgroup-domain.patch
> patching file sage/categories/finite_permutation_groups.py
> Hunk #1 FAILED at 300
> Hunk #2 FAILED at 326
> 2 out of 2 hunks FAILED -- saving rejects to file 
> sage/categories/finite_permutation_groups.py.rej
> patching file sage/groups/perm_gps/permgroup_named.py
> Hunk #10 FAILED at 310
> 1 out of 21 hunks FAILED -- saving rejects to file 
> sage/groups/perm_gps/permgroup_named.py.rej
> patch failed, unable to continue (try -v)
> patch failed, rejects left in working dir
> errors during apply, please fix and refresh permgroup-domain.patch
> Abort
> 
> Cheers,
> 
> Anne

Hello,

I move a piece of code yesterday from the category of finite permutation
group to sage/groups/perm_gps/permgroup_named... I suppose that
permgroup-domain.patch is a patch from Mike. As I was before in the
queue, the later can't be applied.

I can fix it (in your patch and if you want Mike...). You was correcting
some errors in my code which doesn't exist anymore.

For now, I just put a guard on permgroup-domain.patch for the queue to
rebuild well.

Cheers,

Nicolas.



-- 
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-de...@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.



[sage-combinat-devel] Name and syntax for integer vectors modulo the action of a permutation group.

2010-09-21 Thread Nicolas Borie
Hello all,

I am trying to search a good name and a good syntax for a parent with
parameters. The parent is the integer vectors modulo the action of a
permutation group. It consists to enumerate integer vectors maximal in
their orbit for the lexicographic order under a permutation group.

Currently, name and access are :
sage: IntegerVectorsModPermutationGroup(PermutationGroup([[(1,2,3)]]))
Integer vectors of length 3 enumerated up to the action of Permutation
Group with generators [(1,2,3)]
sage:
IntegerVectorsModPermutationGroup(PermutationGroup([[(1,2,3)]])).subset(4)
Integer vectors of length 3 and of sum 4 enumerated up to the action of
Permutation Group with generators [(1,2,3)]

What do you think about the name IntegerVectorsModPermutationGroup ?

To access integer vectors of a given sum, do you prefer :
IntegerVectorsModPermutationGroup(G, sum=None) 
--> Integer vectors of length 3 enumerated up to the action G
IntegerVectorsModPermutationGroup(G, 4) 
--> Integer vectors of length 3 and of sum 4 enumerated up to the action
of G

Any other suggestion ?

Best,
Nicolas B.

-- 
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-de...@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.



[sage-combinat-devel] Help needed for right coset and length for permutation groups

2010-07-08 Thread Nicolas Borie
Hello,

I need to compute a function which do that :

*
def get_representative_and_possible_length(G):
r"""
Return a dictionary indexed by right coset representatives of the
quotient of `S_n` by ``G`` and whose values are a list of integers
representing length of permutations appearing in the corresponding
right coset of the key. (`n` is the degree of the group ``G``)

INPUT:

- ``G``: a permutation group

EXAMPLES::
"""
n = G.degree()
S = SymmetricGroup(n)
C = gap.RightCosets(S._gap_(), G._gap_())
D = dict()
for coset in C:
lengths = []
for permgap in coset.List():
length = S(permgap).length()
if length not in lengths:
lengths.append(length)
lengths.sort()
D[Permutation(S(coset.Representative()))] = lengths
return D
*

That is horrible but do the job. I searched a very huge time how to get
the length of a permutation in gap but I don't find it. By length of a
permutation, I mean Coxeter length (size of product for a minimal
decomposition over the Coxeter generators (simple transpositions in my
case)). I searched on gap permutation, on his gap "parent", number of
inversion, in the gap console, in gap reference manual, ... Perhaps it
was just behind me but I didn't get anything...

This function is thus very slow and I don't manage to improve it.
Suggestions welcome.

Many Tanks,
Nicolas B.

-- 
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-de...@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] Finalize Breadth first search improvement for search forest

2010-06-02 Thread Nicolas Borie
>From trac : 
***
Hi Nicolas,

I'm currently using search forest and I run into some troubles... I also
want to suggest some improvements in the code:

please define method _repr_ (Sage way) rather than __repr__ (Python's
way).
when you need to link a class in the same file you don't have to give
the full path for exampe :class:`SearchForest` is sufficient compared
to :class:`~sage.combinat.backtrack.SearchForest`
please make sure and document that a common intended use of SearchForest
is to inherit from it, calling only Parent.__init__ and overload the
methods roots, children, post_process rather than passing them to the
constructors. Please make sure to specify their result type (iterable
vs. iterator). By the way, should'nt those methods be private methods
(eg: _roots vs. roots. I don't expect the user to call them in my
use-case.
Thanks for all this ! I'm using it...

Florent
***

Thanks Florent for you comments.

I still need your help(Nicolas/Florent) for the following problems :

- Post processing is hard to integrate. Post processing make two
things : it apply a function on enumerated elements and skip the yield
when post_process(elt) is None. This skip make impossible to implement
recursive iterator affected by post processing because post processing
can destroy a part of the tree. think about
elements_of_depth_iterator(depth), you can't construct
elements_of_depth_iterator(depth+1) from the previous one. For that, my
current code implement iterators affected by post processing and other
non touch by post_process()

- I did not manage (I can do it but my code is too ugly so I probably
don't do it the right way) to implement a breadth first search which
remains enumerated elements in memory, there is several constrains : 
* The number of element of a fixed depth can be infinite
* The post processing cannot be applied (or just finally applied, the
cache concerns only the elements)
* How define properly breadth_first_search_iterator ? I mean what extra
argument set for this iterator (name of them : cache=None,
memory=None) ? Do I have to set some assert in this method in the sense
that cache=True with an infinite number of roots will produced infinite
loop and memory explosion ? Should I use @cached_method or set an extra
argument fathers=None to give elements of depth n-1.
* I simply don't know how to do it simply and in a good python... (call
list(bla) on bla an iterator ?) Python does not allow the presence of
yield and return in a same function thus dispatch due to post_process is
not simple...

- We stated some mouth ago that SearchForest should not inherit from
UniqueRepresentation. I am still agree with that. But we should insert
strong warning that inherit from SearchForest is not enough and it is
also important to inherit also from UniqueRepresentation for pickable
reason. (I spent a lot of time searching what broke my pickle...)

- I don't have very good example of SearchForest with nice post_process
function:
The following works but is very ugly for a such problem
sage: S = SearchForest([(0,0)] , lambda x : [(x[0], x[1]+1)] if x[1] !=
0 else [(x[0]+1,0), (x[0],1)], post_process = lambda x: x if
((is_prime(x[0]) and is_prime(x[1])) and ((x[0] - x[1]) == 2)) else
None)
sage: p = S.breadth_first_search_iterator()
sage: p.next()
(5, 3)
sage: p.next()
(7, 5)
sage: p.next()
(13, 11)
sage: p.next()
(19, 17)
sage: p.next()
(31, 29)
sage: p.next()
(43, 41)
sage: p.next()
(61, 59)
sage: p.next()
(73, 71)
sage: p.next()
(103, 101)

- I don't have very good example of Parent which can inherit of
SearchForest. As first implementation, I pushed that:

sage: from sage.combinat.backtrack import PositiveIntegerSemigroup
sage: PP = PositiveIntegerSemigroup()
sage: PP.category()
Join of Category of infinite enumerated sets and Category of commutative
additive semigroups and Category of monoids
sage: TestSuite(PP).run(skip='_test_one')

Note that I skip the _test_one due to SearchForest will often defined
facade parent. The one work but the parent of the one is the Integer
Ring.

The current version of my patch is on the trac and in the combinat
queue. Feel free to give me some advises... 

Cheers,
Nicolas.

-- 
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-de...@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] Finalize Breadth first search improvement for search forest

2010-06-01 Thread Nicolas Borie
Hi William,

Le mardi 01 juin 2010 à 15:52 -0400, William Laffin a écrit :
> I have a few general questions questions:
> 
> Are there plans for Uniform-cost, Depth-limited, iterative deepening,
> and bidirectional(if applicable)?
> How does one easily incorporate a bounding function? The comments of the file
> say it is there, but how?
> Similarly, how would one incorporate restrictions with
> isomorphism(I've visited a structure isomorphic to this one, I do not
> need to visit it again)?
> Plans for Hill-climbing, Genetic algorithms, Simulated annealing, or
> the various beam searches?
> 
> Maybe wishing a bit too much, but how much automatic parallelism is available?

This is clearly too much for my knowledge and my skills about search
algorithms. I started to work on this module to build explicit basis of
some graded algebras which are often finite dimensional degree by degree
but degree goes to infinity. So I needed a breadth first search iterator
adapted with a tree structure of infinite depth but finite for a given
depth. This is my only plan for now. In the same time, I will try to
integrate some very small improvements suggested around me. I am sorry
but all our remarks would cost to much for me compare to my current
skills.

But Sage looks like these contributors. So if you are interested in
contribute to Sage and such features, that's make Sage beginning to mind
about such improves. These functions are perhaps more connected with
graph theorist people. 
try :
G = Graph()
G. 
The tab completion will show you available functions on graph. There is
no possible comparaison with SearchForest. Perhaps you will already find
functions you are looking for.

SearchForest(args) will shortly return a Parent with category at least
EnumeratedSets(). SearchForest is a part of Combinat code whose goal is
to implement a primitive data structure for some algebraic structure
whose element are defined by a tree structure. I have currently no
knowledge about the mix of algebraic structure with forest structure and
high level search algorithm.

I don't want to say too many horrible (and perhaps false) things, I
leave a veteran or a graph expert correct what I said.

Cheers,
Nicolas (the little).

-- 
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-de...@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.



[sage-combinat-devel] Finalize Breadth first search improvement for search forest

2010-05-31 Thread Nicolas Borie
Hello all!

This topic deal with ticket #8288.

We (Florent, Nicolas^2) discussed a few about search forest improvements
in Marne. Let's me try to recall main points of the discussion :

- Search Forest deserve to stay very simple to use (arguments are simple
functions).
- We currently have no specific use-case which motivate the integration
of father and next_brother function. We also have no use-case where the
combination of father and next_brother make a breadth first search more
efficient.
- We have use-cases and interest in a post_process function as optional
argument.

We accorded together on the following specifications :

INPUT:

- ``roots``: a list (or iterable)
- ``children``: a function returning a iterator (or iterable)
- ``post_process``: a function well defined over the nodes of
``self`` returning your favorite output or None if you don't want the
node appearing in iterators. (default to None)
- ``category``: a category (default to None)

OUTPUT:

- a Parent of category EnumeratedSets().or_subcategory(category)

In the same time, Minh proposed a reviewer patch for this ticket
(#8288). He didn't know conclusions of our discussion. His work is not a
loss of time (firstly because his long comment was a very good source of
informations for beginner developer like me).

Here comes the questions :
- Is everybody still ok with main points and spec ?
- Any comment, suggestion of improvement ?

I will try to finalise this ticket using the contribution of everybody
shortly.

Cheers,
Nicolas (The little.)

-- 
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-de...@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] Sequences depreciated ?

2010-05-06 Thread Nicolas Borie
Hi Viviane,

There is so much different ways to do it... I discussed a while about
that with Nicolas and the better way to do this seems to implement a
'free' method for some categories.

Define a free group with some generators, a free monoid, a free
algebra... is a definitely a feature we will need for the future. From
an acceptable category, we define :
class Bla:
...
def free(self, gens):
"""
Returns the free Bla generated by ``gens``.
"""
with gens of type Family seems to be fine.

There is here some job to do about free monoid and free group. There is
already some people working on that.

Once you have this feature, you can define very nicely polynomials over
any set of indeterminate S (S a Lazy Family). You use two times the
category framework:
For regular polynomials : the algebra of the free monoid generated by S.
For type B,C,D : the algebra of the free group generated by S.

We are several people very interested by multivariate polynomials with
several basis (Schubert and friends). It could be fine to make a bilan
about what is ready, what remains to be done, who work on this and how
coordinate people to work together. I think this has to begin by a face
to face discussion at Marne (with Nicolas or Florent).

I did this patch some time ago, but that don't seems the better way as I
said before...
http://trac.sagemath.org/sage_trac/ticket/8581

See you with Adrien at Marne to discuss on that. (not tomorrow but I
hope the week to come...).

Nicolas.

-- 
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-de...@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.



[sage-combinat-devel] Sage days 20.5 : coding sprints organisation for the outside...

2010-05-03 Thread Nicolas Borie
Hi Franco,

I will be happy to participate to the coding sprints of Sage Days 20.5
from France. It will be very kind of you (and the other specialists of
coding sprints...) if you caught edit and maintain a wiki page about the
coding sprints organisation.

I don't mean something long. Just a list of task like :
# title_of_ticket (owner: free, reviewer_candidate: free)
# title_of ticket (owner: xxx, reviewer_candidate: yyy)
...
You can root this wiki page at bottom of:
http://wiki.sagemath.org/days20.5

>From that, I will be happy to take care of some easy stuff and Florent
caught easily assign some review to me. 

Perhaps, Trac and irc are enought... A such page caught also help for
status report at the end of your Sage days. The roadmap is not also very
clear to find and describe a single task that I am able to dealt with.

Have good times there with all the others!

Cheers,
Nicolas (The little).

-- 
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-de...@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.



[sage-combinat-devel] Re: queue is broken -- am I responsible ?

2010-04-21 Thread Nicolas Borie
Hi there,

Two thing creates this last rejection.

step 1 :

Vincent perhaps use an editor which add the following comments in
file :
#encoding=utf8
One of his patch contains :
view trac_8431-word_morphism_extensions-vd.patch @ 3225:259bda674da2
**
 1 diff -r 79d9e00bcdb7 sage/combinat/invariant_ring_perm_gps/
evaluation.py
2 --- a/sage/combinat/invariant_ring_perm_gps/evaluation.py Sun Mar 07
13:06:54 2010 +0100
3 +++ b/sage/combinat/invariant_ring_perm_gps/evaluation.py Sun Mar 07
13:08:37 2010 +0100
4 @@ -1,3 +1,4 @@
5 +#encoding=utf8
6
#*
7 # Copyright (C) 2009 Nicolas Borie 
8 #
9 diff -r 79d9e00bcdb7 sage/combinat/words/all.py
**

step 2 :

By managing series this afternoon

1.14 +language-vd.patch
1.15 +trac_8431-word_morphism_extensions-vd.patch
1.16
1.17
##
1.18 # Words : the next generation
1.19 @@ -236,8 +238,6 @@
1.20 fast_generating_list_up_to_permgroup-nb.patch
1.21 invariant_ring_permutation_group-nb.patch
1.22
1.23 -trac_8431-word_morphism_extensions-vd.patch
1.24 -

But the two patch invariant_ring_permutation_group-nb.patch and
trac_8431-word_morphism_extensions-vd.patch are no more commutative
since probably an editor add a comment about encoding...

A true police investigation! ;)

I don't really know what produce this #encoding=utf8 The best
solution is probably to remove that in Vincent's patch. The two patch
really should be commutative!!!

Cheers,
Nicolas B.

-- 
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-de...@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.



[sage-combinat-devel] Re: IntegerRange output...

2010-04-17 Thread Nicolas Borie
Hi,

For IntegerRange(a, b, step):
{a, a+step, ..., ?} is nice... Evaluating the "?" require a very small
computation.

In the same way, I find For IntegerRange(a, infinity, step)
{a, a+step, ..., ∞} is very nice too. ∞ is 236 of ascii code... (don't
know the possibility of using such symbol...)
{a, a+step, ..., +Infinity} works also.

Be aware :
sage: range(5,-12)
[]
sage: IntegerRange(5,-12)
Integer progression from 5 to -12 with increment 1
sage: IntegerRange(5,-12).list()
[]

It could be fine to have a special output for EmptySet... because
IntegerRange(5,-12)
{5, 6, ..., -12} makes no sens..
still the Empty.

Cheers,
Nicolas.

-- 
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-de...@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.



[sage-combinat-devel] Build a FreeModule with a step by step construction...

2010-03-17 Thread Nicolas Borie
Hello,

As often in algebraic combinatoric, I compute very very huge
FreeModule/VectorSpace... Let's me give some examples :

- I have a Matrix algebra (Hecke like) defined by a set of 5 matrices
of size factorial(5)*factorial(5) and I want to get a basis this
algebra as a VectorSpace over Q. For that, I start with the
VectorSpace empty and I had the generator, thus the product of length
2 over the generators, product on length 3, ... I stop when I have
stability of the product. (I won't speak about the optimizations of
this problem)

- Currently, for the ring of invariants multivariate polynomials under
the action of a permutation group.
For the cyclic group of order 8, I have a Vector space of dimension
factorial(7) with a number of generators close to factorial(7) and
whose coefficients leave in a cyclotomic field of degree(8). The point
of the problem is : you have a graded algebra in which you know the
generators as VectorSpace degree by degree and now, you want the
generator as an algebra...
degree 0 : just the one --> one algebra generator
degree 1 : I take a basis --> new algebra generators
degree 2 : I compute all product v_1*v_2 with the algebra generator of
degree 1. I make a gauss reduction and to complete this degree, I take
a basis of this degree and check each vector is already inside,
otherwise I have to add them as algebra generators.
...
degree n : All products of generators less than n, first gauss
reduction and a search of missing generators for this degree.

Sorry for this two technical examples, The point is, in this case of
problems, the elementary operation (And very very expansive operation)
is the following one :

K is any field. and n an integer. (mind n is very big)

Data : A subspace `E` of K^n with a basis already echelonized and a
vector `v` of K^n.

What I want :
if `v` in `E` --> the coordinates of `v` in `E`
if `v` not in `E` --> I want to add it in `E` and I want to get back
the transformation of `v` once it is echelonized in `F` = `E`+.

Mathematically : It is possible to do that with a single
echelonization of `v`. I want also a possibility to skip the tests.

***
My first code was:
if v in E:
F = Ambient.Subspace(E.basis()+[v])
else:
E.coordinates(v)

# How many echelonization ? How many checks over an already
echelonized vector?
***
And now:
***
dimE = E.dimension()
F = Ambient.Subspace(E.basis()+[v])
if F.dimension() > DimE:
--> Some job
Else:
--> Other Job

# How many echelonization ? How many checks over an already
echelonized vector?
***

I need some advises about :
- How to do that in Sage ?
- Does I miss it ? perhaps it is already in sage...
- Advises for describing a ticket (if needed) and name of a such
method (E.add_new_generator(v), check=False) ?

Thanks in advanced,
Cheers,
Nicolas the little.

-- 
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-de...@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.



[sage-combinat-devel] Re: I broke the queue

2010-03-15 Thread Nicolas Borie
Ok,

It was a very short alert. Sorry for that (and the two e-mails
attached...). The fix was not so hard as I was thinking...

Pull now as you want.

Cheers,
Nicolas the little.

-- 
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-de...@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.



[sage-combinat-devel] I broke the queue

2010-03-15 Thread Nicolas Borie
Hi all,

I am very sorry, I just broke the queue!

PLEASE DON'T PULL!

I will tell when it will be fixed. And as soon as possible

Sorry again.
Nicolas the little.

-- 
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-de...@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.



[sage-combinat-devel] Re: Sage Days 20 Status Report

2010-03-01 Thread Nicolas Borie
Chevie is a very huge package...

--> from http://www.math.rwth-aachen.de/~CHEVIE/how-get.html:
It is now very easy to get the GAP part of CHEVIE - you only need to
install GAP, version 3.4.4, released in April 97 (see GAP for
details).
---
Yes, Chevie work only with GAP3...

--> from http://www.gap-system.org/Gap3/status3.html
Changing from GAP 3 to GAP 4
If you still have private programs written in GAP 3 the functionality
of which you would like to have in GAP 4 it may be the best idea to
rewrite them from scratch.


Some people who used to contribute to Chevie are very interresting by
Sage. They are still working with GAP3. They are ok to contribute to
sage but an interface can make sweater their migration. It's true an
interface is not an easy job (Many thanks to Franco) and everybody
mind a lot before the decision...

Nicolas the little.

-- 
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-de...@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.



[sage-combinat-devel] Re: Check when defining a permutation by one-line notation (list of int)

2010-02-28 Thread Nicolas Borie
There is a patch proposition here :

http://trac.sagemath.org/sage_trac/ticket/8392

Feel free to give any suggestion

Cheers,
Nicolas the little.

-- 
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-de...@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.



[sage-combinat-devel] Re: Check when defining a permutation by one-line notation (list of int)

2010-02-28 Thread Nicolas Borie
Hi Sébastien,

On 28 fév, 15:10, Sébastien Labbé  wrote:
> > This function then call an hidden internal function
> > called for example _from_list that creates the object from a list
> > without any check.
>
> hidden or not : I now remember Nicolas saying from_list is good. The
> user might want to use it.
>
> Sébastien

I remember this discussion about words checks...

That look a good, a light and a very easy solution. But I have still a
problem to do that :

In normal time, the call would work like that :
Parent(arg_parent)(arg_element) --> Some checks
Parent(arg_parent).from_list(arg_element) --> No checks

Here the call is :
Permutation(list) --> Some checks
? --> No checks

For now, in sage, we have :
***
sage: Permutation([1,2,3,4])
[1, 2, 3, 4]
sage: Permutation([1,1,1,1])
[1, 1, 1, 1]
sage: Permutations()([1,2,3,4])
[1, 2, 3, 4]
sage: Permutations()([1,1,1,1])
---
ValueErrorTraceback (most recent call
last)

/home/nicolas/ in ()

/opt/sage/local/lib/python2.6/site-packages/sage/combinat/combinat.pyc
in __call__(self, x)
   1457 return self._element_constructor_(x)
   1458 else:
-> 1459 raise ValueError, "%s not in %s"%(x, self)
   1460
   1461 Element = CombinatorialObject # mostly for backward
compatibility

ValueError: [1, 1, 1, 1] not in Standard permutations
sage: Permutations()._element_constructor_([1,2,3,4])
[1, 2, 3, 4]
sage: Permutations()._element_constructor_([1,1,1,1])
[1, 1, 1, 1]
sage: type(Permutation([1,1,1,1]))

sage: type(Permutations()._element_constructor_([1,1,1,1]))

sage: Permutation([1,1,1,1]) ==
Permutations()._element_constructor_([1,1,1,1])
True
sage: Permutation([1,1,1,1]) is
Permutations()._element_constructor_([1,1,1,1])
False
***

So, it is already possible to avoid checks in the parent PermutationS
using _element_constructor_ method (not a very practical name...)

Permutation is more a shortcut constructor. I can make something
like :
* Permutation(list, check=False) ?
* Permutation(list, from_list=True) ?

Questions:
- Do I had a from_list() method to Permutations to point to
_element_constructor_() ?

- Do I had systematic check on Permutation ?

Any other proposition ?

Cheers,
Nicolas the little.

-- 
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-de...@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.



[sage-combinat-devel] Check when defining a permutation by one-line notation (list of int)

2010-02-28 Thread Nicolas Borie
*** Sorry for double post but the original one is probably blocked by
the moderation system of googlegroups ***

De: Nicolas Borie 
À:  SAGE-COMBINAT-DEVEL 
Sujet:  Check when defining a permutation by one-line notation (list
of int)
Date:   27/02/2010 23:22:52


Hello all,

I have a disign question for you guys!

For now, in sage the following work :
sage: Permutation([1,1,1,1,1])
[1, 1, 1, 1, 1]
sage: Permutation([-12,1,3])
[-12, 1, 3]

But in the permutation code, we have :
def robinson_schensted(self):
"""
Returns the pair of standard tableaux obtained by running the
Robinson-Schensted Algorithm on self.

EXAMPLES::

sage: Permutation([6,2,3,1,7,5,4]).robinson_schensted()
[[[1, 3, 4], [2, 5], [6, 7]], [[1, 3, 5], [2, 6], [4, 7]]]

It also works in the case of repeated letters. In this case
only
the
second tableau is standard::

sage: Permutation([2,3,3,2,1,3,2,3]).robinson_schensted()
[[[1, 2, 2, 3, 3], [2, 3], [3]], [[1, 2, 3, 6, 8], [4, 7],
[5]]]


QUESTIONS :
- Is it reasonnable to add some checks when define a permutation with
a
list of integer ? Or, do we prefer to continue this abuse ?

- In the case a sage Permutation have to be a mathematical
permutation,
where can I move the code of this method and just leave a pointer ?
(Composition ?)

- If you think robinson_schensted method can live in composition code,
how to import tableau in composition.py without breaking sage ?


>From my point of view, I think the checks are necessary, I think
Composition would be a good place for robinson_schensted method. I
really don't konw how to import 'tableau' or 'Tableau' in
composition.py
(Is it round import which break ?). It is also important from my point
of
view to not loose the abuse of this method (keep it working not only
on
permutation)...


Cheers,
Nicolas (The little...)

-- 
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-de...@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.



[sage-combinat-devel] Re: There are ReST warnings in the sage-combinat tree

2009-09-13 Thread Nicolas BORIE

Hi,

I hope it is fine now. I just fixed and pushed for the two warning in 
group/permgroup...

Tell me if another warning appear...

Cheers,
Nicolas.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-combinat-devel] Enumerate integer lists up to the action of a Permutation Group

2009-09-05 Thread Nicolas BORIE

Hello all,

I am currently working on a small engine to enumerate integer lists 
modulo the action of a permutation group. Here is the ticket on the trac 
: http://sagetrac.org/sage_trac/ticket/6812.

The important class is the Parent of Category InfiniteEnumeratedSets.
This set is the set of all cosets (classes d'équivalence in french) of 
integer vectors modulo the action of a fixed permutation group. Elements 
of this Parent are just list of integer but all list are canonical in 
the sens that they are maximum in their orbit under the action of the 
permutation group (maximum according the lex order.)


sage: I = 
IntegerVectorsUptoPermGroup(PermutationGroup([[(1,2,3)],[(2,3,4)]]))
sage: [5,2,0,0] in I
True
sage: [5,0,2,0] in I
False
sage: [2,2,0,1] in I
False
sage: [3,2,0,1] in I
True
sage: p = [0,0,0,0]
sage: for i in range(20):
: print p
: p = I.next(p)
:
[0, 0, 0, 0]
[1, 0, 0, 0]
[2, 0, 0, 0]
[1, 1, 0, 0]
[3, 0, 0, 0]
[2, 1, 0, 0]
[1, 1, 1, 0]
[4, 0, 0, 0]
[3, 1, 0, 0]
[2, 2, 0, 0]
[2, 1, 1, 0]
[1, 1, 1, 1]
[5, 0, 0, 0]
[4, 1, 0, 0]
[3, 2, 0, 0]
[3, 1, 1, 0]
[2, 2, 1, 0]
[2, 1, 1, 1]
[6, 0, 0, 0]
[5, 1, 0, 0]


This set contains thus canonical representatives of cosets... Does 
anyone have suggestion for a good name for this parent ? Does anyone 
would like to review that after...

Currently : IntegerVectorsUptoPermGroup
MuPAD : IntegerVectorsModPermutationGroup
Other proposition : ???

Cheers,
Nicolas the little.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-combinat-devel] Re: Sage-Combinat patches rebased for Sage 4.1.1

2009-08-26 Thread Nicolas Borie

Hi everyone,

I had the same problem than Jason and since the rebase, all apply
clearly...

Cheers,
Nicolas the little.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-combinat-devel] Re: Patches from combinat repository to sage trac

2009-08-15 Thread Nicolas Borie

Hello Jason,

One more time, you save my life. I have persisted in this mistake
because I was persuaded that this hg information was just optionals...

Thanks and cheers,
Nicolas the little.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-combinat-devel] Patches from combinat repository to sage trac

2009-08-14 Thread Nicolas Borie

Hello all,

I have some problems to export patches from the sage-combinat
repository to the sage trac. I used to work only with the sage-
combinat repository and my small parts of code were merge in someone
else patch before submission. This time, i tried to submit and manage
the trac alone (it's time to learn for me...)

Here is the ticket : http://sagetrac.org/sage_trac/ticket/6647

David can't apply my patch and I don't know why ?

The patch work fine in the sage-combinat patches queue and (I think)
work in a sage 4.1 (without combinat).

What should I do for rebase my patch ? With which sage should I work
to get fine trac patch ? Does someone have a good pointer in the sage-
combinat wiki ? What precise problems can be produced beetween the
moving sage and the sage with combinat patches ?

Thanks,
Nicolas the little.

P.S. : if someone have suggestions to improve the code of the ticket,
I'm open
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---