(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.0' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 16131, 434]*) (*NotebookOutlinePosition[ 17147, 470]*) (* CellTagsIndexPosition[ 17074, 464]*) (*WindowFrame->Normal*) Notebook[{ Cell["\<\ We need to define gg and hh in the cell below. This is for the graph C4.\ \>", "Text"], Cell[CellGroupData[{ Cell["\<\ <", "Input", CellTags->"S5.18.1"], Cell[BoxData[ InterpretationBox[\("m = "\[InvisibleSpace]4\[InvisibleSpace]" vertices, \ n = "\[InvisibleSpace]4\[InvisibleSpace]" edges"\), SequenceForm[ "m = ", 4, " vertices, n = ", 4, " edges"], Editable->False]], "Print", CellTags->"S5.18.1"], Cell[GraphicsData["PostScript", "\<\ %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart /Mabs { Mgmatrix idtransform Mtmatrix dtransform } bind def /Mabsadd { Mabs 3 -1 roll add 3 1 roll add exch } bind def %% Graphics %%IncludeResource: font Courier %%IncludeFont: Courier /Courier findfont 10 scalefont setfont % Scaling calculations 0.0454545 0.909091 0.0454545 0.909091 [ [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath % Start of user PostScript /mathtops { gsave MBeginOrig moveto MEndOrig currentpoint grestore } bind def /MAtocoords { mathtops 4 2 roll mathtops 4 copy pop pop 3 -1 roll sub /arry exch def exch sub /arrx exch def arrx dup mul arry dup mul add sqrt /arrl exch def translate } bind def /MAarrowhead1 { gsave MAtocoords arrl 0. eq { 0 0 Mdot } { [ arrx arrl div arry arrl div -1 arry mul arrl div arrx arrl div 0 0 ] concat -0.05 0.0125 moveto 0 0 lineto -0.05 -0.0125 lineto fill -0.05 0.0125 moveto 0 0 lineto -0.05 -0.0125 lineto -0.05 0.0125 lineto stroke } ifelse grestore } def % End of user PostScript 0 0 0 r .005 w [ ] 0 setdash .5 .95455 m .04545 .5 L s % Start of user PostScript 0.5 1. 0 0.5 MAarrowhead1 % End of user PostScript .04545 .5 m .5 .04545 L s % Start of user PostScript 0 0.5 0.5 0 MAarrowhead1 % End of user PostScript .5 .04545 m .95455 .5 L s % Start of user PostScript 0.5 0 1. 0.5 MAarrowhead1 % End of user PostScript .95455 .5 m .5 .95455 L s % Start of user PostScript 1. 0.5 0.5 1. MAarrowhead1 % End of user PostScript .025 w .5 .95455 Mdot .04545 .5 Mdot .5 .04545 Mdot .95455 .5 Mdot % End of Graphics MathPictureEnd \ \>"], "Graphics", ImageSize->{81.3125, 81.3125}, ImageMargins->{{43, 0}, {0, 0}}, ImageRegion->{{0, 1}, {0, 1}}, ImageCache->GraphicsData["Bitmap", "\<\ CF5dJ6E]HGAYHf4PAg9QL6QYHg_oo0P0000?oo`00ool0>_oo000hool40002ool0 0`00ooooo`0hool003Ooo`@000Coo`03003ooooo03Ooo`00>?oo0`001Ooo00<00?ooool0=_oo000g ool00`00ool00007ool00`00ooooo`0eool003Koo`03003ooooo00Woo`03003ooooo03Coo`00=Ooo 00<00?ooool02ooo00<00?ooool0ooo00<00?ooool06ooo 000Lool00`00ooooo`0mool00`00ooooo`0Jool001_oo`03003ooooo03ooo`03003ooooo01Woo`00 6_oo00<00?ooool0@Ooo00<00?ooool06?oo000Iool00`00ooooo`13ool00`00ooooo`0Gool001So o`03003ooooo04Goo`03003ooooo01Koo`005ooo00<00?ooool0Aooo00<00?ooool05Ooo000Fool0 0`00ooooo`19ool00`00ooooo`0Dool001Goo`03003ooooo04_oo`03003ooooo01?oo`005?oo00<0 0?ooool0COoo00<00?ooool04_oo000Cool00`00ooooo`1?ool00`00ooooo`0Aool001;oo`03003o oooo057oo`03003ooooo013oo`004Ooo00<00?ooool0Dooo00<00?ooool03ooo000@ool00`00oooo o`1Eool00`00ooooo`0>ool000ooo`03003ooooo05Ooo`03003ooooo00goo`003_oo00<00?ooool0 FOoo00<00?ooool03?oo000=ool00`00ooooo`1Kool00`00ooooo`0;ool000coo`03003ooooo05go o`03003ooooo00[oo`002ooo00<00?ooool0Gooo00<00?ooool02Ooo000:ool00`00ooooo`1Qool0 0`00ool00008ool000Woo`03003ooooo06?oo`<000Ooo`002?oo00<00?ooool0Hooo10001ooo0007 ool00`00ooooo`1Uool40006ool000Goo`8006[oo`@000Coo`001Ooo0P00K?oo0P001?oo0006ool2 001Zool00`00ooooo`04ool000Koo`@006Ooo`03003ooooo00Goo`001ooo1000IOoo00<00?ooool0 1_oo0007ool3001Uool00`00ooooo`07ool000Soo`03003oo`0006?oo`03003ooooo00Soo`002ooo 00<00?ooool0Gooo00<00?ooool02Ooo000ooo00<00?oo ool06ooo000Nool00`00ooooo`0iool00`00ooooo`0Lool001ooo`03003ooooo03Ooo`03003ooooo 01goo`008?oo00<00?ooool0=Ooo00<00?ooool07_oo000Qool00`00ooooo`0cool00`00ooooo`0O ool002;oo`03003ooooo037oo`03003ooooo023oo`008ooo00<00?ooool0;ooo00<00?ooool08Ooo 000Tool00`00ooooo`0]ool00`00ooooo`0Rool002Goo`03003ooooo02_oo`03003ooooo02?oo`00 9_oo00<00?ooool0:Ooo00<00?ooool09?oo000Wool00`00ooooo`0Wool00`00ooooo`0Uool002So o`03003ooooo02Goo`03003ooooo02Koo`00:Ooo00<00?ooool08ooo00<00?ooool09ooo000Zool0 0`00ooooo`0Qool00`00ooooo`0Xool002_oo`03003ooooo01ooo`03003ooooo02Woo`00;?oo00<0 0?ooool07Ooo00<00?ooool0:_oo000]ool00`00ooooo`0Kool00`00ooooo`0[ool002koo`03003o oooo01Woo`03003ooooo02coo`00;ooo00<00?ooool05ooo00<00?ooool0;Ooo000`ool00`00oooo o`0Eool00`00ooooo`0^ool0037oo`03003ooooo01?oo`03003ooooo02ooo`00<_oo00<00?ooool0 4Ooo00<00?ooool0?oo00<00?ooool00ooo0`00 >?oo000iool00`00ooooo`02ool4000gool003[oo`03003ooooo00@003Soo`00>ooo1000>_oo000l ool2000kool007Woo`00NOoo001iool007Woo`00NOoo0000\ \>"], ImageRangeCache->{{{0, 120.938}, {120.938, 0}} -> {-0.0500054, -0.0500054, \ 0.0136435, 0.0136435}}, CellTags->"S5.18.1"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ Form\ Basis\ of\ Eigenvectors\ of\ - Laplacian\ *) \)\(\[IndentingNewLine]\)\(\(pp = Eigenvectors[L];\)\(\n\) \(l = Eigenvalues[L];\)\(\n\) \(Print["\", l];\)\(\[IndentingNewLine]\) \(Print["\", \ MatrixForm[Chop[pp]]];\)\(\n\)\( (*\(Print[ MatrixForm[ Chop[pp . Transpose[pp]]]];\)*) \)\(\[IndentingNewLine]\)\(\n\)\( (*\ Gram\ Schmitt\ the\ basis, \ multiple\ eigenvalues\ *) \)\(\[IndentingNewLine]\) \(p = {};\)\(\n\)\( (*\(p = Append[p, pp[\([1]\)]/\((Sqrt[pp[\([1]\)] . pp[\([1]\)]])\)] // N;\)*) \)\(\n\) \(p = Append[p, pp[\([1]\)]/\((Sqrt[pp[\([1]\)] . pp[\([1]\)]])\)];\)\(\n\) \(For[i = 2, i \[LessEqual] m, \(i++\), \[IndentingNewLine]q = pp[\([i]\)]; \[IndentingNewLine]For[j = 1, j \[LessEqual] i - 1, \(j++\), \[IndentingNewLine]\(q -= \((p[\([j]\)] . q)\) p[\([j]\)];\)\[IndentingNewLine]]; \[IndentingNewLine]q = q/Sqrt[q . q]; \[IndentingNewLine] (*\(p = Append[p, q] // N;\)*) \[IndentingNewLine]p = Append[p, q];\[IndentingNewLine]];\)\(\n\)\( (*\(Print[ MatrixForm[Chop[p . Transpose[p]]]];\)*) \)\(\[IndentingNewLine]\) \(Print["\", \ MatrixForm[Chop[p]]];\)\(\[IndentingNewLine]\) \( (*\[IndentingNewLine]p\ = \ p // N; \[IndentingNewLine]Print["\", \ MatrixForm[Chop[p]]];\[IndentingNewLine]*) \)\)\)\)], "Input"], Cell[BoxData[ InterpretationBox[\("evals of L = -Laplacian: "\[InvisibleSpace]{4, 2, 2, 0}\), SequenceForm[ "evals of L = -Laplacian: ", {4, 2, 2, 0}], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"evecs of L are rows of \"\>", "\[InvisibleSpace]", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {\(-1\), "1", \(-1\), "1"}, {"0", \(-1\), "0", "1"}, {\(-1\), "0", "1", "0"}, {"1", "1", "1", "1"} }], "\[NoBreak]", ")"}], Function[ BoxForm`e$, MatrixForm[ BoxForm`e$]]]}], SequenceForm[ "evecs of L are rows of ", MatrixForm[ {{-1, 1, -1, 1}, {0, -1, 0, 1}, {-1, 0, 1, 0}, {1, 1, 1, 1}}]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"evecs after Gram Schmitt: \"\>", "\[InvisibleSpace]", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {\(-\(1\/2\)\), \(1\/2\), \(-\(1\/2\)\), \(1\/2\)}, {"0", \(-\(1\/\@2\)\), "0", \(1\/\@2\)}, {\(-\(1\/\@2\)\), "0", \(1\/\@2\), "0"}, {\(1\/2\), \(1\/2\), \(1\/2\), \(1\/2\)} }], "\[NoBreak]", ")"}], Function[ BoxForm`e$, MatrixForm[ BoxForm`e$]]]}], SequenceForm[ "evecs after Gram Schmitt: ", MatrixForm[ {{ Rational[ -1, 2], Rational[ 1, 2], Rational[ -1, 2], Rational[ 1, 2]}, {0, Times[ -1, Power[ 2, Rational[ -1, 2]]], 0, Power[ 2, Rational[ -1, 2]]}, { Times[ -1, Power[ 2, Rational[ -1, 2]]], 0, Power[ 2, Rational[ -1, 2]], 0}, { Rational[ 1, 2], Rational[ 1, 2], Rational[ 1, 2], Rational[ 1, 2]}}]], Editable->False]], "Print"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ Read\ gap\ data\ *) \)\(\[IndentingNewLine]\)\(\(gapfile = \ "\";\)\n \(fmt = {Number, Number};\)\n \({m, k} = \(ReadList[gapfile, fmt, 1]\)[\([1]\)];\)\n \(fmt = {Number, Number, Table[Number, {i, 1, k}], Table[Number, {i, 1, k}]};\)\n \({m, k, j, q} = \(ReadList[gapfile, fmt, 1]\)[\([1]\)];\)\n (*\ \(Print[{m, k, j, q}];\)\ *) \n \(fmt = {Number, Number, Table[Number, {i, 1, k}], Table[Number, {i, 1, k}]};\)\n \(sym = {};\)\n \(For[kk = 1, kk \[LessEqual] k, \(kk++\), \[IndentingNewLine]sub = {}; \[IndentingNewLine]For[ jj = 1, jj \[LessEqual] j[\([kk]\)], \(jj++\), \[IndentingNewLine]row = Table[Number, {s, 1, q[\([kk]\)]}, {t, 1, m}]; \[IndentingNewLine]sub = Append[sub, row];\[IndentingNewLine]]; \[IndentingNewLine]sym = Append[sym, sub];\[IndentingNewLine]];\)\n \(fmt = Append[fmt, sym];\)\n \(AAA = \(ReadList[gapfile, fmt, 1]\)[\([1]\)];\)\n \(ss = AAA[\([5]\)];\)\[IndentingNewLine] \(B = {};\)\n \(For[si = 1, si \[LessEqual] Length[ss], \(si++\), \[IndentingNewLine]Bb = {}; \ \[IndentingNewLine]For[sii = 1, sii \[LessEqual] Length[ss[\([si]\)]\ ], \(sii++\), \[IndentingNewLine]gg = ss[\([si, sii]\)]; \[IndentingNewLine]ggs = Sign[Table[ gg[\([i, 1]\)], {i, 1, Length[gg]}]]; \[IndentingNewLine]gg = Abs[gg]; \[IndentingNewLine]BB = Flatten[\[IndentingNewLine]Table[ Transpose[\[IndentingNewLine]Table[ ggs[\([j]\)]\ p[\([i, gg[\([j]\)]]\)], \[IndentingNewLine]{i, 1, m}] - p], \[IndentingNewLine]{j, 1, Length[gg]}], 1]; \[IndentingNewLine]BB = NullSpace[BB]; \[IndentingNewLine]Bb = Append[Bb, BB];\[IndentingNewLine]]; \[IndentingNewLine]B = Append[B, Bb];\[IndentingNewLine]];\)\[IndentingNewLine] MatrixForm[B]\)\)\)], "Input"], Cell[BoxData[ InterpretationBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {\({{{0, 0, 0, 1}, {0, 0, 1, 0}, {0, 1, 0, 0}, {1, 0, 0, 0}}}\)}, {\({{{0, 0, 1, 0}, {0, 1, 0, 0}}}\)}, {\({{{0, 0, 0, 1}, {0, 1, 1, 0}}, {{0, 0, 0, 1}, {0, \(-1\), 1, 0}}}\)}, {\({{{0, \(-1\), 1, 0}, {1, 0, 0, 0}}, {{0, 1, 1, 0}, {1, 0, 0, 0}}}\)}, {\({{{0, 0, 0, 1}, {0, 0, 1, 0}, {1, 0, 0, 0}}, {{0, 0, 0, 1}, {0, 1, 0, 0}, {1, 0, 0, 0}}}\)}, {\({{{0, 0, 0, 1}, {1, 0, 0, 0}}}\)}, {\({{{0, 1, 1, 0}}, {{0, \(-1\), 1, 0}}}\)}, {\({{{0, 0, 1, 0}}, {{0, 1, 0, 0}}}\)}, {\({{{0, 0, 0, 1}}}\)}, {\({{{1, 0, 0, 0}}}\)}, {\({{}}\)} }], "\[NoBreak]", ")"}], MatrixForm[ {{{{0, 0, 0, 1}, {0, 0, 1, 0}, {0, 1, 0, 0}, {1, 0, 0, 0}}}, {{{0, 0, 1, 0}, {0, 1, 0, 0}}}, {{{0, 0, 0, 1}, {0, 1, 1, 0}}, {{0, 0, 0, 1}, {0, -1, 1, 0}}}, {{{0, -1, 1, 0}, {1, 0, 0, 0}}, {{0, 1, 1, 0}, {1, 0, 0, 0}}}, {{{0, 0, 0, 1}, {0, 0, 1, 0}, {1, 0, 0, 0}}, {{0, 0, 0, 1}, {0, 1, 0, 0}, {1, 0, 0, 0}}}, {{{0, 0, 0, 1}, {1, 0, 0, 0}}}, {{{0, 1, 1, 0}}, {{0, -1, 1, 0}}}, {{{0, 0, 1, 0}}, {{0, 1, 0, 0}}}, {{{0, 0, 0, 1}}}, {{{1, 0, 0, 0}}}, {{}}}]]], "Output"] }, Open ]] }, FrontEndVersion->"5.0 for X", ScreenRectangle->{{0, 1024}, {0, 768}}, WindowSize->{1014, 741}, WindowMargins->{{Automatic, 0}, {0, Automatic}}, PrintingCopies->1, PrintingPageRange->{Automatic, Automatic}, Magnification->1.5 ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{ "S5.18.1"->{ Cell[1876, 57, 465, 20, 378, "Input", CellTags->"S5.18.1"], Cell[2344, 79, 265, 5, 33, "Print", CellTags->"S5.18.1"], Cell[2612, 86, 6234, 172, 134, 1697, 111, "GraphicsData", "PostScript", "Graphics", CellTags->"S5.18.1"]} } *) (*CellTagsIndex CellTagsIndex->{ {"S5.18.1", 16789, 452} } *) (*NotebookFileOutline Notebook[{ Cell[1754, 51, 97, 2, 46, "Text"], Cell[CellGroupData[{ Cell[1876, 57, 465, 20, 378, "Input", CellTags->"S5.18.1"], Cell[2344, 79, 265, 5, 33, "Print", CellTags->"S5.18.1"], Cell[2612, 86, 6234, 172, 134, 1697, 111, "GraphicsData", "PostScript", \ "Graphics", CellTags->"S5.18.1"] }, Open ]], Cell[CellGroupData[{ Cell[8883, 263, 1659, 33, 614, "Input"], Cell[10545, 298, 206, 4, 33, "Print"], Cell[10754, 304, 625, 15, 104, "Print"], Cell[11382, 321, 1148, 32, 160, "Print"] }, Open ]], Cell[CellGroupData[{ Cell[12567, 358, 2159, 46, 890, "Input"], Cell[14729, 406, 1386, 25, 297, "Output"] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)