[sage-combinat-devel] Re: sage question

2011-03-31 Thread Nicolas M. Thiery
Hi Mark!

On Thu, Mar 31, 2011 at 12:39:44AM -0400, msh...@math.vt.edu wrote:
 How can I make a Combinatorial Algebra with an infinite basis?
 I'm trying to make the nilHecke algebra for any root datum,
 but I'll start with the nilCoxeter algebra.

Finite or infinite basis does not really make a difference. Here is
how to build just the vector space:

sage: F = CombinatorialFreeModule(QQ, WeylGroup([A,3,1]))
sage: F.an_element()
2*B[[-1  1  0  1]
[ 0  1  0  0]
[ 0  0  1  0]
[ 0  0  0  1]] +
3*B[[ 0 -1  1  1]
[ 1 -1  1  0]
[ 0  0  1  0]
[ 0  0  0  1]] +
  B[[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
[0 0 0 1]] +
  B[[ 2  0  1 -2]
[ 2  0  0 -1]
[ 1  1  0 -1]
[ 1  0  1 -1]]

For an example of implementation of algebra (which is further graded,
but you can ignore this part), you can have a look at:

   sage: A = GradedAlgebrasWithBasis(QQ).example()
   sage: A??

Note: this requires the sage-combinat patches. And of course there is
the tutorial:

http://combinat.sagemath.org/doc/reference/demos/tutorial-implementing-algebraic-structures.html

Now, you may want to check out with Anne, since she might already have
code for what you want.

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

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To 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: Categorification of sage/rings/ring.pyx

2011-03-31 Thread Simon King
Hi Anne,

On 31 Mrz., 14:09, Anne Schilling a...@math.ucdavis.edu wrote:
 Hi Simon,

 Applying your two patches

 trac11068_nc_ideals_and_quotients.patch
 trac7797-full_letterplace_wrapper_rel11068.patch

 in this order, I get the attached error for sage -b. Am I missing a patch?

Do you also have the patch from #10961, which is a dependency for
#11068?

Anyway, I think I'll soon have to rebase everything.

Namely, in #11068, it would be nice if one could *move* code from
sage.rings.ring.Ring to sage.categories.rings.Rings.ParentMethods,
rather than copying it (code duplication is known as a code smell).

But in order to be able to move it, it is needed that the category is
properly initialised for all rings. This is the purpose of #9944 and
#9138.

But I think that, for now, #10961, #11068 and #7797 should be enough
for letterplace.

Best regards,
Simon

-- 
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: Categorification of sage/rings/ring.pyx

2011-03-31 Thread Simon King
Hi Anne

On 31 Mrz., 14:09, Anne Schilling a...@math.ucdavis.edu wrote:

 /Applications/sage-4.6.2/devel/sage-combinat/sage/algebras/letterplace/free_algebra_letterplace.pxd:15:72:
  Name 'FreeAlgebraElement_letterplace' not declared in module
 'sage.algebras.letterplace.free_algebra_element_letterplace'

I can reproduce the problem. Well, the ticket currently is needs
work anyway :(

Best regards,
Simon

-- 
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: Categorification of sage/rings/ring.pyx

2011-03-31 Thread Anne Schilling

Hi Simon,

Thank you for your answers! I keep working with the combined patch

trac7797-full_letterplace_wrapper.patch

for now.

I have a question regarding the quotients. If I work in the free algebra

sage: F = FreeAlgebra(QQ,3,'x',implementation='letterplace')
sage: x = F.gens()
sage: p=x[1]*x[0]+x[2]*x[2]

I can iterate over the elements:

sage: [w for w in p]
[((0, 0, 1, 0, 0, 1), 1), ((0, 1, 0, 1, 0, 0), 1)]

and hence can get access to the keys this way. However, for quotients this
does not work:

sage: F = FreeAlgebra(QQ,3,'x',implementation='letterplace')
sage: x = F.gens()
sage: rel = [x[2]**2 - x[1]*x[0]]
sage: I = F*rel*F
sage: Q = F.quo(I, names='a')
sage: a = Q.gens()
sage: p=a[1]*a[0]+a[2]*a[2]
sage: p
2*a2*a2
sage: [w for w in p]
---
TypeError Traceback (most recent call last)

TypeError: 'QuotientRingElement' object is not iterable

Is there a plan to change this? I am now using the trick of coercing to another
free algebra to get access to the iterator:

sage: K = FreeAlgebra(QQ,3,'x')
sage: p=a[1]*a[0]+a[2]*a[2]
sage: [w for w in p.lift()*K.one()]
[(2, x2^2)]

but this seems a little around about.

Cheers,

Anne

On 3/31/11 12:35 PM, Simon King wrote:

Here is the solution:

Create an empty file __init__.py in .../sage/algebras/letterplace/,
for  examply with
touch sage/algebras/letterplace/__init__.py  (when you are in
SAGE_ROOT/devel/sage/)

Then, sage -br should do the trick.

Once again, I forgot to include __init__.py in a patch. I will update
it on  trac tomorrow.

Cheers,
Simon


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