(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 7.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 8560, 245] NotebookOptionsPosition[ 8107, 224] NotebookOutlinePosition[ 8467, 240] CellTagsIndexPosition[ 8424, 237] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"L2Norm", "[", "f_", "]"}], " ", ":=", SqrtBox[ RowBox[{" ", RowBox[{ SubsuperscriptBox["\[Integral]", "0", "\[Pi]"], RowBox[{ SuperscriptBox[ RowBox[{"Abs", "[", "f", "]"}], "2"], RowBox[{"\[DifferentialD]", "x"}]}]}]}]]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"L2IP", "[", RowBox[{"f_", ",", " ", "g_"}], "]"}], " ", ":=", " ", RowBox[{ SubsuperscriptBox["\[Integral]", "0", "\[Pi]"], RowBox[{"f", " ", RowBox[{"Conjugate", "[", "g", "]"}], RowBox[{"\[DifferentialD]", "x"}]}]}]}], ";"}]}], "Input", CellChangeTimes->{{3.4596865062044563`*^9, 3.459686664120265*^9}, { 3.4596906854989*^9, 3.459690691303339*^9}, 3.459691313898197*^9, { 3.459694182516881*^9, 3.459694187027012*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"v", " ", "=", " ", "1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"c", " ", "=", " ", "1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"m", "=", "2"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"H", " ", "=", " ", RowBox[{"ConstantArray", "[", RowBox[{"0", ",", RowBox[{"{", RowBox[{ RowBox[{"m", "+", "1"}], ",", "m"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"V", " ", "=", " ", RowBox[{"{", RowBox[{"v", "/", RowBox[{"L2Norm", "[", "v", "]"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"k", "=", "1"}], ",", RowBox[{"k", "\[LessEqual]", " ", "m"}], ",", RowBox[{"k", "++"}], ",", RowBox[{ RowBox[{"w", " ", "=", RowBox[{"Simplify", "[", " ", RowBox[{ RowBox[{"Integrate", "[", RowBox[{ RowBox[{ FractionBox["1", "c"], RowBox[{"(", FractionBox[ RowBox[{ RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", "c"}], " ", "\[Xi]"}], "]"}], "-", "1"}], RowBox[{ RowBox[{"Exp", "[", RowBox[{"c", " ", "\[Pi]"}], "]"}], "-", "1"}]], ")"}], RowBox[{"(", RowBox[{ RowBox[{"Exp", "[", RowBox[{"c", " ", "x"}], "]"}], "-", RowBox[{"Exp", "[", RowBox[{"c", " ", "\[Pi]"}], "]"}]}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"V", "[", RowBox[{"[", RowBox[{"-", "1"}], "]"}], "]"}], "/.", RowBox[{"x", " ", "\[Rule]", " ", "\[Xi]"}]}], ")"}]}], ",", RowBox[{"{", RowBox[{"\[Xi]", ",", "0", ",", "x"}], "}"}]}], "]"}], "+", RowBox[{"Integrate", "[", RowBox[{ RowBox[{ FractionBox["1", "c"], RowBox[{"(", FractionBox[ RowBox[{ RowBox[{"Exp", "[", RowBox[{"c", RowBox[{"(", RowBox[{"\[Pi]", "-", "\[Xi]"}], ")"}]}], "]"}], "-", "1"}], RowBox[{ RowBox[{"Exp", "[", RowBox[{"c", " ", "\[Pi]"}], "]"}], "-", "1"}]], ")"}], RowBox[{"(", RowBox[{ RowBox[{"Exp", "[", RowBox[{"c", " ", "x"}], "]"}], "-", "1"}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"V", "[", RowBox[{"[", RowBox[{"-", "1"}], "]"}], "]"}], "/.", RowBox[{"x", " ", "\[Rule]", " ", "\[Xi]"}]}], ")"}]}], ",", RowBox[{"{", RowBox[{"\[Xi]", ",", "x", ",", "\[Pi]"}], "}"}]}], "]"}]}], " ", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "1"}], ",", RowBox[{"j", "\[LessEqual]", " ", "k"}], ",", " ", RowBox[{"j", "++"}], ",", " ", RowBox[{ RowBox[{ RowBox[{"H", "\[LeftDoubleBracket]", RowBox[{"j", ",", "k"}], "\[RightDoubleBracket]"}], "=", RowBox[{"L2IP", "[", RowBox[{"w", ",", RowBox[{ "V", "\[LeftDoubleBracket]", "j", "\[RightDoubleBracket]"}]}], "]"}]}], ";", " ", RowBox[{"w", "=", RowBox[{"w", "-", " ", RowBox[{ RowBox[{"H", "\[LeftDoubleBracket]", RowBox[{"j", ",", "k"}], "\[RightDoubleBracket]"}], " ", RowBox[{ "V", "\[LeftDoubleBracket]", "j", "\[RightDoubleBracket]"}]}]}]}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"H", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"k", "+", "1"}], ",", "k"}], "\[RightDoubleBracket]"}], " ", "=", " ", RowBox[{"L2Norm", "[", RowBox[{"Simplify", "[", "w", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"w", " ", "=", " ", RowBox[{ RowBox[{"Simplify", "[", "w", "]"}], "/", RowBox[{"H", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"k", "+", "1"}], ",", "k"}], "\[RightDoubleBracket]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"V", " ", "=", " ", RowBox[{"Join", "[", RowBox[{"V", ",", RowBox[{"{", "w", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"ew", " ", "=", " ", RowBox[{"1", "/", RowBox[{"Eigenvalues", "[", RowBox[{"N", "[", RowBox[{ RowBox[{"H", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;", "k"}], ",", RowBox[{"1", ";;", "k"}]}], "\[RightDoubleBracket]"}], ",", "50"}], "]"}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"Print", "[", "ew", "]"}], ";"}]}], "]"}], "\[IndentingNewLine]"}], "Input", CellChangeTimes->{{3.459686670964349*^9, 3.459686678579653*^9}, { 3.459686787648664*^9, 3.459686801823084*^9}, {3.459690329034417*^9, 3.4596903442156363`*^9}, {3.459690479420857*^9, 3.459690596274705*^9}, { 3.459690635085486*^9, 3.459690669501542*^9}, {3.45969070035959*^9, 3.4596907638592443`*^9}, {3.459690800180705*^9, 3.459690867706676*^9}, { 3.459691030345536*^9, 3.459691223388999*^9}, {3.4596912599010077`*^9, 3.45969126888894*^9}, {3.459691343795947*^9, 3.459691471314824*^9}, { 3.45969186447091*^9, 3.4596918869576902`*^9}, {3.459691921425787*^9, 3.4596919216916847`*^9}, {3.4596941908370113`*^9, 3.459694209494769*^9}, { 3.459694455740677*^9, 3.4596946206728277`*^9}, {3.4596946744655437`*^9, 3.4596946763611927`*^9}, {3.4596947073402243`*^9, 3.45969472937354*^9}, { 3.459694768349484*^9, 3.459694885682805*^9}, {3.459694941490788*^9, 3.459694947448514*^9}, {3.460058527428712*^9, 3.4600586481681557`*^9}, { 3.460058689561757*^9, 3.460058690014307*^9}, {3.46005944420091*^9, 3.460059502643559*^9}, {3.460059946744733*^9, 3.4600599579388437`*^9}, { 3.460059988855042*^9, 3.4600600619782057`*^9}, 3.460060281355843*^9, { 3.460060317482957*^9, 3.460060317760948*^9}, {3.460060378037088*^9, 3.460060415192512*^9}, {3.460304018719139*^9, 3.460304033157764*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"{", "1.4031374083085585364041847538861193547002965190873636288700814227199408432\ 9001`50.", "}"}]], "Print", CellChangeTimes->{3.460304050315351*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ "1.2178323050069588247401400725104687572660827985502786162331548646001062854\ 5982`50.", ",", "12.79620036713088568969904244229598237151794310752150229494794176469537362\ 977977`50."}], "}"}]], "Print", CellChangeTimes->{3.460304181940063*^9}] }, Open ]] }, Open ]] }, WindowSize->{640, 750}, WindowMargins->{{63, Automatic}, {Automatic, 1}}, ShowSelection->True, FrontEndVersion->"7.0 for Mac OS X x86 (32-bit) (February 18, 2009)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[545, 20, 845, 24, 105, "Input"], Cell[CellGroupData[{ Cell[1415, 48, 6168, 155, 403, "Input"], Cell[CellGroupData[{ Cell[7608, 207, 178, 4, 20, "Print"], Cell[7789, 213, 290, 7, 36, "Print"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)