Commit 37fbc4de authored by Jefferson Stafusa E. Portela's avatar Jefferson Stafusa E. Portela
Browse files

Update/add notebooks.

parent e5d8366d
......@@ -30,7 +30,7 @@
\usepackage{booktabs}
\usepackage[breaklinks=true,colorlinks,pdfborder={0 0 0}]{hyperref}
\usepackage{float}
\usepackage{pdfpages}
%\usepackage{pdfpages,eso-pic,atbegshi,pdflscape} % including tex notebooks instead
%\usepackage{titlesec} % incompatible with Koma
\usepackage{relsize}
\graphicspath{{./Figures/}{./Notebooks/}}
......@@ -229,7 +229,7 @@ which opens the ``notebook dashboard'' in your default browser, where you can na
\section*{Notebooks}
%\includepdf[pages=-,pagecommand={},width=1.2\textwidth]{Notebooks/minimal_ALF_run.pdf}
%\includepdf[pages=1-,pagecommand={},width=1.2\textwidth]{Notebooks/minimal_ALF_run.pdf}
\input{Notebooks/minimal_ALF_run-content.tex}
%\begin{figure}[h]
......@@ -239,9 +239,16 @@ which opens the ``notebook dashboard'' in your default browser, where you can na
% \caption{ $\Delta \tau t $ extrapolation for the 4-site Hubbard ring. }
%\end{figure}
%\includepdf[pages=-,pagecommand={},width=1.2\textwidth]{Notebooks/trotter_error.pdf}
\input{Notebooks/trotter_error-content.tex}
% ? Include Dtau figure ?
%\includepdf[pages=1-,pagecommand={},width=1.2\textwidth]{Notebooks/testing_against_ED.pdf}
\input{Notebooks/testing_against_ED-content.tex}
%\input{Notebooks/.tex}
%\includepdf[pages=1-,pagecommand={},width=1.2\textwidth]{Notebooks/projective_algorithm.pdf}
\input{Notebooks/projective_algorithm-content.tex}
%\newpage
......
......@@ -14,7 +14,7 @@ temperature \(\beta = 5\).
Bellow we go through the steps for performing the simulation and
outputting observables.
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\textbf{1.} Import \texttt{Simulation} class from the \texttt{py\_alf}
python module, which provides the interface with ALF:
......@@ -22,7 +22,7 @@ python module, which provides the interface with ALF:
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{1}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{k+kn}{from} \PY{n+nn}{py\PYZus{}alf} \PY{k}{import} \PY{n}{Simulation} \PY{c+c1}{\PYZsh{} Interface with ALF}
\PY{k+kn}{from} \PY{n+nn}{py\PYZus{}alf} \PY{k+kn}{import} \PY{n}{Simulation} \PY{c+c1}{\PYZsh{} Interface with ALF}
\end{Verbatim}
\end{tcolorbox}
......@@ -126,7 +126,7 @@ array([[-29.983503, 0.232685]])
\end{Verbatim}
\end{tcolorbox}
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\textbf{7.} Running again: The simulation can be resumed to increase the
precision of the results.
......@@ -168,9 +168,9 @@ Running again reduced the error from 0.232685 to 0.135667 .
\textbf{Note}: To run a fresh simulation - instead of performing a
refinement over previous run(s) - the Monte Carlo run directory should
deleted before rerunning.
be deleted before rerunning.
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{exercises}{%
\subsection{Exercises}\label{exercises}}
......
......@@ -13074,23 +13074,6 @@ div#notebook {
<div tabindex="-1" id="notebook" class="border-box-sizing">
<div class="container" id="notebook-container">
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h1 id="ALF-Tutorial-2.0">ALF Tutorial 2.0<a class="anchor-link" href="#ALF-Tutorial-2.0">&#182;</a></h1><h2 id="Introductory-examples-and-exercises">Introductory examples and exercises<a class="anchor-link" href="#Introductory-examples-and-exercises">&#182;</a></h2>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>This notebook is part of the <a href="https://git.physik.uni-wuerzburg.de/ALF/ALF_Tutorial">Tutorial 2.0</a> for the quantum Monte Carlo simulation package <a href="https://git.physik.uni-wuerzburg.de/ALF/ALF_code"><em>Algorithms for Lattice Fermions</em> - ALF</a>, and can be found, together with its required files, in the <a href="https://git.physik.uni-wuerzburg.de/ALF/pyALF">pyALF repository</a>.</p>
<p>ALF is compiled from source, which is downloaded from the <a href="https://git.physik.uni-wuerzburg.de:ALF">ALF repository</a> when not found locally.</p>
<p>[<strong>REMEMBER TO UPDATE GIT ADDRESSES</strong>]</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
......@@ -13101,7 +13084,7 @@ div#notebook {
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>In this bare-bones example we use the pyALF interface to run the canonical Hubbard model on a default configuration: a $6\times6$ square grid, with interaction strength $U=4$ and inverse temperature $\beta = 5 $.</p>
<p>In this bare-bones example we use the <a href="https://git.physik.uni-wuerzburg.de/ALF/pyALF">pyALF</a> interface to run the canonical Hubbard model on a default configuration: a $6\times6$ square grid, with interaction strength $U=4$ and inverse temperature $\beta = 5$.</p>
<p>Bellow we go through the steps for performing the simulation and outputting observables.</p>
<hr>
<p><strong>1.</strong> Import <code>Simulation</code> class from the <code>py_alf</code> python module, which provides the interface with ALF:</p>
......@@ -13132,7 +13115,7 @@ div#notebook {
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[4]:</div>
<div class="prompt input_prompt">In&nbsp;[2]:</div>
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">sim</span> <span class="o">=</span> <span class="n">Simulation</span><span class="p">(</span>
......@@ -13151,14 +13134,14 @@ div#notebook {
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p><strong>3.</strong> Compile ALF, downloading it first if not found locally. This may take a few minutes:</p>
<p><strong>3.</strong> Compile ALF, downloading it first from the <a href="https://git.physik.uni-wuerzburg.de:ALF">ALF repository</a> if not found locally. This may take a few minutes:</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[5]:</div>
<div class="prompt input_prompt">In&nbsp;[3]:</div>
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">sim</span><span class="o">.</span><span class="n">compile</span><span class="p">()</span> <span class="c1"># Compilation needs to be performed only once</span>
......@@ -13178,7 +13161,8 @@ div#notebook {
<div class="output_subarea output_stream output_stdout output_text">
<pre>Compiling ALF... Done.
<pre>Repository /home/stafusa/ALF/pyALF/Notebooks/ALF does not exist, cloning from git@git.physik.uni-wuerzburg.de:ALF/ALF.git
Compiling ALF... Done.
</pre>
</div>
</div>
......@@ -13197,7 +13181,7 @@ div#notebook {
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[6]:</div>
<div class="prompt input_prompt">In&nbsp;[4]:</div>
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">sim</span><span class="o">.</span><span class="n">run</span><span class="p">()</span> <span class="c1"># Perform the actual simulation in ALF</span>
......@@ -13217,9 +13201,9 @@ div#notebook {
<div class="output_subarea output_stream output_stdout output_text">
<pre>Prepare directory &#34;/home/jonas/Programs/pyALF/Hubbard_Hubbard_Square&#34; for Monte Carlo run.
<pre>Prepare directory &#34;/home/stafusa/ALF/pyALF/Notebooks/Hubbard_Square&#34; for Monte Carlo run.
Create new directory.
Run /home/jonas/Programs/pyALF/ALF/Prog/Hubbard.out
Run /home/stafusa/ALF/pyALF/Notebooks/ALF/Prog/Hubbard.out
</pre>
</div>
</div>
......@@ -13238,7 +13222,7 @@ Run /home/jonas/Programs/pyALF/ALF/Prog/Hubbard.out
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[7]:</div>
<div class="prompt input_prompt">In&nbsp;[5]:</div>
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">sim</span><span class="o">.</span><span class="n">analysis</span><span class="p">()</span> <span class="c1"># Perform default analysis; list observables</span>
......@@ -13258,20 +13242,20 @@ Run /home/jonas/Programs/pyALF/ALF/Prog/Hubbard.out
<div class="output_subarea output_stream output_stdout output_text">
<pre>Analysing Part_scal
Analysing Kin_scal
Analysing Ener_scal
<pre>Analysing Ener_scal
Analysing Part_scal
Analysing Pot_scal
Analysing SpinT_eq
Analysing Kin_scal
Analysing Den_eq
Analysing SpinZ_eq
Analysing SpinXY_eq
Analysing Green_eq
Analysing Den_eq
Analysing SpinXY_eq
Analysing SpinT_eq
Analysing SpinXY_tau
Analysing SpinZ_tau
Analysing Den_tau
Analysing SpinXY_tau
Analysing SpinT_tau
Analysing Green_tau
Analysing SpinT_tau
</pre>
</div>
</div>
......@@ -13290,7 +13274,7 @@ Analysing Green_tau
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[8]:</div>
<div class="prompt input_prompt">In&nbsp;[6]:</div>
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">obs</span> <span class="o">=</span> <span class="n">sim</span><span class="o">.</span><span class="n">get_obs</span><span class="p">()</span> <span class="c1"># Dictionary for the observables</span>
......@@ -13311,7 +13295,7 @@ Analysing Green_tau
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[9]:</div>
<div class="prompt input_prompt">In&nbsp;[7]:</div>
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">obs</span><span class="p">[</span><span class="s1">&#39;Ener_scalJ&#39;</span><span class="p">][</span><span class="s1">&#39;obs&#39;</span><span class="p">]</span>
......@@ -13327,7 +13311,7 @@ Analysing Green_tau
<div class="output_area">
<div class="prompt output_prompt">Out[9]:</div>
<div class="prompt output_prompt">Out[7]:</div>
......@@ -13353,7 +13337,7 @@ Analysing Green_tau
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[10]:</div>
<div class="prompt input_prompt">In&nbsp;[8]:</div>
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">sim</span><span class="o">.</span><span class="n">run</span><span class="p">()</span>
......@@ -13377,23 +13361,23 @@ Analysing Green_tau
<div class="output_subarea output_stream output_stdout output_text">
<pre>Prepare directory &#34;/home/jonas/Programs/pyALF/Hubbard_Hubbard_Square&#34; for Monte Carlo run.
<pre>Prepare directory &#34;/home/stafusa/ALF/pyALF/Notebooks/Hubbard_Square&#34; for Monte Carlo run.
Resuming previous run.
Run /home/jonas/Programs/pyALF/ALF/Prog/Hubbard.out
Analysing Part_scal
Analysing Kin_scal
Run /home/stafusa/ALF/pyALF/Notebooks/ALF/Prog/Hubbard.out
Analysing Ener_scal
Analysing Part_scal
Analysing Pot_scal
Analysing SpinT_eq
Analysing Kin_scal
Analysing Den_eq
Analysing SpinZ_eq
Analysing SpinXY_eq
Analysing Green_eq
Analysing Den_eq
Analysing SpinXY_eq
Analysing SpinT_eq
Analysing SpinXY_tau
Analysing SpinZ_tau
Analysing Den_tau
Analysing SpinXY_tau
Analysing SpinT_tau
Analysing Green_tau
Analysing SpinT_tau
[[-29.819654 0.135667]]
Running again reduced the error from 0.232685 to 0.135667 .
......@@ -13408,7 +13392,7 @@ Running again reduced the error from 0.232685 to 0.135667 .
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p><strong>Note</strong>: To run a fresh simulation - instead of performing a refinement over previous run(s) - the Monte Carlo run directory should deleted before rerunning.</p>
<p><strong>Note</strong>: To run a fresh simulation - instead of performing a refinement over previous run(s) - the Monte Carlo run directory should be deleted before rerunning.</p>
</div>
</div>
......
......@@ -382,7 +382,7 @@ temperature \(\beta = 5\).
Bellow we go through the steps for performing the simulation and
outputting observables.
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\textbf{1.} Import \texttt{Simulation} class from the \texttt{py\_alf}
python module, which provides the interface with ALF:
......@@ -390,7 +390,7 @@ python module, which provides the interface with ALF:
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{1}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{k+kn}{from} \PY{n+nn}{py\PYZus{}alf} \PY{k}{import} \PY{n}{Simulation} \PY{c+c1}{\PYZsh{} Interface with ALF}
\PY{k+kn}{from} \PY{n+nn}{py\PYZus{}alf} \PY{k+kn}{import} \PY{n}{Simulation} \PY{c+c1}{\PYZsh{} Interface with ALF}
\end{Verbatim}
\end{tcolorbox}
......@@ -494,7 +494,7 @@ array([[-29.983503, 0.232685]])
\end{Verbatim}
\end{tcolorbox}
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\textbf{7.} Running again: The simulation can be resumed to increase the
precision of the results.
......@@ -536,9 +536,9 @@ Running again reduced the error from 0.232685 to 0.135667 .
\textbf{Note}: To run a fresh simulation - instead of performing a
refinement over previous run(s) - the Monte Carlo run directory should
deleted before rerunning.
be deleted before rerunning.
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{exercises}{%
\subsection{Exercises}\label{exercises}}
......
\hypertarget{projective-algorithm}{%
\section{Projective algorithm}\label{projective-algorithm}}
In this example we use the
\href{https://git.physik.uni-wuerzburg.de/ALF/pyALF}{pyALF} interface to
run ALF's projective algorithm with the Mz choice of Hubbard
Stratonovich transformation on a 4-site ring.
The projective approach is the method of choice if one is interested in
ground-state properties. The starting point is a pair of trial wave
functions, \(|\Psi_{T,L/R} \rangle\), that are not orthogonal to the
ground state \(|\Psi_0 \rangle\): \[
\langle \Psi_{T,L/R} | \Psi_0 \rangle \neq 0.
\] The ground-state expectation value of any observable \(\hat{O}\) can
then be computed by propagation along the imaginary time axis: \[
\frac{ \langle \Psi_0 | \hat{O} | \Psi_0 \rangle }{ \langle \Psi_0 | \Psi_0 \rangle} = \lim_{\theta \rightarrow \infty}
\frac{ \langle \Psi_{T,L} | e^{-\theta \hat{H}} e^{-(\beta - \tau)\hat{H} }\hat{O} e^{- \tau \hat{H} } e^{-\theta \hat{H}} | \Psi_{T,R} \rangle }
{ \langle \Psi_{T,L} | e^{-(2 \theta + \beta) \hat{H} } | \Psi_{T,R} \rangle } ,
\] where \(\beta\) defines the imaginary time range where observables
(time displaced and equal time) are measured and \(\tau\) varies from
\(0\) to \(\beta\) in the calculation of time-displace observables. For
further details, see Sec. 3 of
\href{https://git.physik.uni-wuerzburg.de/ALF/ALF_code/-/blob/master/Documentation/ALF_v1.0.pdf}{ALF
documentation}.
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\textbf{1.} Import \texttt{Simulation} class from the \texttt{py\_alf}
python module, which provides the interface with ALF, as well as
numerical and plotting packages:
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{1}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{k+kn}{from} \PY{n+nn}{py\PYZus{}alf} \PY{k+kn}{import} \PY{n}{Simulation} \PY{c+c1}{\PYZsh{} Interface with ALF}
\PY{c+c1}{\PYZsh{} }
\PY{k+kn}{import} \PY{n+nn}{numpy} \PY{k}{as} \PY{n+nn}{np} \PY{c+c1}{\PYZsh{} Numerical library}
\PY{k+kn}{from} \PY{n+nn}{scipy}\PY{n+nn}{.}\PY{n+nn}{optimize} \PY{k+kn}{import} \PY{n}{curve\PYZus{}fit} \PY{c+c1}{\PYZsh{} Numerical library}
\PY{k+kn}{import} \PY{n+nn}{matplotlib}\PY{n+nn}{.}\PY{n+nn}{pyplot} \PY{k}{as} \PY{n+nn}{plt} \PY{c+c1}{\PYZsh{} Plotting library}
\end{Verbatim}
\end{tcolorbox}
\textbf{2.} Create instances of \texttt{Simulation}, specifying the
necessary parameters, in particular the \texttt{Projector} to
\texttt{True}:
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{2}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n}{sims} \PY{o}{=} \PY{p}{[}\PY{p}{]} \PY{c+c1}{\PYZsh{} Vector of Simulation instances}
\PY{n+nb}{print}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Theta values used:}\PY{l+s+s1}{\PYZsq{}}\PY{p}{)}
\PY{k}{for} \PY{n}{theta} \PY{o+ow}{in} \PY{p}{[}\PY{l+m+mi}{5}\PY{p}{,} \PY{l+m+mi}{10}\PY{p}{,} \PY{l+m+mi}{20}\PY{p}{]}\PY{p}{:} \PY{c+c1}{\PYZsh{} Values of Theta}
\PY{n+nb}{print}\PY{p}{(}\PY{n}{theta}\PY{p}{)}
\PY{n}{sim} \PY{o}{=} \PY{n}{Simulation}\PY{p}{(}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Hubbard}\PY{l+s+s1}{\PYZsq{}}\PY{p}{,} \PY{c+c1}{\PYZsh{} Hamiltonian}
\PY{p}{\PYZob{}} \PY{c+c1}{\PYZsh{} Model and simulation parameters for each Simulation instance}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Model}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Hubbard}\PY{l+s+s1}{\PYZsq{}}\PY{p}{,} \PY{c+c1}{\PYZsh{} Base model}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Lattice\PYZus{}type}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{N\PYZus{}leg\PYZus{}ladder}\PY{l+s+s1}{\PYZsq{}}\PY{p}{,} \PY{c+c1}{\PYZsh{} Lattice type}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{L1}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{l+m+mi}{4}\PY{p}{,} \PY{c+c1}{\PYZsh{} Lattice length in the first unit vector direction}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{L2}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{l+m+mi}{1}\PY{p}{,} \PY{c+c1}{\PYZsh{} Lattice length in the second unit vector direction}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Checkerboard}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{k+kc}{False}\PY{p}{,} \PY{c+c1}{\PYZsh{} Whether checkerboard decomposition is used or not}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Symm}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{k+kc}{True}\PY{p}{,} \PY{c+c1}{\PYZsh{} Whether symmetrization takes place}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Projector}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{k+kc}{True}\PY{p}{,} \PY{c+c1}{\PYZsh{} Whether to use the projective algorithm}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Theta}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{n}{theta}\PY{p}{,} \PY{c+c1}{\PYZsh{} Projector parameter}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{ham\PYZus{}T}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{l+m+mf}{1.0}\PY{p}{,} \PY{c+c1}{\PYZsh{} Hopping parameter}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{ham\PYZus{}U}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{l+m+mf}{4.0}\PY{p}{,} \PY{c+c1}{\PYZsh{} Hubbard interaction}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{ham\PYZus{}Tperp}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{l+m+mf}{0.0}\PY{p}{,} \PY{c+c1}{\PYZsh{} For bilayer systems}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{beta}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{l+m+mf}{1.0}\PY{p}{,} \PY{c+c1}{\PYZsh{} Inverse temperature}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Ltau}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{l+m+mi}{0}\PY{p}{,} \PY{c+c1}{\PYZsh{} \PYZsq{}1\PYZsq{} for time\PYZhy{}displaced Green functions; \PYZsq{}0\PYZsq{} otherwise }
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{NSweep}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{l+m+mi}{400}\PY{p}{,} \PY{c+c1}{\PYZsh{} Number of sweeps}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{NBin}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{l+m+mi}{10}\PY{p}{,} \PY{c+c1}{\PYZsh{} Number of bins}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Dtau}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{l+m+mf}{0.05}\PY{p}{,} \PY{c+c1}{\PYZsh{} Only dtau varies between simulations, Ltrot=beta/Dtau}
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Mz}\PY{l+s+s1}{\PYZsq{}}\PY{p}{:} \PY{k+kc}{True}\PY{p}{,} \PY{c+c1}{\PYZsh{} If true, sets the M\PYZus{}z\PYZhy{}Hubbard model: Nf=2, N\PYZus{}sum=1,}
\PY{p}{\PYZcb{}}\PY{p}{,} \PY{c+c1}{\PYZsh{} HS field couples to z\PYZhy{}component of magnetization}
\PY{n}{alf\PYZus{}dir}\PY{o}{=}\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{\PYZti{}/Programs/ALF}\PY{l+s+s1}{\PYZsq{}}\PY{p}{,} \PY{c+c1}{\PYZsh{} Local ALF copy, if present}
\PY{p}{)}
\PY{n}{sims}\PY{o}{.}\PY{n}{append}\PY{p}{(}\PY{n}{sim}\PY{p}{)}
\end{Verbatim}
\end{tcolorbox}
\begin{Verbatim}[commandchars=\\\{\}]
Theta values used:
5
10
20
\end{Verbatim}
\textbf{3.} Compile ALF, downloading it first if not found locally. This
may take a few minutes:
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{3}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n}{sims}\PY{p}{[}\PY{l+m+mi}{0}\PY{p}{]}\PY{o}{.}\PY{n}{compile}\PY{p}{(}\PY{p}{)} \PY{c+c1}{\PYZsh{} Compilation needs to be performed only once}
\end{Verbatim}
\end{tcolorbox}
\begin{Verbatim}[commandchars=\\\{\}]
Compiling ALF{\ldots} Done.
\end{Verbatim}
\textbf{4.} Perform the simulations, as specified in each element of
\texttt{sim}:
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{4}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{k}{for} \PY{n}{i}\PY{p}{,} \PY{n}{sim} \PY{o+ow}{in} \PY{n+nb}{enumerate}\PY{p}{(}\PY{n}{sims}\PY{p}{)}\PY{p}{:}
\PY{n}{sim}\PY{o}{.}\PY{n}{run}\PY{p}{(}\PY{p}{)} \PY{c+c1}{\PYZsh{} Perform the actual simulation in ALF}
\end{Verbatim}
\end{tcolorbox}
\begin{Verbatim}[commandchars=\\\{\}]
Prepare directory "/home/stafusa/ALF/pyALF/Hubbard\_N\_leg\_ladder\_L1=4\_L2=1\_Checke
rboard=False\_Symm=True\_Projector=True\_Theta=5\_T=1.0\_U=4.0\_Tperp=0.0\_beta=1.0\_Dta
u=0.05\_Mz=True" for Monte Carlo run.
Create new directory.
Run /home/stafusa/Programs/ALF/Prog/Hubbard.out
Prepare directory "/home/stafusa/ALF/pyALF/Hubbard\_N\_leg\_ladder\_L1=4\_L2=1\_Checke
rboard=False\_Symm=True\_Projector=True\_Theta=10\_T=1.0\_U=4.0\_Tperp=0.0\_beta=1.0\_Dt
au=0.05\_Mz=True" for Monte Carlo run.
Create new directory.
Run /home/stafusa/Programs/ALF/Prog/Hubbard.out
Prepare directory "/home/stafusa/ALF/pyALF/Hubbard\_N\_leg\_ladder\_L1=4\_L2=1\_Checke
rboard=False\_Symm=True\_Projector=True\_Theta=20\_T=1.0\_U=4.0\_Tperp=0.0\_beta=1.0\_Dt
au=0.05\_Mz=True" for Monte Carlo run.
Create new directory.
Run /home/stafusa/Programs/ALF/Prog/Hubbard.out
\end{Verbatim}
\textbf{5.} Calculate the internal energies:
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{6}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{o}{\PYZpc{}\PYZpc{}capture}
\PY{n}{ener} \PY{o}{=} \PY{n}{np}\PY{o}{.}\PY{n}{empty}\PY{p}{(}\PY{p}{(}\PY{n+nb}{len}\PY{p}{(}\PY{n}{sims}\PY{p}{)}\PY{p}{,} \PY{l+m+mi}{2}\PY{p}{)}\PY{p}{)} \PY{c+c1}{\PYZsh{} Matrix for storing energy values}
\PY{n}{thetas} \PY{o}{=} \PY{n}{np}\PY{o}{.}\PY{n}{empty}\PY{p}{(}\PY{p}{(}\PY{n+nb}{len}\PY{p}{(}\PY{n}{sims}\PY{p}{)}\PY{p}{,}\PY{p}{)}\PY{p}{)} \PY{c+c1}{\PYZsh{} Matrix for Thetas values, for plotting}
\PY{k}{for} \PY{n}{i}\PY{p}{,} \PY{n}{sim} \PY{o+ow}{in} \PY{n+nb}{enumerate}\PY{p}{(}\PY{n}{sims}\PY{p}{)}\PY{p}{:}
\PY{n+nb}{print}\PY{p}{(}\PY{n}{sim}\PY{o}{.}\PY{n}{sim\PYZus{}dir}\PY{p}{)} \PY{c+c1}{\PYZsh{} Directory containing the simulation output}
\PY{n}{sim}\PY{o}{.}\PY{n}{analysis}\PY{p}{(}\PY{p}{)} \PY{c+c1}{\PYZsh{} Perform default analysis}
\PY{n}{thetas}\PY{p}{[}\PY{n}{i}\PY{p}{]} \PY{o}{=} \PY{n}{sim}\PY{o}{.}\PY{n}{sim\PYZus{}dict}\PY{p}{[}\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Theta}\PY{l+s+s1}{\PYZsq{}}\PY{p}{]} \PY{c+c1}{\PYZsh{} Store Theta value}
\PY{n}{ener}\PY{p}{[}\PY{n}{i}\PY{p}{]} \PY{o}{=} \PY{n}{sim}\PY{o}{.}\PY{n}{get\PYZus{}obs}\PY{p}{(}\PY{p}{[}\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Ener\PYZus{}scalJ}\PY{l+s+s1}{\PYZsq{}}\PY{p}{]}\PY{p}{)}\PY{p}{[}\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{Ener\PYZus{}scalJ}\PY{l+s+s1}{\PYZsq{}}\PY{p}{]}\PY{p}{[}\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{obs}\PY{l+s+s1}{\PYZsq{}}\PY{p}{]} \PY{c+c1}{\PYZsh{} Store internal energy}
\end{Verbatim}
\end{tcolorbox}
Where the \emph{cell magic} \texttt{\%\%capture} suppresses the output
of \texttt{sim.analysis()}, which lists the data directories and
observables.
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{7}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n+nb}{print}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{For Theta values}\PY{l+s+s1}{\PYZsq{}}\PY{p}{,} \PY{n}{thetas}\PY{p}{,} \PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{the measured energies are:}\PY{l+s+se}{\PYZbs{}n}\PY{l+s+s1}{\PYZsq{}}\PY{p}{,} \PY{n}{ener}\PY{p}{)}
\end{Verbatim}
\end{tcolorbox}
\begin{Verbatim}[commandchars=\\\{\}]
For Theta values [ 5. 10. 20.] the measured energies are:
[[-2.137697 0.025552]
[-2.108235 0.023964]
[-2.089294 0.025426]]
\end{Verbatim}
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{8}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n}{plt}\PY{o}{.}\PY{n}{errorbar}\PY{p}{(}\PY{l+m+mi}{1}\PY{o}{/}\PY{n}{thetas}\PY{p}{,} \PY{n}{ener}\PY{p}{[}\PY{p}{:}\PY{p}{,} \PY{l+m+mi}{0}\PY{p}{]}\PY{p}{,} \PY{n}{ener}\PY{p}{[}\PY{p}{:}\PY{p}{,} \PY{l+m+mi}{1}\PY{p}{]}\PY{p}{)}
\end{Verbatim}
\end{tcolorbox}
\begin{tcolorbox}[breakable, size=fbox, boxrule=.5pt, pad at break*=1mm, opacityfill=0]
\prompt{Out}{outcolor}{8}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
<ErrorbarContainer object of 3 artists>
\end{Verbatim}
\end{tcolorbox}
\begin{center}
\adjustimage{max size={0.6\linewidth}{0.9\paperheight}}{projective_algorithm-output_13_1.png}
\end{center}
{ \hspace*{\fill} \\}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{exercises}{%
\subsection{Exercises}\label{exercises}}
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{{[} TO BE FLESHED OUT {]}} Kondo phase transition.
References:\\
https://journals.aps.org/prb/abstract/10.1103/PhysRevB.63.155114\\
https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.83.796
\end{enumerate}
% Add a bibliography block to the postdoc
This diff is collapsed.
This diff is collapsed.
......@@ -224,7 +224,7 @@ For Dtau values [0.05 0.1 0.15] the measured energies are:
\end{tcolorbox}
\begin{center}
\adjustimage{max size={0.9\linewidth}{0.9\paperheight}}{trotter_error-output_12_2.png}
\adjustimage{max size={0.6\linewidth}{0.9\paperheight}}{trotter_error-output_12_2.png}
\end{center}
{ \hspace*{\fill} \\}
......@@ -237,11 +237,12 @@ For Dtau values [0.05 0.1 0.15] the measured energies are:
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
Try the four different combinations for \texttt{Checkerboard} and
\texttt{Symm} settings in order to reproduce the reference plot below
(found in Sec. 2.3.2 - Symmetric Trotter decomposition - of the
Try out the four different combinations for \texttt{Checkerboard} and
\texttt{Symm} settings in order to observe their effect on the output
and run time. Reference: Sec. 2.3.2 - Symmetric Trotter decomposition
- of the
\href{https://git.physik.uni-wuerzburg.de/ALF/ALF_code/-/blob/master/Documentation/ALF_v1.0.pdf}{ALF
documentation}).\includegraphics{trotter_error-attachment:Dtau.png}
documentation}, especially Fig. 2.
\end{enumerate}
......
This diff is collapsed.
......@@ -605,11 +605,12 @@ For Dtau values [0.05 0.1 0.15] the measured energies are:
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
Try the four different combinations for \texttt{Checkerboard} and
\texttt{Symm} settings in order to reproduce the reference plot below
(found in Sec. 2.3.2 - Symmetric Trotter decomposition - of the
Try out the four different combinations for \texttt{Checkerboard} and
\texttt{Symm} settings in order to observe their effect on the output
and run time. Reference: Sec. 2.3.2 - Symmetric Trotter decomposition
- of the
\href{https://git.physik.uni-wuerzburg.de/ALF/ALF_code/-/blob/master/Documentation/ALF_v1.0.pdf}{ALF
documentation}).\includegraphics{attachment:Dtau.png}
documentation}, especially Fig. 2.
\end{enumerate}