Skip to content

Commit

Permalink
d4dimer plots
Browse files Browse the repository at this point in the history
  • Loading branch information
Awallace3 committed May 15, 2024
1 parent 5067aa2 commit feb1aca
Show file tree
Hide file tree
Showing 18 changed files with 402 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,4 @@ dfs/los_saptdft_atz.pkl
*.pkl
dfs/los_saptdft_atz_1.pkl
los_saptdft_atz.pkl

plots/los_*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ serve as a place to use the functions in the `src` directory.

## Contact
If you want to use this codebase and would like assistance, please contact me
via email at <a href="mailto:austinwallace196@gmail.com">austinwallace196@gmail.com</a>
via email at <a href="mailto:awallace43@gatech.edu">awallace43@gatech.edu</a>
93 changes: 74 additions & 19 deletions plot_saptdft.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import src
import pandas as pd
import numpy as np
import qcelemental as qcel

h2kcalmol = qcel.constants.conversion_factor("hartree", "kcal/mol")

def merge_basis_study():
df = pd.read_pickle("./plots/basis_study.pkl")
Expand All @@ -15,26 +19,77 @@ def check_c6s(df):
def main():
# merge_basis_study()
# return
df_name = "./dfs/los_saptdft_atz_fixed.pkl"
# df_name = "./dfs/los_saptdft_atz_fixed.pkl"
df_name = "./dfs/los_adz_candidacy_s0atz.pkl"
df = pd.read_pickle(df_name)
df['C6s'] = df['C6']
print(df['C6s'])
print(len(df))
print(df['DB'].unique())
print(df['C6s'])
# print number of null C6s
print('null c6s:', df['C6s'].isnull().count())
assert df['C6s'].notnull().all()

# df = check_c6s(df)
# print(df['C6s'])
# print(f"{df_name = }")
# df.to_pickle(df_name)
# df = src.misc.make_geometry_bohr_column_df(df)
# df.to_pickle(df_name)
df.dropna(subset=['SAPT_DFT_pbe0_adz', 'SAPT_DFT_pbe0_atz', "C6s"], inplace=True)


# df['C6s'] = df['C6']
# assert df['C6s'].notnull().all()
# df.dropna(subset=['SAPT_DFT_pbe0_adz_total', "C6s"], inplace=True)
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
# df['diff'] = abs(df['Benchmark'] - df['SAPT_DFT_pbe0_adz_total'])
# print(df[["system_id", 'SAPT_DFT_pbe0_adz_total', 'Benchmark', "diff"]])
# df.sort_values(by='diff', inplace=True,
# ascending=False
# )
# print(df[["system_id", 'Benchmark', "diff"]].head(50))
# print(df.columns.values)
# return
df['SAPT0_adz'] = df.apply(
lambda x: np.array([
x['SAPT0 ELST ENERGY adz']+
x['SAPT0 EXCH ENERGY adz']+
x['SAPT0 IND ENERGY adz']+
x['SAPT0 DISP ENERGY adz'],
x['SAPT0 ELST ENERGY adz'],
x['SAPT0 EXCH ENERGY adz'],
x['SAPT0 IND ENERGY adz'],
x['SAPT0 DISP ENERGY adz'],
])* h2kcalmol, axis=1)
df['SAPT0_atz'] = df.apply(
lambda x: np.array([
x['SAPT0 ELST ENERGY atz']+
x['SAPT0 EXCH ENERGY atz']+
x['SAPT0 IND ENERGY atz']+
x['SAPT0 DISP ENERGY atz'],
x['SAPT0 ELST ENERGY atz'],
x['SAPT0 EXCH ENERGY atz'],
x['SAPT0 IND ENERGY atz'],
x['SAPT0 DISP ENERGY atz'],
]) * h2kcalmol, axis=1)
df['SAPT0_atz_IE'] = df.apply(
lambda x: x['SAPT0_atz'][0], axis=1)
df['SAPT0_adz_IE'] = df.apply(
lambda x: x['SAPT0_adz'][0], axis=1)
df['SAPT0_atz_3_IE'] = df.apply(
lambda x: sum(x['SAPT0_atz'][1:4]), axis=1)
# df['SAPT0_adz_3_IE'] = df.apply(
# lambda x:
# (x['SAPT0 ELST ENERGY adz']+
# x['SAPT0 EXCH ENERGY adz']+
# x['SAPT0 IND ENERGY adz']) * h2kcalmol, axis=1)
df['SAPT0_adz_3_IE'] = df.apply(
lambda x: sum(x['SAPT0_adz'][1:4]), axis=1)
# df = src.plotting.compute_d4_from_opt_params(
# df,
# bases=[
# [
# "SAPT0_adz_IE",
# "SAPT0_adz_3_IE",
# "SAPT0_adz_3_IE_2B",
# "SAPT0_adz_3_IE",
# ],
# [
# "SAPT0_atz_IE",
# "SAPT0_atz_3_IE",
# "SAPT0_atz_3_IE_2B",
# "SAPT0_atz_3_IE",
# ],
# ],
# )
df['Benchmark'] = df['benchmark ref energy']
df.to_pickle(df_name)
# print(df.columns.values)
src.plotting.plotting_setup_dft_ddft(
df_name,
build_df=True,
Expand Down
Binary file modified plots/basis_study_ATM2_dbs_violin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/basis_study_ATM_dbs_violin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/basis_study_basis_set_dbs_violin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/basis_study_charged_dbs_violin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/basis_study_d3_dbs_violin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/basis_study_d3_opt_vs_adz_dbs_violin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/basis_study_d3_zoomed_dbs_violin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/basis_study_d4_dbs_violin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/basis_study_d4_opt_vs_adz_dbs_violin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/basis_study_d4_zoomed_dbs_violin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/basis_study_saptdft_d4_dhf_dbs_violin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed plots/los_saptdft_atz_saptdft_components_ONLY.png
Binary file not shown.
Binary file removed plots/los_saptdft_atz_saptdft_components_TOTAL.png
Binary file not shown.
2 changes: 1 addition & 1 deletion src/dispersion
Loading

0 comments on commit feb1aca

Please sign in to comment.