Skip to content

Commit

Permalink
Polish the pimd example (#65)
Browse files Browse the repository at this point in the history
Start visualizing from frame 1 so beads have spread
Folded molecules in the cell so it looks more like water
  • Loading branch information
ceriottm authored Jun 29, 2024
1 parent 567be4a commit 0cad60d
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 101 deletions.
10 changes: 6 additions & 4 deletions examples/path-integrals/path-integrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@
# Note that i-PI prints a separate trajectory for each bead, as structural properties
# can be computed averaging over the configurations of any of the beads.

# drops first frame where all atoms overlap
output_data, output_desc = ipi.read_output("simulation.out")
traj_data = [ipi.read_trajectory(f"simulation.pos_{i}.xyz") for i in range(8)]
traj_data = [ipi.read_trajectory(f"simulation.pos_{i}.xyz")[1:] for i in range(8)]


# %%
Expand Down Expand Up @@ -228,8 +229,9 @@
# PIMD one, because it is closer to the converged value (try to run a PIMD trajectory
# with 64 beads for comparison)

# drops first frame
output_gle, desc_gle = ipi.read_output("simulation_piglet.out")
traj_gle = [ipi.read_trajectory(f"simulation_piglet.pos_{i}.xyz") for i in range(8)]
traj_gle = [ipi.read_trajectory(f"simulation_piglet.pos_{i}.xyz")[1:] for i in range(8)]

fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)
ax.plot(
Expand Down Expand Up @@ -287,8 +289,8 @@
# them over the last 10 frames and combining them with the centroid configuration
# from the last frame in the trajectory.

kinetic_cv = ipi.read_trajectory("simulation_piglet.kin.xyz")
kinetic_od = ipi.read_trajectory("simulation_piglet.kod.xyz")
kinetic_cv = ipi.read_trajectory("simulation_piglet.kin.xyz")[1:]
kinetic_od = ipi.read_trajectory("simulation_piglet.kod.xyz")[1:]
kinetic_tens = np.hstack(
[
np.asarray([k.positions for k in kinetic_cv[-10:]]).mean(axis=0),
Expand Down
194 changes: 97 additions & 97 deletions examples/path-integrals/water_32.pdb
Original file line number Diff line number Diff line change
@@ -1,98 +1,98 @@
CRYST1 10.26 10.26 10.26 90.00 90.00 90.00 P 1 1
ATOM 1 O 1 1 3.756 4.710 -0.766 0.00 0.00 0
ATOM 2 H 1 1 4.604 4.272 -0.589 0.00 0.00 0
ATOM 3 H 1 1 3.998 5.320 -1.472 0.00 0.00 0
ATOM 4 O 1 1 9.933 8.841 0.366 0.00 0.00 0
ATOM 5 H 1 1 10.132 8.196 1.120 0.00 0.00 0
ATOM 6 H 1 1 9.368 8.449 -0.316 0.00 0.00 0
ATOM 7 O 1 1 0.321 1.492 5.796 0.00 0.00 0
ATOM 8 H 1 1 -0.287 1.993 5.241 0.00 0.00 0
ATOM 9 H 1 1 0.791 2.061 6.364 0.00 0.00 0
ATOM 10 O 1 1 -2.225 -0.525 4.307 0.00 0.00 0
ATOM 11 H 1 1 -3.057 -0.471 4.847 0.00 0.00 0
ATOM 12 H 1 1 -1.624 -0.953 4.920 0.00 0.00 0
ATOM 13 O 1 1 -4.597 -1.178 10.920 0.00 0.00 0
ATOM 14 H 1 1 -3.882 -0.539 11.074 0.00 0.00 0
ATOM 15 H 1 1 -5.047 -1.269 11.812 0.00 0.00 0
ATOM 16 O 1 1 -2.130 0.215 11.461 0.00 0.00 0
ATOM 17 H 1 1 -2.064 -0.065 12.378 0.00 0.00 0
ATOM 18 H 1 1 -1.322 -0.161 11.078 0.00 0.00 0
ATOM 19 O 1 1 8.177 4.165 0.716 0.00 0.00 0
ATOM 20 H 1 1 7.895 5.066 0.840 0.00 0.00 0
ATOM 21 H 1 1 7.722 3.562 1.341 0.00 0.00 0
ATOM 22 O 1 1 -3.919 3.256 -0.582 0.00 0.00 0
ATOM 23 H 1 1 -3.127 3.423 -0.071 0.00 0.00 0
ATOM 24 H 1 1 -3.753 2.398 -0.910 0.00 0.00 0
ATOM 25 O 1 1 10.396 -2.462 2.738 0.00 0.00 0
ATOM 26 H 1 1 10.254 -1.960 3.584 0.00 0.00 0
ATOM 27 H 1 1 10.574 -3.355 2.966 0.00 0.00 0
ATOM 28 O 1 1 5.027 2.563 6.169 0.00 0.00 0
ATOM 29 H 1 1 5.538 3.336 6.262 0.00 0.00 0
ATOM 30 H 1 1 5.313 2.031 6.922 0.00 0.00 0
ATOM 31 O 1 1 -3.096 2.542 2.418 0.00 0.00 0
ATOM 32 H 1 1 -4.012 2.467 2.667 0.00 0.00 0
ATOM 33 H 1 1 -2.876 1.681 2.057 0.00 0.00 0
ATOM 34 O 1 1 3.336 -1.209 3.265 0.00 0.00 0
ATOM 35 H 1 1 2.818 -1.919 2.787 0.00 0.00 0
ATOM 36 H 1 1 2.733 -0.466 3.398 0.00 0.00 0
ATOM 37 O 1 1 1.476 1.420 0.819 0.00 0.00 0
ATOM 38 H 1 1 1.060 0.568 0.631 0.00 0.00 0
ATOM 39 H 1 1 1.582 1.509 1.770 0.00 0.00 0
ATOM 40 O 1 1 1.222 4.946 3.218 0.00 0.00 0
ATOM 41 H 1 1 2.111 4.703 3.522 0.00 0.00 0
ATOM 42 H 1 1 1.342 4.956 2.245 0.00 0.00 0
ATOM 43 O 1 1 -3.470 6.491 4.488 0.00 0.00 0
ATOM 44 H 1 1 -3.177 5.755 5.074 0.00 0.00 0
ATOM 45 H 1 1 -3.513 7.293 4.975 0.00 0.00 0
ATOM 46 O 1 1 -0.930 3.465 4.430 0.00 0.00 0
ATOM 47 H 1 1 -0.286 3.956 3.918 0.00 0.00 0
ATOM 48 H 1 1 -1.677 3.143 3.966 0.00 0.00 0
ATOM 49 O 1 1 -2.776 4.543 6.379 0.00 0.00 0
ATOM 50 H 1 1 -2.656 4.450 7.328 0.00 0.00 0
ATOM 51 H 1 1 -2.019 4.098 5.987 0.00 0.00 0
ATOM 52 O 1 1 0.448 5.701 8.219 0.00 0.00 0
ATOM 53 H 1 1 0.573 4.840 7.871 0.00 0.00 0
ATOM 54 H 1 1 0.720 5.651 9.123 0.00 0.00 0
ATOM 55 O 1 1 10.996 4.082 0.545 0.00 0.00 0
ATOM 56 H 1 1 11.292 3.147 0.501 0.00 0.00 0
ATOM 57 H 1 1 10.010 3.978 0.476 0.00 0.00 0
ATOM 58 O 1 1 4.229 2.582 3.562 0.00 0.00 0
ATOM 59 H 1 1 4.650 2.364 4.424 0.00 0.00 0
ATOM 60 H 1 1 4.306 3.526 3.496 0.00 0.00 0
ATOM 61 O 1 1 14.009 5.318 3.591 0.00 0.00 0
ATOM 62 H 1 1 13.837 5.600 2.690 0.00 0.00 0
ATOM 63 H 1 1 14.779 5.812 3.831 0.00 0.00 0
ATOM 64 O 1 1 0.242 8.540 5.195 0.00 0.00 0
ATOM 65 H 1 1 0.243 9.452 5.454 0.00 0.00 0
ATOM 66 H 1 1 0.725 8.102 5.864 0.00 0.00 0
ATOM 67 O 1 1 6.065 10.503 8.171 0.00 0.00 0
ATOM 68 H 1 1 6.685 9.900 8.559 0.00 0.00 0
ATOM 69 H 1 1 5.235 10.240 8.586 0.00 0.00 0
ATOM 70 O 1 1 7.362 8.029 9.049 0.00 0.00 0
ATOM 71 H 1 1 6.719 7.831 8.312 0.00 0.00 0
ATOM 72 H 1 1 6.813 7.839 9.757 0.00 0.00 0
ATOM 73 O 1 1 1.971 1.171 3.631 0.00 0.00 0
ATOM 74 H 1 1 1.520 1.399 4.474 0.00 0.00 0
ATOM 75 H 1 1 2.821 1.577 3.533 0.00 0.00 0
ATOM 76 O 1 1 7.674 6.605 2.134 0.00 0.00 0
ATOM 77 H 1 1 7.143 6.490 2.918 0.00 0.00 0
ATOM 78 H 1 1 8.563 6.681 2.409 0.00 0.00 0
ATOM 79 O 1 1 2.769 7.384 7.275 0.00 0.00 0
ATOM 80 H 1 1 2.353 8.088 7.748 0.00 0.00 0
ATOM 81 H 1 1 2.249 6.554 7.408 0.00 0.00 0
ATOM 82 O 1 1 2.253 13.051 7.349 0.00 0.00 0
ATOM 83 H 1 1 2.718 13.490 8.076 0.00 0.00 0
ATOM 84 H 1 1 2.955 12.931 6.707 0.00 0.00 0
ATOM 85 O 1 1 3.652 9.953 9.290 0.00 0.00 0
ATOM 86 H 1 1 4.114 9.509 9.983 0.00 0.00 0
ATOM 87 H 1 1 3.199 10.639 9.784 0.00 0.00 0
ATOM 88 O 1 1 5.263 6.708 7.589 0.00 0.00 0
ATOM 89 H 1 1 4.318 7.082 7.707 0.00 0.00 0
ATOM 90 H 1 1 5.455 7.057 6.733 0.00 0.00 0
ATOM 91 O 1 1 3.507 6.721 1.020 0.00 0.00 0
ATOM 92 H 1 1 4.097 7.303 0.607 0.00 0.00 0
ATOM 93 H 1 1 3.586 5.984 0.419 0.00 0.00 0
ATOM 94 O 1 1 5.455 9.196 5.888 0.00 0.00 0
ATOM 95 H 1 1 5.473 9.602 6.758 0.00 0.00 0
ATOM 96 H 1 1 4.549 9.238 5.484 0.00 0.00 0
CRYST1 10.260 10.260 10.260 90.00 90.00 90.00 P 1
ATOM 1 O 1 1 3.756 4.710 9.494 0.00 0.00 O
ATOM 2 H 1 1 4.604 4.272 9.671 0.00 0.00 H
ATOM 3 H 1 1 3.998 5.320 8.788 0.00 0.00 H
ATOM 4 O 1 1 9.933 8.841 0.366 0.00 0.00 O
ATOM 5 H 1 1 10.132 8.196 1.120 0.00 0.00 H
ATOM 6 H 1 1 9.368 8.449 -0.316 0.00 0.00 H
ATOM 7 O 1 1 0.321 1.492 5.796 0.00 0.00 O
ATOM 8 H 1 1 -0.287 1.993 5.241 0.00 0.00 H
ATOM 9 H 1 1 0.791 2.061 6.364 0.00 0.00 H
ATOM 10 O 1 1 8.035 9.735 4.307 0.00 0.00 O
ATOM 11 H 1 1 7.203 9.789 4.847 0.00 0.00 H
ATOM 12 H 1 1 8.636 9.307 4.920 0.00 0.00 H
ATOM 13 O 1 1 5.663 9.082 0.660 0.00 0.00 O
ATOM 14 H 1 1 6.378 9.721 0.814 0.00 0.00 H
ATOM 15 H 1 1 5.213 8.991 1.552 0.00 0.00 H
ATOM 16 O 1 1 8.130 0.215 1.201 0.00 0.00 O
ATOM 17 H 1 1 8.196 -0.065 2.118 0.00 0.00 H
ATOM 18 H 1 1 8.938 -0.161 0.818 0.00 0.00 H
ATOM 19 O 1 1 8.177 4.165 0.716 0.00 0.00 O
ATOM 20 H 1 1 7.895 5.066 0.840 0.00 0.00 H
ATOM 21 H 1 1 7.722 3.562 1.341 0.00 0.00 H
ATOM 22 O 1 1 6.341 3.256 9.678 0.00 0.00 O
ATOM 23 H 1 1 7.133 3.423 10.189 0.00 0.00 H
ATOM 24 H 1 1 6.507 2.398 9.350 0.00 0.00 H
ATOM 25 O 1 1 0.136 7.798 2.738 0.00 0.00 O
ATOM 26 H 1 1 -0.006 8.300 3.584 0.00 0.00 H
ATOM 27 H 1 1 0.314 6.905 2.966 0.00 0.00 H
ATOM 28 O 1 1 5.027 2.563 6.169 0.00 0.00 O
ATOM 29 H 1 1 5.538 3.336 6.262 0.00 0.00 H
ATOM 30 H 1 1 5.313 2.031 6.922 0.00 0.00 H
ATOM 31 O 1 1 7.164 2.542 2.418 0.00 0.00 O
ATOM 32 H 1 1 6.248 2.467 2.667 0.00 0.00 H
ATOM 33 H 1 1 7.384 1.681 2.057 0.00 0.00 H
ATOM 34 O 1 1 3.336 9.051 3.265 0.00 0.00 O
ATOM 35 H 1 1 2.818 8.341 2.787 0.00 0.00 H
ATOM 36 H 1 1 2.733 9.794 3.398 0.00 0.00 H
ATOM 37 O 1 1 1.476 1.420 0.819 0.00 0.00 O
ATOM 38 H 1 1 1.060 0.568 0.631 0.00 0.00 H
ATOM 39 H 1 1 1.582 1.509 1.770 0.00 0.00 H
ATOM 40 O 1 1 1.222 4.946 3.218 0.00 0.00 O
ATOM 41 H 1 1 2.111 4.703 3.522 0.00 0.00 H
ATOM 42 H 1 1 1.342 4.956 2.245 0.00 0.00 H
ATOM 43 O 1 1 6.790 6.491 4.488 0.00 0.00 O
ATOM 44 H 1 1 7.083 5.755 5.074 0.00 0.00 H
ATOM 45 H 1 1 6.747 7.293 4.975 0.00 0.00 H
ATOM 46 O 1 1 9.330 3.465 4.430 0.00 0.00 O
ATOM 47 H 1 1 9.974 3.956 3.918 0.00 0.00 H
ATOM 48 H 1 1 8.583 3.143 3.966 0.00 0.00 H
ATOM 49 O 1 1 7.484 4.543 6.379 0.00 0.00 O
ATOM 50 H 1 1 7.604 4.450 7.328 0.00 0.00 H
ATOM 51 H 1 1 8.241 4.098 5.987 0.00 0.00 H
ATOM 52 O 1 1 0.448 5.701 8.219 0.00 0.00 O
ATOM 53 H 1 1 0.573 4.840 7.871 0.00 0.00 H
ATOM 54 H 1 1 0.720 5.651 9.123 0.00 0.00 H
ATOM 55 O 1 1 0.736 4.082 0.545 0.00 0.00 O
ATOM 56 H 1 1 1.032 3.147 0.501 0.00 0.00 H
ATOM 57 H 1 1 -0.250 3.978 0.476 0.00 0.00 H
ATOM 58 O 1 1 4.229 2.582 3.562 0.00 0.00 O
ATOM 59 H 1 1 4.650 2.364 4.424 0.00 0.00 H
ATOM 60 H 1 1 4.306 3.526 3.496 0.00 0.00 H
ATOM 61 O 1 1 3.749 5.318 3.591 0.00 0.00 O
ATOM 62 H 1 1 3.577 5.600 2.690 0.00 0.00 H
ATOM 63 H 1 1 4.519 5.812 3.831 0.00 0.00 H
ATOM 64 O 1 1 0.242 8.540 5.195 0.00 0.00 O
ATOM 65 H 1 1 0.243 9.452 5.454 0.00 0.00 H
ATOM 66 H 1 1 0.725 8.102 5.864 0.00 0.00 H
ATOM 67 O 1 1 6.065 0.243 8.171 0.00 0.00 O
ATOM 68 H 1 1 6.685 -0.360 8.559 0.00 0.00 H
ATOM 69 H 1 1 5.235 -0.020 8.586 0.00 0.00 H
ATOM 70 O 1 1 7.362 8.029 9.049 0.00 0.00 O
ATOM 71 H 1 1 6.719 7.831 8.312 0.00 0.00 H
ATOM 72 H 1 1 6.813 7.839 9.757 0.00 0.00 H
ATOM 73 O 1 1 1.971 1.171 3.631 0.00 0.00 O
ATOM 74 H 1 1 1.520 1.399 4.474 0.00 0.00 H
ATOM 75 H 1 1 2.821 1.577 3.533 0.00 0.00 H
ATOM 76 O 1 1 7.674 6.605 2.134 0.00 0.00 O
ATOM 77 H 1 1 7.143 6.490 2.918 0.00 0.00 H
ATOM 78 H 1 1 8.563 6.681 2.409 0.00 0.00 H
ATOM 79 O 1 1 2.769 7.384 7.275 0.00 0.00 O
ATOM 80 H 1 1 2.353 8.088 7.748 0.00 0.00 H
ATOM 81 H 1 1 2.249 6.554 7.408 0.00 0.00 H
ATOM 82 O 1 1 2.253 2.791 7.349 0.00 0.00 O
ATOM 83 H 1 1 2.718 3.230 8.076 0.00 0.00 H
ATOM 84 H 1 1 2.955 2.671 6.707 0.00 0.00 H
ATOM 85 O 1 1 3.652 9.953 9.290 0.00 0.00 O
ATOM 86 H 1 1 4.114 9.509 9.983 0.00 0.00 H
ATOM 87 H 1 1 3.199 10.639 9.784 0.00 0.00 H
ATOM 88 O 1 1 5.263 6.708 7.589 0.00 0.00 O
ATOM 89 H 1 1 4.318 7.082 7.707 0.00 0.00 H
ATOM 90 H 1 1 5.455 7.057 6.733 0.00 0.00 H
ATOM 91 O 1 1 3.507 6.721 1.020 0.00 0.00 O
ATOM 92 H 1 1 4.097 7.303 0.607 0.00 0.00 H
ATOM 93 H 1 1 3.586 5.984 0.419 0.00 0.00 H
ATOM 94 O 1 1 5.455 9.196 5.888 0.00 0.00 O
ATOM 95 H 1 1 5.473 9.602 6.758 0.00 0.00 H
ATOM 96 H 1 1 4.549 9.238 5.484 0.00 0.00 H
END

0 comments on commit 0cad60d

Please sign in to comment.