This commit is contained in:
Anthony Scemama 2020-04-21 12:11:38 +02:00
parent 58b6da5780
commit e6a25d1115
86 changed files with 400490 additions and 0 deletions

396
Data/Jastrow.ipynb Normal file
View File

@ -0,0 +1,396 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Jastrow factors"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## H2O"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"onedet = \"Jastrows/H2O/H2O-cc-pcvTz.wfj-1det_J2.ud_exp.dat\"\n",
"os = 1.-7.92535494e-01\n",
"\n",
"multidet = \"Jastrows/H2O/H2O-cc-pcvTz-multidet.wfj_J2.ud_exp.dat\"\n",
"ms = 1.-8.59001137e-01\n",
"\n",
"onedet_H = \"Jastrows/H2O/H2O-cc-pcvTz.wfj-1det_J1.H_exp.dat\"\n",
"ohs = 1.-1.03221118e+00\n",
"onedet_O = \"Jastrows/H2O/H2O-cc-pcvTz.wfj-1det_J1.O_exp.dat\"\n",
"oos = 1.-1.43887500e+00\n",
"\n",
"#onedet = \"Jastrows/N2H4/N2H4-tr6.wfj_J2.ud_exp.dat\"\n",
"#os = 1.-8.03464242e-01\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"set yrange [1:1.4]\n",
"set xrange [0:3]\n",
"set grid\n",
"set xlabel \"r_{12} (a.u.)\"\n",
"set format y \"%.2f\"\n",
"set format x \"%.1f\"\n",
"set key bottom right\n",
"\n",
"plot onedet u 1:($2+os) w l title \"HF\"\\\n",
", multidet u 1:($2+ms) w l title \"FCI\"\n",
"\n",
"set yrange [0:1]\n",
"plot onedet_O u 1:($2+oos) w l title \"O\"\\\n",
", onedet_H u 1:($2+ohs) w l title \"H\"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"f1(x) = exp(a_1 * x/(1. + b_1*x))\n",
"f2(x) = exp(a_2 * x/(1. + b_2*x))\n",
"f3(x) = exp(a_3 * x**2+b_3)\n",
"f4(x) = exp(a_4 * x**2+b_4)\n",
"a_1 = 0.5\n",
"a_2 = 0.5\n",
"a_3 = 0.5\n",
"a_4 = 0.5\n",
"b_1 = 1.\n",
"b_2 = 1.\n",
"b_3 = 1.\n",
"b_4 = 1.\n",
"\n",
"fit f1(x) onedet u 1:($2+os) via b_1\n",
"fit f2(x) multidet u 1:($2+ms) via b_2\n",
"fit [0:1] f3(x) onedet_O u 1:($2+oos) via a_3, b_3\n",
"fit [0:1] f4(x) onedet_H u 1:($2+ohs) via a_4, b_4\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"set xrange [0:3]\n",
"set yrange [1.:1.3]\n",
"set grid\n",
"set xlabel \"r_{12} (a.u.)\"\n",
"set format y \"%.2f\"\n",
"set format x \"%.1f\"\n",
"set key bottom right\n",
"\n",
"plot onedet u 1:($2+os) w l title \"HF\"\\\n",
", multidet u 1:($2+ms) w l title \"FCI\"\\\n",
", f1(x) title \"exp(- 0.5 r_{12} / (1. + 1.93 r_{12}))\"\\\n",
", f2(x) title \"exp(- 0.5 r_{12} / (1. + 3.99 r_{12}))\"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"set xrange [0:1]\n",
"set yrange [0.6:1.]\n",
"set grid\n",
"set xlabel \"r_{12} (a.u.)\"\n",
"set format y \"%.2f\"\n",
"set format x \"%.1f\"\n",
"set key bottom right\n",
"\n",
"plot onedet_O u 1:($2+oos) w l title \"O\"\\\n",
", onedet_H u 1:($2+ohs) w l title \"H\"\\\n",
", f3(x) title \"exp(- 0.5 r_{12} / (1. + 1.93 r_{12}))\"\\\n",
", f4(x) title \"exp(- 0.5 r_{12} / (1. + 3.99 r_{12}))\"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#set term pdf font \"Times,15pt\"\n",
"#set output \"jastrow_h2o.pdf\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Range-separated Coulomb operator"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"w(x) = 1./x\n",
"w_lr(mu,x) = erf(mu*x)/x\n",
"w_sr(mu,x) = w(x) - w_lr(mu,x)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"set xrange [0:4]\n",
"set yrange [0:3]\n",
"set key top right\n",
"plot w(x) title '1/r_{12}',\\\n",
" w_lr(0.5,x) title '{/Symbol m}=0.5' ls 2,\\\n",
" w_sr(0.5,x) notitle ls 2, \\\n",
" w_lr(1.0,x) title '{/Symbol m}=1.0' ls 4,\\\n",
" w_sr(1.0,x) notitle ls 4"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## DMC Energies"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Single-determinant"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"data = \"Jastrows/data_dmc\"\n",
"set key top right\n",
"set xrange [0:7.5]\n",
"set xlabel \"{/Symbol m} (a.u.)\"\n",
"set ylabel \"Energy (a.u.)\"\n",
"set format y \"%.4f\"\n",
"set yrange [-76.4115:-76.4095]\n",
"plot data index 0 u 1:5:6 w errorlines title \"1 det / cc-pVDZ\"\n",
"set yrange [-76.4215:-76.4195]\n",
"plot data index 1 u 1:5:6 w errorlines title \"1 det / cc-pVTZ\"\n",
"set yrange [-76.4232:-76.4212]\n",
"plot data index 2 u 1:5:6 w errorlines title \"1 det / cc-pVQZ\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Multi-determinant"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"data = \"Jastrows/data_dmc\"\n",
"set key top right\n",
"set xrange [0:7.5]\n",
"set xlabel \"{/Symbol m} (a.u.)\"\n",
"set ylabel \"Energy (a.u.)\"\n",
"set format y \"%.3f\"\n",
"set yrange [-76.44:-76.405]\n",
"plot data index 0 u 1:7:8 w errorlines title \"CIPSI / cc-pVDZ\", \\\n",
"data index 1 u 1:7:8 w errorlines title \"CIPSI / cc-pVTZ\", \\\n",
"data index 2 u 1:7:8 w errorlines title \"CIPSI / cc-pVQZ\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Fit $\\mu$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"-----\n",
"$\\Psi(r_1,\\dots,r_N)$ is a CI trial wave function:\n",
"$$\n",
"|\\Psi \\rangle = \\sum_{I \\in \\mathcal{B}} c_I |I\\rangle\n",
"$$\n",
"When running a FN-DMC calculation, the fixed-node wave function can be written as $\\Phi(r_1,\\dots,r_N) = \\Psi(r_1,\\dots,r_N)\\times w(r_1,\\dots,r_N)$, where $w$ is a positive function, such that\n",
"$$\n",
"E = \\min_w \\frac{ \\langle w \\Psi | H | \\Psi \\rangle } {\\langle w \\Psi | \\Psi \\rangle}\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We want to find the change in the potential that would model the effect of the FN-DMC. This corresponds to removing some short-range potential:\n",
"\n",
"$$\n",
"\\frac{ \\langle w \\Psi | V_{ee} | w \\Psi \\rangle } {\\langle w \\Psi | w \\Psi \\rangle} = \n",
"\\frac{ \\langle \\Psi | V_{ee} - \\delta V_{ee} | \\Psi \\rangle } {\\langle \\Psi | \\Psi \\rangle} \n",
"$$\n",
"where\n",
"\n",
"$$\n",
"V_{ee} = \\frac{1}{r_{12}} \n",
"$$\n",
"and\n",
"$$\n",
"\\delta V_{ee} = \n",
"\\alpha \\left( \\frac{1}{r_{12}} - \\frac{\\text{erf}( \\mu r_{12})}{r_{12}} \\right).\n",
"$$\n",
"\n",
"\n",
"$$\n",
"\\frac{ \\langle w \\Psi | V_{ee} | w \\Psi \\rangle } {\\langle w \\Psi | w \\Psi \\rangle} = \n",
"\\frac{ \\langle \\Psi | V_{ee} | \\Psi \\rangle } {\\langle \\Psi | \\Psi \\rangle} -\n",
"\\alpha \\frac{ \\langle \\Psi | V_{ee} | \\Psi \\rangle } {\\langle \\Psi | \\Psi \\rangle} +\n",
"\\alpha \\frac{ \\langle \\Psi | V_{ee}^{lr} | \\Psi \\rangle } {\\langle \\Psi | \\Psi \\rangle} \n",
"$$\n",
"\n",
"$$\n",
"\\frac{\\langle \\Psi | w^2 V_{ee} | \\Psi \\rangle}\n",
"{\\langle w \\Psi | w \\Psi \\rangle}\n",
"=\n",
"(1-\\alpha) \\langle \\Psi | V_{ee} | \\Psi \\rangle +\n",
"\\alpha \\langle \\Psi | V_{ee}^{lr} | \\Psi \\rangle \n",
"$$\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$\n",
"w^2 = \\left[ (1-\\alpha) + \\alpha\\, \\text{erf}(\\mu\\, r_{12}) \\right]\\langle w \\Psi | w \\Psi \\rangle\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To find the parameter $\\mu$, we minimize\n",
"$$\n",
"\\int \\left|a\\, \\text{erf}(\\mu\\,r_{12}) + b - w(r_{12})^2 \\right|^2 \\text{d}r_{12}\n",
"$$"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"set yrange [1:1.3]\n",
"set xrange [0:3]\n",
"set grid\n",
"set xlabel \"r_{12} (a.u.)\"\n",
"set format y \"%.2f\"\n",
"set format x \"%.1f\"\n",
"set key bottom right\n",
"\n",
"f(x) = (a * (erf(mu*x)) +b)\n",
"mu = 2.\n",
"b=1.\n",
"a = 1.\n",
"fit f(x) multidet u 1:( ($2+ms)**2 ) via a, b, mu\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plot f(x), multidet u 1:( ($2+ms)**2) title \"{/Symbol m}=3.05\" w l"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"set yrange [1:1.7]\n",
"set xrange [0:2.5]\n",
"set grid\n",
"set xlabel \"r_{12} (a.u.)\"\n",
"set format y \"%.2f\"\n",
"set format x \"%.1f\"\n",
"set key bottom right\n",
"\n",
"f(x) = (a * (erf(mu*x)) +b)\n",
"mu = 2.\n",
"b=1.\n",
"a = 1.\n",
"fit f(x) onedet u 1:( ($2+os)**2) via a, b, mu\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plot f(x), onedet u 1:( ($2+os)**2 ) title \"{/Symbol m}=0.94\" w l"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "gnuplot",
"language": "gnuplot",
"name": "gnuplot"
},
"language_info": {
"codemirror_mode": "Octave",
"file_extension": ".gp",
"help_links": [
{
"text": "MetaKernel Magics",
"url": "https://metakernel.readthedocs.io/en/latest/source/README.html"
}
],
"mimetype": "text/x-gnuplot",
"name": "gnuplot"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

34
Data/Jastrows/Jastrow.gp Normal file
View File

@ -0,0 +1,34 @@
onedet = "~/Anouar/Jastrows/H2O/H2O-cc-pcvTz.wfj-1det_J2.ud_exp.dat"
multidet = "~/Anouar/Jastrows/H2O/H2O-cc-pcvTz-multidet.wfj_J2.ud_exp.dat"
#f1(x) = exp(a_1 * x/(1. + b_1*x))
#f2(x) = exp(a_2 * x/(1. + b_2*x))
#a_1 = 0.5
#a_2 = 0.5
#b_1 = 1.
#b_2 = 1.
#fit f1(x) onedet u 1:($2-7.92535494e-01+1.) via b_1
#fit f2(x) multidet u 1:($2-8.59001137e-01+1.) via b_2
set xrange [0:3]
set yrange [1:1.25]
set grid
set xlabel "r_{12} (a.u.)"
set format y "%.2f"
set format x "%.1f"
set key bottom right
plot onedet u 1:($2-7.92535494e-01+1.) w l title "HF / cc-pVTZ"\
, multidet u 1:($2-8.59001137e-01+1.) w l title "CIPSI / cc-pVTZ"\
#, f1(x) title "exp(- 0.5 r_{12} / (1. + 1.93 r_{12}))"\
#, f2(x) title "exp(- 0.5 r_{12} / (1. + 3.99 r_{12}))"
set term pdf font "Times,16pt" linewidth 2.
set output "jastrow_h2o.pdf"
replot
set term cairo

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

38
Data/Jastrows/data_dmc Normal file
View File

@ -0,0 +1,38 @@
# mu ndet E(PBE) RS-CI DMC(1det) DMC(RS-CI)
# DZ
0.5 2396 -76.33604445222997 -76.3441442508 -76.410018 0.000198 -76.411258 0.000383
1.0 40963 -76.27348956941330 -76.3336831179 -76.410771 0.000218 -76.415616 0.000479
1.5 138253 -76.20172972611051 -76.3147073528 -76.411030 0.000143 -76.418327 0.000311
2.0 207380 -76.15446145849143 -76.3018300218 -76.410994 0.000168 -76.417751 0.000544
2.5 311071 -76.12743299891538 -76.2963616190 -76.410997 0.000138 -76.418830 0.000320
3.0 466607 -76.11231786534898 -76.2953530572 -76.410925 0.000175 -76.418333 0.000604
4.0 466607 -76.09737987601412 -76.2973907108 -76.410767 0.000183 -76.417842 0.000485
5.0 466607 -76.08892265698270 -76.299088319 -76.410719 0.000167 -76.417461 0.000481
6.0 466607 -76.08222148947996 -76.2995315838 -76.410730 0.000172 -76.417162 0.000632
7.0 466607 -76.07645402100390 -76.2992732268 -76.410741 0.000192 -76.417398 0.000384
# TZ
0.5 8090 -76.37411359270587 -76.3853803202 -76.420407 0.000116 -76.422574 0.000253
1.0 466607 -76.30808407357975 -76.3810129344 -76.420450 0.000117 -76.427268 0.000494
1.5 2000000 -76.23450972568928 -76.3699240165 -76.420484 0.000129 -76.430965 0.000937
2.0 2000000 -76.18647332232358 -76.3659759776 -76.420322 0.000123 -76.430956 0.000704
2.5 2000000 -76.15905488759424 -76.3681700530 -76.420125 0.000170 -76.432259 0.000539
3.0 2000000 -76.14366220610044 -76.3730744570 -76.420003 0.000149 -76.432267 0.000611
4.0 2000000 -76.12827446549065 -76.3829546254 -76.420138 0.000139 -76.430869 0.000996
5.0 2000000 -76.11950514107885 -76.3892344149 -76.419934 0.000119 -76.431917 0.000943
7.0 2000000 -76.10674756885926 -76.3942237680 -76.419851 0.000161 -76.430150 0.000752
# QZ
0.5 12136 -76.38318565911486 -76.3952959489 -76.422831 0.000207 -76.425846 0.000254
1.0 2382775 -76.31599767191094 -76.3917462575 -76.422337 0.000151 -76.428929 0.000748
1.5 2408343 -76.24211906926882 -76.3816852280 -76.422451 0.000188 -76.432489 0.000531
2.0 3698407 -76.19399206529708 -76.3795304096 -76.422567 0.000139 -76.435818 0.000763
2.5 3847936 -76.16655117814619 -76.3834274230 -76.422184 0.000103 -76.435031 0.000546
3.0 2000000 -76.15117119770653 -76.3898019841 -76.421932 0.000201 -76.435098 0.000539
4.0 2000000 -76.13583094033078 -76.4016324447 -76.422268 0.000097 -76.433833 0.000530
5.0 2000000 -76.12708615152579 -76.4093388884 -76.421901 0.000154 -76.434136 0.000370
7.0 3468702 -76.11433599757845 -76.4159382168 -76.421721 0.000183 -76.434913 0.000523

BIN
Data/Jastrows/e_h2o_dmc.pdf Normal file

Binary file not shown.

View File

@ -0,0 +1,22 @@
w(x) = 1./x
w_lr(mu,x) = erf(mu*x)/x
w_sr(mu,x) = w(x) - w_lr(mu,x)
set grid
set xlabel "r_{12} (a.u.)"
set xrange [0:4]
set yrange [0:3]
set format y "%.1f"
set format x "%.1f"
set key top right
plot w(x) title '1/r_{12}',\
w_lr(0.5,x) title '{/Symbol m}=0.5' ls 2,\
w_sr(0.5,x) notitle ls 2, \
w_lr(1.0,x) title '{/Symbol m}=1.0' ls 4,\
w_sr(1.0,x) notitle ls 4
set term pdf font "Times,16pt" linewidth 2.
set out "rs-coulomb.pdf"
replot
set term cairo

Binary file not shown.