-
Notifications
You must be signed in to change notification settings - Fork 15
ROM calculations of Pinned H2O with 3 DOF #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
1ad1292
Fix EnergyAndForces tests (#277)
jeanlucf22 8ac6cd6
Move factor 4pi out og linear solvers (#278)
jeanlucf22 a2ece1a
Move some code into PoissonSolverFactory (#279)
jeanlucf22 8b577ea
Clean up class Potentials (#280)
jeanlucf22 7ac691c
Clean up class Ions, add test for it (#281)
jeanlucf22 fa36d2f
set up offline procedure
siuwuncheung 1526974
Parametric file
siuwuncheung 65939c5
Add basis script
siuwuncheung 03e59eb
Add postprocessing scripts
siuwuncheung 318325c
Add files via upload
siuwuncheung b616e8e
Add restore check. Make H1 shorter than H2 in original system for ver…
siuwuncheung ffd2a8b
Merge branch 'ROM-PinnedH2O-3DOF' of https://github.com/LLNL/mgmol in…
siuwuncheung 38a0511
Minor change
siuwuncheung 2f79fdb
Add C++ translation
siuwuncheung 8f61523
Add restoring test
siuwuncheung c05ba7f
Add test MD_MVP (#290)
jeanlucf22 bb8051d
Clean up code related to DM restart data (#292)
jeanlucf22 a227c04
Write dm (#291)
jeanlucf22 a09ca14
Set up test
siuwuncheung 47e6335
Update cfg
siuwuncheung cdf38c8
Fix conversions
siuwuncheung 15555f4
Add new script
siuwuncheung f2c963c
Add CMake
siuwuncheung b09a20f
Restore
siuwuncheung cac12ac
Updates
siuwuncheung 9acca3f
Changes
siuwuncheung 98ef8f2
Relocate set
siuwuncheung b2bc316
Refactor
siuwuncheung b263532
Remove unused function in Control (#294)
jeanlucf22 3eb52d6
Change symlink to restart in tests (#295)
jeanlucf22 c1d46bc
Extract number empty orbitals from restart file (#296)
jeanlucf22 6feca4f
Merge release to ROMFPMD
siuwuncheung c9b4a15
Merge branch 'merge-release-20250113' into ROM-PinnedH2O-3DOF
siuwuncheung e2656f8
Merge branch 'ROMFPMD' into ROM-PinnedH2O-3DOF
siuwuncheung 0bb043d
updates
siuwuncheung 15a0e37
Updates
siuwuncheung 88f2535
Fixes
siuwuncheung eaa93ea
Add computeGramAndInvS
siuwuncheung 0777a95
Add
siuwuncheung 7fa2b79
Debug
siuwuncheung f33a8d9
Clean up
siuwuncheung 4a1c0ef
Turn on MVP solver for nempty > 0 case
siuwuncheung 3f18631
Add getForces for evaluateDMandEnergyAndForces
siuwuncheung 1340d30
Merge branch 'DM_driver_print_force' into ROM-PinnedH2O-3DOF
siuwuncheung c25c614
Add new tests
siuwuncheung 1b5ed09
Remove redundant line
siuwuncheung 2b62d76
Fix filename
siuwuncheung 6e0113b
Add quench and MVP comparison for main executable
siuwuncheung e699f4d
minor changes
siuwuncheung 9943a23
Changes in setting of Quench and MVP comparison
siuwuncheung 13b59b3
Add number of quench iterations for convergence
siuwuncheung 18650d5
Update job scripts
siuwuncheung fb2c72d
Update config files
siuwuncheung 8036917
Update toy example
siuwuncheung a80300d
Remove redundant script
siuwuncheung f0eaa2a
Updates
siuwuncheung 0822805
Update scripts
siuwuncheung c0bc938
Add functional script
siuwuncheung dd076eb
Templatize scripts
siuwuncheung caa87e5
Add postprocessing script
siuwuncheung d7a34b4
Add units to plot
siuwuncheung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import subprocess | ||
| import re | ||
|
|
||
| pattern = r"For energy fraction: \d+\.\d+, take first (\d+) of \d+ basis vectors" | ||
|
|
||
| print("\\begin{tabular}{|c||c|c|c|c|c|c|c|}") | ||
| print("\\hline") | ||
| print("$k$ & $\\varepsilon = 10^{-1}$ & $\\varepsilon = 10^{-2}$ & $\\varepsilon = 10^{-3}$ & $\\varepsilon = 10^{-4}$ & $\\varepsilon = 10^{-5}$ & Snapshots \\\\") | ||
| print("\\hline") | ||
|
|
||
| for t in range(10): | ||
| k = 50*(t+1) | ||
| snapshots = 4*k | ||
| grep_command = f"grep 'take first' basis_1_{k}_Pinned_H2O.out" | ||
| result = subprocess.run(grep_command, shell=True, capture_output=True, text=True) | ||
| matches = re.findall(pattern, result.stdout) | ||
| energy_fractions = { | ||
| "0.9": matches[0], | ||
| "0.99": matches[1], | ||
| "0.999": matches[2], | ||
| "0.9999": matches[3], | ||
| "0.99999": matches[4], | ||
| } | ||
| line = f"{k} & {energy_fractions['0.9']} & {energy_fractions['0.99']} & {energy_fractions['0.999']} & {energy_fractions['0.9999']} & {energy_fractions['0.99999']} & {snapshots} \\\\" | ||
| print(line) | ||
|
|
||
| print("\\hline") | ||
| print("\\end{tabular}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| python3 test.py srun -p debug -n 64 ../../build_quartz/tests/testPinnedH2O_3DOF mgmol_online.cfg coords_1.00_1.00_0.0.in ../../potentials |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #!/bin/bash | ||
|
|
||
| rm -rf PinnedH2O_3DOF_assembled_results | ||
| mkdir PinnedH2O_3DOF_assembled_results | ||
|
|
||
| for d in results_*; do | ||
| echo "Processing $d" | ||
| rm $d/energy_and_forces_*.out | ||
| rm $d/*.png | ||
|
|
||
| suffix=$(echo "$d" | cut -d'_' -f2,3,4) | ||
| N_l=$(echo "$suffix" | cut -d'_' -f1) | ||
| N_theta=$(echo "$suffix" | cut -d'_' -f2) | ||
| rdim=$(echo "$suffix" | cut -d'_' -f3) | ||
| python3 compare_energy_and_forces.py --N_l "$N_l" --N_theta "$N_theta" --rdim "$rdim" | ||
|
|
||
| cp "$d/Eks_difference_histogram_reproductive.png" "PinnedH2O_3DOF_assembled_results/Eks_difference_histogram_${suffix}_reproductive.png" | ||
| cp "$d/f_H1_difference_histogram_reproductive.png" "PinnedH2O_3DOF_assembled_results/f_H1_difference_histogram_${suffix}_reproductive.png" | ||
| cp "$d/f_H2_difference_histogram_reproductive.png" "PinnedH2O_3DOF_assembled_results/f_H2_difference_histogram_${suffix}_reproductive.png" | ||
| cp "$d/f_O1_difference_histogram_reproductive.png" "PinnedH2O_3DOF_assembled_results/f_O1_difference_histogram_${suffix}_reproductive.png" | ||
|
|
||
| cp "$d/Eks_difference_histogram_predictive.png" "PinnedH2O_3DOF_assembled_results/Eks_difference_histogram_${suffix}_predictive.png" | ||
| cp "$d/f_H1_difference_histogram_predictive.png" "PinnedH2O_3DOF_assembled_results/f_H1_difference_histogram_${suffix}_predictive.png" | ||
| cp "$d/f_H2_difference_histogram_predictive.png" "PinnedH2O_3DOF_assembled_results/f_H2_difference_histogram_${suffix}_predictive.png" | ||
| cp "$d/f_O1_difference_histogram_predictive.png" "PinnedH2O_3DOF_assembled_results/f_O1_difference_histogram_${suffix}_predictive.png" | ||
| done | ||
|
|
||
| tar -cvf PinnedH2O_3DOF_assembled_results.tar PinnedH2O_3DOF_assembled_results | ||
| mv PinnedH2O_3DOF_assembled_results.tar /p/lustre2/cheung26/scp_local | ||
|
|
||
| echo "Finished assembling results." |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import subprocess | ||
| import re | ||
|
|
||
| bondlength_num_increments = (2, 5, 10) | ||
| bondangle_num_increments = (2, 5, 10) | ||
|
|
||
| pattern = r"For energy fraction: \d+\.\d+, take first (\d+) of \d+ basis vectors" | ||
|
|
||
| print("\\begin{tabular}{|c|c||c|c|c|c|c|c|c|}") | ||
| print("\\hline") | ||
| print("$N_L$ & $N_\\theta$ & $\\varepsilon = 10^{-1}$ & $\\varepsilon = 10^{-2}$ & $\\varepsilon = 10^{-3}$ & $\\varepsilon = 10^{-4}$ & $\\varepsilon = 10^{-5}$ & Snapshots \\\\") | ||
| print("\\hline") | ||
|
|
||
| for _, N_L in enumerate(bondlength_num_increments): | ||
| for _, N_theta in enumerate(bondangle_num_increments): | ||
| snapshots = 2*(N_L+1)*(N_L+2)*(N_theta+1) | ||
| grep_command = f"grep 'take first' basis_{N_L}_{N_theta}_PinnedH2O_3DOF.out" | ||
| result = subprocess.run(grep_command, shell=True, capture_output=True, text=True) | ||
| matches = re.findall(pattern, result.stdout) | ||
| energy_fractions = { | ||
| "0.9": matches[0], | ||
| "0.99": matches[1], | ||
| "0.999": matches[2], | ||
| "0.9999": matches[3], | ||
| "0.99999": matches[4], | ||
| } | ||
| line = f"{N_L} & {N_theta} & {energy_fractions['0.9']} & {energy_fractions['0.99']} & {energy_fractions['0.999']} & {energy_fractions['0.9999']} & {energy_fractions['0.99999']} & {snapshots} \\\\" | ||
| print(line) | ||
|
|
||
| print("\\hline") | ||
| print("\\end{tabular}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| import matplotlib | ||
| import matplotlib.pyplot as plt | ||
| import numpy as np | ||
|
|
||
| ref_bondlength = 1.83 | ||
| ref_bondangle = 104.5 | ||
|
|
||
| # factors and increments for bond lengths and bond angle | ||
| bondlength_factor = np.linspace(0.95, 1.05, 3) | ||
| bondangle_increment = np.linspace(-5, 5, 3) | ||
|
|
||
| fig, ax = plt.subplots() | ||
|
|
||
| for d_bondangle in bondangle_increment: | ||
| bondangle = ref_bondangle + d_bondangle | ||
| x = ref_bondlength * np.cos(np.radians(bondangle / 2)) | ||
| y = ref_bondlength * np.sin(np.radians(bondangle / 2)) | ||
| for i, f_bondlength1 in enumerate(bondlength_factor): | ||
| H1_x = f_bondlength1*x | ||
| H1_y = f_bondlength1*y | ||
| ax.plot(H1_x, H1_y, 'ro', markersize=8, alpha=0.1) | ||
| for f_bondlength2 in bondlength_factor[:(i+1)]: | ||
| H2_x = f_bondlength2*x | ||
| H2_y = -f_bondlength2*y | ||
| ax.plot(H2_x, H2_y, 'bo', markersize=8, alpha=0.1) | ||
|
|
||
| ref_bondangle = np.radians(ref_bondangle) | ||
| x = ref_bondlength * np.cos(ref_bondangle / 2) | ||
| y = ref_bondlength * np.sin(ref_bondangle / 2) | ||
|
|
||
| ax.plot([0, x], [0, y], 'r-', lw=2) | ||
| ax.plot([0, x], [0, -y], 'b-', lw=2) | ||
| ax.plot(0, 0, 'ko', markersize=8) | ||
| ax.plot(x, y, 'ro', markersize=8) | ||
| ax.plot(x, -y, 'bo', markersize=8) | ||
|
|
||
| arc1 = matplotlib.patches.Arc(xy=(0, 0), | ||
| width=0.5, | ||
| height=0.5, | ||
| angle=0, | ||
| theta1=0, | ||
| theta2=ref_bondangle/2, | ||
| color='red', | ||
| linewidth=2) | ||
| ax.add_patch(arc1) | ||
| ax.text(0.4, 0.25, r"$\frac{\theta}{2}$", ha='center', va='center', fontsize=12, color='red') | ||
|
|
||
| arc2 = matplotlib.patches.Arc(xy=(0, 0), | ||
| width=0.5, | ||
| height=0.5, | ||
| angle=0, | ||
| theta1=-ref_bondangle/2, | ||
| theta2=0, | ||
| color='blue', | ||
| linewidth=2) | ||
| ax.add_patch(arc2) | ||
| ax.text(0.4, -0.25, r"$\frac{\theta}{2}$", ha='center', va='center', fontsize=12, color='blue') | ||
|
|
||
| ax.text(x / 2 - 0.1, y / 2, r"$L_1$", ha='right', color='red') | ||
| ax.text(x / 2 - 0.1, -y / 2, r"$L_2$", ha='right', color='blue') | ||
|
|
||
| ax.plot([-2, 2], [0, 0], 'k--', lw=1) | ||
| ax.set_xlim(-2.0, 2.0) | ||
| ax.set_ylim(-2.0, 2.0) | ||
| ax.set_aspect('equal') | ||
| ax.set_xlabel("x (Bohr)") | ||
| ax.set_ylabel("y (Bohr)") | ||
| ax.grid(True) | ||
| plt.savefig("PinnedH2O_3DOF.png") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.