-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathoz_doc.tex
More file actions
2289 lines (2177 loc) · 87.2 KB
/
oz_doc.tex
File metadata and controls
2289 lines (2177 loc) · 87.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% This file is part of SunlightDPD - a home for open source software
% related to the dissipative particle dynamics (DPD) simulation
% method.
% Original copyright (c) 2009-2018 Unilever UK Central Resources Ltd
% (Registered in England & Wales, Company No 29140; Registered Office:
% Unilever House, Blackfriars, London, EC4P 4BQ, UK). Later
% modifications copyright (c) 2020-2025 Patrick B Warren
% <patrick.warren@stfc.ac.uk> and STFC.
% SunlightDPD is free software: you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
% published by the Free Software Foundation, either version 3 of the
% License, or (at your option) any later version.
% SunlightDPD is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
% General Public License for more details.
% You should have received a copy of the GNU General Public License
% along with SunlightDPD. If not, see <http://www.gnu.org/licenses/>.
\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
%\usepackage{color}
\usepackage{upquote}
\DeclareMathOperator{\erf}{erf}
\DeclareMathOperator{\erfc}{erfc}
\DeclareMathOperator{\imaginary}{Im}
\DeclareMathOperator{\Tr}{Tr}
\newcommand{\latin}[1]{\emph{#1}}
\newcommand{\german}[1]{$\frak{#1}$}
\newcommand{\etal}{\latin{et al.}}
\newcommand{\etc}{\latin{et\,c.}}
\newcommand{\eg}{\latin{e.\,g.}}
\newcommand{\cf}{\latin{c.\,f.}}
\newcommand{\ie}{\latin{i.\,e.}}
\newcommand{\via}{\latin{via}}
\newcommand{\aposteriori}{\latin{a posteriori}}
\newcommand{\adhoc}{\latin{ad hoc}}
\newcommand{\viz}{\latin{viz.}}
\newcommand{\viceversa}{\latin{vice versa}}
\newcommand{\mutmut}{\latin{mutatis mutandis}}
\newcommand{\ansatz}{{ansatz}}
\newcommand{\perse}{\latin{per se}}
\newcommand{\french}[1]{\emph{#1}}
\newcommand{\ala}{\french{\`a la}}
\newcommand{\half}{{\textstyle\frac{1}{2}}}
\newcommand{\alt}{\lesssim}
\newcommand{\agt}{\gtrsim}
\newcommand{\kB}{k_{\mathrm{B}}}
\newcommand{\kT}{\kB T}
\newcommand{\myex}{^{\mathrm{ex}}}
\newcommand{\pex}{p\myex}
\newcommand{\Uex}{U\myex}
\newcommand{\uex}{u\myex}
\newcommand{\Aex}{A\myex}
\newcommand{\aex}{a\myex}
\newcommand{\muex}{\mu\myex}
\newcommand{\myvec}[1]{{\mathbf #1}}
\newcommand{\rvec}{\myvec{r}}
\newcommand{\kvec}{\myvec{k}}
\newcommand{\lr}{^{\mathrm{L}}}
\newcommand{\vlr}{v\lr}
\newcommand{\tildevlr}{{\tilde v}\lr}
\newcommand{\myprime}{^{{}\,\prime}}
%\newcommand{\sigmap}{{\overline\sigma}}
%\newcommand{\sigmap}{{\Sigma}}
\newcommand{\sigmap}{{\sigma'}{}}
\newcommand{\gc}{g^{c}}
\newcommand{\href}{h^{(0)}}
\newcommand{\varbeta}{\text{\ss}}
% The following are used to typeset a box of width character '0'
\newlength{\zerolen}
\settowidth{\zerolen}{0}
\newcommand{\zeroset}[1]{\makebox[\zerolen][c]{#1}}
\newcommand{\Eqref}[1]{Eq.~\eqref{#1}}
\newcommand{\Eqsref}[1]{Eqs.~\eqref{#1}}
\newcommand{\Refcite}[1]{Ref.~\cite{#1}}
\newcommand{\myav}[1]{\langle #1\rangle}
\newcommand{\FLAG}[1]{{\color{red} #1}}
\newcommand{\FORTRAN}{{\sc fortran}}
\newcommand{\python}{{\tt python}}
\newcommand{\LAPACK}{{\sc lapack}}
\newcommand{\FFTW}{{\sc fftw}}
\begin{document}
\noindent{\bf\large FORTRAN 90 Ornstein-Zernike solver :: version 1.13}\\[6pt]
\noindent{\it Patrick B Warren, Hartree Centre, STFC (July 2021)}\\[6pt]
\noindent The code and this accompanying documentation is released
under the GPL. You are welcome to use and modify it for your own
projects. If you end up publishing results based on this, please cite\\
%
\begin{center}
\fbox{\parbox{0.9\textwidth}{P.~B.~Warren, A.~Vlasov, L.~Anton and
A.~J.~Masters ``Screening properties of Gaussian electrolyte
models, with application to dissipative particle dynamics'',
J. Chem. Phys. {\bf138}, 204907 (2013).}}
\end{center}
\vspace{0.25in}
\noindent Features of version 1.13:
\begin{itemize}
\setlength{\itemsep}{1pt}
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}
\item modern \FORTRAN\ 90 based, with example \python\ driver scripts;
\item HNC, MSA, RPA, and EXP closures;
\item fast Ng solver, and Ng decomposition for electrostatics;
\item multicomponent (arbitrary number of components);
\item hard core (RPM-like) and soft core (DPD-like) potentials;
\item thermodynamics computed (full HNC free energy added in v1.12);
\item fully open source.
\end{itemize}
\noindent
{\small Versions 1.13 and 1.12 were feature enhancements. Versions
1.10, 1.11 fixed bugs: the contact virial pressure contribution was
missing from the HNC free energy, and the compressibility and HNC
chemical potentials were missing a mean-field term for the off-SYM
RPM potential. Added in version 1.7--1.9: MSA closure and EXP;
exact and approximate pair potentials for Slater smearing; EXP for
hard core potentials fixed, new examples added; source code brought
up to a modern \FORTRAN\ 90 standard.}
\newpage
{\small\tableofcontents}
\newpage
\section{Introduction}
%
The \FORTRAN\ 90 module \verb+oz_mod.f90+ implements an
Ornstein-Zernike solver for multicomponent mixtures of possibly
charged particles, returning both structural and thermodynamic
information \cite{WVA+13}. The closures currently implemented are the HNC, MSA,
RPA, and EXP. Though we say it ourselves, the code is \emph{fast}
since it is written in native \FORTRAN\ and implements the Ng
acceleration schemes \cite{Ng74}. The interaction potentials are
specified in their own routines and the code could be used for other
potentials with minor modifications. Further technical background to
liquid state integral equation methods can be found in Hansen and
McDonald \cite{HM06}, Kelley and Montgomery Pettitt \cite{KMP04}, and
Vrbka \etal\ \cite{Vrbka09}. We note that Vrbka provides an
independent package called `pyOZ', implemented entirely in
\python. There are some differences with the present
approach: the Ornstein-Zernike relation is normalised slightly
differently, a conjugate gradient method is used to accelerate
convergence, and pyOZ provides other closures in addition to the ones
provided here. The present code is based on an HNC code developed by
Lucian Anton, modified for dissipative particle dynamics (DPD) by
Andrey Vlasov with help from Lucian and Andrew Masters. The code was
later converted to use the open source libraries \FFTW\ and
\LAPACK\ by Patrick Warren, and rewritten to be compatible with
\python\ using the \verb+f2py+ interface generator.
\section{Theoretical background}
%
\subsection{Single component HNC}
%
We suppose that the interaction between a pair of particles is given
by the potential $v(r)$. We introduce the following quantities:
%
\begin{equation}
\begin{array}{lll}
g(r) &\quad& \text{pair distribution function}, \\
h(r)=g(r)-1 && \text{total correlation function}, \\[6pt]
c(r) && \text{direct correlation function}, \\
e(r) = h(r)-c(r) && \text{indirect correlation function},
\end{array}
\end{equation}
%
where $c(r)$ is defined by the Ornstein-Zernike relation below. Note
that the indirect correlation function is called $b(r)$ by Hansen and
McDonald \cite{HM06} and $\gamma(r)$ by Vrbka \etal\ \cite{Vrbka09}.
We also introduce the Fourier transforms, \eg\
%
\begin{equation}
\tilde h(k) = \int\!d^3\rvec\, e^{-i\kvec\cdot\rvec} \,h(r)\,,
\end{equation}
%
which simplifies to the Fourier-Bessel transform
%
\begin{equation}
\tilde h(k) = \frac{4\pi}{k} \int_0^\infty \!\! dr\, \sin(kr)\, r\, h(r)\,,
\label{eq:fFB}
\end{equation}
%
and
%
\begin{equation}
h(r) = \int\! \frac{d^3\kvec}{(2\pi)^3} \,e^{i\kvec\cdot\rvec} \,\tilde h(k)\,,\label{eq:ftinv}
\end{equation}
%
which simplifies to
%
\begin{equation}
h(r) = \frac{1}{2 \pi^2 r} \int_0^\infty \!\!dk\, \sin(kr)\, k\, \tilde h(k)\,.
\label{eq:bFB}
\end{equation}
%
In these terms the Ornstein-Zernike (OZ) relation is~\cite{HM06}
%
\begin{equation}
\tilde h(k) = \tilde c(k) + \rho\,
\tilde h(k)\, \tilde c(k)
\label{eq:oz1a}
\end{equation}
%
where $\rho$ is the density. This confirms the relevance of the
standard choice of normalisation of the 3d Fourier transform pair
which puts the factor $1/(2\pi)^3$ into the back transform. The OZ
relation can be rearranged to
%
\begin{equation}
\tilde h(k) = \frac{\tilde c(k)}{1-\rho \tilde c(k)}
\label{eq:oz1b}
\end{equation}
%
(\cf\ Eq.~(3.5.13) in \Refcite{HM06}).
The hyper-netted chain (HNC) closure is defined in real space and is
%
\begin{equation}
g(r)=\exp[-\beta v(r)+h(r)-c(r)]
\label{eq:hnc1a}
\end{equation}
%
(\cf\ Eq.~(4.3.19) in \Refcite{HM06}) where $\beta=1/\kT$. It
amounts the neglect of the bridge diagrams. For hard spheres HNC is
known to be inferior to Percus-Yevick, but for soft potentials like
DPD it generally gives excellent results. In the presence of hard
cores, we note that $\exp[-\beta v]$ is still well defined (and zero,
in fact) where $\beta v$ is infinite. We can accommodate hard cores
therefore by making sure that we always work with $\exp[-\beta v]$
instead of $\beta v$ in the numerics. The function $\exp[-\beta v]$
can be pre-computed for a given potential.
To obtain the algorithm implemented in the code we rewrite
\Eqsref{eq:oz1b} and \eqref{eq:hnc1a} in terms of $c(r)$ and
$e(r)$. The OZ relation becomes
%
\begin{equation}
\tilde e = \frac{\tilde c}{1-\rho\tilde c}-\tilde c
\label{eq:oz1c}
\end{equation}
%
and the HNC closure becomes
%
\begin{equation}
c=\exp[{-\beta v}+e]-e-1\,.
\label{eq:hnc1b}
\end{equation}
%
The algorithm is as follows. We start with some guess for the direct
correlation function $c(r)$. We Fourier transform this to $\tilde
c(k)$ and solve the OZ relation in \Eqref{eq:oz1c} to get the indirect
correlation function (in reciprocal space) $\tilde e(k)$. We Fourier
back-transform to get $e(r)$ and plug this into the HNC closure in the
form of \Eqref{eq:hnc1b} to get a new direct correlation function
$c(r)$. This cycle is iterated until $c(r)$ and $e(r)$ converge to a
self-consistent solution pair. A direct approach like this is usually
numerically unstable so in the Picard scheme we mix a little of the
new $c(r)$ into the old $c(r)$, and iterate until we converge to a
solution. In the Ng acceleration scheme we keep track of the
convergence trajectory and use this to accelerate convergence to the
solution. The details of the Ng scheme will not be described here,
rather we point the interested reader to \Refcite{Ng74} and the code
itself. The initial trajectory for the Ng scheme is generated by a
few Picard iterations. Some possible initial choices for the direct
correlation function $c(r)$ are zero, $-\beta v(r)$ and $\exp[-\beta
v(r)]-1$. For soft potentials any of these will do in principle but
the initial rate of convergence may differ. For hard core potentials,
the middle option cannot be used.
Now we describe Ng's splitting method for handling long range forces.
We partition the interaction potential into a short range part and a
long range part,
%
\begin{equation}
v(r)=v'(r)+v\lr(r)\,.
\end{equation}
%
It is generally accepted that $c(r)\sim-\beta v\lr(r)$ for
$r\to\infty$ so we make this explicit by partitioning both the direct
and indirect correlation functions,
%
\begin{equation}
c(r)=c'(r)-\beta v\lr(r)\,,\quad
e(r)=e'(r)+\beta v\lr(r)\,.
\end{equation}
%
These are taken to provide the definitions of the offset functions
$c'(r)$ and $e'(r)$. We rewrite the OZ relation and the HNC closure
in terms of these,
%
\begin{equation}
\tilde e\myprime=\frac{\tilde c\myprime-\beta\tildevlr}{1-\rho(\tilde
c\myprime-\beta\tildevlr)}-\tilde c\myprime
\label{eq:oz1d}
\end{equation}
and
\begin{equation}
c'=\exp[-\beta v'+e']-e'-1\,.
\label{eq:hnc1d}
\end{equation}
%
The first of these requires that we know the Fourier transform of the
long range part of the potential. The second requires that we know
the exponentiated short range potential. Any hard core interaction
can be parked safely in the latter but the consequential freedom to
specify $v\lr(r)$ inside the hard core should be used wisely!
The main advantage of the Ng split is that $c'(r)$ and $e'(r)$ are now
genuinely short-ranged so the numerical behaviour is much better,
certain thermodynamic integrals are guaranteed convergence, and the
expected asymptotic behaviour of $c(r)$ is explicitly incorporated.
The numerical solution scheme based on \Eqsref{eq:oz1d} and
\eqref{eq:hnc1d} goes through as before. The initial choices for
$c'(r)$ are replicated from above with $v$ replaced by $v'$.
\subsection{Multicomponent HNC}
%
Now we turn to the multicomponent problem. The pair functions
become for example $g_{\mu\nu}(r)$, \etc, and the problem is specified
by the interaction potential $v_{\mu\nu}(r)$ and the species densities
$\rho_\mu$. The total density is $\rho=\sum_\mu \rho_\mu$ and the
species mole fractions are $x_\mu=\rho_\mu/\rho$. We again split the
potential into short and long range contributions,
%
\begin{equation}
v_{\mu\nu}(r)=v'_{\mu\nu}(r)+ v\lr_{\mu\nu}(r)
\end{equation}
%
where typically $v\lr_{\mu\nu}(r)$ incorporates the long range part of
the charge interactions. Often the long range part satisfies a
symmetry condition (SYM) where
%
\begin{equation}
v\lr_{\mu\nu}(r)=z_\mu z_\nu v\lr(r)\quad\text{(SYM)}
\label{eq:sp}
\end{equation}
in which $z_\mu$ is the valency and $v\lr(r)$ is the interaction
potential between unit charges of the same sign. However we will not
assume that $v\lr_{\mu\nu}(r)$ necessarily meets the SYM condition. As
above we define $c'_{\mu\nu} = c_{\mu\nu} + \beta v\lr_{\mu\nu}$ and
$e'_{\mu\nu} = e_{\mu\nu} - \beta v\lr_{\mu\nu}$. The multicomponent
HNC closure becomes
%
\begin{equation}
c_{\mu\nu}'=\exp[-\beta v_{\mu\nu}'+e_{\mu\nu}']-e_{\mu\nu}'-1\,.
\label{eq:hncnd}
\end{equation}
%
To derive the OZ relation in a usable form we start from
the multicomponent analogue of \Eqref{eq:oz1a},
%
\begin{equation}
{\tilde h}_{\mu\nu} = {\tilde c}_{\mu\nu}+\rho\,{\textstyle\sum_\lambda}
\,x_\lambda\,{\tilde c}_{\mu\lambda}\,{\tilde h}_{\lambda\nu}\,.
\end{equation}
%
We write this as a matrix relation, introducing $R$ as a diagonal
matrix with entries $\rho_\mu=\rho x_\mu$,
%
\begin{equation}
{\tilde H}={\tilde C}+{\tilde C}\cdot R\cdot{\tilde H}\,.
\label{eq:oz2}
\end{equation}
%
Note that all the matrices in this are symmetric, so we can equally
well write this as
%
\begin{equation}
{\tilde H}={\tilde C}+{\tilde H}\cdot R\cdot{\tilde C}\,.
\label{eq:oz2a}
\end{equation}
%
Introducing next ${\tilde C}' = {\tilde C} + \beta{\tilde U}\lr$ and
${\tilde E}'={\tilde E}-\beta{\tilde U}\lr$ in \Eqref{eq:oz2}, and
rearranging, gives eventually
%
\begin{equation}
{\tilde E}'=[I-({\tilde C}'-\beta{\tilde U}\lr)\cdot R]^{-1}\cdot
[({\tilde C}'-\beta{\tilde U}\lr)\cdot R\cdot {\tilde C}'-\beta{\tilde
U}\lr]\,.
\label{eq:oznd}
\end{equation}
%
The solution scheme is essentially as before. Given an initial guess
for $c_{\mu\nu}'(r)$ we Fourier transform, evaluate the matrix
expression in \Eqref{eq:oznd}, and Fourier back-transform to obtain
$e_{\mu\nu}'(r)$. We substitute this into the HNC closure in
\Eqref{eq:hncnd} to obtain a new guess for $c_{\mu\nu}'(r)$. The
cycle is iterated to convergence and in practice a few Picard
iterations are used to pump-prime a multicomponent version of the Ng
acceleration scheme. As before, any hard core part of the potential
should be parked in $\exp[-\beta v_{\mu\nu}']$.
\subsection{Multicomponent MSA}
%
The closure in the mean spherical approximation (MSA) is
$g_{\mu\nu}(r)=0$ for $r\le d_{\mu\nu}$, and $c_{\mu\nu}(r)= -\beta
v_{\mu\nu}(r)$ for $r> d_{\mu\nu}$. Here, $d_{\mu\nu}$ is the range
of the hard core repulsion between species $\mu$ and $\nu$
(\ie\ $v'_{\mu\nu}=\infty$ for $r\le d_{\mu\nu}$). Rewriting as usual
in terms of our offset functions the MSA closure becomes
%
\begin{equation}
c'_{\mu\nu}=\Bigl\{\begin{array}{ll}
-e'_{\mu\nu}-1 & (r<d_{\mu\nu})\,,\\[3pt]
-\beta v'_{\mu\nu} & (r>d_{\mu\nu})\,.
\end{array}
\end{equation}
%
This is almost a drop-in replacement for the HNC closure in
\Eqref{eq:hncnd}. For a cold start we can initialise $c'_{\mu\nu}=-1$
for $r\le d_{\mu\nu}$, and we leave $c'_{\mu\nu}=-\beta v'_{\mu\nu}$
untouched for $r>d_{\mu\nu}$ during the iterative solution. We make
sure that whenever the potential is changed $c'_{\mu\nu}$ for
$r>d_{\mu\nu}$ is correctly set.
\subsection{Multicomponent RPA}\label{sec:RPA}
%
The RPA closure is a special case of the MSA when there are no hard
cores, and is represented by $c_{\mu\nu}(r)=-\beta v_{\mu\nu}(r)$.
This is in fact one of the choices for initialising the HNC solver.
Given the HNC machinery, the implementation of the RPA is trivial and
comprises a single round trip through the OZ solver starting from
$c'_{\mu\nu}(r)=-\beta v'_{\mu\nu}(r)$. No iteration is required.
\subsection{Multicomponent EXP}\label{sec:EXP}
%
The EXP approximation is a refinement of the MSA/RPA
in which the total correlation functions are replaced by
%
\begin{equation}
h_{\mu\nu}\to(1+\href_{\mu\nu})\exp(h_{\mu\nu}-\href_{\mu\nu})-1\,,
\label{eq:exp}
\end{equation}
%
in which $\href_{\mu\nu}$ will be a hard sphere reference fluid in
the case of MSA, and $\href_{\mu\nu}=0$ in the case of RPA (no hard
cores). The EXP breaks unwarranted symmetries such as
$h_{++}=-h_{+-}$ and ensures that $h_{\mu\nu}(r)>-1$ which is not
always satisfied by the MSA/RPA. In practice EXP can be nearly as
good as HNC and extends to state points where HNC doesn't have a
solution.
Since the EXP approximation is defined as an action on the correlation
functions in real space, a round trip through the OZ relation is
required to compute the corresponding offset direct and indirect
correlation functions. To do this we rewrite the OZ relation in
\Eqref{eq:oz2a} as
%
\begin{equation}
{\tilde C} = (I+{\tilde H}\cdot R)^{-1}\cdot{\tilde H}\,.
\label{eq:ozndb}
\end{equation}
%
With this implemented, $c'_{\mu\nu}=c_{\mu\nu}+\beta
v\lr_{\mu\nu}$ and $e'_{\mu\nu}= h_{\mu\nu} - c'_{\mu\nu}$ follow.
\subsection{Structural properties}
%
\subsubsection{Pair functions}
%
Given a converged solution pair $(c_{\mu\nu}', e_{\mu\nu}')$, the
total correlation functions can be evaluated from
%
\begin{equation}
h_{\mu\nu}(r) = c'_{\mu\nu}(r) + e'_{\mu\nu}(r)\label{eq:hrs}
\end{equation}
%
(note that $\beta v_{\mu\nu}\lr$ cancels). The pair functions are
given by $g_{\mu\nu}=\delta_{\mu\nu}+h_{\mu\nu}$.
\subsubsection{Structure factors}
%
For the partial structure factors, there is a choice of normalisation.
The present code defines
%
\begin{equation}
S_{\mu\nu}(k)
= \rho_\mu\delta_{\mu\nu} + \rho_\mu\rho_\nu{\tilde h}_{\mu\nu}
\qquad \text{(present definition)}\,,
\label{eq:skdef}
\end{equation}
%
where ${\tilde h}_{\mu\nu}={\tilde c}_{\mu\nu}\myprime + {\tilde
e}_{\mu\nu}\myprime$ (again, $\beta v_{\mu\nu}\lr$ cancels) and
(recall) $\rho_\mu=\rho x_\mu$\,; the Fourier transforms ${\tilde
c}_{\mu\nu}\myprime$ and ${\tilde e}_{\mu\nu}\myprime$ are available
as a byproduct of solving the OZ relation. With this normalisation
the structure factors obey $S_{\mu\nu}(k)\to\rho_\mu\delta_{\mu\nu}$
as $k\to\infty$. Two alternative normalisations are due to Aschroft
and Langreth \cite{AL67} and to Hansen and McDonald
\cite{HM06} respectively:
%
\begin{equation}
\begin{array}{llll}
S_{\mu\nu}(k)/\rho^{1/2}_\mu \rho^{1/2}_\nu
&= \delta_{\mu\nu} + \rho x^{1/2}_\mu x^{1/2}_\nu{\tilde h}_{\mu\nu}
&\quad& \text{(Ashcroft-Langreth)}\,,\\[6pt]
S_{\mu\nu}(k)/\rho
&= x_\mu\delta_{\mu\nu} + \rho x_\mu x_\nu{\tilde h}_{\mu\nu}
&& \text{(Hansen-McDonald)}\,.
\end{array}
\end{equation}
%
The present choice of normalisation is made to facilitate
the calculation of the density-density and charge-charge structure
factors \via\
%
\begin{equation}
S_{NN}(k) = \frac{\sum_{\mu\nu}S_{\mu\nu}(k)}{\sum_\mu\rho_\mu}\,,\quad
S_{ZZ}(k) = \frac{\sum_{\mu\nu}z_\mu z_\nu S_{\mu\nu}(k)}{\sum_\mu z_\mu^2\rho_\mu}\,.
\label{eq:snnszz}
\end{equation}
%
This ensures $S_{NN}$, $S_{ZZ}\to1$ as $k\to\infty$.
\subsection{Thermodynamics}
\label{sec:thermo}
%
The above sections specify the various closures for the
integral equation problem for multicomponent systems. We provide here
the suite of thermodynamic quantities which can be evaluated from the
converged solution pair $(c_{\mu\nu}', e_{\mu\nu}')$. Some care is
needed in the case of hard core potentials, where $v_{\mu\nu}=\infty$
for $r<d_{\mu\nu}$.
\subsubsection{Virial pressure}
%
The so-called virial route compressibility factor is
%
\begin{equation}
\frac{\beta p}{\rho}=1-\frac{2\pi}{3}\,{\textstyle \sum_{\mu\nu}}\,
\rho x_\mu x_\nu \int_0^\infty\!\!dr\,r^3\,\frac{\partial(\beta
v_{\mu\nu})}{\partial r} g_{\mu\nu}(r)
\end{equation}
%
(\cf\ Eq.~(1.2) in \Refcite{Vrbka09}). To handle the hard core
contribution to this we follow the line of argument presented in
Hansen and McDonald \cite{HM06} and introduce the function
$y_{\mu\nu}=\exp[\beta v_{\mu\nu}]\,g_{\mu\nu}$, which is continuous
through into the hard core region. The above integral can be written
%
\begin{equation}
\begin{split}
I_{\mu\nu}&=\int_0^\infty\!\!dr\,r^3\,\frac{\partial(\beta
v_{\mu\nu})}{\partial r} \exp[-\beta v_{\mu\nu}]\,y_{\mu\nu}(r)\\[6pt]
&{}\hspace{8em}{}=-\int_0^\infty\!\!dr\,r^3\,\frac{\partial(\exp[-\beta
v_{\mu\nu}])}{\partial r} \,y_{\mu\nu}(r)\,.
\end{split}
\end{equation}
%
Let us write
%
\begin{equation}
\exp[-\beta v_{\mu\nu}]=\Theta(r-d_{\mu\nu})\,\exp[-\beta \overline v_{\mu\nu}]
\end{equation}
%
where $\overline v_{\mu\nu}=v_{\mu\nu}$ for $r\ge d_{\mu\nu}$, and we
don't care what it does for $r<d_{\mu\nu}$ except that it should be
\emph{continuous} through $r=d_{\mu\nu}$. The Heaviside step function
$\Theta(x)=0$ for $x<0$ and $\Theta(x)=1$ for $x\ge0$, with derivative
$\Theta'(x)=\delta(x)$. Then
%
\begin{equation}
\begin{split}
I_{\mu\nu}&=-\int_0^\infty\!\!dr\,r^3\,\Bigl(\delta(r-d_{\mu\nu})
\exp[-\beta \overline v_{\mu\nu}])\\[3pt]
&{}\hspace{8em}{}+\Theta(r-d_{\mu\nu})
\frac{\partial(\exp[-\beta
\overline v_{\mu\nu}])}{\partial r} \Bigr)\,y_{\mu\nu}(r)\\[9pt]
&=-g_{\mu\nu}(d_{\mu\nu})\,d_{\mu\nu}^3+
\int_{d_{\mu\nu}}^\infty\!\!dr\,r^3\,\frac{\partial(\beta
v_{\mu\nu})}{\partial r} g_{\mu\nu}(r)
\end{split}
\end{equation}
%
In the second line we have restored $v_{\mu\nu}$ and $g_{\mu\nu}$.
Thus, finally,
%
\begin{equation}
\frac{\beta p}{\rho}=1
+\frac{2\pi}{3}\,{\textstyle \sum_{\mu\nu}}\,\rho x_\mu x_\nu
\Bigl[g_{\mu\nu}(d_{\mu\nu})\,d_{\mu\nu}^3
- \int_{d_{\mu\nu}}^\infty\!\!dr\,r^3\,\frac{\partial(\beta
v_{\mu\nu})}{\partial r} g_{\mu\nu}(r)\Bigr]
\end{equation}
%
This now contains explicitly the famous contact contribution to the
pressure, and the integral is now restricted to the region external to
the hard core. In the case of a soft potential (DPD, URPM), the
contact contribution vanishes and the integral extends to $r=0$.
In practice we write the integral contribution to the virial pressure as
%
\begin{equation}
-\frac{2\pi}{3}\int_{d_{\mu\nu}}^\infty\!\!dr\,r^3\,
\frac{\partial({\textstyle \sum_{\mu\nu}}\,
\rho x_\mu x_\nu\,\beta
v_{\mu\nu})}{\partial r}
+{\textstyle \sum_{\mu\nu}}\,
\rho x_\mu x_\nu t^{\mathrm{V}}_{\mu\nu}
\label{eq:vrpb}
\end{equation}
%
where
%
\begin{equation}
t^{\mathrm{V}}_{\mu\nu}=-\frac{2\pi}{3}\int_{d_{\mu\nu}}^\infty\!\!dr\,r^3\,
\frac{\partial(\beta v'_{\mu\nu}+\beta v_{\mu\nu}\lr)}{\partial r}
\,(c'_{\mu\nu}+e'_{\mu\nu})
\end{equation}
%
The first term in \Eqref{eq:vrpb} is the result for $g_{\mu\nu}=1$ and
is the mean-field contribution. For many applications it is important
to evaluate this analytically, as the individual contributions may
diverge. Under the SYM condition the contribution from
$v_{\mu\nu}\lr$ to the mean field term vanishes since charge
neutrality implies $\sum_{\mu\nu}\rho x_\mu x_\nu v_{\mu\nu}\lr
\propto v\lr(\sum_\mu \rho_\mu z_\mu)^2 = 0$. The second term in
\Eqref{eq:vrpb} is the correlation correction (note
$c'_{\mu\nu}+e'_{\mu\nu}=g_{\mu\nu}-1$).
\subsubsection{Compressibility}
%
The compressibility (not to be confused with the above
\emph{compressibility factor}) is
%
\begin{equation}
\frac{\partial(\beta p)}{\partial\rho}=
1-{\textstyle \sum_{\mu\nu}}\,\rho x_\mu x_\nu t^{\mathrm{C}}_{\mu\nu}
\end{equation}
%
where
%
\begin{equation}
t^{\mathrm{C}}_{\mu\nu}={4\pi}\int_0^\infty\!\!dr\,r^2\,(c_{\mu\nu}'(r)
-\beta v_{\mu\nu}\lr)
\end{equation}
%
(\cf\ Eq. (18) in \Refcite{Vrbka09}). In terms of this, the
isothermal compressibility is $\chi_T=[\rho(\partial
p/\partial\rho)]^{-1}$. The contribution from $v_{\mu\nu}\lr$ can
also often be evaluated analytically and vanishes under the SYM
condition by the same argument as above. Obviously the
compressibility can be integrated along an isotherm to obtain an
alternative expression for the pressure. This is the so-called
compressibility route to the equation of state. This expression is
insensitive to the presence of hard cores since they are supposed to
be contained in $v_{\mu\nu}'$ and enter \via\ the direct correlation
function.
\subsubsection{Energy}
%
The excess internal energy density is
%
\begin{equation}
\beta\uex\equiv
\frac{\beta \Uex}{V}=2\pi\rho\,{\textstyle \sum_{\mu\nu}}\,\rho x_\mu x_\nu
\int_{d_{\mu\nu}}^\infty\!\!dr\, r^2\, \beta v_{\mu\nu}(r)\,g_{\mu\nu}(r)
\end{equation}
%
(\cf\ Eq. (2.5.20) in \Refcite{HM06}). Again this can be split into
a mean field term and a correlation correction,
%
\begin{equation}
{\beta\uex}={2\pi\rho}\int_{d_{\mu\nu}}^\infty\!\!dr\,r^2\,
({\textstyle \sum_{\mu\nu}}\,\rho x_\mu x_\nu\,\beta
v_{\mu\nu})
+\rho\,{\textstyle \sum_{\mu\nu}}\,
\rho x_\mu x_\nu t^{\mathrm{E}}_{\mu\nu}
\end{equation}
%
where
%
\begin{equation}
t^{\mathrm{E}}_{\mu\nu}={2\pi}\int_{d_{\mu\nu}}^\infty\!\!dr\,r^2\,
(\beta v'_{\mu\nu}+\beta v_{\mu\nu}\lr)\,(c'_{\mu\nu}+e'_{\mu\nu})\,.
\end{equation}
%
An integration by parts shows that the mean field term here is related
to that for the compressibility factor,
%
\begin{equation}
{2\pi}\int_{d_{\mu\nu}}^\infty\!\!dr\,r^2\,
\beta v_{\mu\nu}
=
-\frac{2\pi\beta v_{\mu\nu}(d_{\mu\nu})\,d_{\mu\nu}^3}{3}
-\frac{2\pi}{3}\int_{d_{\mu\nu}}^\infty\!\!dr\,r^3\,
\frac{\partial(\beta
v_{\mu\nu})}{\partial r}\,.\label{eq:same}
\end{equation}
%
The equation of state can be derived from the internal energy and this
is the so-called energy route.
\subsubsection{Free energy and chemical potentials}\label{subsec:aex}
%
Last, \emph{only valid for the HNC closure}, are expressions for the
free energy and chemical potentials. The excess free energy density
can be written as
%
\begin{equation}
\begin{split}
\beta\aex\equiv\frac{\beta\Aex}{V}&=\frac{1}{2}\int\!d^3\rvec\,
{\textstyle \sum_{\mu\nu}}\,\rho_\mu \rho_\nu
(\half h_{\mu\nu}^2-c_{\mu\nu})\\[6pt]
&\qquad{}+ \frac{1}{2}\int\!\frac{d^3\kvec}{(2\pi)^3}\,
[\ln\det(I-R\cdot {\tilde C})+ \Tr R\cdot {\tilde C} ]\,.
\end{split}
\end{equation}
%
The first (real space) term has been simplified from the literature
expressions (\cf\ Eq.~(5.1) in \Refcite{Hir60} or Eq.~(30) in
\Refcite{LB94}), by inserting the HNC closure \Eqref{eq:hncnd}. The
second (reciprocal space) term is couched in terms of the $R$ and
$\tilde C$ matrices introduced in \Eqref{eq:oz2}: $R$ as a diagonal
matrix with entries $\rho_\mu=\rho_\mu=\rho x_\mu$ and ${\tilde C}$ is
the matrix with entries ${\tilde c}_{\mu\lambda}$.
For the real space part,
$\beta\aex{}^{,1} = (\rho/2)\, {\textstyle \sum_{\mu\nu}}\,\rho x_\mu
x_\nu t^{\mathrm{A}}_{\mu\nu}$ where
%
\begin{equation}
t^{\mathrm{A}}_{\mu\nu}={4\pi}\int_0^\infty\!\!dr\,r^2\,
[\half (c_{\mu\nu}'(r)+e_{\mu\nu}'(r)]^2-
c_{\mu\nu}'(r)+\beta v_{\mu\nu}\lr]\,.
\end{equation}
%
The last term in this is same as that appearing in the compressibility
(to within an overall sign) and often can be evaluated analytically.
We split the reciprocal space part into the separate contributions
from the determinant and the trace. For the former we use $\ln\det
M=\half\,\sum_i\ln |\lambda_i|^2$ where the sum is over the
eigenvalues $\lambda_i$ of $M=I-R\cdot{\tilde C}$. Note that this matrix is not
symmetric and the eigenvalues may be complex. For the latter we write
the trace as $\sum_\mu \rho_\mu ({\tilde c}_{\mu\mu}'-\beta {\tilde
v}_{\mu\mu}\lr)$ and we note from the definition of the inverse
Fourier transform in \Eqref{eq:ftinv} that $(2\pi)^{-3}\!\int\!
d^3\kvec\, {\tilde v}_{\mu\mu}\lr=v_{\mu\mu}\lr(0)$, \ie\ the long
range potential in real space evaluated at $r=0$. Thus
the reciprocal space contribution is computed from
%
\begin{equation}
\beta\aex{}^{,2}=\frac{1}{4\pi^2}\int_0^\infty\!\!dk\,k^2\,
\bigl[\half{\textstyle\sum_i}\ln|\lambda_i(k)|^2
+ {\textstyle\sum_\mu} \rho_\mu {\tilde c}_{\mu\mu}'(k)\bigr]
-\half{\textstyle\sum_\mu} \rho_\mu v_{\mu\mu}\lr(0)\,.
\end{equation}
%
The final excess free energy density is $\aex = \aex{}^{,1} +
\aex{}^{,2}$. The above expressions are insensitive to the presence
of hard cores.
The corresponding chemical potentials are
%
\begin{equation}
\beta\muex_\mu = 4\pi\,{\textstyle \sum_{\nu}}\,\rho x_\nu
\int_0^\infty\!\!dr\, r^2\,
[\half\,h_{\mu\nu}(r)\,e_{\mu\nu}(r)-c_{\mu\nu}(r)]\quad
\Bigl(\>{}\equiv\ln\gamma_\mu\>\Bigr)
\end{equation}
%
(\cf\ section II\,C in \Refcite{Vrbka09}). This
also defines the activity $\gamma_\mu$.
We
write this result as $\beta\muex_\mu = {\textstyle \sum_{\nu}}\,\rho x_\nu
t^{\mathrm{M}}_{\mu\nu}$ where
%
\begin{equation}
t^{\mathrm{M}}_{\mu\nu}=
4\pi \int_0^\infty\!\!dr\, r^2\,
[\half\,(c'_{\mu\nu}+e'_{\mu\nu})(e'_{\mu\nu}+\beta v_{\mu\nu}\lr)
-c'_{\mu\nu}+\beta v_{\mu\nu}\lr]\,.
\end{equation}
%
The contribution from $v_{\mu\nu}\lr$ (the last term) also appears in
the free energy and is computed separately (analytically). These
expressions are also insensitive to the presence of hard cores.
\section{Potentials}
%
\subsection{DPD potential}
\label{sec:dpd}
%
The code contains routines which specify a multicomponent
potential for dissipative particle dynamics (DPD) with possible
charges. The potential in this case consists of short range and long
range contributions which can be mapped exactly to the Ng split. The
short range part is
%
\newcommand{\rc}{r_c}
\newcommand{\lB}{l_{\mathrm{B}}}
\begin{equation}
\beta v'_{\mu\nu}(r)=\left\{\begin{array}{ll}
\frac{1}{2}A_{\mu\nu}(1-r/\rc)^2 & r<\rc\\[3pt]
0 & r \ge \rc
\end{array}\right.\,.
\end{equation}
%
This is a conventional choice, depending on a dimensionless symmetric
repulsion amplitude matrix $A_{\mu\nu}$ and cut off beyond a
distance $\rc$.
\subsubsection{Gaussian charges}
%
Unlike the short range part there is no consensus on the best choice
for the long range interaction although the differences can always be
adsorbed into a redefinition of the short range potential.\footnote{By
writing $\beta {\tilde v}\lr(k)=4\pi\lB
k^{-2}(1+k^2\sigma^2/n)^{-n}$, there is a natural hierarchy going
from Bessel ($n=1$), approximate ($n=2$) and exact ($n=4$) Slater,
Gaussian ($n\to\infty$).}
The \emph{default} choice of Gaussian charges can be supported for a
range of practical reasons \cite{WVA+13, WV14}. The Gaussian charges
have size $\sim\sigma$ and a density distribution
$(2\pi\sigma^2)^{-3/2} \exp({-r^2/2\sigma^2})$. The corresponding
interaction satisfies the SYM condition and is given by
%
\begin{equation}
v_{\mu\nu}\lr(r)=z_\mu z_\nu v\lr(r)\,,\quad
\beta v\lr(r)=\frac{\lB}{r}
\erf\Bigl(\frac{r}{2\sigma}\Bigr)\,,\quad
\beta v\lr(0)=\frac{\lB}{\sigma\sqrt{\pi}}\>,
\label{eq:dpdvlr}
\end{equation}
%
where $\lB$ is the coupling strength (the Bjerrum length). The
precise definition of $\sigma$ is made to simplify the Fourier
transform (see below).
For use with the above expressions, we need the derivative of both
parts of the potential, and the Fourier transform of the long range
part. These are
%
\begin{equation}
\frac{\partial(\beta v_{\mu\nu}')}{\partial r}=
\left\{\begin{array}{ll}
-(A_{\mu\nu}/\rc)(1-r/\rc) & r<\rc\\[3pt]
0 & r \ge \rc
\end{array}\right.
\end{equation}
%
\begin{equation}
\frac{\partial(\beta v\lr)}{\partial r}=
-\frac{\lB}{r^2}
\erf\Bigl(\frac{r}{2\sigma}\Bigr)
+\frac{\lB}{r\sigma\sqrt\pi}\,
e^{-r^2/4\sigma^2}\,,
\end{equation}
%
and
%
\begin{equation}
\beta {\tilde v}\lr(k)=\frac{4\pi\lB}{k^2}\times e^{-k^2\sigma^2}\,.
\end{equation}
%
The mean field contributions to the virial route pressure and energy
are given by (see also \Eqref{eq:same})
%
\begin{equation}
{2\pi}\int_0^\infty\!\!dr\,r^2\,
({\textstyle \sum_{\mu\nu}}\,\rho x_\mu x_\nu\,\beta
v_{\mu\nu})=\frac{\pi\rc^3}{30}\,{\textstyle
\sum_{\mu\nu}}\,
\rho x_\mu x_\nu A_{\mu\nu}\,.
\end{equation}
%
Because of the SYM condition, the contribution from $v\lr$ vanishes
from this, and also vanishes from the mean field contributions to the
compressibility and chemical potentials (this is true for all the
cases in this section).
This DPD model depends on the dimensionless repulsion amplitude matrix
$A_{\mu\nu}$, the ratios $\lB/\sigma$ and $\sigma/\rc$, and the
dimensionless density $\rho r_c^3$ \cite{WVA+13}. In these terms
$\rc=1$ is often used as the fundamental length scale. The ratio
$\lB/\sigma$ plays the role of an inverse effective temperature for
the Coloumbic part of the potential.
\subsubsection{Bessel charges}
%
If Bessel charges are selected the charge distribution becomes
$K_1(r/\sigma) / 2\pi^2\sigma^2 r$ and the expressions change to
\cite{WV14}
%
\begin{equation}
\beta v\lr(r)=\frac{\lB}{r}(1-e^{-r/\sigma})\,,\quad
\beta v\lr(0)=\frac{\lB}{\sigma}\,,
\end{equation}
%
\begin{equation}
\frac{\partial(\beta v\lr)}{\partial r}=
-\frac{\lB}{r^2}\Bigl[1-e^{-r/\sigma}\Bigl(1+\frac{r}{\sigma}\Bigr)\Bigr]\,,
\end{equation}
%
\begin{equation}
\beta {\tilde v}\lr(k)=\frac{4\pi\lB}{k^2}\times\frac{1}{1+k^2\sigma^2}\,.
\end{equation}
%
Note that $\sigma$ here is chosen to match the second moment of the
charge distribution for the Gaussian case.
\subsubsection{Linear charge smearing}
%
Another alternative is linear charge smearing proposed by Groot
\cite{Groot03}. In this case the charge distribution is $(3/\pi
R^3)(1-r/R)$ for $r<R$, vanishing for $r>R$. This gives rise to an
interaction potential in reciprocal space \cite{WV14}
%
\begin{equation}
\beta {\tilde v}\lr(k)=\frac{4\pi\lB}{k^2}
\Bigl(\frac{24-24\cos kR-12kR\sin kR}{k^4R^4}\Bigr)^2\,.
\end{equation}
%
A closed form expression in real space is not available, hence is not
implemented in the code. This means that the thermodynamics is
\emph{not available} in this case, though the HNC solution goes
through since this only requires the reciprocal space potential. The
term in large brackets is the charge density in reciprocal space.
Matching the second moment of the charge distribution \cite{WV14}
shows that the equivalent Gaussian smearing length is
$\sigma=R\sqrt{2/15}$.
\subsubsection{Approximate Slater smearing}
%
Another popular alternative is Slater smearing proposed by
Gonz\'alez-Melchor \etal\ \cite{GM+06}. They use an approximate
expression for the interaction potential, for which we have
%
\begin{equation}
\beta v\lr(r)=\frac{\lB}{r}\Bigl[1-e^{-2\varbeta r}(1+\varbeta r)\Bigr]\,,
\quad \beta v\lr(0)=\varbeta\lB\,,
\label{eq:slaterapprox}
\end{equation}
%
\begin{equation}
\frac{\partial(\beta v\lr)}{\partial r}=
-\frac{\lB}{r^2}\Bigl[1-e^{-2\varbeta r}(1+2\varbeta r(1+\varbeta r))\Bigr]\,,
\end{equation}
%
\begin{equation}
\beta {\tilde v}\lr(k)=\frac{4\pi\lB}{k^2}
\times\frac{1}{(1+k^2/4\varbeta^2)^2}\,.
\end{equation}
%
These actually corresponds to a charge density $\varbeta^2
e^{-2\varbeta r}/\pi r$ where $\varbeta$ is a smearing parameter, not
to be confused with $\beta=1/\kT$. The equivalent Gaussian smearing
length is here $\sigma=1/\varbeta\sqrt{2}$.
\subsubsection{Exact Slater smearing}
%
The intended charge density in Slater smearing is
$(1/\pi\lambda^3)e^{-2r/\lambda}$. It turns out that there are exact
expressions for the interaction between such charges \cite{WV14},
%
\begin{equation}
\beta v\lr(r)=\frac{\lB}{r}\Bigl[1-e^{-2r/\lambda}\Bigl(
1+\frac{11r}{8\lambda}+\frac{3r^2}{4\lambda^2}
+\frac{r^3}{6\lambda^3}\Bigr)\Bigr]\,,
\quad \beta v\lr(0)=\frac{5\lB}{8\lambda}\>,
\label{eq:slaterexact}
\end{equation}
%
\begin{equation}
\frac{\partial(\beta v\lr)}{\partial r}=
-\frac{\lB}{r^2}\Bigl[1-e^{-2r/\lambda}\Bigl(
1+\frac{2r}{\lambda}+\frac{2r^2}{\lambda^2}
+\frac{7r^3}{6\lambda^3}+\frac{r^4}{3\lambda^4}\Bigr)\Bigr]\,,
\end{equation}
%
\begin{equation}
\beta {\tilde v}\lr(k)=\frac{4\pi\lB}{k^2}
\times\frac{1}{(1+k^2\lambda^2/4)^4}\,.