12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301 |
- REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % %
- % Examples of calculations of matrix normal forms using the REDUCE %
- % NORMFORM package. %
- % %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- load_package normform;
- on errcont;
- % So that computation continues after an error.
- %
- % If using xr, the X interface for REDUCE, then turn on looking_good to
- % improve the appearance of the output.
- %
- fluid '(options!*);
- lisp if memq('fmprint ,options!*) then on looking_good;
- procedure test(tmp,A);
- %
- % Checks that P * N * P^-1 = A where tmp is the output {P,N,P^-1}
- % of the Normal form calculation on A.
- %
- begin
- if second tmp * first tmp * third tmp = A then
- write "Seems O.K." else rederr "something isn't working.";
- end;
- test
- %%%%%%%%%%%%%%%%%%%%%%%%%%%% Smithex %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- A := mat((3*x,x^2+x),(0,x^2));
- [3*x x*(x + 1)]
- [ ]
- a := [ 2 ]
- [ 0 x ]
- answer := smithex(A,x);
- answer := {
- [x 0 ]
- [ ]
- [ 2]
- [0 x ]
- ,
- [1 0]
- [ ]
- [x 1]
- ,
- [3 x + 1]
- [ ]
- [-3 - x ]
- }
- test(answer,A);
- Seems O.K.
- %
- % Extend algebraic field to include sqrt2.
- %
- load_package arnum;
- defpoly sqrt2**2-2;
- A := mat((sqrt2*y^2,y+1),(3*sqrt2,y^3+y*sqrt2));
- [ 2 ]
- [sqrt2*y y + 1 ]
- a := [ ]
- [ 2 ]
- [3*sqrt2 y*(y + sqrt2)]
- answer := smithex(A,y);
- answer := {
- [1 0 ]
- [ ]
- [ 5 3 ]
- [0 y + sqrt2*y - 3*y - 3]
- ,
- [ 2 1 ]
- [sqrt2*y ---*sqrt2]
- [ 6 ]
- [ ]
- [3*sqrt2 0 ]
- ,
- [ 1 2 ]
- [1 ---*sqrt2*y*(y + sqrt2)]
- [ 6 ]
- [ ]
- [0 - sqrt2 ]
- }
- test(answer,A);
- Seems O.K.
- off arnum;
- %
- % smithex will compute the Smith normal form of matrices containing
- % only integer entries but the integers are regarded as univariate
- % polynomials in x over a field F (the rationals unless the field has
- % been extended). For calculations over the integers use smithex_int.
- %
- A := mat((9,-36,30),(-36,192,-180),(30,-180,180));
- [ 9 -36 30 ]
- [ ]
- a := [-36 192 -180]
- [ ]
- [30 -180 180 ]
- answer := smithex(A,x);
- *** WARNING: all matrix entries are integers.
- If calculations in Z(the integers) are required, use smithex_int.
- answer := {
- [1 0 0]
- [ ]
- [0 1 0]
- [ ]
- [0 0 1]
- ,
- [ 1 ]
- [ 9 18 -----]
- [ 720 ]
- [ ]
- [-36 -24 0 ]
- [ ]
- [30 0 0 ]
- ,
- [1 -6 6 ]
- [ ]
- [ - 3 ]
- [0 1 ------]
- [ 2 ]
- [ ]
- [0 0 2160 ]
- }
- test(answer,A);
- Seems O.K.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%% Smithex_int %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- A := mat((1,2,3),(4,5,6),(7,8,x));
- [1 2 3]
- [ ]
- a := [4 5 6]
- [ ]
- [7 8 x]
- answer := smithex_int(A);
- ***** ERROR: matrix contains non_integer entries. Try smithex.
- A := mat((9,-36,30),(-36,192,-180),(30,-180,180));
- [ 9 -36 30 ]
- [ ]
- a := [-36 192 -180]
- [ ]
- [30 -180 180 ]
- answer := smithex_int(A);
- answer := {
- [3 0 0 ]
- [ ]
- [0 12 0 ]
- [ ]
- [0 0 60]
- ,
- [-17 -5 -4 ]
- [ ]
- [64 19 15 ]
- [ ]
- [-50 -15 -12]
- ,
- [1 -24 30 ]
- [ ]
- [-1 25 -30]
- [ ]
- [0 -1 1 ]
- }
- test(answer,A);
- Seems O.K.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Frobenius %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- A := mat(((y+y^2-x^2)/y,(x-x^2-y+y^2)/y,(x^2-y^2)/y),(1+x+y,
- (x-y+y^2+x*y)/y,-x-y),((y-x+y^2-x^2)/y,(x-y+y^2-x^2)/y,
- (x+x^2-y^2)/y));
- [ 2 2 2 2 2 2 ]
- [ - x + y + y - x + x + y - y x - y ]
- [ ---------------- -------------------- --------- ]
- [ y y y ]
- [ ]
- [ 2 ]
- [ x*y + x + y - y ]
- a := [ x + y + 1 ------------------ - (x + y) ]
- [ y ]
- [ ]
- [ 2 2 2 2 2 2 ]
- [ - x - x + y + y - x + x + y - y x + x - y ]
- [-------------------- -------------------- -------------]
- [ y y y ]
- answer := frobenius(A);
- answer := {
- [ x ]
- [--- 0 0 ]
- [ y ]
- [ ]
- [ - x*(x + y) ]
- [ 0 0 --------------]
- [ y ]
- [ ]
- [ 2 ]
- [ x*y + x + y ]
- [ 0 1 --------------]
- [ y ]
- ,
- 3 2 2 2 2 2 2
- - x - 2*x *y - x - x*y + x*y + 2*y + y x - y - y
- mat((---------------------------------------------,-1,-------------),
- y*(x + y + 1) y
- (x + y + 1,0, - (x + y + 1)),
- 2 2 2 2
- - x - x + y + 2*y x + x - y - y
- (----------------------,0,-----------------))
- y y
- ,
- [ x - y ]
- [0 ------- 1 ]
- [ y ]
- [ ]
- [ 3 2 2 2 3 2 2 2 ]
- [ - x - x *y - x + x*y + y + y + y - x - 2*x*y - y ]
- [-1 ---------------------------------------- --------------------]
- [ y*(x + y + 1) x + y + 1 ]
- [ ]
- [ 2 2 ]
- [ x + x - y - 2*y ]
- [0 ------------------- 1 ]
- [ y*(x + y + 1) ]
- }
- test(answer,A);
- Seems O.K.
- %
- % Extend algebraic field to include i.
- %
- load_package arnum;
- defpoly i^2+1;
- A := mat((-3-i,1,2+i,7-9*i),(-2,1,1,5-i),(-2-2*i,1,2+2*i,4-2*i),
- (2,0,-1,-2+8*i));
- [ - (i + 3) 1 i + 2 - (9*i - 7)]
- [ ]
- [ -2 1 1 - (i - 5) ]
- a := [ ]
- [ - (2*i + 2) 1 2*i + 2 - (2*i - 4)]
- [ ]
- [ 2 0 -1 8*i - 2 ]
- answer := frobenius(A);
- answer := {
- [i + 1 0 0 0 ]
- [ ]
- [ 0 0 0 7*i - 3 ]
- [ ]
- [ 0 1 0 - (8*i - 9)]
- [ ]
- [ 0 0 1 8*i - 3 ]
- ,
- [ 425 189 ]
- [-----*i + ----- -1 i + 3 18*i - 18 ]
- [ 106 106 ]
- [ ]
- [ 634 258 ]
- [-----*i + ----- 0 2 2*i - 12 ]
- [ 53 53 ]
- [ ]
- [ 150 588 ]
- [-----*i - ----- 0 2*i + 2 4*i - 10 ]
- [ 53 53 ]
- [ ]
- [ 108 7 ]
- [-----*i + ---- 0 -2 - (16*i - 8)]
- [ 53 53 ]
- ,
- mat((0, - i,1,1),
- 143 268 263 152 491 155
- (-1, - (-----*i - -----),-----*i + -----,-----*i + -----),
- 53 53 53 53 106 106
- 339 368 392 383 370 189
- (0, - (-----*i + -----), - (-----*i - -----), - (-----*i - -----)
- 106 53 53 106 53 53
- ),
- 101 9 7 54
- (0, - (-----*i + -----), - (-----*i - ----),1))
- 106 106 106 53
- }
- off arnum;
- A := mat((10,-5,-5,8,3,0),(-4,2,-10,-7,-5,-5),(-8,2,7,3,7,5),
- (-6,-7,-7,-7,10,7),(-4,-3,-3,-6,8,-9),(-2,5,-5,9,7,-4));
- [10 -5 -5 8 3 0 ]
- [ ]
- [-4 2 -10 -7 -5 -5]
- [ ]
- [-8 2 7 3 7 5 ]
- a := [ ]
- [-6 -7 -7 -7 10 7 ]
- [ ]
- [-4 -3 -3 -6 8 -9]
- [ ]
- [-2 5 -5 9 7 -4]
- F := first frobenius(A);
- [0 0 0 0 0 -867960]
- [ ]
- [1 0 0 0 0 -466370]
- [ ]
- [0 1 0 0 0 47845 ]
- f := [ ]
- [0 0 1 0 0 -712 ]
- [ ]
- [0 0 0 1 0 -95 ]
- [ ]
- [0 0 0 0 1 16 ]
- %
- % Calculate in Z\23Z...
- %
- on modular;
- setmod 23;
- 1
- F_mod := first frobenius(A);
- [0 17 0 0 0 0 ]
- [ ]
- [1 19 0 0 0 0 ]
- [ ]
- [0 0 0 0 0 10]
- f_mod := [ ]
- [0 0 1 0 0 5 ]
- [ ]
- [0 0 0 1 0 15]
- [ ]
- [0 0 0 0 1 20]
-
- %
- % ...and with a balanced modular representation.
- %
- on balanced_mod;
- F_bal_mod := first frobenius(A);
- [0 - 6 0 0 0 0 ]
- [ ]
- [1 - 4 0 0 0 0 ]
- [ ]
- [0 0 0 0 0 10 ]
- f_bal_mod := [ ]
- [0 0 1 0 0 5 ]
- [ ]
- [0 0 0 1 0 - 8]
- [ ]
- [0 0 0 0 1 - 3]
- off balanced_mod;
- off modular;
- %%%%%%%%%%%%%%%%%%%%%%%%%%% Ratjordan %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- A := mat(((y+y^2-x^2)/y,(x-x^2-y+y^2)/y,(x^2-y^2)/y),(1+x+y,
- (x-y+y^2+x*y)/y,-x-y),((y-x+y^2-x^2)/y,(x-y+y^2-x^2)/y,
- (x+x^2-y^2)/y));
- [ 2 2 2 2 2 2 ]
- [ - x + y + y - x + x + y - y x - y ]
- [ ---------------- -------------------- --------- ]
- [ y y y ]
- [ ]
- [ 2 ]
- [ x*y + x + y - y ]
- a := [ x + y + 1 ------------------ - (x + y) ]
- [ y ]
- [ ]
- [ 2 2 2 2 2 2 ]
- [ - x - x + y + y - x + x + y - y x + x - y ]
- [-------------------- -------------------- -------------]
- [ y y y ]
- answer := ratjordan(A);
- answer := {
- [ x ]
- [--- 0 0 ]
- [ y ]
- [ ]
- [ x ]
- [ 0 --- 0 ]
- [ y ]
- [ ]
- [ 0 0 x + y]
- ,
- 3 2 2 2 2 2
- - x - 2*x *y - x - x*y + x*y + 2*y + y - x - x*y + y
- mat((---------------------------------------------,-----------------,
- y*(x + y + 1) 2
- x*y - x + y
- 2 2
- x + x - y - y
- -----------------),
- 2
- x*y - x + y
- y*(x + y + 1) - y*(x + y + 1)
- (x + y + 1,---------------,------------------),
- 2 2
- x*y - x + y x*y - x + y
- 2 2 2 2 2 2
- - x - x + y + 2*y - x - x + y + y x + x - y - y
- (----------------------,--------------------,-----------------))
- y 2 2
- x*y - x + y x*y - x + y
- ,
- x - y
- mat((0,-------,1),
- y
- 3 3 2 2 2 2 3 2 4 3 2
- - x *y + x - x *y - x *y + x + x*y - x*y - 2*x*y + y + y + y
- (-1,-----------------------------------------------------------------------,
- 2
- y *(x + y + 1)
- 2 2 2 3
- - x *y + x - 2*x*y + x*y + x - y
- --------------------------------------),
- y*(x + y + 1)
- - x - y + 1 x + y
- (-1,--------------,-----------))
- x + y + 1 x + y + 1
- }
- test(answer,A);
- Seems O.K.
- %
- % Extend algebraic field to include sqrt(2).
- %
- load_package arnum;
- defpoly sqrt2**2-2;
- A:= mat((4*sqrt2-6,-4*sqrt2+7,-3*sqrt2+6),(3*sqrt2-6,-3*sqrt2+7,
- -3*sqrt2+6),(3*sqrt2,1-3sqrt2,-2*sqrt2));
- [4*sqrt2 - 6 - (4*sqrt2 - 7) - (3*sqrt2 - 6)]
- [ ]
- a := [3*sqrt2 - 6 - (3*sqrt2 - 7) - (3*sqrt2 - 6)]
- [ ]
- [ 3*sqrt2 - (3*sqrt2 - 1) - 2*sqrt2 ]
- answer := ratjordan(A);
- answer := {
- [sqrt2 0 0 ]
- [ ]
- [ 0 sqrt2 0 ]
- [ ]
- [ 0 0 - (3*sqrt2 - 1)]
- ,
- [ 21 49 21 18 ]
- [7*sqrt2 - 6 ----*sqrt2 - ---- - (----*sqrt2 - ----)]
- [ 31 31 31 31 ]
- [ ]
- [ 21 18 21 18 ]
- [3*sqrt2 - 6 ----*sqrt2 - ---- - (----*sqrt2 - ----)]
- [ 31 31 31 31 ]
- [ ]
- [ 3 24 3 24 ]
- [3*sqrt2 + 1 - (----*sqrt2 + ----) ----*sqrt2 + ---- ]
- [ 31 31 31 31 ]
- ,
- [0 sqrt2 + 1 1 ]
- [ ]
- [-1 4*sqrt2 + 9 4*sqrt2]
- [ ]
- [ 1 ]
- [-1 - (---*sqrt2 - 1) 1 ]
- [ 6 ]
- }
- test(answer,A);
- Seems O.K.
- off arnum;
- A := mat((-12752,-6285,-9457,-7065,-4939,-5865,-3769),(13028,6430,
- 9656, 7213,5041,5984,3841),(16425,8080,12192,9108,6370,7569,
- 4871), (-6065,-2979,-4508,-3364,-2354,-2801,-1803),(2968,
- 1424,2231, 1664,1171,1404,919),(-22762,-11189,-16902,-12627,
- -8833, -10498,-6760),(23112,11400,17135,12799,8946,10622,
- 6821));
- [-12752 -6285 -9457 -7065 -4939 -5865 -3769]
- [ ]
- [13028 6430 9656 7213 5041 5984 3841 ]
- [ ]
- [16425 8080 12192 9108 6370 7569 4871 ]
- [ ]
- a := [-6065 -2979 -4508 -3364 -2354 -2801 -1803]
- [ ]
- [ 2968 1424 2231 1664 1171 1404 919 ]
- [ ]
- [-22762 -11189 -16902 -12627 -8833 -10498 -6760]
- [ ]
- [23112 11400 17135 12799 8946 10622 6821 ]
- R := first ratjordan(A);
- [0 2 0 0 0 0 0 ]
- [ ]
- [1 0 0 0 0 0 0 ]
- [ ]
- [0 0 0 0 0 0 5 ]
- [ ]
- r := [0 0 1 0 0 0 0 ]
- [ ]
- [0 0 0 1 0 0 -2]
- [ ]
- [0 0 0 0 1 0 3 ]
- [ ]
- [0 0 0 0 0 1 0 ]
- %
- % Calculate in Z/23Z...
- %
- on modular;
- setmod 23;
- 23
- R_mod := first ratjordan(A);
- [19 0 0 0 0 0 0 ]
- [ ]
- [0 18 0 0 0 0 0 ]
- [ ]
- [0 0 17 0 0 0 0 ]
- [ ]
- r_mod := [0 0 0 5 0 0 0 ]
- [ ]
- [0 0 0 0 0 0 5 ]
- [ ]
- [0 0 0 0 1 0 19]
- [ ]
- [0 0 0 0 0 1 10]
- %
- % ...and with a balanced modular representation.
- %
- on balanced_mod;
- R_bal_mod := first ratjordan(A);
- [ - 4 0 0 0 0 0 0 ]
- [ ]
- [ 0 - 5 0 0 0 0 0 ]
- [ ]
- [ 0 0 - 6 0 0 0 0 ]
- [ ]
- r_bal_mod := [ 0 0 0 5 0 0 0 ]
- [ ]
- [ 0 0 0 0 0 0 5 ]
- [ ]
- [ 0 0 0 0 1 0 - 4]
- [ ]
- [ 0 0 0 0 0 1 10 ]
- off balanced_mod;
- off modular;
- %%%%%%%%%%%%%%%%%%%%%%%%%%% jordansymbolic %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- A := mat(((y+y^2-x^2)/y,(x-x^2-y+y^2)/y,(x^2-y^2)/y),(1+x+y,
- (x-y+y^2+x*y)/y,-x-y),((y-x+y^2-x^2)/y,(x-y+y^2-x^2)/y,
- (x+x^2-y^2)/y));
- [ 2 2 2 2 2 2 ]
- [ - x + y + y - x + x + y - y x - y ]
- [ ---------------- -------------------- --------- ]
- [ y y y ]
- [ ]
- [ 2 ]
- [ x*y + x + y - y ]
- a := [ x + y + 1 ------------------ - (x + y) ]
- [ y ]
- [ ]
- [ 2 2 2 2 2 2 ]
- [ - x - x + y + y - x + x + y - y x + x - y ]
- [-------------------- -------------------- -------------]
- [ y y y ]
- answer := jordansymbolic(A);
- answer := {
- [ x ]
- [--- 0 0 ]
- [ y ]
- [ ]
- [ x ]
- [ 0 --- 0 ]
- [ y ]
- [ ]
- [ 0 0 x + y]
- ,
- lambda*y - x
- {{--------------,lambda - x - y},
- y
- lambda},
- 3 2 2 2 2 2
- - x - 2*x *y - x - x*y + x*y + 2*y + y - x - x*y + y
- mat((---------------------------------------------,-----------------,
- y*(x + y + 1) 2
- x*y - x + y
- 2 2
- x + x - y - y
- -----------------),
- 2
- x*y - x + y
- y*(x + y + 1) - y*(x + y + 1)
- (x + y + 1,---------------,------------------),
- 2 2
- x*y - x + y x*y - x + y
- 2 2 2 2 2 2
- - x - x + y + 2*y - x - x + y + y x + x - y - y
- (----------------------,--------------------,-----------------))
- y 2 2
- x*y - x + y x*y - x + y
- ,
- x - y
- mat((0,-------,1),
- y
- 3 3 2 2 2 2 3 2 4 3 2
- - x *y + x - x *y - x *y + x + x*y - x*y - 2*x*y + y + y + y
- (-1,-----------------------------------------------------------------------,
- 2
- y *(x + y + 1)
- 2 2 2 3
- - x *y + x - 2*x*y + x*y + x - y
- --------------------------------------),
- y*(x + y + 1)
- - x - y + 1 x + y
- (-1,--------------,-----------))
- x + y + 1 x + y + 1
- }
- %
- % Extend algebraic field.
- %
- load_package arnum;
- defpoly b^3-2*b+b-5;
- A := mat((1-b,2+b^2),(3+b-2*b^2,3));
- [ 2 ]
- [ - (b - 1) b + 2]
- a := [ ]
- [ 2 ]
- [ - (2*b - b - 3) 3 ]
- answer := jordansymbolic(A);
- answer := {
- [lambda11 0 ]
- [ ]
- [ 0 lambda12]
- ,
- 2 2
- {{lambda + (b - 4)*lambda + 3*b + 4*b - 8},lambda},
- [ lambda11 - 3 lambda12 - 3 ]
- [ ]
- [ 2 2 ]
- [ - (2*b - b - 3) - (2*b - b - 3)]
- ,
- 1966 2 3514 1054 1
- mat(( - (--------*b + --------*b - --------)*(lambda11 + ---*b - 2),
- 239891 239891 239891 2
- 127472 2 236383 82923
- (----------*b + ----------*b + ---------)
- 29986375 29986375 5997275
- 26 2 107 45
- *(lambda11 + ----*b - -----*b + ----)),
- 11 11 11
- 1966 2 3514 1054 1
- ( - (--------*b + --------*b - --------)*(lambda12 + ---*b - 2),
- 239891 239891 239891 2
- 127472 2 236383 82923
- (----------*b + ----------*b + ---------)
- 29986375 29986375 5997275
- 26 2 107 45
- *(lambda12 + ----*b - -----*b + ----)))
- 11 11 11
- }
- off arnum;
- A := mat((-9,21,-15,4,2,0),(-10,21,-14,4,2,0),(-8,16,-11,4,2,0),
- (-6,12,-9,3,3,0),(-4,8,-6,0,5,0),(-2,4,-3,0,1,3));
- [-9 21 -15 4 2 0]
- [ ]
- [-10 21 -14 4 2 0]
- [ ]
- [-8 16 -11 4 2 0]
- a := [ ]
- [-6 12 -9 3 3 0]
- [ ]
- [-4 8 -6 0 5 0]
- [ ]
- [-2 4 -3 0 1 3]
- answer := jordansymbolic(A);
- answer := {
- [3 0 0 0 0 0 ]
- [ ]
- [0 3 0 0 0 0 ]
- [ ]
- [0 0 1 1 0 0 ]
- [ ]
- [0 0 0 1 0 0 ]
- [ ]
- [0 0 0 0 lambda31 0 ]
- [ ]
- [0 0 0 0 0 lambda32]
- ,
- 2
- {{lambda - 3,lambda - 1,lambda - 4*lambda + 5},lambda},
- [ - 3 1 6*lambda31 - 17 6*lambda32 - 17 ]
- [3 ------ 1 --- ----------------- ----------------- ]
- [ 8 4 2 2 ]
- [ ]
- [ - 3 1 5*(lambda31 - 3) 5*(lambda32 - 3) ]
- [3 ------ 1 --- ------------------ ------------------]
- [ 8 4 2 2 ]
- [ ]
- [ - 3 1 ]
- [3 ------ 1 --- 2*(lambda31 - 3) 2*(lambda32 - 3) ]
- [ 8 4 ]
- [ ]
- [ - 3 3 3 3*(lambda31 - 3) 3*(lambda32 - 3) ]
- [3 ------ --- --- ------------------ ------------------]
- [ 8 4 8 2 2 ]
- [ ]
- [ - 3 1 1 ]
- [3 ------ --- --- lambda31 - 3 lambda32 - 3 ]
- [ 8 2 4 ]
- [ ]
- [ - 1 1 1 lambda31 - 3 lambda32 - 3 ]
- [2 ------ --- --- -------------- -------------- ]
- [ 8 4 8 2 2 ]
- ,
- [ - 1 ]
- [ 0 0 0 ------ 0 1]
- [ 3 ]
- [ ]
- [ 8 ]
- [ 0 0 0 --- -8 8]
- [ 3 ]
- [ ]
- [ 0 -4 6 0 -2 0]
- [ ]
- [ 0 0 -4 8 -4 0]
- [ ]
- [ - lambda31 + 3 lambda31 - 4 1 0 0 0]
- [ ]
- [ - lambda32 + 3 lambda32 - 4 1 0 0 0]
- }
-
- % Check to see if looking_good (*) is on as the choice of using
- % either lambda or xi is dependent upon this.
- % (* -> the use of looking_good is described in the manual.).
- if not lisp !*looking_good then
- <<
- %
- % NB: we use lambda_ in solve (instead of lambda) as lambda is used
- % for other purposes in REDUCE which mean it cannot be used with
- % solve.
- %
- solve(lambda_^2-4*lambda_+5,lambda_);
- J := sub({lambda31=i + 2,lambda32= - i + 2},first answer);
- P := sub({lambda31=i + 2,lambda32= - i + 2},third answer);
- Pinv :=sub({lambda31=i + 2,lambda32= - i + 2},third rest answer);
- >>
- else
- <<
- solve(xi^2-4*xi+5,xi);
- J := sub({xi(3,1)=i + 2,xi(3,2)= - i + 2},first answer);
- P := sub({xi(3,1)=i + 2,xi(3,2)= - i + 2},third answer);
- Pinv := sub({xi(3,1)=i + 2,xi(3,2)= - i + 2},third rest answer);
- >>;
- test({J,P,Pinv},A);
- Seems O.K.
- %
- % Calculate in Z/23Z...
- %
- on modular;
- setmod 23;
- 23
- answer := jordansymbolic(A)$
- J_mod := {first answer, second answer};
- j_mod := {
- [3 0 0 0 0 0 ]
- [ ]
- [0 3 0 0 0 0 ]
- [ ]
- [0 0 1 1 0 0 ]
- [ ]
- [0 0 0 1 0 0 ]
- [ ]
- [0 0 0 0 lambda31 0 ]
- [ ]
- [0 0 0 0 0 lambda32]
- ,
- 2
- {{lambda + 20,lambda + 22,lambda + 19*lambda + 5},lambda}}
- %
- % ...and with a balanced modular representation.
- %
- on balanced_mod;
- answer := jordansymbolic(A)$
- J_bal_mod := {first answer, second answer};
- j_bal_mod := {
- [3 0 0 0 0 0 ]
- [ ]
- [0 3 0 0 0 0 ]
- [ ]
- [0 0 1 1 0 0 ]
- [ ]
- [0 0 0 1 0 0 ]
- [ ]
- [0 0 0 0 lambda31 0 ]
- [ ]
- [0 0 0 0 0 lambda32]
- ,
- 2
- {{lambda - 3,lambda - 1,lambda - 4*lambda + 5},lambda}}
- off balanced_mod;
- off modular;
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%% jordan %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- A := mat((1,y),(y^2,3));
- [1 y]
- [ ]
- a := [ 2 ]
- [y 3]
- answer := jordan(A);
- answer := {
- [ 3 ]
- [sqrt(y + 1) + 2 0 ]
- [ ]
- [ 3 ]
- [ 0 - sqrt(y + 1) + 2]
- ,
- [ 3 3 ]
- [sqrt(y + 1) - 1 - (sqrt(y + 1) + 1)]
- [ ]
- [ 2 2 ]
- [ y y ]
- ,
- [ 3 3 3 ]
- [ sqrt(y + 1) sqrt(y + 1) + y + 1 ]
- [ -------------- ----------------------- ]
- [ 3 2 3 ]
- [ 2*(y + 1) 2*y *(y + 1) ]
- [ ]
- [ 3 3 3 ]
- [ - sqrt(y + 1) - sqrt(y + 1) + y + 1 ]
- [----------------- --------------------------]
- [ 3 2 3 ]
- [ 2*(y + 1) 2*y *(y + 1) ]
- }
- test(answer,A);
- Seems O.K.
- A := mat((-12752,-6285,-9457,-7065,-4939,-5865,-3769),(13028,6430,
- 9656, 7213,5041,5984,3841),(16425,8080,12192,9108,6370,7569,
- 4871), (-6065,-2979,-4508,-3364,-2354,-2801,-1803),(2968,
- 1424,2231, 1664,1171,1404,919),(-22762,-11189,-16902,-12627,
- -8833, -10498,-6760),(23112,11400,17135,12799,8946,10622,
- 6821));
- [-12752 -6285 -9457 -7065 -4939 -5865 -3769]
- [ ]
- [13028 6430 9656 7213 5041 5984 3841 ]
- [ ]
- [16425 8080 12192 9108 6370 7569 4871 ]
- [ ]
- a := [-6065 -2979 -4508 -3364 -2354 -2801 -1803]
- [ ]
- [ 2968 1424 2231 1664 1171 1404 919 ]
- [ ]
- [-22762 -11189 -16902 -12627 -8833 -10498 -6760]
- [ ]
- [23112 11400 17135 12799 8946 10622 6821 ]
- on rounded;
- J := first jordan(A);
- *** Domain mode rounded changed to rational
- *** Domain mode rational changed to complex-rational
- *** Domain mode complex-rational changed to rational
- *** Domain mode rational changed to rounded
- j := mat((1.41421356237,0,0,0,0,0,0),
- (0, - 1.41421356237,0,0,0,0,0),
- (0,0, - 1.80491973207,0,0,0,0),
- (0,0,0, - 1.12491094597,0,0,0),
- (0,0,0,0,1.03588656373*i + 0.620319270571,0,0),
- (0,0,0,0,0, - 1.03588656373*i + 0.620319270571,0),
- (0,0,0,0,0,0,1.6891921369))
- off rounded;
- %
- % Extend algebraic field.
- %
- load_package arnum;
- defpoly b^3-2*b+b-5;
- A := mat((1-b,2+b^2),(3+b-2*b^2,3));
- [ 2 ]
- [ - (b - 1) b + 2]
- a := [ ]
- [ 2 ]
- [ - (2*b - b - 3) 3 ]
- J := first jordan(A);
- 11 2 1
- j := mat((sqrt(----*b + 6*b - 12)*i - (---*b - 2),0),
- 4 2
- 11 2 1
- (0, - (sqrt(----*b + 6*b - 12)*i + ---*b - 2)))
- 4 2
- off arnum;
- END;
- (TIME: normform 55819 60469)
|