{"id":943,"date":"2018-10-27T21:25:00","date_gmt":"2018-10-27T21:25:00","guid":{"rendered":"http:\/\/second-tech.com\/wordpress\/?p=943"},"modified":"2020-01-08T23:05:18","modified_gmt":"2020-01-08T23:05:18","slug":"direct-access-to-wave-function-amplitudes-and-eigenvalues-in-tbtk","status":"publish","type":"post","link":"http:\/\/second-tech.com\/wordpress\/index.php\/2018\/10\/27\/direct-access-to-wave-function-amplitudes-and-eigenvalues-in-tbtk\/","title":{"rendered":"Direct access to wave function amplitudes and eigenvalues in TBTK"},"content":{"rendered":"<p><i>Most recent TBTK release at the time of writing: v1.0.3<\/i><br \/>\n<i>Updated to work with: v2.0.0.<\/i><\/p>\n<p>The wave functions and corresponding eigenvalues provide complete information about a system, from which other properties can be calculated. In this post we will therefore take a look at how to extract these directly using the Solver::Diagonalizer. In particular, we show how to calculate the energy and probability density for a given state in a two-dimensional rectangular geometry.<\/p>\n<div class=\"a-single a-4\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block; text-align:center;\"\r\n     data-ad-layout=\"in-article\"\r\n     data-ad-format=\"fluid\"\r\n     data-ad-client=\"ca-pub-3756520172792312\"\r\n     data-ad-slot=\"9656949358\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script><\/div>\n<h2>Model<\/h2>\n<p>The model that we will consider is a simple two-dimensional square lattice with nearest neighbor hopping <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/ql-cache\/quicklatex.com-14abf99c05aca801d5c2ba2350cc5296_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#116;&#32;&#61;&#32;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"38\" style=\"vertical-align: -1px;\"\/>, for which the Hamiltonian is<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 44px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/ql-cache\/quicklatex.com-a64258768b7c05fa80ec3c7fb102241a_l3.png\" height=\"44\" width=\"125\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091; &#72;&#32;&#61;&#32;&#45;&#116;&#92;&#115;&#117;&#109;&#95;&#123;&#92;&#108;&#97;&#110;&#103;&#108;&#101;&#32;&#105;&#106;&#92;&#114;&#97;&#110;&#103;&#108;&#101;&#125;&#99;&#95;&#123;&#105;&#125;&#94;&#123;&#92;&#100;&#97;&#103;&#103;&#101;&#114;&#125;&#99;&#95;&#123;&#106;&#125;&#46; &#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>Here <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/ql-cache\/quicklatex.com-b5058d9507f49acb6c33457e030e789e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#108;&#97;&#110;&#103;&#108;&#101;&#32;&#105;&#106;&#92;&#114;&#97;&#110;&#103;&#108;&#101;\" title=\"Rendered by QuickLaTeX.com\" height=\"19\" width=\"25\" style=\"vertical-align: -5px;\"\/> denotes summation over nearest neighbors.<\/p>\n<p>The Hamiltonian <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/ql-cache\/quicklatex.com-604f84528aa51ac51424f48fc5396280_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#72;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"16\" style=\"vertical-align: 0px;\"\/> can either be viewed as the simplest example of a two-dimensional tight-binding model, or as a discretized version of the two-dimensional Schr\u00f6dinger equation<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 44px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/ql-cache\/quicklatex.com-b47e4a87d5e5d3e769120d4aefe64429_l3.png\" height=\"44\" width=\"279\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091; &#72;&#95;&#123;&#83;&#125;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#45;&#92;&#104;&#98;&#97;&#114;&#94;&#50;&#125;&#123;&#50;&#109;&#125;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#94;&#50;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#94;&#50;&#125;&#32;&#43;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#94;&#50;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#121;&#94;&#50;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#43;&#32;&#86;&#40;&#120;&#44;&#121;&#41;&#44; &#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>with <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/ql-cache\/quicklatex.com-cdd4336816741e7262dfe9c7b22f4a6a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#98;&#97;&#114;&#94;&#50;&#47;&#50;&#109;&#100;&#120;&#94;&#50;&#32;&#61;&#32;&#92;&#104;&#98;&#97;&#114;&#94;&#50;&#47;&#50;&#109;&#100;&#121;&#94;&#50;&#32;&#61;&#32;&#116;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"208\" style=\"vertical-align: -5px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/ql-cache\/quicklatex.com-24db8abd0e2d06eaf2d3cd8d80794f4f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#86;&#40;&#120;&#44;&#32;&#121;&#41;&#32;&#61;&#32;&#45;&#52;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"102\" style=\"vertical-align: -4px;\"\/>. We therefore begin by introducing the following parameters.<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\/\/Parameters.\r\nconst unsigned int SIZE_X = 20;\r\nconst unsigned int SIZE_Y = 20;\r\ndouble t = 1;\r\nint state = 0;\r\n<\/pre>\n<p>The last parameter is used to indicate for which state we are going to calculate the energy and probability density.<\/p>\n<p>We next create the model and loop over each site to feed the model with the hopping amplitudes. We could achieve this by for each site adding the hopping amplitudes corresponding to<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 71px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/ql-cache\/quicklatex.com-1477295d3655ca6b13ba5e674468ec78_l3.png\" height=\"71\" width=\"269\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#101;&#100;&#125; &#45;&#116;&#38;&#92;&#108;&#101;&#102;&#116;&#40;&#99;&#95;&#123;&#40;&#120;&#43;&#49;&#44;&#121;&#41;&#125;&#94;&#123;&#92;&#100;&#97;&#103;&#103;&#101;&#114;&#125;&#99;&#95;&#123;&#40;&#120;&#44;&#121;&#41;&#125;&#32;&#43;&#32;&#99;&#95;&#123;&#40;&#120;&#45;&#49;&#44;&#121;&#41;&#125;&#94;&#123;&#92;&#100;&#97;&#103;&#103;&#101;&#114;&#125;&#99;&#95;&#123;&#40;&#120;&#44;&#121;&#41;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#46;&#92;&#92; &#38;&#43;&#92;&#108;&#101;&#102;&#116;&#46;&#99;&#95;&#123;&#40;&#120;&#44;&#121;&#43;&#49;&#41;&#125;&#94;&#123;&#92;&#100;&#97;&#103;&#103;&#101;&#114;&#125;&#99;&#95;&#123;&#40;&#120;&#44;&#121;&#41;&#125;&#32;&#43;&#32;&#99;&#95;&#123;&#40;&#120;&#44;&#121;&#45;&#49;&#41;&#125;&#94;&#123;&#92;&#100;&#97;&#103;&#103;&#101;&#114;&#125;&#99;&#95;&#123;&#40;&#120;&#44;&#121;&#41;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#46; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#101;&#100;&#125;&#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>However, we note that this is equivalent to adding<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 33px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/ql-cache\/quicklatex.com-5de92b1ad2f4a414504749e3e5eca899_l3.png\" height=\"33\" width=\"306\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091; &#45;&#116;&#92;&#108;&#101;&#102;&#116;&#40;&#99;&#95;&#123;&#40;&#120;&#43;&#49;&#44;&#121;&#41;&#125;&#94;&#123;&#92;&#100;&#97;&#103;&#103;&#101;&#114;&#125;&#99;&#95;&#123;&#40;&#120;&#44;&#121;&#41;&#125;&#32;&#43;&#32;&#99;&#95;&#123;&#40;&#120;&#44;&#121;&#43;&#49;&#41;&#125;&#94;&#123;&#92;&#100;&#97;&#103;&#103;&#101;&#114;&#125;&#99;&#95;&#123;&#40;&#120;&#44;&#121;&#41;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#43;&#32;&#72;&#46;&#99;&#46; &#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>at each site since for example <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/ql-cache\/quicklatex.com-e4501fa67108c12bb0fdf29a28dc8e93_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#45;&#116;&#99;&#95;&#123;&#40;&#120;&#45;&#49;&#44;&#121;&#41;&#125;&#94;&#123;&#92;&#100;&#97;&#103;&#103;&#101;&#114;&#125;&#99;&#95;&#123;&#40;&#120;&#44;&#121;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"27\" width=\"111\" style=\"vertical-align: -9px;\"\/> is the Hermitian conjugate of <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/ql-cache\/quicklatex.com-d4a3260dd87c23b1d20f6d3cfdcb97bf_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#45;&#116;&#99;&#95;&#123;&#40;&#120;&#44;&#121;&#41;&#125;&#94;&#123;&#92;&#100;&#97;&#103;&#103;&#101;&#114;&#125;&#99;&#95;&#123;&#40;&#120;&#45;&#49;&#44;&#121;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"27\" width=\"111\" style=\"vertical-align: -9px;\"\/>.<span id='easy-footnote-1-943' class='easy-footnote-margin-adjust'><\/span><span class='easy-footnote'><a href='http:\/\/second-tech.com\/wordpress\/index.php\/2018\/10\/27\/direct-access-to-wave-function-amplitudes-and-eigenvalues-in-tbtk\/#easy-footnote-bottom-1-943' title='Note that the two expressions are not equivalent on each individual site since the Hermitian conjugate of one term is a term that appears in the former expression on a different site. The two prescriptions are only equivalent since we add the terms on all sites.'><sup>1<\/sup><\/a><\/span> Using the later notation we implement this as follows.<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\/\/Create the Model.\r\nModel model;\r\nfor(unsigned int x = 0; x &lt; SIZE_X; x++){\r\n\tfor(unsigned int y = 0; y &lt; SIZE_Y; y++){\r\n\t\tif(x+1 &lt; SIZE_X){\r\n\t\t\tmodel &lt;&lt;; HoppingAmplitude(\r\n\t\t\t\t-t,\r\n\t\t\t\t{x + 1, y},\r\n\t\t\t\t{x,     y}\r\n\t\t\t) + HC;\r\n\t\t}\r\n\t\tif(y+1 &lt; SIZE_Y){\r\n\t\t\tmodel &lt;&lt; HoppingAmplitude(\r\n\t\t\t\t-t,\r\n\t\t\t\t{x, y + 1},\r\n\t\t\t\t{x, y}\r\n\t\t\t) + HC;\r\n\t\t}\r\n\t}\r\n}\r\nmodel.construct();\r\n<\/pre>\n<p>The if statements are added to guard against adding hopping amplitudes beyond the boundary of the system.<\/p>\n<h2>Solver<\/h2>\n<p>We are now ready to setup and run the solver.<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\/\/Setup and run the Solver.\r\nSolver::Diagonalizer solver;\r\nsolver.setModel(model);\r\nsolver.run();\r\n<\/pre>\n<h2>Extract the eigenvalue and probability density<\/h2>\n<p>To extract the eigenvalue and probability density we first setup the PropertyExtractor.<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\/\/Setup the PropertyExtractor.\r\nPropertyExtractor::Diagonalizer\r\n    propertyExtractor(solver);\r\n<\/pre>\n<p>After this we print the energy for the given state by requesting it from the PropertyExtractor.<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\/\/Print the eigenvalue for the given state.\r\nStreams::out &lt;&lt; &quot;The energy of state &quot;\r\n    &lt;&lt; state &lt;&lt; &quot; is &quot;\r\n    &lt;&lt; propertyExtractor.getEigenValue(state)\r\n    &lt;&lt; &quot;\\n&quot;;\r\n<\/pre>\n<p>Further, to calculate the probability density we create an array, which we fill with the square of the absolute value of the probability amplitude.<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\/\/Calculate the probability density for the\r\n\/\/given state.\r\nArray&lt;double&gt; probabilityDensity(\r\n    {SIZE_X, SIZE_Y}\r\n);\r\nfor(unsigned int x = 0; x &lt; SIZE_X; x++){\r\n\tfor(unsigned int y = 0; y &lt; SIZE_Y; y++){\r\n\t\t\/\/Get the probability amplitude at\r\n\t\t\/\/site (x, y) for the given state.\r\n\t\tcomplex&lt;double&gt; amplitude\r\n\t\t\t= propertyExtractor.getAmplitude(\r\n\t\t\t\tstate,\r\n\t\t\t\t{x, y}\r\n\t\t\t);\r\n\r\n\t\t\/\/Calculate the probability density.\r\n\t\tprobabilityDensity&#x5B;{x, y}] = pow(\r\n\t\t\tabs(amplitude),\r\n\t\t\t2\r\n\t\t);\r\n\t}\r\n}\r\n<\/pre>\n<p>Finally, we plot the probability density and save it to file.<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\/\/Plot the probability density.\r\nPlotter plotter;\r\nplotter.plot(probabilityDensity);\r\nplotter.save(&quot;figures\/ProbabilityDensity.png&quot;);\r\n<\/pre>\n<h2>Results<\/h2>\n<p>Below we present the results for the six lowest energy states for a lattice size of 20&#215;20. The states separate into four groups with eigenvalues<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 18px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/ql-cache\/quicklatex.com-24afc190a1c9e903fd516bea9973d95a_l3.png\" height=\"18\" width=\"343\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091; &#69;&#32;&#92;&#105;&#110;&#32;&#92;&#123;&#45;&#51;&#46;&#57;&#53;&#53;&#51;&#44;&#32;&#45;&#51;&#46;&#56;&#56;&#56;&#49;&#44;&#32;&#45;&#51;&#46;&#56;&#50;&#50;&#50;&#57;&#44;&#32;&#45;&#51;&#46;&#55;&#55;&#57;&#54;&#92;&#125;&#46; &#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>The second and fourth of these eigenvalues are degenerate with two eigenfunctions per energy. We can understand this grouping by realizing that the solutions to our problem are sinus functions with wave numbers (m, n),<span id='easy-footnote-2-943' class='easy-footnote-margin-adjust'><\/span><span class='easy-footnote'><a href='http:\/\/second-tech.com\/wordpress\/index.php\/2018\/10\/27\/direct-access-to-wave-function-amplitudes-and-eigenvalues-in-tbtk\/#easy-footnote-bottom-2-943' title='This is most easily understood from considering the continous Schr\u00f6dinger equation above, but is also true for the discrete lattice.'><sup>2<\/sup><\/a><\/span> where for the six lowest states<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 19px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/ql-cache\/quicklatex.com-f60ccc179807430b166048decfef82bf_l3.png\" height=\"19\" width=\"366\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091; &#40;&#109;&#44;&#32;&#110;&#41;&#32;&#92;&#105;&#110;&#32;&#92;&#123;&#40;&#49;&#44;&#32;&#49;&#41;&#44;&#32;&#40;&#50;&#44;&#32;&#49;&#41;&#44;&#32;&#40;&#49;&#44;&#32;&#50;&#41;&#44;&#32;&#40;&#50;&#44;&#32;&#50;&#41;&#44;&#32;&#40;&#51;&#44;&#32;&#49;&#41;&#44;&#32;&#40;&#49;&#44;&#32;&#51;&#41;&#92;&#125;&#46; &#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>Among these (2,1) and (1, 2) as well as (3, 1) and (1, 3) are degenerate.<\/p>\n<h3>E = -3.9553<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1840 size-full\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity0-2.png\" alt=\"\" width=\"800\" height=\"600\" srcset=\"http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity0-2.png 800w, http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity0-2-300x225.png 300w, http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity0-2-768x576.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<h3>E = -3.88881 (two degenerate states)<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1841 size-full\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity1-2.png\" alt=\"\" width=\"800\" height=\"600\" srcset=\"http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity1-2.png 800w, http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity1-2-300x225.png 300w, http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity1-2-768x576.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1842 size-full\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity2-2.png\" alt=\"\" width=\"800\" height=\"600\" srcset=\"http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity2-2.png 800w, http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity2-2-300x225.png 300w, http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity2-2-768x576.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<h3>E = -3.82229<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1843 size-full\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity3-2.png\" alt=\"\" width=\"800\" height=\"600\" srcset=\"http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity3-2.png 800w, http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity3-2-300x225.png 300w, http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity3-2-768x576.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<h3>E = -3.7796 (two degenerate states)<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1844 size-full\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity4-2.png\" alt=\"\" width=\"800\" height=\"600\" srcset=\"http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity4-2.png 800w, http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity4-2-300x225.png 300w, http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity4-2-768x576.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1845 size-full\" src=\"http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity5-2.png\" alt=\"\" width=\"800\" height=\"600\" srcset=\"http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity5-2.png 800w, http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity5-2-300x225.png 300w, http:\/\/second-tech.com\/wordpress\/wp-content\/uploads\/2018\/10\/ProbabilityDensity5-2-768x576.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<h2>Full code<\/h2>\n<p>Full code is available in <a href=\"https:\/\/github.com\/dafer45\/SecondTechCode\/blob\/master\/2018_10_27\/src\/main.cpp\">src\/main.cpp<\/a> in the project <a href=\"https:\/\/github.com\/dafer45\/SecondTechCode\/tree\/master\/2018_10_27\">2018_10_27<\/a> of the <a href=\"https:\/\/github.com\/dafer45\/SecondTechCode\">Second Tech code package<\/a>. See the README for instructions on how to build and run.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most recent TBTK release at the time of writing: v1.0.3 Updated to work with: v2.0.0. The wave functions and corresponding eigenvalues provide complete information about a system, from which other properties can be calculated. In this post we will therefore take a look at how to extract these directly using the Solver::Diagonalizer. In particular, we &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/second-tech.com\/wordpress\/index.php\/2018\/10\/27\/direct-access-to-wave-function-amplitudes-and-eigenvalues-in-tbtk\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Direct access to wave function amplitudes and eigenvalues in TBTK&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/second-tech.com\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/943"}],"collection":[{"href":"http:\/\/second-tech.com\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/second-tech.com\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/second-tech.com\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/second-tech.com\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=943"}],"version-history":[{"count":78,"href":"http:\/\/second-tech.com\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/943\/revisions"}],"predecessor-version":[{"id":1849,"href":"http:\/\/second-tech.com\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/943\/revisions\/1849"}],"wp:attachment":[{"href":"http:\/\/second-tech.com\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/second-tech.com\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=943"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/second-tech.com\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}