Nice plots for on-top

This commit is contained in:
Anthony Scemama 2020-08-08 03:17:47 +02:00
parent d2c52787d3
commit 3ebf2a6fb7
13 changed files with 8321 additions and 8078 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -6336,8 +6336,146 @@ to_kcal <- 627.502164882
library(ggplot2)
library(latex2exp)
library(extrafont)
library(RColorBrewer)
loadfonts()
#+end_src
#+RESULTS:
#+begin_example
More than one version of regular/bold/italic found for Cannam Codec Fixed. Skipping setup for this font.
More than one version of regular/bold/italic found for Cannam Codec Proportional. Skipping setup for this font.
aakar already registered with pdfFonts().
Abyssinica SIL already registered with pdfFonts().
Ani already registered with pdfFonts().
AnjaliOldLipi already registered with pdfFonts().
Chandas already registered with pdfFonts().
Chilanka already registered with pdfFonts().
DejaVu Math TeX Gyre already registered with pdfFonts().
DejaVu Sans already registered with pdfFonts().
DejaVu Sans Light already registered with pdfFonts().
DejaVu Sans Condensed already registered with pdfFonts().
DejaVu Sans Mono already registered with pdfFonts().
DejaVu Serif already registered with pdfFonts().
DejaVu Serif Condensed already registered with pdfFonts().
Droid Sans Fallback already registered with pdfFonts().
Dyuthi already registered with pdfFonts().
FontAwesome already registered with pdfFonts().
FreeMono already registered with pdfFonts().
FreeSans already registered with pdfFonts().
FreeSerif already registered with pdfFonts().
Gargi already registered with pdfFonts().
Garuda already registered with pdfFonts().
Gubbi already registered with pdfFonts().
Jamrul already registered with pdfFonts().
JetBrains Mono already registered with pdfFonts().
JetBrains Mono ExtraBold already registered with pdfFonts().
JetBrains Mono Medium already registered with pdfFonts().
JetBrains Mono NL already registered with pdfFonts().
JetBrains Mono NL ExtraBold already registered with pdfFonts().
JetBrains Mono NL Medium already registered with pdfFonts().
KacstArt already registered with pdfFonts().
KacstBook already registered with pdfFonts().
KacstDecorative already registered with pdfFonts().
KacstDigital already registered with pdfFonts().
KacstFarsi already registered with pdfFonts().
KacstLetter already registered with pdfFonts().
KacstNaskh already registered with pdfFonts().
KacstOffice already registered with pdfFonts().
KacstOne already registered with pdfFonts().
KacstPen already registered with pdfFonts().
KacstPoster already registered with pdfFonts().
KacstQurn already registered with pdfFonts().
KacstScreen already registered with pdfFonts().
KacstTitle already registered with pdfFonts().
KacstTitleL already registered with pdfFonts().
Kalapi already registered with pdfFonts().
Kalimati already registered with pdfFonts().
Karumbi already registered with pdfFonts().
No regular (non-bold, non-italic) version of Keraleeyam. Skipping setup for this font.
Khmer OS already registered with pdfFonts().
Khmer OS System already registered with pdfFonts().
More than one version of regular/bold/italic found for Kinnari. Skipping setup for this font.
Laksaman already registered with pdfFonts().
Lato Black already registered with pdfFonts().
Lato already registered with pdfFonts().
Lato Hairline already registered with pdfFonts().
Lato Heavy already registered with pdfFonts().
Lato Light already registered with pdfFonts().
Lato Medium already registered with pdfFonts().
Lato Semibold already registered with pdfFonts().
Lato Thin already registered with pdfFonts().
More than one version of regular/bold/italic found for Liberation Mono. Skipping setup for this font.
More than one version of regular/bold/italic found for Liberation Sans. Skipping setup for this font.
Liberation Sans Narrow already registered with pdfFonts().
More than one version of regular/bold/italic found for Liberation Serif. Skipping setup for this font.
Likhan already registered with pdfFonts().
LKLUG already registered with pdfFonts().
Lohit Assamese already registered with pdfFonts().
Lohit Bengali already registered with pdfFonts().
Lohit Devanagari already registered with pdfFonts().
Lohit Gujarati already registered with pdfFonts().
Lohit Gurmukhi already registered with pdfFonts().
Lohit Kannada already registered with pdfFonts().
Lohit Malayalam already registered with pdfFonts().
Lohit Odia already registered with pdfFonts().
Lohit Tamil already registered with pdfFonts().
Lohit Tamil Classical already registered with pdfFonts().
Lohit Telugu already registered with pdfFonts().
Loma already registered with pdfFonts().
Material Design Icons already registered with pdfFonts().
Meera already registered with pdfFonts().
Mitra Mono already registered with pdfFonts().
mry_KacstQurn already registered with pdfFonts().
Mukti Narrow already registered with pdfFonts().
Nakula already registered with pdfFonts().
Navilu already registered with pdfFonts().
More than one version of regular/bold/italic found for Norasi. Skipping setup for this font.
Noto Mono already registered with pdfFonts().
OpenSymbol already registered with pdfFonts().
Padauk already registered with pdfFonts().
Padauk Book already registered with pdfFonts().
More than one version of regular/bold/italic found for padmaa. Skipping setup for this font.
No regular (non-bold, non-italic) version of padmaa-Bold.1.1. Skipping setup for this font.
Pagul already registered with pdfFonts().
Phetsarath OT already registered with pdfFonts().
Pothana2000 already registered with pdfFonts().
Purisa already registered with pdfFonts().
Rachana already registered with pdfFonts().
RaghuMalayalam already registered with pdfFonts().
Rekha already registered with pdfFonts().
Saab already registered with pdfFonts().
Sahadeva already registered with pdfFonts().
Samanata already registered with pdfFonts().
Samyak Devanagari already registered with pdfFonts().
Samyak Gujarati already registered with pdfFonts().
Samyak Malayalam already registered with pdfFonts().
Samyak Tamil already registered with pdfFonts().
Sarai already registered with pdfFonts().
Sawasdee already registered with pdfFonts().
Source Code Pro Black already registered with pdfFonts().
Source Code Pro already registered with pdfFonts().
Source Code Pro ExtraLight already registered with pdfFonts().
Source Code Pro Light already registered with pdfFonts().
Source Code Pro Medium already registered with pdfFonts().
Source Code Pro Semibold already registered with pdfFonts().
Suruma already registered with pdfFonts().
Tibetan Machine Uni already registered with pdfFonts().
TlwgMono already registered with pdfFonts().
TlwgTypewriter already registered with pdfFonts().
Tlwg Typist already registered with pdfFonts().
Tlwg Typo already registered with pdfFonts().
Ubuntu already registered with pdfFonts().
Ubuntu Light already registered with pdfFonts().
Ubuntu Condensed already registered with pdfFonts().
Ubuntu Mono already registered with pdfFonts().
More than one version of regular/bold/italic found for Umpush. Skipping setup for this font.
No regular (non-bold, non-italic) version of Uroob. Skipping setup for this font.
utkal already registered with pdfFonts().
Vemana2000 already registered with pdfFonts().
Waree already registered with pdfFonts().
#+end_example
** Read csv
#+begin_src R :results output :session *R* :exports both
mad = function(x) { mean(abs(x)) }
@ -6652,27 +6790,119 @@ dev.off()
#+end_src
** On-top pair density
#+begin_src gnuplot :file output.png
#set terminal pdf
#set output "on-top-mu.pdf"
set xlabel "distance from O"
set ylabel "on-top pair density"
plot "H2O_1.e-6.density" w l title "n2(r,r), {/Symbol m}=0", \
"H2O_0.25.density" w l title "n2(r,r), {/Symbol m}=0.25", \
"H2O_0.5.density" w l title "n2(r,r), {/Symbol m}=0.5", \
"H2O_1.0.density" w l title "n2(r,r), {/Symbol m}=1.0", \
"H2O_1e6.density" w l title "n2(r,r), {/Symbol m}=10^6", \
"H2O.density" w l title "n2(r,r), Jastrow"
#+begin_src R :results output graphics :file (org-babel-temp-file "figure" ".png") :exports both :width 600 :height 400 :session *R*
breaks <- c("0.00", "0.25", "0.50", "1.00", "$\\infty$", "Jastrow")
tmp_data <- read.csv("H2O_1.e-6.density")
data.0 <- data.frame(mu=breaks[1], x=tmp_data$X..distance, n=tmp_data$on.top)
tmp_data <- read.csv("H2O_0.25.density")
data.0.25 <- data.frame(mu=breaks[2], x=tmp_data$X..distance, n=tmp_data$on.top)
tmp_data <- read.csv("H2O_0.5.density")
data.0.5 <- data.frame(mu=breaks[3], x=tmp_data$X..distance, n=tmp_data$on.top)
tmp_data <- read.csv("H2O_1.0.density")
data.1.0 <- data.frame(mu=breaks[4], x=tmp_data$X..distance, n=tmp_data$on.top)
tmp_data <- read.csv("H2O_1e6.density")
data.inf <- data.frame(mu=breaks[5], x=tmp_data$X..distance, n=tmp_data$on.top)
tmp_data <- read.csv("H2O.density")
data.J <- data.frame(mu=breaks[6], x=tmp_data$X..distance, n=tmp_data$on.top)
data <- rbind(data.0, data.0.25, data.0.5, data.1.0, data.inf)
labels= TeX(breaks)
p <- ggplot(data, aes(x=x, y=n, col=mu))
p <- p + geom_line(lwd=1.5)
p <- p + geom_line(data=data.J, lwd=1, col=1, linetype="dashed")
p <- p + scale_colour_discrete(name = TeX("$\\mu$"), breaks = breaks,
labels = labels)
#p <- p + scale_color_brewer(palette = "Paired")
p <- p + scale_x_continuous(name=TeX("$r_{O-H}$ (bohr)"))
p <- p + scale_y_continuous(name = "Integrated on-top pair density (a.u.)")
p <- p + theme(text = element_text(size = 20, family="Times"), legend.position=c(.85,.75), legend.text.align = 0)
p
#+end_src
#+RESULTS:
[[file:output.png]]
[[file:/tmp/babel-eZHQur/figurey8Ummd.png]]
#+begin_src R :results output :session *R* :exports both
pdf("../Manuscript/on-top-mu.pdf", family="Times", width=8, height=5)
p
dev.off()
#+end_src
#+RESULTS:
:
: png
: 2
** One-body density
#+begin_src gnuplot :file output.png
#+begin_src R :results output graphics :file (org-babel-temp-file "figure" ".png") :exports both :width 600 :height 400 :session *R*
breaks <- c("0.00", "0.25", "0.50", "1.00", "$\\infty$", "Jastrow")
tmp_data <- read.csv("H2O_1.e-6.density")
data.0 <- data.frame(mu=breaks[1], x=tmp_data$X..distance, n=tmp_data$density)
tmp_data <- read.csv("H2O_0.25.density")
data.0.25 <- data.frame(mu=breaks[2], x=tmp_data$X..distance, n=tmp_data$density)
tmp_data <- read.csv("H2O_0.5.density")
data.0.5 <- data.frame(mu=breaks[3], x=tmp_data$X..distance, n=tmp_data$density)
tmp_data <- read.csv("H2O_1.0.density")
data.1.0 <- data.frame(mu=breaks[4], x=tmp_data$X..distance, n=tmp_data$density)
tmp_data <- read.csv("H2O_1e6.density")
data.inf <- data.frame(mu=breaks[5], x=tmp_data$X..distance, n=tmp_data$density)
tmp_data <- read.csv("H2O.density")
data.J <- data.frame(mu=breaks[6], x=tmp_data$X..distance, n=tmp_data$density)
data <- rbind(data.0, data.0.25, data.0.5, data.1.0, data.inf)
labels= TeX(breaks)
p <- ggplot(data, aes(x=x, y=n, col=mu))
p <- p + geom_line(lwd=1.5)
p <- p + geom_line(data=data.J, lwd=1, col=1, linetype="dashed")
p <- p + scale_colour_discrete(name = TeX("$\\mu$"), breaks = breaks,
labels = labels)
p <- p + scale_x_continuous(name=TeX("$r_{O-H}$ (bohr)"))
p <- p + scale_y_continuous(name = "Density (a.u.)")
p <- p + theme(text = element_text(size = 20, family="Times"), legend.position=c(.85,.75), legend.text.align = 0)
p
#+end_src
#+RESULTS:
[[file:/tmp/babel-eZHQur/figureJZB5vg.png]]
#+begin_src R :results output :session *R* :exports both
pdf("../Manuscript/density-mu.pdf", family="Times", width=8, height=5)
p
dev.off()
#+end_src
#+RESULTS:
:
: png
: 2
#+begin_src gnuplot :file output2.png
#set terminal pdf
#set output "density.pdf"
reset
set xlabel "distance from O"
set ylabel "Density"
plot "H2O_1.e-6.density" u 1:3 w l title "n2(r,r), {/Symbol m}=0", \
@ -6684,7 +6914,6 @@ plot "H2O_1.e-6.density" u 1:3 w l title "n2(r,r), {/Symbol m}=0", \
#+end_src
#+RESULTS:
[[file:output.png]]
** Optimal mu
*** Table

Binary file not shown.

BIN
Manuscript/h2o-200-dmc.pdf Normal file

Binary file not shown.

Binary file not shown.

View File

@ -512,7 +512,7 @@ but also the non-hermitian transcorrelated eigenvalue problem\cite{many_things}
which is much easier to handle despite its non-hermicity.
Of course, the FN-DMC energy of $\Phi$ depends therefore only on the nodes of $\Psi^J$.
In a finite basis set and with a quite accurate Jastrow factor, it is known that the nodes
of $\Psi^J$ are better than that of the FCI wave function, and therefore, we would like to compare $\Psi^J$ and $\Psi^\mu$.
of $\Psi^J$ may be better than that of the FCI wave function, and therefore, we would like to compare $\Psi^J$ and $\Psi^\mu$.
To do so, we have made the following numerical experiment.
First, we extract the 200 determinants with the largest weights in the FCI wave
@ -558,10 +558,50 @@ with that of $\Psi^\mu$ with $0.5 < \mu < 1$~bohr$^{-1}$. This confirms that
introducing short-range correlation with DFT has
an impact on the CI coefficients similar to the Jastrow factor.
In order to refine the comparison between $\Psi^\mu$ and $\Psi^J$,
we report several quantities related to the one- and two-body density
of $\Psi^J$ and $\Psi^\mu$ with different values of $\mu$.
First, we report in table~\ref{table_on_top} the integrated on-top pair density $\expval{ n_2({\bf r},{\bf r}) }$
\begin{table}
\caption{\ce{H2O}, double-zeta basis set. Integrated on-top pair density $\expval{ n_2({\bf r},{\bf r}) }$
for $\Psi^J$ and $\Psi^\mu$ with different values of $\mu$. }
\label{table_on_top}
\begin{ruledtabular}
\begin{tabular}{cc}
$\mu$ & $\expval{ n_2({\bf r},{\bf r}) }$ \\
\hline
0.00 & 1.443 \\
0.25 & 1.438 \\
0.50 & 1.423 \\
1.00 & 1.378 \\
2.00 & 1.325 \\
5.00 & 1.288 \\
$\infty$ & 1.277 \\
\hline
$\Psi^J$ & 1.404 \\
\end{tabular}
\end{ruledtabular}
\end{table}
\begin{figure}
\centering
\includegraphics[width=\columnwidth]{on-top-mu.pdf}
\caption{\ce{H2O}, double-zeta basis set. On-top pair
density $n_2({\bf r},{\bf r})$ along the O---H axis,
for $\Psi^J$ (dashed curve) and $\Psi^\mu$ with different values of $\mu$. }
\label{fig:n2}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=\columnwidth]{density-mu.pdf}
\caption{\ce{H2O}, double-zeta basis set. Density $n({\bf r})$ along
the O---H axis, for $\Psi^J$ (dashed curve) and $\Psi^\mu$ with different values of $\mu$. }
\label{fig:n1}
\end{figure}
In order to refine the comparison between $\Psi^\mu$ and $\Psi^J$, we
report several quantities related to the one- and two-body density of
$\Psi^J$ and $\Psi^\mu$ with different values of $\mu$. First, we
report in table~\ref{table_on_top} the integrated on-top pair density
$\expval{ n_2({\bf r},{\bf r}) }$
\begin{equation}
\expval{ n_2({\bf r},{\bf r}) } = \int \text{d}{\bf r} \,\,n_2({\bf r},{\bf r})
\end{equation}
@ -581,11 +621,15 @@ are much more important than that of the one-body density, the latter
being essentially unchanged between $\mu=0$ and $\mu=\infty$ while the
former can vary by about 10$\%$ in some regions.
%TODO TOTO
The values of the on-top pair density in $\Psi^\mu$ are closer for
certain values of $\mu$ to those of $\Psi^J$ than the FCI wave
function.
In the high-density region of the O---H bond, the value of the on-top
pair density obtained from $\Psi^J$ is superimposed with
$\Psi^{\mu=0.5}$, and at a large distance the on-top pair density is
the closest to $\mu=\infty$. The integrated on-top pair density
obtained with $\Psi^J$ lies between the values obtained with
$\mu=0.5$ and $\mu=1$~bohr$^{-1}$, constently with the FN-DMC energies
and the overlap curve.
These data suggest that the wave functions $\Psi^{\mu=0.5}$ and $\Psi^J$ are similar,
These data suggest that the wave functions $\Psi^{0.5 \le \mu \le 1}$ and $\Psi^J$ are close,
and therefore that the operators that produced these wave functions (\textit{i.e.} $H^\mu[n]$ and $e^{-J}He^J$) contain similar physics.
Considering the form of $\hat{H}^\mu[n]$ (see Eq.~\eqref{H_mu}),
one can notice that the differences with respect to the usual Hamiltonian come
@ -605,53 +649,23 @@ Therefore, one can understand the similarity between the eigenfunctions of $H^\m
they both deal with an effective non-divergent interaction but still
produce a reasonable one-body density.
\begin{table}
\caption{\ce{H2O}, double-zeta basis set. Integrated on-top pair density $\expval{ n_2({\bf r},{\bf r}) }$
for $\Psi^J$ and $\Psi^\mu$ with different values of $\mu$. }
\label{table_on_top}
\begin{ruledtabular}
\begin{tabular}{cc}
$\mu$ & $\expval{ n_2({\bf r},{\bf r}) }$ \\
\hline
0.00 & 1.443 \\
0.25 & 1.438 \\
0.50 & 1.423 \\
1.00 & 1.378 \\
2.00 & 1.325 \\
5.00 & 1.288 \\
$\infty$ & 1.277 \\
\hline
$\Psi^J$ & \\
\end{tabular}
\end{ruledtabular}
\end{table}
\begin{figure}
\centering
\includegraphics[width=\columnwidth]{on-top-mu.pdf}
\caption{\ce{H2O}, double-zeta basis set. Integrated on-top pair density $\expval{ n_2({\bf r},{\bf r}) }$ along the O---H axis, for $\Psi^J$ and $\Psi^\mu$ with different values of $\mu$. }
\label{fig:n2}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=\columnwidth]{density-mu.pdf}
\caption{\ce{H2O}, double-zeta basis set. Density $n({\bf r})$ along the O---H axis, for $\Psi^J$ and $\Psi^\mu$ with different values of $\mu$. }
\label{fig:n1}
\end{figure}
As a conclusion of the first part of this study, we can notice that:
i) with respect to the nodes of a KS determinant or a FCI wave function,
one can obtain a multi determinant trial wave function $\Psi^\mu$ with a smaller
fixed node error by properly choosing an optimal value of $\mu$
in RS-DFT calculations, ii) the value of the optimal $\mu$ depends
on the system and the basis set, and the larger the basis set, the larger the optimal value of $\mu$,
iii) numerical experiments (such as computation of overlap, FN-DMC energies) indicates
that the RS-DFT scheme essentially plays the role of a simple Jastrow factor,
\textit{i.e.} mimicking short-range correlation effects.
The latter statement can be qualitatively understood by noticing that both RS-DFT
and transcorrelated approach deal with an effective non-divergent electron-electron interaction, while keeping the density constant.
\begin{itemize}
\item with respect to the nodes of a KS determinant or a FCI wave function,
one can obtain a multi determinant trial wave function $\Psi^\mu$ with a smaller
fixed node error by properly choosing an optimal value of $\mu$
in RS-DFT calculations,
\item the optimal value of $\mu$ depends on the system and the
basis set, and the larger the basis set, the larger the optimal value
of $\mu$,
\item numerical experiments (overlap $\braket{\Psi^\mu}{\Psi^J}$,
one-body density, on-top pair density, and FN-DMC energy) indicate
that the RS-DFT scheme essentially plays the role of a simple Jastrow factor,
\textit{i.e.} mimicking short-range correlation effects. The latter
statement can be qualitatively understood by noticing that both RS-DFT
and transcorrelated approaches deal with an effective non-divergent
electron-electron interaction, while keeping the density constant.
\end{itemize}
\section{Energy differences in FN-DMC: atomization energies}