[sage-devel] Re: Fwd: Tensor products

2008-05-07 Thread Robert Bradshaw

On May 7, 2008, at 5:50 AM, David Kohel wrote:

> Hi,
>
>>> Given algebras A and B, I would return C and the two maps m1: A -> C
>>> and m2: B -> C:
>>
>>> (C, m1, m2) = A.tensor_product(B,ring=R)
>>
>> I might prefer to have something like
>>
>>  C = A.tensor_product(B, ring=R)
>>
>> and then one can do
>>
>>  C.coerce_map_from(A)
>>  C.coerce_map_from(B)
>
> This would require a new tensor product class in order to represent C.

I think this is a good thing, as then one could ask for its factors,  
etc.

> I think it might be desirable when taking the tensor product of two
> matrix algebras to return a matrix algebra, or when taking a tensor
> product of two polynomial rings to return a polynomial ring.
> The  other option is to have a genuine class which wraps these
> rings as you indicate.

The wrapper class is already implemented. As for the tensor product  
of two polynomial rings being a polynomial ring, for example, it  
essentially will be (it'll have all the same methods, and should be  
useable anywhere a polynomial ring is), just have some additional  
structure on top.

>
> The suggested syntax above, and here:
>
>> One would rarely need the maps themselves, as one
>> could do C(a) and C(b), or even c + a, and the coercion model would
>> handle it all well (here a, b, and c live in A, B, and C resp. of
>> course).
>
> assumes that A is distinct from B (or that there are no canonical
> coercions from A to B or vice versa).

True, though if A *is* exactly the left of right term, one could  
return the correct half.

> However a common
> construction is precisely to form a self tensor product or power
> C = \otimes_{i=1}^n A, in which case the choice of the 2 or n
> maps A -> C can not be decided by without specification of
> the map.

Yep, there should be a method for getting a morphism that takes which  
factor one wants to land in.

>> C would probably be implemented one of David Roe's wrapper
>> classes, so Q tensor Z[x] would be Q[x], but would still know its
>> factors.
>
> A good design is very important.

I agree here.

> In fact this is a vey generic categorical construction of (a sum or
> coproduct in the category of rings).  We should  first consider how
> general products and coproducts should be constructed, and set
> up a common infrastructure and syntax.  It needs to be (1) easy
> and natural to use, (2) mathematically correct and complete.

And (3) (if possible) efficient.

> The homomorphisms for products and coproducts are essential
> parts of the construction so they should be an accessible part
> of the design.  The homomorphisms themselves should be fast
> to apply, and their design should take into account canonical
> homomorphisms.

Certainly. We are putting a lot more infrastructure in place to do  
generic operations like this.

- Robert



--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Fwd: Tensor products

2008-05-07 Thread Bill Page

On Wed, May 7, 2008 at 8:50 AM, David Kohel wrote:
> ...
> A good design is very important.
>
> In fact this is a vey generic categorical construction of (a sum or
> coproduct in the category of rings).  We should  first consider how
> general products and coproducts should be constructed, and set
> up a common infrastructure and syntax.  It needs to be (1) easy
> and natural to use, (2) mathematically correct and complete.
>

+1 I strongly agree with this. I think a more direct representation of
categorical constructions in Sage would be a very good thing. Some
similar work along these lines has been done by Saul Youssef in the
Aldor language. Perhaps something like this is possible in
Python/Sage?

See for example the links at:

http://axiom-wiki.newsynthesis.org/SandBoxAldorCategoryTheory

Most of the coding is done in terms of Aldor "categories" (something
like generic interfaces in Java) and there is no direct counterpart to
this in Python programming language as far as I know. I have seen here
on this list a mention of some ideas for implementing generic
programming in Sage but I do not know where to go for details. I think
that whatever one might do with category theory in Sage is likely to
require or at least interact with such generic programming features.

Regards,
Bill Page.

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Fwd: Tensor products

2008-05-07 Thread Michel


> A good design is very important.
>
> In fact this is a vey generic categorical construction of (a sum or
> coproduct in the category of rings).  We should  first consider how
> general products and coproducts should be constructed, and set
> up a common infrastructure and syntax.  It needs to be (1) easy
> and natural to use, (2) mathematically correct and complete.
>
One remark. The tensor product is only the coproduct in the category
of commutative rings.  In the category rings the coproduct is the free
product but the tensor product still makes sense.

Michel

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Fwd: Tensor products

2008-05-07 Thread David Kohel

Hi,

> > Given algebras A and B, I would return C and the two maps m1: A -> C
> > and m2: B -> C:
>
> > (C, m1, m2) = A.tensor_product(B,ring=R)
>
> I might prefer to have something like
>
>  C = A.tensor_product(B, ring=R)
>
> and then one can do
>
>  C.coerce_map_from(A)
>  C.coerce_map_from(B)

This would require a new tensor product class in order to represent C.
I think it might be desirable when taking the tensor product of two
matrix algebras to return a matrix algebra, or when taking a tensor
product of two polynomial rings to return a polynomial ring.
The  other option is to have a genuine class which wraps these
rings as you indicate.

The suggested syntax above, and here:

> One would rarely need the maps themselves, as one
> could do C(a) and C(b), or even c + a, and the coercion model would
> handle it all well (here a, b, and c live in A, B, and C resp. of
> course).

assumes that A is distinct from B (or that there are no canonical
coercions from A to B or vice versa).  However a common
construction is precisely to form a self tensor product or power
C = \otimes_{i=1}^n A, in which case the choice of the 2 or n
maps A -> C can not be decided by without specification of
the map.

> C would probably be implemented one of David Roe's wrapper
> classes, so Q tensor Z[x] would be Q[x], but would still know its
> factors.

A good design is very important.

In fact this is a vey generic categorical construction of (a sum or
coproduct in the category of rings).  We should  first consider how
general products and coproducts should be constructed, and set
up a common infrastructure and syntax.  It needs to be (1) easy
and natural to use, (2) mathematically correct and complete.

The homomorphisms for products and coproducts are essential
parts of the construction so they should be an accessible part
of the design.  The homomorphisms themselves should be fast
to apply, and their design should take into account canonical
homomorphisms.

--David


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Fwd: Tensor products

2008-05-05 Thread Robert Bradshaw

On May 4, 2008, at 12:49 PM, David Kohel wrote:

> Hi,
>
> Tensor products (of commutative rings) are "necessary" for
> representing the
> coordinate rings of a product of [affine] schemes.
>
> For commutative rings, a new tensor product class imay not be needed
> or desirable, rather what is missing  currently is the homomorphisms.
>
> Given algebras A and B, I would return C and the two maps m1: A -> C
> and m2: B -> C:
>
> (C, m1, m2) = A.tensor_product(B,ring=R)

I might prefer to have something like

 C = A.tensor_product(B, ring=R)

and then one can do

 C.coerce_map_from(A)
 C.coerce_map_from(B)

to get the maps. One would rarely need the maps themselves, as one  
could do C(a) and C(b), or even c + a, and the coercion model would  
handle it all well (here a, b, and c live in A, B, and C resp. of  
course). C would probably be implemented one of David Roe's wrapper  
classes, so Q tensor Z[x] would be Q[x], but would still know its  
factors.

> The algebra C would be an algebra which represents the tensor product
> and whose class could depend on A and B. If the ring is not specified,
> then A and B should have the same base_ring.

Or perhaps a reasonable default could be found. (e.g. if A is over Z  
and B over Q, then the tensor makes sense over Z).

> Tensor products of polynomial rings and their quotients would be the
> first natural cases to implement.

Certainly.

There seems to be a lot of talk about having a tensor product  
structure in Sage lately, and coincidentally I wrote up a simple  
tensor product implementation just a few weeks ago. It doesn't really  
do anything other than just store elements as sums of pairs (a,b),  
and has 0% doctest coverage (in fact, it's just sitting in a big  
notebook cell) but perhaps I could check it in if people are  
interested. I am not sure what operations (if any) one can do for  
completely generic tensor products, but we should still have them.

- Robert


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Fwd: Tensor products

2008-05-04 Thread David Kohel

Hi,

Tensor products (of commutative rings) are "necessary" for
representing the
coordinate rings of a product of [affine] schemes.

For commutative rings, a new tensor product class imay not be needed
or
desirable, rather what is missing  currently is the homomorphisms.

Given algebras A and B, I would return C and the two maps m1: A -> C
and
m2: B -> C:

(C, m1, m2) = A.tensor_product(B,ring=R)

The algebra C would be an algebra which represents the tensor product
and
whose class could depend on A and B. If the ring is not specified,
then A
and B should have the same base_ring.

Tensor products of polynomial rings and their quotients would be the
first
natural cases to implement.

--David


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---