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

Demonstration of XDistributedPolynomial?

The following example is an attempt to answer https://groups.google.com/d/msg/fricas-devel/UxxF97W5tXA/EYbkeCBZYJsJ (see also the mail following this post)

fricas
Q ==> Fraction Integer
Type: Void
fricas
V ==> OrderedVariableList(['y11,'y12,'y21,'y22])
Type: Void
fricas
v := enumerate()$V

\label{eq1}\left[ y 11, \: y 12, \: y 21, \: y 22 \right](1)
Type: List(OrderedVariableList([y11,y12,y21,y22]))
fricas
X ==> XDistributedPolynomial(V, Q)
Type: Void
fricas
z11: X := v.1

\label{eq2}y 11(2)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
z12: X := v.2

\label{eq3}y 12(3)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
z21: X := v.3

\label{eq4}y 21(4)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
z22: X := v.4

\label{eq5}y 22(5)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
q: Matrix X := matrix [[z11, z12],[z21,z22]]

\label{eq6}\left[ 
\begin{array}{cc}
y 11 & y 12 
\
y 21 & y 22 
(6)
Type: Matrix(XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer)))
fricas
K := kroneckerProduct(q, q)

\label{eq7}\left[ 
\begin{array}{cccc}
{{y 11}^{2}}&{y 11 \  y 12}&{y 12 \  y 11}&{{y 12}^{2}}
\
{y 11 \  y 21}&{y 11 \  y 22}&{y 12 \  y 21}&{y 12 \  y 22}
\
{y 21 \  y 11}&{y 21 \  y 12}&{y 22 \  y 11}&{y 22 \  y 12}
\
{{y 21}^{2}}&{y 21 \  y 22}&{y 22 \  y 21}&{{y 22}^{2}}
(7)
Type: Matrix(XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer)))
fricas
MM: Matrix(Q) :=matrix([[1,0,0,1], [0,1,1,0], [0,1,-1,0], [1,0,0,-1]])

\label{eq8}\left[ 
\begin{array}{cccc}
1 & 0 & 0 & 1 
\
0 & 1 & 1 & 0 
\
0 & 1 & - 1 & 0 
\
1 & 0 & 0 & - 1 
(8)
Type: Matrix(Fraction(Integer))
fricas
T := MM*K*inverse(MM)

\label{eq9}\left[ 
\begin{array}{cccc}
{{{1 \over 2}\ {{y 22}^{2}}}+{{1 \over 2}\ {{y 21}^{2}}}+{{1 \over 2}\ {{y 12}^{2}}}+{{1 \over 2}\ {{y 11}^{2}}}}&{{{1 \over 2}\  y 22 \  y 21}+{{1 \over 2}\  y 21 \  y 22}+{{1 \over 2}\  y 12 \  y 11}+{{1 \over 2}\  y 11 \  y 12}}&{-{{1 \over 2}\  y 22 \  y 21}+{{1 \over 2}\  y 21 \  y 22}-{{1 \over 2}\  y 1
2 \  y 11}+{{1 \over 2}\  y 11 \  y 12}}&{-{{1 \over 2}\ {{y 22}^{2}}}+{{1 \over 2}\ {{y 21}^{2}}}-{{1 \over 2}\ {{y 12}^{2}}}+{{1 \over 2}\ {{y 11}^{2}}}}
\
{{{1 \over 2}\  y 22 \  y 12}+{{1 \over 2}\  y 21 \  y 11}+{{1 \over 2}\  y 12 \  y 22}+{{1 \over 2}\  y 11 \  y 21}}&{{{1 \over 2}\  y 22 \  y 11}+{{1 \over 2}\  y 21 \  y 12}+{{1 \over 2}\  y 12 \  y 21}+{{1 \over 2}\  y 11 \  y 22}}&{-{{1 \over 2}\  y 22 \  y 11}+{{1 \over 2}\  y 21 \  y 12}-{{1 \over 2}\  y 1
2 \  y 21}+{{1 \over 2}\  y 11 \  y 22}}&{-{{1 \over 2}\  y 2
2 \  y 12}+{{1 \over 2}\  y 21 \  y 11}-{{1 \over 2}\  y 12 \  y 22}+{{1 \over 2}\  y 11 \  y 21}}
\
{-{{1 \over 2}\  y 22 \  y 12}-{{1 \over 2}\  y 21 \  y 11}+{{1 \over 2}\  y 12 \  y 22}+{{1 \over 2}\  y 11 \  y 21}}&{-{{1 \over 2}\  y 22 \  y 11}-{{1 \over 2}\  y 21 \  y 12}+{{1 \over 2}\  y 12 \  y 21}+{{1 \over 2}\  y 11 \  y 22}}&{{{1 \over 2}\  y 22 \  y 11}-{{1 \over 2}\  y 21 \  y 12}-{{1 \over 2}\  y 1
2 \  y 21}+{{1 \over 2}\  y 11 \  y 22}}&{{{1 \over 2}\  y 22 \  y 12}-{{1 \over 2}\  y 21 \  y 11}-{{1 \over 2}\  y 12 \  y 22}+{{1 \over 2}\  y 11 \  y 21}}
\
{-{{1 \over 2}\ {{y 22}^{2}}}-{{1 \over 2}\ {{y 21}^{2}}}+{{1 \over 2}\ {{y 12}^{2}}}+{{1 \over 2}\ {{y 11}^{2}}}}&{-{{1 \over 2}\  y 22 \  y 21}-{{1 \over 2}\  y 21 \  y 22}+{{1 \over 2}\  y 12 \  y 11}+{{1 \over 2}\  y 11 \  y 12}}&{{{1 \over 2}\  y 22 \  y 21}-{{1 \over 2}\  y 21 \  y 22}-{{1 \over 2}\  y 12 \  y 11}+{{1 \over 2}\  y 11 \  y 12}}&{{{1 \over 2}\ {{y 22}^{2}}}-{{1 \over 2}\ {{y 21}^{2}}}-{{1 \over 2}\ {{y 12}^{2}}}+{{1 \over 2}\ {{y 11}^{2}}}}
(9)
Type: Matrix(XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer)))
fricas
r1 := (z11*z11+z21*z21-1)

\label{eq10}- 1 +{{y 21}^{2}}+{{y 11}^{2}}(10)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
r2 := (z11*z11+z12*z12-1)

\label{eq11}- 1 +{{y 12}^{2}}+{{y 11}^{2}}(11)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
r3 := (z12*z12+z22*z22-1)

\label{eq12}- 1 +{{y 22}^{2}}+{{y 12}^{2}}(12)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
r4 := (z21*z21+z22*z22-1)

\label{eq13}- 1 +{{y 22}^{2}}+{{y 21}^{2}}(13)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
r5 := (z11*z12+z21*z22)

\label{eq14}{y 21 \  y 22}+{y 11 \  y 12}(14)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
r6 := (z11*z21+z12*z22)

\label{eq15}{y 12 \  y 22}+{y 11 \  y 21}(15)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
r7 := (z12*z11+z22*z21)

\label{eq16}{y 22 \  y 21}+{y 12 \  y 11}(16)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
r8 := (z21*z11+z22*z12);
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
sigma ==> 1111;
Type: Void
fricas
r9 := z11*z22+z12*z21-sigma

\label{eq17}-{1111}+{y 12 \  y 21}+{y 11 \  y 22}(17)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
ra := (z11*z22-z22*z11)

\label{eq18}-{y 22 \  y 11}+{y 11 \  y 22}(18)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
rb := (z12*z21-z21*z12)

\label{eq19}-{y 21 \  y 12}+{y 12 \  y 21}(19)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
rc := (z11*z12+z12*z11)

\label{eq20}{y 12 \  y 11}+{y 11 \  y 12}(20)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
rd := (z21*z22+z22*z21)

\label{eq21}{y 22 \  y 21}+{y 21 \  y 22}(21)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
re := (z11*z21+z21*z11)

\label{eq22}{y 21 \  y 11}+{y 11 \  y 21}(22)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
rf := (z22*z12+z12*z22)

\label{eq23}{y 22 \  y 12}+{y 12 \  y 22}(23)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
t11 := 2*T(1,1) - r3 - r1

\label{eq24}2(24)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
t12 := 2*T(1,2) - r7 - r5

\label{eq25}0(25)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
t21 := 2*T(2,1) - r8 - r6

\label{eq26}0(26)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))
fricas
t22 := 2*T(2,2) + ra + rb - 2*r9

\label{eq27}2222(27)
Type: XDistributedPolynomial?(OrderedVariableList([y11,y12,y21,y22]),Fraction(Integer))




  Subject:   Be Bold !!
  ( 13 subscribers )  
Please rate this page: