Skip to content

Commit

Permalink
TT plot
Browse files Browse the repository at this point in the history
  • Loading branch information
Awallace3 committed Jul 9, 2024
1 parent 79d0865 commit d37a40b
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 80 deletions.
21 changes: 5 additions & 16 deletions plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,13 @@ def main():
subprocess.call("mv basis_study.pkl plots/basis_study.pkl", shell=True)
df = pd.read_pickle(df_name)
# print(df.columns.values)
df = src.plotting.plotting_setup(
(df, df_name),
False,
)
# return
# df = src.plotting.plotting_setup_dft(
# (df, df_name),
# build_df=True,
# )
print(df['SAPT_DFT_atz'][0])
df['size'] = df.apply(lambda x: len(x['Geometry']), axis=1)
print(df['size'].describe())
# get id of largest molecule
id_max = df['size'].idxmax()
print(f"Max size molecule: {df['size'][id_max]} {id_max = }")
# return
df = src.plotting.plot_basis_sets_d4_TT(
df,
True,
)
return
df = src.plotting.plotting_setup(
(df, df_name),
False,
)
df = src.plotting.plot_basis_sets_d4(
Expand Down
Binary file added plots/basis_study_d4_TT_dbs_violin.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/basis_study_d4_zoomed_TT_dbs_violin.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 28 additions & 31 deletions src/paramsTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,51 +157,46 @@ def paramsDict() -> {}:
dtype=np.float64,
),
# 2B TT, no ATM
# "SAPT0_adz_3_IE_TT": np.array(
# [
# # , -0.15911374845197218, 2.9397071748917925
# [1.0, 0.17968468859075246, -0.15911374845197218, 2.9397071748917925, 0.0],
# [1.0, 0.17968468859075246, -0.15911374845197218, 2.9397071748917925, 0.0],
# ]
# ),
"SAPT0_adz_3_IE_TT_2B": np.array([[ 1.00000000e+00, 1.54566284e-01, -1.00000007e-03,
2.02528117e+00, 0.00000000e+00],
[ 1.00000000e+00, 1.54566284e-01, -1.00000007e-03,
2.02528117e+00, 0.00000000e+00]]),
"SAPT0_dz_3_IE_TT_2B": np.array(
[
[1.0, 0.64630915, -0.51577064, 5.99994612, 0.0],
[1.0, 0.64630915, -0.51577064, 5.99994612, 0.0],
"SAPT0_adz_3_IE_2B_TT": np.array(
[
[1.0, 0.15608556, -0.33516031, 3.88601556, 0.0],
[1.0, 0.15608556, -0.33516031, 3.88601556, 0.0],
]
),
"SAPT0_jdz_3_IE_2B_TT": np.array(
[
[1.0, 0.13964684, -0.33516374, 3.90019226, 0.0],
[1.0, 0.13964684, -0.33516374, 3.90019226, 0.0],
]
),
"SAPT0_jdz_3_IE_TT_2B": np.array(
"SAPT0_dz_3_IE_2B_TT": np.array(
[
[1.0, 0.64265685, -0.53013124, 6.0, 0.0],
[1.0, 0.64265685, -0.53013124, 6.0, 0.0],
[1.0, 0.14640137, -0.33539648, 3.89159297, 0.0],
[1.0, 0.14640137, -0.33539648, 3.89159297, 0.0],
]
),
"SAPT0_mtz_3_IE_TT_2B": np.array(
"SAPT0_mtz_3_IE_2B_TT": np.array(
[
[1.0, 0.66702338, -0.54595775, 5.99993925, 0.0],
[1.0, 0.66702338, -0.54595775, 5.99993925, 0.0],
[1.0, 0.16657909, -0.33519359, 3.88207733, 0.0],
[1.0, 0.16657909, -0.33519359, 3.88207733, 0.0],
]
),
"SAPT0_jtz_3_IE_TT_2B": np.array(
"SAPT0_jtz_3_IE_2B_TT": np.array(
[
[1.0, 0.66821291, -0.54568506, 5.9999398, 0.0],
[1.0, 0.66821291, -0.54568506, 5.9999398, 0.0],
[1.0, 0.16800654, -0.335142, 3.87820076, 0.0],
[1.0, 0.16800654, -0.335142, 3.87820076, 0.0],
]
),
"SAPT0_atz_3_IE_TT_2B": np.array(
"SAPT0_atz_3_IE_2B_TT": np.array(
[
[1.0, 0.66896414, -0.54645336, 5.99993976, 0.0],
[1.0, 0.66896414, -0.54645336, 5.99993976, 0.0],
[1.0, 0.16863906, -0.33510403, 3.87576844, 0.0],
[1.0, 0.16863906, -0.33510403, 3.87576844, 0.0],
]
),
"SAPT0_tz_3_IE_TT_2B": np.array(
"SAPT0_tz_3_IE_2B_TT": np.array(
[
[1.0, 0.66827885, -0.53614363, 6.0, 0.0],
[1.0, 0.66827885, -0.53614363, 6.0, 0.0],
[1.0, 0.17021906, -0.33526289, 3.87804042, 0.0],
[1.0, 0.17021906, -0.33526289, 3.87804042, 0.0],
]
),
"3B_TT": np.array(
Expand Down Expand Up @@ -251,7 +246,7 @@ def paramsDict() -> {}:
[
1.54566284e-01,
-1.00000007e-03,
2.02528117e+00,
2.02528117e00,
],
dtype=np.float64,
),
Expand Down Expand Up @@ -650,7 +645,9 @@ def generate_2B_ATM_param_subsets(
raise ValueError("params must be of size 2, 3, 5, 6, or 7!")
return params_2B, params_ATM


param_dict = paramsDict()


def param_lookup(param_name):
return generate_2B_ATM_param_subsets(param_dict[param_name])
72 changes: 39 additions & 33 deletions src/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def compute_d4_from_opt_params(
["SAPT0_atz_IE", "SAPT0_atz_3_IE", "SAPT0_atz_3_IE_2B", "SAPT0_atz_3_IE"],
],
benchmark_label="Benchmark",
disp_compute=locald4.compute_disp_2B_BJ_ATM_CHG_dimer,
) -> pd.DataFrame:
"""
compute_D3_D4_values_for_params
Expand All @@ -173,7 +174,7 @@ def compute_d4_from_opt_params(
params_d4 = params_dict[i[2]]
params_2B, params_ATM = paramsTable.generate_2B_ATM_param_subsets(params_d4)
df[f"-D4 ({i[1]})"] = df.apply(
lambda row: locald4.compute_disp_2B_BJ_ATM_CHG_dimer(
lambda row: disp_compute(
row,
params_2B,
params_ATM,
Expand Down Expand Up @@ -427,72 +428,77 @@ def plot_basis_sets_d4_TT(df, build_df=False, df_out: str = "basis_study", df_na
bases=[
[
"SAPT0_dz_IE",
"SAPT0_dz_3_IE_TT_ADZ",
"SAPT0_adz_3_IE_TT_2B",
"SAPT0_dz_3_IE_TT",
"SAPT0_dz_3_IE_2B_TT",
"SAPT0_dz_3_IE",
],
[
"SAPT0_jdz_IE",
"SAPT0_jdz_3_IE_TT_ADZ",
"SAPT0_adz_3_IE_TT_2B",
"SAPT0_jdz_3_IE_TT",
"SAPT0_jdz_3_IE_2B_TT",
"SAPT0_jdz_3_IE",
],
[
"SAPT0_adz_IE",
"SAPT0_adz_3_IE_TT_ADZ",
"SAPT0_adz_3_IE_TT_2B",
"SAPT0_adz_3_IE_TT",
"SAPT0_adz_3_IE_2B_TT",
"SAPT0_adz_3_IE",
],
[
"SAPT0_tz_IE",
"SAPT0_tz_3_IE_TT_ADZ",
"SAPT0_adz_3_IE_TT_2B",
"SAPT0_tz_3_IE_TT",
"SAPT0_tz_3_IE_2B_TT",
"SAPT0_tz_3_IE",
],
[
"SAPT0_mtz_IE",
"SAPT0_mtz_3_IE_TT_ADZ",
"SAPT0_adz_3_IE_TT_2B",
"SAPT0_mtz_3_IE_TT",
"SAPT0_mtz_3_IE_2B_TT",
"SAPT0_mtz_3_IE",
],
[
"SAPT0_jtz_IE",
"SAPT0_jtz_3_IE_TT_ADZ",
"SAPT0_adz_3_IE_TT_2B",
"SAPT0_jtz_3_IE_TT",
"SAPT0_jtz_3_IE_2B_TT",
"SAPT0_jtz_3_IE",
],
[
"SAPT0_atz_IE",
"SAPT0_atz_3_IE_TT_ADZ",
"SAPT0_adz_3_IE_TT_2B",
"SAPT0_atz_3_IE_TT",
"SAPT0_atz_3_IE_2B_TT",
"SAPT0_atz_3_IE",
],
],
disp_compute=locald4.compute_disp_2B_TT_ATM_TT_dimer,
)
df.to_pickle(df_out)
else:
df = pd.read_pickle(df_out)
plot_violin_d3_d4_ALL(
plot_violin_d3_d4_ALL_zoomed_min_max(
df,
{
"0/DZ": "SAPT0_dz_3_IE_TT_diff",
"0-D4/DZ": "SAPT0_dz_3_IE_TT_d4_diff",
"0/jDZ": "SAPT0_jdz_3_IE_TT_diff",
"0-D4/jDZ": "SAPT0_jdz_3_IE_TT_d4_diff",
"0/aDZ": "SAPT0_adz_3_IE_TT_diff",
"0-D4/aDZ": "SAPT0_adz_3_IE_TT_d4_diff",
"0/TZ": "SAPT0_tz_3_IE_TT_diff",
"0-D4/TZ": "SAPT0_tz_3_IE_TT_d4_diff",
"0/mTZ": "SAPT0_mtz_3_IE_TT_diff",
"0-D4/mTZ": "SAPT0_mtz_3_IE_TT_d4_diff",
"0/jTZ": "SAPT0_jtz_3_IE_TT_diff",
"0-D4/jTZ": "SAPT0_jtz_3_IE_TT_d4_diff",
"0/aTZ": "SAPT0_atz_3_IE_TT_diff",
"0-D4/aTZ": "SAPT0_atz_3_IE_TT_d4_diff",
"0-D4(BJ)/DZ": "SAPT0_dz_3_IE_d4_diff",
"0-D4(TT)/DZ": "SAPT0_dz_3_IE_TT_d4_diff",
"0-D4(BJ)/jDZ": "SAPT0_jdz_3_IE_d4_diff",
"0-D4(TT)/jDZ": "SAPT0_jdz_3_IE_TT_d4_diff",
"0-D4(BJ)/aDZ": "SAPT0_adz_3_IE_d4_diff",
"0-D4(TT)/aDZ": "SAPT0_adz_3_IE_TT_d4_diff",
"0-D4(BJ)/TZ": "SAPT0_tz_3_IE_d4_diff",
"0-D4(TT)/TZ": "SAPT0_tz_3_IE_TT_d4_diff",
"0-D4(BJ)/mTZ": "SAPT0_mtz_3_IE_d4_diff",
"0-D4(TT)/mTZ": "SAPT0_mtz_3_IE_TT_d4_diff",
"0-D4(BJ)/jTZ": "SAPT0_jtz_3_IE_d4_diff",
"0-D4(TT)/jTZ": "SAPT0_jtz_3_IE_TT_d4_diff",
"0-D4(BJ)/aTZ": "SAPT0_atz_3_IE_d4_diff",
"0-D4(TT)/aTZ": "SAPT0_atz_3_IE_TT_d4_diff",
},
None,
f"{selected}_d4_TT",
bottom=0.30,
"", # f"All Dimers (8299)",
f"{selected}_d4_zoomed_TT",
bottom=0.45,
ylim=[-5, 5],
legend_loc="upper right",
transparent=True,
# figure_size=(6, 6),
)
return

Expand Down

0 comments on commit d37a40b

Please sign in to comment.