login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for SandBoxTensorProduct revision 9 of 9

1 2 3 4 5 6 7 8 9
Editor: test1
Time: 2013/04/25 20:25:03 GMT+0
Note:

changed:
-FreeModule is defined in poly.spad.
-FreeModuleCategory is defined in xpoly.spad.
-
-\begin{spad}
-)abbrev category TENSORC TensorProductCategory
-TensorProductCategory(R:CommutativeRing, M : Module(R), N : Module(R)):Category == Module(R) with
-    product: (M, N) -> %
-)abbrev category TENSORP TensorProductProperty
-TensorProductProperty(R:CommutativeRing, M : Module(R), N : Module(R), _
-      MxN : TensorProductCategory(R, M, N), S : Module(R)): Category == with
-    eval: (MxN, (M, N) -> S) -> S
-)abbrev package TENSORD TensorProduct
-TensorProduct(R : CommutativeRing, B1 : OrderedSet, B2 : OrderedSet, _
-    M1 : FreeModuleCategory(R, B1), M2 : FreeModuleCategory(R, B2)): TPcat == TPimp where
-    TPcat == Join(TensorProductCategory(R,M1,M2),FreeModuleCategory(R,Product(B1,B2))) with
-             if M1 has Algebra(R) and M2 has Algebra(R) then Algebra(R)
-    TERM1 == Record(k: B1, c: R)
-    TERM2 == Record(k: B2, c: R)
-    B1xB2 == Product(B1,B2)
-    TERM  == Record(k: B1xB2, c: R)
-    TPimp == FreeModule(R, Product(B1, B2)) add
-       import Rep, TERM1, TERM2, TERM, B1xB2
-       product(x1:M1,x2:M2):% ==
-           zero? x1 or zero? x2 => return 0
-           ltx1:List TERM1 := listOfTerms x1
-           ltx2:List TERM2 := listOfTerms x2
-           res : List TERM := []
-           for s1 in ltx1 repeat
-               for s2 in ltx2 repeat
-                   res := concat!(res,[makeprod(s1.k, s2.k), s1.c*s2.c]$TERM)
-           res pretend %
-       if M1 has Algebra(R) and M2 has Algebra(R) then 
-         (x1:% * x2:%):% ==
-              res : % := 0
-              for t1 in listOfTerms x1 repeat
-                 for t2 in listOfTerms x2 repeat 
-                    -- the coefficients
-                    t1c:R := t1.c
-                    t2c:R := t2.c
-                    -- the basis elements
-                    t1k:B1xB2 := t1.k
-                    t2k:B1xB2 := t2.k
-                    t1a: M1 := monom(selectfirst t1k,1)
-                    t1b: M2 := monom(selectsecond t1k,1)
-                    t2a: M1 := monom(selectfirst t2k,1)
-                    t2b: M2 := monom(selectsecond t2k,1)
-                    res:= res +  t1.c*t2.c *product(t1a*t2a,t1b*t2b)
-              res
-\end{spad}
TensorProduct is now included with FriCAS. Thank you Franz!


changed:
-t:=product(a1+a2,b1+b2)$MxN;
t := tensor(a1 + a2, b1 + b2)$MxN;

changed:
-r:=product(p,q)$MxM
r := tensor(p, q)$MxM

changed:
-test( product(p+q,w)$MxM = product(p,w)$MxM + product(q,w)$MxM )
-test( product(p,q+w)$MxM = product(p,q)$MxM + product(p,w)$MxM )
-test( product(p,23*w)$MxM = 23*product(p,w)$MxM )
-test( product(23*p,w)$MxM = 23*product(p,w)$MxM )
test( tensor(p + q, w)$MxM = tensor(p, w)$MxM + tensor(q, w)$MxM )
test( tensor(p, q + w)$MxM = tensor(p, q)$MxM + tensor(p, w)$MxM )
test( tensor(p, 23*w)$MxM = 23*tensor(p, w)$MxM )
test( tensor(23*p, w)$MxM = 23*tensor(p, w)$MxM )

removed:
-From BillPage Mon Nov 2 07:23:07 -0800 2009
-From: Bill Page
-Date: Mon, 02 Nov 2009 07:23:07 -0800
-Subject: TensorProduct
-Message-ID: <20091102072307-0800@axiom-wiki.newsynthesis.org>

Date: Fri, 15 May 2009 21:03:00 +0200 Franz Lehner wrote:

Attached is a prototype for tensor products. It is free modules over commutative rings.

TensorProduct? is now included with FriCAS. Thank you Franz!

fricas
M:=FreeModule(Integer,Symbol)

\label{eq1}\hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Integer}\ } , \hbox{\axiomType{Symbol}\ })(1)
Type: Type
fricas
N:=FreeModule(Integer,Symbol)

\label{eq2}\hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Integer}\ } , \hbox{\axiomType{Symbol}\ })(2)
Type: Type
fricas
a1:='a1::M

\label{eq3}a 1(3)
Type: FreeModule(Integer,Symbol)
fricas
a2:='a2::M

\label{eq4}a 2(4)
Type: FreeModule(Integer,Symbol)
fricas
b1:='b1::N

\label{eq5}b 1(5)
Type: FreeModule(Integer,Symbol)
fricas
b2:='b2::N

\label{eq6}b 2(6)
Type: FreeModule(Integer,Symbol)
fricas
MxN:=TensorProduct(Integer,Symbol,Symbol,M,N);
Type: Type
fricas
t := tensor(a1 + a2, b1 + b2)$MxN;
Type: TensorProduct?(Integer,Symbol,Symbol,FreeModule(Integer,Symbol),FreeModule(Integer,Symbol))
fricas
t

\label{eq7}{a 2 \otimes b 2}+{a 2 \otimes b 1}+{a 1 \otimes b 2}+{a 1 \otimes b 1}(7)
Type: TensorProduct?(Integer,Symbol,Symbol,FreeModule(Integer,Symbol),FreeModule(Integer,Symbol))
fricas
leadingMonomial t

\label{eq8}a 2 \otimes b 2(8)
Type: TensorProduct?(Integer,Symbol,Symbol,FreeModule(Integer,Symbol),FreeModule(Integer,Symbol))
fricas
numberOfMonomials t

\label{eq9}4(9)
Type: PositiveInteger?

Demonstrating the axioms of the tensor product:

fricas
x:M
Type: Void
fricas
y:M
Type: Void
fricas
u:M
Type: Void
fricas
p:=2*x+3*u

\label{eq10}{2 \  x}+{3 \  u}(10)
Type: FreeModule(Integer,Symbol)
fricas
q:=5*x+7*y+11*u

\label{eq11}{7 \  y}+{5 \  x}+{{11}\  u}(11)
Type: FreeModule(Integer,Symbol)
fricas
MxM:=TensorProduct(Integer,Symbol,Symbol,M,M);
Type: Type
fricas
r := tensor(p, q)$MxM

\label{eq12}\begin{array}{@{}l}
\displaystyle
{{14}\ {x \otimes y}}+{{10}\ {x \otimes x}}+{{22}\ {x \otimes u}}+{{21}\ {u \otimes y}}+ 
\
\
\displaystyle
{{15}\ {u \otimes x}}+{{33}\ {u \otimes u}}
(12)
Type: TensorProduct?(Integer,Symbol,Symbol,FreeModule(Integer,Symbol),FreeModule(Integer,Symbol))
fricas
w:= 13*y+17*y+19*u

\label{eq13}{{30}\  y}+{{19}\  u}(13)
Type: FreeModule(Integer,Symbol)
fricas
test( tensor(p + q, w)$MxM = tensor(p, w)$MxM + tensor(q, w)$MxM )

\label{eq14} \mbox{\rm true} (14)
Type: Boolean
fricas
test( tensor(p, q + w)$MxM = tensor(p, q)$MxM + tensor(p, w)$MxM )

\label{eq15} \mbox{\rm true} (15)
Type: Boolean
fricas
test( tensor(p, 23*w)$MxM = 23*tensor(p, w)$MxM )

\label{eq16} \mbox{\rm true} (16)
Type: Boolean
fricas
test( tensor(23*p, w)$MxM = 23*tensor(p, w)$MxM )

\label{eq17} \mbox{\rm true} (17)
Type: Boolean

first example of a bialgebra --Bill Page, Wed, 13 May 2009 08:06:57 -0700 reply
SandBoxHopfAlgebra

TensorProduct? is now included with FriCAS. Thank you Franz!