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

Edit detail for SandBoxTensorProduct3 revision 1 of 2

1 2
Editor: pagani
Time: 2016/12/09 20:43:31 GMT+0
Note:

changed:
-
\begin{axiom}
R ==> EXPR INT

e:=[subscript('e, [k]) for k in 1..3]
g:=[subscript('g, [k]) for k in 1..4]
h:=[superscript('h, [k]) for k in 1..4]

B1:=OrderedVariableList e
B2:=OrderedVariableList g 
B3:=OrderedVariableList h 

M1:=FreeModule(R,B1)
M2:=FreeModule(R,B2)
M3:=FreeModule(R,B3)

M12:=TensorProduct(R,B1,B2,M1,M2)
M23:=TensorProduct(R,B2,B3,M2,M3)
M123:=TensorProduct(R,Product(B1,B2),B3,M12,M3)

v1:=x*(e.1)::M1 - y*(e.3)::M1
v2:=q*(g.2)::M2 + r*(g.4)::M2
v3:=3*(h.1)::M3 - z*(h.3)::M3

t12:=tensor(v1,v2)$M12
t23:=tensor(v2,v3)$M23

t123:=tensor(t12,v3)$M123

N:=TensorPower(3,R,B2,M2)
tt3:=tensor([(g.1)::M2,(g.2)::M2,(g.4)::M2])$N

-- 

construct(e.1,g.1)$Product(B1,B2)::M12
BB12:=concat [[construct((e.i)::B1,(g.j)::B2)$Product(B1,B2)::M12 for j in 1..4] for i in 1..3]

typeOf(%) has OrderedSet
\end{axiom}

Tensor product of three or more different spaces:
$$ U\otimes V \otimes W$$
where $$U=[e_1,e_2,_e3], V=[g_1,\ldots,g_4]$$ and 
$$W=[h^1,\ldots,h^4]$$. The problem can be seen in
the output of equation $(18)$. 

In order to get the output correct how should B12 be set?


fricas
R ==> EXPR INT
Type: Void
fricas
e:=[subscript('e, [k]) for k in 1..3]

\label{eq1}\left[{e_{1}}, \:{e_{2}}, \:{e_{3}}\right](1)
Type: List(Symbol)
fricas
g:=[subscript('g, [k]) for k in 1..4]

\label{eq2}\left[{g_{1}}, \:{g_{2}}, \:{g_{3}}, \:{g_{4}}\right](2)
Type: List(Symbol)
fricas
h:=[superscript('h, [k]) for k in 1..4]

\label{eq3}\left[{h^{1}}, \:{h^{2}}, \:{h^{3}}, \:{h^{4}}\right](3)
Type: List(Symbol)
fricas
B1:=OrderedVariableList e

\label{eq4}\hbox{\axiomType{OrderedVariableList}\ } ([ e [ 1 ] , e [ 2 ] , e [ 3 ] ])(4)
Type: Type
fricas
B2:=OrderedVariableList g

\label{eq5}\hbox{\axiomType{OrderedVariableList}\ } ([ g [ 1 ] , g [ 2 ] , g [ 3 ] , g [ 4 ] ])(5)
Type: Type
fricas
B3:=OrderedVariableList h

\label{eq6}\hbox{\axiomType{OrderedVariableList}\ } ([ h [ ; 1 ] , h [ ; 2 ] , h [ ; 3 ] , h [ ; 4 ] ])(6)
Type: Type
fricas
M1:=FreeModule(R,B1)

\label{eq7}\hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ e [ 1 ] , e [ 2 ] , e [ 3 ] ]))(7)
Type: Type
fricas
M2:=FreeModule(R,B2)

\label{eq8}\hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ g [ 1 ] , g [ 2 ] , g [ 3 ] , g [ 4 ] ]))(8)
Type: Type
fricas
M3:=FreeModule(R,B3)

\label{eq9}\hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ h [ ; 1 ] , h [ ; 2 ] , h [ ; 3 ] , h [ ; 4 ] ]))(9)
Type: Type
fricas
M12:=TensorProduct(R,B1,B2,M1,M2)

\label{eq10}\hbox{\axiomType{TensorProduct}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ e [ 1 ] , e [ 2 ] , e [ 3 ] ]) , \hbox{\axiomType{OrderedVariableList}\ } ([ g [ 1 ] , g [ 2 ] , g [ 3 ] , g [ 4 ] ]) , \hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ e [ 1 ] , e [ 2 ] , e [ 3 ] ])) , \hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ g [ 1 ] , g [ 2 ] , g [ 3 ] , g [ 4 ] ])))(10)
Type: Type
fricas
M23:=TensorProduct(R,B2,B3,M2,M3)

\label{eq11}\hbox{\axiomType{TensorProduct}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ g [ 1 ] , g [ 2 ] , g [ 3 ] , g [ 4 ] ]) , \hbox{\axiomType{OrderedVariableList}\ } ([ h [ ; 1 ] , h [ ; 2 ] , h [ ; 3 ] , h [ ; 4 ] ]) , \hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ g [ 1 ] , g [ 2 ] , g [ 3 ] , g [ 4 ] ])) , \hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ h [ ; 1 ] , h [ ; 2 ] , h [ ; 3 ] , h [ ; 4 ] ])))(11)
Type: Type
fricas
M123:=TensorProduct(R,Product(B1,B2),B3,M12,M3)

\label{eq12}\hbox{\axiomType{TensorProduct}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{Product}\ } (\hbox{\axiomType{OrderedVariableList}\ } ([ e [ 1 ] , e [ 2 ] , e [ 3 ] ]) , \hbox{\axiomType{OrderedVariableList}\ } ([ g [ 1 ] , g [ 2 ] , g [ 3 ] , g [ 4 ] ])) , \hbox{\axiomType{OrderedVariableList}\ } ([ h [ ; 1 ] , h [ ; 2 ] , h [ ; 3 ] , h [ ; 4 ] ]) , \hbox{\axiomType{TensorProduct}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ e [ 1 ] , e [ 2 ] , e [ 3 ] ]) , \hbox{\axiomType{OrderedVariableList}\ } ([ g [ 1 ] , g [ 2 ] , g [ 3 ] , g [ 4 ] ]) , \hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ e [ 1 ] , e [ 2 ] , e [ 3 ] ])) , \hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ g [ 1 ] , g [ 2 ] , g [ 3 ] , g [ 4 ] ]))) , \hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ h [ ; 1 ] , h [ ; 2 ] , h [ ; 3 ] , h [ ; 4 ] ])))(12)
Type: Type
fricas
v1:=x*(e.1)::M1 - y*(e.3)::M1

\label{eq13}{x \ {e_{1}}}-{y \ {e_{3}}}(13)
Type: FreeModule?(Expression(Integer),OrderedVariableList?([e[1],e[2],e[3]]))
fricas
v2:=q*(g.2)::M2 + r*(g.4)::M2

\label{eq14}{q \ {g_{2}}}+{r \ {g_{4}}}(14)
Type: FreeModule?(Expression(Integer),OrderedVariableList?([g[1],g[2],g[3],g[4]]))
fricas
v3:=3*(h.1)::M3 - z*(h.3)::M3

\label{eq15}{3 \ {h^{1}}}-{z \ {h^{3}}}(15)
Type: FreeModule?(Expression(Integer),OrderedVariableList?([h[;1],h[;2],h[;3],h[;4]]))
fricas
t12:=tensor(v1,v2)$M12

\label{eq16}\begin{array}{@{}l}
\displaystyle
{q \  x \ {{e_{1}}\otimes{g_{2}}}}+{r \  x \ {{e_{1}}\otimes{g_{4}}}}-{q \  y \ {{e_{3}}\otimes{g_{2}}}}- 
\
\
\displaystyle
{r \  y \ {{e_{3}}\otimes{g_{4}}}}
(16)
Type: TensorProduct?(Expression(Integer),OrderedVariableList?([e[1],e[2],e[3]]),OrderedVariableList?([g[1],g[2],g[3],g[4]]),FreeModule?(Expression(Integer),OrderedVariableList?([e[1],e[2],e[3]])),FreeModule?(Expression(Integer),OrderedVariableList?([g[1],g[2],g[3],g[4]])))
fricas
t23:=tensor(v2,v3)$M23

\label{eq17}\begin{array}{@{}l}
\displaystyle
{3 \  q \ {{g_{2}}\otimes{h^{1}}}}-{q \  z \ {{g_{2}}\otimes{h^{3}}}}+{3 \  r \ {{g_{4}}\otimes{h^{1}}}}- 
\
\
\displaystyle
{r \  z \ {{g_{4}}\otimes{h^{3}}}}
(17)
Type: TensorProduct?(Expression(Integer),OrderedVariableList?([g[1],g[2],g[3],g[4]]),OrderedVariableList?([h[;1],h[;2],h[;3],h[;4]]),FreeModule?(Expression(Integer),OrderedVariableList?([g[1],g[2],g[3],g[4]])),FreeModule?(Expression(Integer),OrderedVariableList?([h[;1],h[;2],h[;3],h[;4]])))
fricas
t123:=tensor(t12,v3)$M123

\label{eq18}\begin{array}{@{}l}
\displaystyle
{3 \  q \  x \ {{\left[{e_{1}}, \:{g_{2}}\right]}\otimes{h^{1}}}}-{q \  x \  z \ {{\left[{e_{1}}, \:{g_{2}}\right]}\otimes{h^{3}}}}+ 
\
\
\displaystyle
{3 \  r \  x \ {{\left[{e_{1}}, \:{g_{4}}\right]}\otimes{h^{1}}}}-{r \  x \  z \ {{\left[{e_{1}}, \:{g_{4}}\right]}\otimes{h^{3}}}}- 
\
\
\displaystyle
{3 \  q \  y \ {{\left[{e_{3}}, \:{g_{2}}\right]}\otimes{h^{1}}}}+{q \  y \  z \ {{\left[{e_{3}}, \:{g_{2}}\right]}\otimes{h^{3}}}}- 
\
\
\displaystyle
{3 \  r \  y \ {{\left[{e_{3}}, \:{g_{4}}\right]}\otimes{h^{1}}}}+{r \  y \  z \ {{\left[{e_{3}}, \:{g_{4}}\right]}\otimes{h^{3}}}}
(18)
Type: TensorProduct?(Expression(Integer),Product(OrderedVariableList?([e[1],e[2],e[3]]),OrderedVariableList?([g[1],g[2],g[3],g[4]])),OrderedVariableList?([h[;1],h[;2],h[;3],h[;4]]),TensorProduct?(Expression(Integer),OrderedVariableList?([e[1],e[2],e[3]]),OrderedVariableList?([g[1],g[2],g[3],g[4]]),FreeModule?(Expression(Integer),OrderedVariableList?([e[1],e[2],e[3]])),FreeModule?(Expression(Integer),OrderedVariableList?([g[1],g[2],g[3],g[4]]))),FreeModule?(Expression(Integer),OrderedVariableList?([h[;1],h[;2],h[;3],h[;4]])))
fricas
N:=TensorPower(3,R,B2,M2)

\label{eq19}\hbox{\axiomType{TensorPower}\ } (3, \hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ g [ 1 ] , g [ 2 ] , g [ 3 ] , g [ 4 ] ]) , \hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{OrderedVariableList}\ } ([ g [ 1 ] , g [ 2 ] , g [ 3 ] , g [ 4 ] ])))(19)
Type: Type
fricas
tt3:=tensor([(g.1)::M2,(g.2)::M2,(g.4)::M2])$N

\label{eq20}{{g_{1}}\otimes{g_{2}}}\otimes{g_{4}}(20)
Type: TensorPower?(3,Expression(Integer),OrderedVariableList?([g[1],g[2],g[3],g[4]]),FreeModule?(Expression(Integer),OrderedVariableList?([g[1],g[2],g[3],g[4]])))
fricas
-- 
construct(e.1,g.1)$Product(B1,B2)::M12

\label{eq21}{e_{1}}\otimes{g_{1}}(21)
Type: TensorProduct?(Expression(Integer),OrderedVariableList?([e[1],e[2],e[3]]),OrderedVariableList?([g[1],g[2],g[3],g[4]]),FreeModule?(Expression(Integer),OrderedVariableList?([e[1],e[2],e[3]])),FreeModule?(Expression(Integer),OrderedVariableList?([g[1],g[2],g[3],g[4]])))
fricas
BB12:=concat [[construct((e.i)::B1,(g.j)::B2)$Product(B1,B2)::M12 for j in 1..4] for i in 1..3]

\label{eq22}\begin{array}{@{}l}
\displaystyle
\left[{{e_{1}}\otimes{g_{1}}}, \:{{e_{1}}\otimes{g_{2}}}, \:{{e_{1}}\otimes{g_{3}}}, \:{{e_{1}}\otimes{g_{4}}}, \: \right.
\
\
\displaystyle
\left.{{e_{2}}\otimes{g_{1}}}, \:{{e_{2}}\otimes{g_{2}}}, \:{{e_{2}}\otimes{g_{3}}}, \:{{e_{2}}\otimes{g_{4}}}, \: \right.
\
\
\displaystyle
\left.{{e_{3}}\otimes{g_{1}}}, \:{{e_{3}}\otimes{g_{2}}}, \:{{e_{3}}\otimes{g_{3}}}, \:{{e_{3}}\otimes{g_{4}}}\right] 
(22)
Type: List(TensorProduct?(Expression(Integer),OrderedVariableList?([e[1],e[2],e[3]]),OrderedVariableList?([g[1],g[2],g[3],g[4]]),FreeModule?(Expression(Integer),OrderedVariableList?([e[1],e[2],e[3]])),FreeModule?(Expression(Integer),OrderedVariableList?([g[1],g[2],g[3],g[4]]))))
fricas
typeOf(%) has OrderedSet

\label{eq23} \mbox{\rm false} (23)
Type: Boolean

Tensor product of three or more different spaces:

 U\otimes V \otimes W 
where
U=[e_1,e_2,_e3], V=[g_1,\ldots,g_4] 
and
W=[h^1,\ldots,h^4] 
. The problem can be seen in the output of equation (18).

In order to get the output correct how should B12 be set?