$$\newcommand{\braketmatrix}[3]{\left \langle #1 \middle \rvert #2 \middle \rvert #3 \right \rangle}$$
# Day 2: "Beyond-DFT" calculations in practice with JDFTx + BGW

## Introduction

<ul>
This tutorial provides an example of how JDFTx and BerkeleyGW can be combined to calculate GW@DFT electronic structures. BerkeleyGW is needed for this method because JDFTx cannot calculate the necessary dielectric and self-energy matrices. For this tutorial, we will be calculating the HOMO-LUMO values for a H$_2$O molecule in vacuum and in SaLSA implicit solvation (with water as the solvent). We will compare the effect of solvation on the HOMO and LUMO states. 
</ul>
<ul>
If you are interested in learning more about the formalism/results from using this feature please see our paper entitled "Impact of solvation on the GW quasiparticle spectra of molecules", which has been recently accepted into the Journal of Applied Physics and should be made available in final published form within the next couple of weeks. 
</ul>
<ul>
We note that this tutorial is only a very brief overview of the capability of BerkeleyGW and the theory behind these calculations. If you are interested in running calculations like this, it is highly recommended to read more about the BerkeleyGW code:
</ul>
<ul>
    
1. [BerkeleyGW website](https://berkeleygw.org/)
2. Jack Deslippe, Georgy Samsonidze, David A. Strubbe, Manish Jain, Marvin L. Cohen, and Steven G. Louie, [“BerkeleyGW: A Massively Parallel Computer Package for the Calculation of the Quasiparticle and Optical Properties of Materials and Nanostructures”](https://www.sciencedirect.com/science/article/pii/S0010465511003912?via%3Dihub), Comput. Phys. Commun. 183, 1269 (2012) 

</ul>
<ul>
and the GW approximation formalism for semiconductors and metallic systems, with a particular focus on the correct method for converging GW approximation calculations. 
</ul>

## Workflow overview
<ul>
GW@DFT calculations (GW calculations based off of a DFT starting point) require multiple steps, which are listed below:
</ul>
<ul>
    
1. Calculate DFT charge densities using DFT-relaxed structures. This step is typically run with a limited number of unoccupied bands to save computational expense. This step occurs in the 1-dft/ directories.
2. Determine the k/q-grid that will be used to calculate the dielectric matrix $\epsilon$ and self-energy $\Sigma$. This step occurs in the 2-generatekgrid/ directories. 
3. (Ignored for vacuum calculation) If running a solvated GW calculation, calculate the fluid polarizability that will be added to the electronic polarizability in 5-epsilon later. This step occurs in the 3-chi/ directory. 
4. Calculate the eigenvalues of many additional unoccupied bands starting from the DFT charge density and structure. This step occurs in the 4-wfn/ directories. 
5. Calculate the dielectric matrix using the wavefunction generated in Step 4. If you are running a calculation using the liquid polarizability from Step 3, it is added to the electronic polarizability prior to the calculation of $\epsilon$. This step occurs in the 5-epsilon/ and 5-epsilon+chi/ directories. 
6. Calculate the self-energy and the GW quasiparticle eigenvalues. This occurs in the 6-sigma/ and 6-sigma+chi/ directories. Multiple of these calculations may need to be run if one wishes to reach self-consistency in either G or W.
</ul>
<ul>
Here, steps 1, 3, and 4 will be run using JDFTx and steps 5 and 6 will be run using BerkeleyGW. Step 2 only requires running a simple script provided by BerkeleyGW. 
</ul>
<ul>
In this tutorial, these steps can be performed by running the various executables in the 01-h2o_vacuum/ and 02-h2o_salsa/ directories in numerical order by their prefix (run the script starting with 01_ first, 02_ second, etc.). 
</ul>
<ul>
To start, please descend into the 01-h2o_vacuum/ directory. We will first calculate the GW quasiparticle eigenvalues for H$_2$O in vacuum. Once you have completed all 6 of the below Steps, please return to Step 1, navigate to the 02-h2o_salsa/ directory and repeat all steps again, but this time also including the subsections for Steps 5 and 6 for the +chi/ directories. After completing these steps, return to this directory and run the final_compare_eigenvalues.ipynb code. The update_submitfiles.sh utility has been included only for convenience if you need to update all of the module submit.sh files for some reason. You likely won't need to use it. 
</ul>

## Very brief introduction to the formalism
This is an extremely condensed introduction towards the use of solvent screening in GW calculations. A longer version is located at the end of this document. 

In the GW formalism, G refers to the one-body Green's function and W the dynamically screened Coulomb interaction. We use the single-particle wavefunctions from DFT as our quasiparticle wavefunctions (the diagonal approximation) and iterate to self-consistency in the quasiparticle energies that enter into the Green's function G in the GW approximation. GW calculations carried out using the DFT vacuum or SaLSA wavefunctions are labeled as GW@GGA or GW@GGA+SaLSA, respectively. 

The self-energy operator $\Sigma$ depends on the screened Coulomb interaction,
\begin{equation}
W_{\textbf{G}\textbf{G}'}(\textbf{q};\omega)
= \epsilon^{-1}_{\textbf{G}\textbf{G}'}(\textbf{q};\omega)
v(\textbf{q}+\textbf{G}'),
\end{equation}
where $v$ is the bare Coulomb interaction, $\epsilon$ is the full-frequency dielectric matrix. Within the random phase approximation $\epsilon$ is given by
\begin{equation}
\epsilon_{\textbf{G}\textbf{G}'}(\textbf{q};\omega)=\delta_{\textbf{G}\textbf{G}'}-v(\textbf{q}+\textbf{G})\chi^0_{\textbf{G}\textbf{G}'}(\textbf{q};\omega).
\end{equation}
Note that this is why RPA and GW are frequently referred to in "beyond-DFT" discussions. The RPA is typically used in the GW formalism, but also enables one to also take this polarizability and calculate total energies. 

Above, $\chi^0$ is the independent-electron polarizability. To account for solvent screening, we replace $\chi^0$ with $\chi^{solv} = \chi^0 + \chi^{lq}$, where $\chi^{lq}$ is the independent-particle susceptibility of the liquid using an implicit solvation model. This approach is labeled GW@GGA+SaLSA+$\chi^{lq}$ below and we use the nonlocal susceptibility from the SaLSA solvation model. The nonlocality of the SaLSA model leads to $\chi^{lq}_{\textbf{GG}'} \to 0$ as $\textbf{G} \to \infty$, where $\textbf{G}$ are reciprocal-lattice vectors. This allows the liquid susceptibility to be converged with a small plane wave cutoff, in comparison to the $\chi^{lq}_{\textbf{GG}'} \propto \textbf{G}\cdot\textbf{G}'$ of local models, that require additional numerical care in constructing and inverting $\epsilon_{\textbf{GG}'}$. Additionally, the lack of empiricism in the SaLSA model is appealing for an ab-initio approach to solvated beyond-DFT calculations. 

## Step 0 - Open the README.md file and a terminal window
<ul>
This tutorial will be run using the terminal and a Jupyter notebook. Please keep this README.md preview open and open a new terminal tab that you can use to run code on the terminal command line. These commands can be copied and pasted into the command line and will be formatted like this:
</ul>
<ul>
    
```bash
./XX_example_script.sh
```

</ul>
<ul>
Please open the needed .ipynb files by double-clicking on them in the the file navigator to the left. If Jupyter ever needs you to select a kernel due to a restart, please select 'BEAST Python' from the list. All .ipynb should already have this set (which you can see in the top right corner). 
</ul>
<ul>
Note that any scripts with the name format XX_run_???.sh submit jobs to the queue. Please do not run these scripts multiple times in a row. If, for some reason, you do need to resubmit a job, please check that the previously submitted job has finished with "sq" (the alias of "squeue -u YOUR_USERNAME" you should have set earlier from the SETUP document). You can cancel jobs with "scancel THE_JOB_ID_NUMBER".
</ul>

## Step 1 - DFT job
<ul>
Descend into 1-dft/ in both your terminal (cd 1-dft) and the file navigator to the left. First, let's visualize the structure we are running. Open the 01a_visualize_structure.ipynb jupyter notebook in a new tab. Then, click on the code block and hit "Shift+Enter" to run it. You should see a molecule render (you may need to zoom in or out some). 
</ul>
<ul>
Once you are done looking at the molecule, run the following terminal command:
</ul>
<ul>
    
```bash
./01b_run_dft.sh
```

</ul>
<ul>
Verify that this job has run sucessfully by examining the output file (name: "out"). You should see the usual timing lines printed at the end of the file. Additionally, the total energy close to the end should be: Etot = -17.0233 Ha for vacuum and -17.0337 Ha for SaLSA when you get to it. The input tags used here closely mirror those used in previous JDFTx DFT tutorials. This calculation uses a 20 Ha planewave cutoff. Note that this value is underconverged to allow these calculations run quickly. The correct value will depend on your pseudopotentials. Why is this? Note that the SaLSA run took significantly longer to complete (about 10 minutes) than the vacuum run (or your previous CANDLE runs). 
</ul>
<ul>
If the job has run successfully, navigate back up a directory (cd ../) on both your terminal and file navigator to the left. 
</ul>
    
## Step 2 - BerkeleyGW k/q-grid generation
<ul>
Descend into 2-generatekgrid/ and run:
</ul>
<ul>
    
```bash
./02_gen_kgrid.sh
```

</ul>
<ul>
Ignore all the Lmod/MODULEPATH and conda messages, these happen because the script is (un)loading some modules to get into the right environment that conflict with JDFTx. This is a simple script that runs the kgrid.x executable provided by BerkeleyGW. kgrid.x takes kgrid.in as input, produces a list of k/q-points in kgrid.out, and logs relevant symmetry information used to generate kgrid.out in kgrid.log. 
</ul>
<ul>
This step is (usually) necessary because BerkeleyGW requires the user to provide an explicit list of k/q-points rather than specifying a grid folding like typically done in DFT calculations. GW calculations do not necessarily need to be run on the same grid folding as DFT calculations but will for this tutorial. For molecules run with a single point this step is not particularly interesting/important. The kgrid.out file contains the list of points that will be provided to BerkeleyGW. However, the list needs to be converted into the format expected by JDFTx by adding the "kpoint" tag to each point and normalizing all of the k-point weights in the right column to a sum of 1. This has already been done and the kgrid.jdft file contains this information. It will be copied to the 3-chi/ and 4-wfn/ directories by scripts in Steps 3 and 4.  
</ul>
<ul>
Navigate back up a directory. 
</ul>

## Step 3 (only for 02-h2o_salsa) - JDFTx liquid chi calculation
<ul>
Now we are ready to set up the JDFTx calculation of the liquid polarizability file. Descend into 3-chi/ and run:
</ul>
<ul>
    
```bash
./03a_setup_chi.sh
```
   
</ul>
<ul>
This script copies input and output files from Step 1 for reuse. This is run at fixed DFT charge density to save computational expense. 
</ul>
<ul>
Next, run:
</ul>
<ul>
    
```bash
./03b_run_chi.sh
```

</ul>
<ul>
to start the job. It will take about 90 seconds to run. While the job is running, look at the input file for this job (name: "in") and see what has changed as compared to the "in" file in 1-dft/. The important things to note are:
</ul>
<ul>

1. Fewer dump tags are used because we only need some files printed for BerkeleyGW to read later. 
2. The k-grid tags have changed to not expand the k-grid automatically because we read in kgrid.jdft (the "include kgrid.jdft" tag). 
3. We have added a new tag called "bgw-params". This tag controls what we print for GW@DFT calculations. Here, we specify that we want the liquid polarizability file using "EcutChiFluid 2.5" (note that this cutoff is the same screened cutoff in epsilon.inp and sigma.inp later but in Ha). The subtags starting with "freq" here are to ensure that the frequency grid printed in the polarizability file matches the grid used in the epsilon calculation later.

</ul>
<ul>
Verify that this job has run sucessfully by examining the output file (name: "out"). You should now see a file named jdft.bgw.chi0Fluid.h5, which contains the solvent polarizability matrix that will be read in during Step 5. 
</ul>
<ul>
Navigate back up a directory. 
</ul>

## Step 4 - JDFTx empty state generation
<ul>
Now we are ready to set up the JDFTx empty state generation calculation for later use in Step 5. Descend into 4-wfn/ and run:
</ul>
<ul>
    
```bash
./04a_setup_wfn.sh
```
    
</ul>
<ul>
This script copies input and output files from Step 1 for reuse. The wavefunction generation calculation is run at fixed DFT charge density. 
</ul>
<ul>
Next, run:
</ul>
<ul>
    
```bash
./04b_run_wfn.sh
```
    
</ul>
<ul>
to start the job. It will take about 2 minutes to run. While the job is running, note that the input file for this job (name: "in") is very similar to the one in 3-chi/. The only change is for the bgw-params tag, which now specifies "nBandsDense 1000". This input tells JDFTx to generate a wavefunction with 1000 empty bands, rather than the few used in the DFT calculation. 
</ul>
<ul>
Verify that this job has run sucessfully by examining the output file (name: "out"). To check that the wavefunction was generated correctly, run:
</ul>
<ul>
    
```bash
./04c_analyze_wfn.sh
```
    
</ul>
<ul>
This script runs a BerkeleyGW utility that compiles important information in the wavefunction into a human-readable condensed format file called "wfn_info.txt". Open this file and examine some of the information there if you wish. In the K-POINTS section, you should see that 1000 bands are present and you should see the same list of points listed in kgrid.jdft. The ifmax field lists the highest occupied band for each k/q-point, are these results what you would expect for this system? 
</ul>
<ul>
Note that another jdft.bgw.vxc.dat file was created during this job. This file is needed for the BerkeleyGW sigma calculation later for GW calculations.
</ul>
<ul>
Navigate back up a directory. 
</ul>
    
## Step 5 - BerkeleyGW epsilon calculation
<ul>
Descend into 5-epsilon/ and run:
</ul>
<ul>
    
```bash
./05a_setup_eps.sh
./05b_run_eps.sh
```
    
</ul>
<ul>
to run the job. It will take under 1 minute to finish. You should see that the "Head of Epsilon Inverse" is 1 and "Epsilon Inverse(2,2)" is 9.568E-01 at the end of the "out" file. Coulomb truncation ensures the Head of epsilon is 1. 
</ul>
<ul>
    
### BerkeleyGW input file and job setup
</ul>
<ul><ul>
This is a highly abridged introduction to GW using BerkeleyGW. It is highly recommended to read their documentation in detail as well.
</ul></ul>
<ul><ul>
Open the epsilon.inp file to see the information specified there. Here are some highlights: cell_box_truncation truncates the Coulomb interaction in all 3 directions. The q-point grid almost matches kgrid.jdft from earlier steps. The epsilon_cutoff tag specifies the screened cutoff to use in the job. The epsilon_cutoff and number_bands tags are the two most important convergence criteria tags in these calculations. Like RPA, GW calculations require the inclusion of many unoccupied states. The frequency tags specify the frequency grid used to calculate the polarizability and other internal tags specific to BerkeleyGW. 
</ul></ul>
<ul><ul>
The epsilon job reads in the wavefunction generated in the previous step. However, because this wavefunction is generally dozens or hundreds of gigabytes, we typically create a symbolic link to it to save space. The symbolic links were created by running the ./05#_setup_eps.sh script. If you run "ls -l" in the terminal, you will see that the file named "WFN.h5" points to the original wavefunction. 
</ul></ul>
<ul><ul>
This job will create the eps0mat.h5 (and epsmat.h5 for more k/q-points beyond the q0 point) file. This file contains the dielectric matrix and will be read in in the following sigma calculation step. 
</ul></ul>
<ul>
Navigate back up a directory. 
</ul>
<ul>
    
### (Only for 02-h2o_salsa)
</ul>
<ul><ul>
Descend into 5-epsilon+chi/ and run:
</ul></ul>
<ul><ul>
    
```bash
./05c_setup_epschi.sh
./05d_run_epschi.sh
```
    
</ul></ul>
<ul><ul>
to run the job. It will take under 1 minute to finish. You should see that the "Head of Epsilon Inverse" is 1 and "Epsilon Inverse(2,2)" is 4.615E-01 at the end of the "out" file. Note the presence of a new linked file named chi0mat_add.h5. Run "ls -l" to see the file it is linked to. It should be the file discussed in Step 3. 
</ul></ul>
<ul><ul>
Navigate back up a directory. 
</ul></ul>

<ul><ul>
Run:
</ul></ul>
<ul><ul>
    
```bash
./05e_compare_eps_inputfiles.sh
```
    
</ul></ul>
<ul><ul>
to see how the epsilon.inp tags change for each run. These two new tags are the only changes needed in BerkeleyGW to enable reading of the JDFTx liquid polarizability file. 
</ul></ul>

## Step 6 - BerkeleyGW sigma calculation
<ul>
Descend into 6-sigma/ and run:
</ul>
<ul>
    
```bash
./06a_setup_sigma.sh
./06b_run_sigma.sh
```
    
</ul>
<ul>
to run the job. It will take under 1 minute to finish. You should see the eqp1.dat file created with several rows of data. 
</ul>
<ul>
    
### BerkeleyGW input file and job setup
</ul>
<ul><ul>
This is a highly abridged introduction to GW using BerkeleyGW. It is highly recommended to read their documentation in detail as well.
</ul></ul>
<ul><ul>
Open the sigma.inp file to see the information specified there. Here are some highlights: cell_box_truncation truncates the Coulomb interaction in all 3 directions. The q-point grid almost matches kgrid.jdft from earlier steps. The screened_coulomb_cutoff tag specifies the screened cutoff to use in the job and should match the epsilon.inp cutoff. The screened_coulomb_cutoff and number_bands tags are the two most important convergence criteria tags in these calculations. Like RPA, GW calculations require the inclusion of many unoccupied states. The frequency tags specify the method used to calculate the self-energy and other internal tags specific to BerkeleyGW. band_index_min/max specify the range (starting index of 1) of bands over which you want to actually calculate the quasiparticle eigenvalues. Increasing this range can greatly increase the cost of the sigma job. We only care about bands near the Fermi level here (and usually), and thus specify a much smaller range than the 500 total requested in the epsilon calculation previously. 
</ul></ul>
<ul><ul>
The sigma job reads in the wavefunction generated in the previous step (note the new name!). However, because this wavefunction is generally dozens or hundreds of gigabytes, we typically create a symbolic link to it to save space. The symbolic links were created by running the ./06#_setup_eps.sh script. If you run "ls -l" in the terminal, you will see that the file named "WFN_inner.h5" points to the original wavefunction. This job also reads in the eps0mat.h5 (and epsmat.h5 file if present) file. This file is how the solvent polarizability change is passed to the self-energy calculation. The vxc.dat file is linked back to the jdft.bgw.vxc.dat file you already generated in Step 4. 
</ul></ul>
<ul><ul>
This job will create the eqp1.dat file (along with several other files we will ignore for now). This file contains the quasiparticle eigenvalues for each k/q-point. Going left-to-right the first 4 columns specify each spin index, band index (matches band_index_min/max), DFT eigenvalue, and GW eigenvalue. 
</ul></ul>
<ul>
Navigate back up a directory. 
</ul>
<ul>
    
### (Only for 02-h2o_salsa)
</ul>
<ul><ul>
Descend into 6-sigma+chi/ and run:
</ul></ul>
<ul><ul>
    
```bash
./06c_setup_sigmachi.sh
./06d_run_sigmachi.sh
```
    
</ul></ul>
<ul><ul>
to run the job. It will take under 1 minute to finish. You should see the eqp1.dat file created with several rows of data.  
</ul></ul>
<ul><ul>
Navigate back up a directory. 
</ul></ul>


# Final comparisons of the HOMO and LUMO states
<ul>
Now that you have completed calculating the GW quasiparticle eigenvalues for both a vacuum and solvated H$_2$O molecule, we are finally ready to compare the  methods. Open the final_compare_eigenvalues.ipynb jupyter notebook and run the first code block. This code looks for the 3 "eqp1.dat" files in 6-sigma/ and 6-sigma+chi/ and calculates the HOMO-LUMO gaps. Note that the terms "HOMO" and "LUMO" are a bit ambiguous here due to the planewave approach approach yet use of only a single k/q-point. Despite this, we still use these terms here to make it clearer which specific eigenvalues we are referring to. You should get 8.767 eV as the G0W0@GGA+SaLSA+chi gap. Run the second code block to plot the eigenvalues for each band (as labeled generally in BerkeleyGW; these are not truly "bands" in the traditional sense) index across all of the methods. Do the occupied and unoccupied states change differently with solvation? GW can also reorder DFT eigenvalues. Bands described poorly by DFT may be most accurately described by coming to self-consistency in both G and W (updating both eigenvalues and underlying wavefunctions). Bands described decently by DFT may be described well-enough by reaching self-consistency only in G by iterating on the quasiparticle eigenvalues. 
</ul>
<ul>
The large increase in gap for G0W0@GGA as compared to GGA is very common. GGA DFT functionals infamously underestimate energy gaps. SaLSA implicit solvation also does not typically change gaps drastically at the DFT level. This is expected because the contribution to the electrostatic potential from the solvation model is mostly constant / varies slowly in the spatial region of the solute, and therefore contributes an almost rigid shift in the DFT orbital energies of molecules. G0W0 calculations run using SaLSA DFT wavefunctions only (G0W0@GGA+SaLSA) produces similar results to the G0W0@GGA case. In contrast, incorporating the liquid polarizability into the epsilon calculation dramatically lowers the predicted gap. This gap lowering is the expected behavior of a molecule moving from vacuum to a solvated state. 
</ul>
<ul>
As a final important note, these calculations are fairly underconverged. Doing testing of convergence parameters as per the BerkeleyGW tutorial would be beneficial for the interested user. One example of improvements would be running to self-consistency in both G and W frequently can change the final quasiparticle eigenvalues quite a bit. Self-consistency in W is commonly ignored due to the computational difficulty. Self-consistency in G however is more common because it only involves repeating the sigma calculations after reading in quasiparticle eigenvalues calculated prior. See the BerkeleyGW documentation to see how to do this. 
</ul>
<ul> 
Now, here are some questions to consider or read further about if you are interested:
</ul>
<ul>
    
1. Why might the HOMO and LUMO be affected differently by solvation? 
2. The number of bands used in these calculations increase as more DFT planewaves are used in the calculation. How do the number of planewaves scale with system size and what does this suggest about GW computational expense?
</ul>

# BONUS EXERCISES
<ul>
If you would like additional systems to run, try actually running calculations to get numbers associated with question 3. Copy the 1-scf/ directory for 01-h2o_vacuum/ into a few new directories and increase/decrease the planewave cutoff in the "in" file in increments of 5. grep for "average nbasis" (average planewaves across all k-points) in the JDFTx "out" file and plot each planewave cutoff vs this value. 
</ul>
<ul>
Similarly, try copying the 01-h2o_vacuum/5-epsilon/ directory into a new directory and increase the screened cutoff and/or number_bands to larger values (the 4-wfn/ was generated using 1000 bands so number_bands can be set to 999 or less). Then, copy 01-h2o_vacuum/6-sigma/ into corresponding new directories and link the new eps0mat.h5 files appropriately. Rerun the sigma jobs to get new GW eigenvalues. You can try this for both the vacuum and solvated systems. This will help you get an idea of convergence in these systems. Other common convergence paramters include the DFT planewave cutoff and cutoffs/bands used in the sigma calculations (the number of bands used in epsilon and sigma do not necessarily have to be the same, sigma may or may not be smaller). Try varying some of these to see how the costs change and construct convergence curves that results from changing different parameters (see the BerkeleyGW tutorials for extra details). If you change the DFT planewave cutoff, you will need to change this value in the 3-chi/ and 4-wfn/ jobs later before redoing the epsilon and sigma calculations. 
</ul>
<ul>
Other molecules will be affected by solvent screening differently. Try applying this towards other molecules. Although it will become more unphysical, for the tutorial you can try lowering the planewave cutoff, screened cutoff, and number of bands if you are trying to run a larger molecule and are seeing (particularly epsilon and sigma) jobs error out due to lack of memory. Alternatively, you can try running on more nodes, say 2 to 4. 
</ul>


## Longer introduction to the formalism
The GW approach solves the Dyson equation for the quasiparticle (QP) energies and wavefunctions (using Hartree atomic units),
\begin{equation}
\left[
-\frac{\nabla^2}{2} + V_{ion}+V_{H}+\Sigma(E_{nk}^{\text{QP}})
\right]
\psi_{nk}^{\text{QP}} = E_{nk}^{\text{QP}}\psi_{nk}^{\text{QP}},
\end{equation}
where $\nabla$ is the kinetic energy operator, $V_{ion}$ is the ionic potential, $V_H$ is the Hartree potential, $\Sigma$ is the nonlocal, energy-dependent self energy within the GW approximation, and E$_{nk}^{\text{QP}}$ and $\psi_{nk}^{\text{QP}}$ are the quasiparticle energies and wavefunctions, respectively. In the GW formalism, G refers to the one-body Green's function and W the dynamically screened Coulomb interaction. We use the single-particle wavefunctions from DFT as our quasiparticle wavefunctions (the diagonal approximation) and iterate to self-consistency in the quasiparticle energies that enter into the Green's function G in the GW approximation. GW calculations carried out using the DFT vacuum or SaLSA wavefunctions are labeled as GW@GGA or GW@GGA+SaLSA, respectively. 

The self-energy operator $\Sigma$ depends on the screened Coulomb interaction,
\begin{equation}
W_{\textbf{G}\textbf{G}'}(\textbf{q};\omega)
= \epsilon^{-1}_{\textbf{G}\textbf{G}'}(\textbf{q};\omega)
v(\textbf{q}+\textbf{G}'),
\end{equation}
where $v$ is the bare Coulomb interaction, $\epsilon$ is the full-frequency dielectric matrix. Within the random phase approximation $\epsilon$ is given by
\begin{equation}
\epsilon_{\textbf{G}\textbf{G}'}(\textbf{q};\omega)=\delta_{\textbf{G}\textbf{G}'}-v(\textbf{q}+\textbf{G})\chi^0_{\textbf{G}\textbf{G}'}(\textbf{q};\omega).
\end{equation}

Above, $\chi^0$ is the independent-electron polarizability, written in the plane-wave basis as
\begin{equation}
\chi^0_{\textbf{G}\textbf{G}'}(\textbf{q};\omega) = 
\sum_{\scriptsize\begin{array}{c}
n~\text{occ.}\\
n'~\text{emp.}
\end{array}} \sum_{\textbf{k}}
\frac{2
M^{*}_{nn'}(\textbf{k},\textbf{q},\textbf{G}) 
M_{nn'}(\textbf{k},\textbf{q},\textbf{G}')
}{
\varepsilon_{n\textbf{k}+\textbf{q}} - \varepsilon_{n'\textbf{k}}
\pm\omega + i\delta
}
\end{equation}
with the matrix elements M defined by
\begin{equation}
M_{nn'}(\textbf{k},\textbf{q},\textbf{G})
\equiv
\braketmatrix{\psi_{n\textbf{k}+\textbf{q}}}{e^{i(\textbf{q}+\textbf{G})\cdot \textbf{r}}}{\psi_{n'\textbf{k}}}.
\end{equation}
Here, $\textbf{q}$ is a vector in the first Brillouin zone, $\textbf{G}$ and $\textbf{G}'$ are reciprocal-lattice vectors, $\omega$ is frequency, $\delta$ is an infinitesimal that locates the poles of $\chi_0$ relative to the real frequency axis, $\psi_{n\textbf{k}}$ and $\varepsilon_{n\textbf{k}}$ are the Kohn-Sham orbitals and energies from the DFT starting point, and $n$ and $n'$ count occupied and empty bands, respectively. 

To account for solvent screening, we replace $\chi^0$ in the equation for $\epsilon_{\textbf{G}\textbf{G}'}(\textbf{q};\omega)$ with $\chi^{solv} = \chi^0 + \chi^{lq}$, where $\chi^{lq}$ is the independent-particle susceptibility of the liquid using an implicit solvation model. This approach is labeled GW@GGA+SaLSA+$\chi^{lq}$ below. Note that $\chi^{lq}$ is also a response to the total Coulomb potential, analogous to $\chi^0$ for the electrons, which is necessary for this additivity.

Here, we use the nonlocal susceptibility from the SaLSA solvation model,
\begin{multline}
\chi_{\textbf{GG}'}^{lq}(\textbf{q};\omega)
= \\
- \frac{\tilde{N}_0(\textbf{G} - \textbf{G}')}{4\pi T}
\sum_{lm}
C^l_{rot}(\omega)
P_l(\textbf{g}\cdot\textbf{g}')
\tilde{\rho}^{lm}_{mol}(\textbf{g})
\tilde{\rho}^{lm\ast}_{mol}(\textbf{g}')
\\
-\sum_\alpha
\tilde{N}^0_\alpha(\textbf{G} - \textbf{G}')
C_{pol}(\omega)
\chi_\alpha
\textbf{g}\cdot\textbf{g}'
\tilde{w}_\alpha(\textbf{g}) \tilde{w}^{\ast}_\alpha(\textbf{g}'),
\end{multline}
where $\textbf{g} = \textbf{q}+\textbf{G}$ and $\textbf{g}' = \textbf{q}+\textbf{G}'$. The first term captures the rotational response of solvent molecules with density $N_0(\textbf{r})$ ($\tilde{N}_0$ is its Fourier transform) at temperature $T$, with $\rho_{mol}^{lm}$ being the charge density distribution of a solvent molecule projected to each spherical harmonic component indexed by $l, m$. The second term captures the electronic polarization response of solvent molecules from atomic sites with densities $N^0_\alpha(\vec{r})$, each with susceptibilities of strength $\chi_\alpha$ and non-local weight function $w_\alpha(\textbf{r})$. All the above parameters are extracted from DFT calculations of solvent molecules, while the correlation strength functions $C_{rot}(\omega)$ and $C_{pol}(\omega)$ are constrained by the experimental rotational and electronic dielectric response of the solvent. See [the paper describing SaLSA](http://dx.doi.org/10.1063/1.4906828) for its derivation and complete parameterization.

We will just emphasize here that the nonlocality of the SaLSA model leads to $\chi^{lq}_{\textbf{GG}'} \to 0$ as $\textbf{G} \to \infty$ because the nonlocal weight functions $\tilde{\rho}^{lm}_{mol}(\textbf{G})$ and $\tilde{w}_\alpha(\textbf{G}) \to 0$ as $\textbf{G} \to \infty$. This allows the liquid susceptibility to be converged with a small plane wave cutoff, in comparison to the $\chi^{lq}_{\textbf{GG}'} \propto \textbf{G}\cdot\textbf{G}'$ of local models, that require additional numerical care in constructing and inverting $\epsilon_{\textbf{GG}'}$. Additionally, the lack of empiricism in the SaLSA model is appealing for an ab-initio approach to solvated beyond-DFT calculations. 

