Skip to content

Commit

Permalink
Finished writing basic regression test for metatensor
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Aneurin Tribello authored and Gareth Aneurin Tribello committed Apr 24, 2024
1 parent 343eaae commit e3369d4
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 3 deletions.
7 changes: 6 additions & 1 deletion regtest/metatensor/rt-soap/config
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
plumed_modules=metatensor
plumed_needs=metatensor
type=driver
arg="--plumed plumed.dat --ixyz crystal_structure.xyz --dump-forces forces --dump-forces-fmt %8.4f --debug-forces forces.num"
arg="--plumed plumed.dat --ixyz crystal_structure.xyz --dump-forces forces --dump-forces-fmt %8.4f" # --debug-forces forces.num"

function plumed_regtest_before(){
python soap_cv.py
echo Generated model using soap_cv.py
}
78 changes: 78 additions & 0 deletions regtest/metatensor/rt-soap/forces.reference
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
76
-2385.3973 -2758.6366 -2559.3318
X -0.5046 -14.7610 -5.7792
X 11.2221 -13.7503 -2.5009
X 8.2975 9.9633 -1.3084
X 12.8829 14.8549 0.7372
X 8.8858 -3.9104 7.3002
X 8.8146 -14.1253 -2.7495
X -1.6740 9.7549 -6.4020
X -2.0899 1.0994 -3.1687
X 6.7163 0.1327 -5.4507
X 14.5098 -2.9457 -2.7676
X -15.0075 -9.4578 -11.8655
X 6.1580 1.9497 -12.5317
X -5.6680 -3.1184 5.2709
X 0.5216 15.5032 4.8350
X -11.7193 10.8937 1.6692
X -12.5984 -17.3580 -1.1848
X -10.2301 -8.3875 4.9173
X -5.2731 4.4699 -4.4445
X -8.9411 11.8663 3.4916
X 1.0432 -11.4657 5.4313
X 1.9849 0.5634 1.8931
X -9.1496 3.3735 2.6638
X -16.0344 2.6388 2.2717
X 14.7061 11.6954 12.5884
X -1.5820 -2.8634 11.4844
X 6.0777 7.5459 -4.3212
X 10.5329 6.4225 1.8260
X 11.5813 -4.1084 7.5776
X 9.6609 7.9748 17.2989
X 12.4542 2.8960 6.5601
X 11.7491 -1.3933 -4.3450
X 6.2641 6.5727 1.1517
X 32.6713 -2.8616 6.5997
X 24.9675 1.2945 -9.3590
X -5.4890 10.6526 -11.2037
X 4.3650 16.0808 12.9214
X -6.6853 -10.6213 -2.6347
X -12.7090 0.6703 -0.8864
X -9.2591 12.3285 -3.9852
X -1.2792 0.5233 -6.6290
X -16.4085 15.5389 -18.7056
X -15.8455 -8.9101 -4.6598
X 2.3318 -4.1716 -3.4480
X 10.6375 11.3446 -9.4963
X -9.6671 -10.4088 8.3804
X -3.3161 3.0531 4.2898
X -10.3911 -6.2835 -3.6980
X -10.9603 6.2966 -7.7771
X -9.1254 -5.3706 -16.6306
X -12.1060 -5.0129 -3.7650
X -9.6199 2.7982 3.5275
X -8.0137 -5.9342 0.4336
X -25.0567 -2.6040 5.7738
X -32.7334 0.0515 -5.4123
X 6.7513 -13.8447 15.7283
X -6.0256 -16.4669 -10.4181
X 5.1973 7.7844 3.7303
X 11.5801 -3.2893 -2.7509
X 9.2378 -13.8778 5.6868
X 1.7723 -0.1722 7.0570
X 14.1668 -15.9527 15.3801
X 14.4890 8.1284 4.0597
X 5.5686 -10.0483 5.5589
X 11.9005 8.6205 -12.7022
X 12.2728 5.7701 2.8822
X 1.8197 -2.2371 -3.9078
X 17.8959 2.8505 8.6345
X -7.9229 10.7577 -10.5727
X 2.0422 1.8151 4.0374
X -4.9811 0.1890 -2.5605
X -4.2991 11.4937 -6.5989
X -11.7770 -9.5720 9.9282
X -10.0465 -6.8534 -3.3167
X -0.2786 5.7009 5.1555
X -17.2474 -0.5899 -9.2182
X 7.9853 -11.1857 10.4230
4 changes: 2 additions & 2 deletions regtest/metatensor/rt-soap/plumed.dat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
soap: METATENSOR ...
MODEL=soap_cv.pt
EXTENSIONS_DIRECTORY=../extensions
EXTENSIONS_DIRECTORY=extensions

SPECIES1=1-26
SPECIES2=27-62
Expand All @@ -13,4 +13,4 @@ scalar: SUM ARG=soap PERIODIC=NO
BIASVALUE ARG=scalar


PRINT ARG=soap FILE=soap.matx STRIDE=1 FMT=%8.4f
PRINT ARG=soap FILE=soap_data STRIDE=1 FMT=%8.4f
1 change: 1 addition & 0 deletions regtest/metatensor/rt-soap/soap_cv.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def __init__(self, species):
atomic_gaussian_width=0.3,
)

torch.manual_seed(-230623)
self.register_buffer("pca_projection", torch.rand(2520, 3, dtype=torch.float64))

def forward(
Expand Down
2 changes: 2 additions & 0 deletions regtest/metatensor/rt-soap/soap_data.reference
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#! FIELDS time soap.1.1 soap.1.2 soap.1.3 soap.2.1 soap.2.2 soap.2.3 soap.3.1 soap.3.2 soap.3.3 soap.4.1 soap.4.2 soap.4.3 soap.5.1 soap.5.2 soap.5.3 soap.6.1 soap.6.2 soap.6.3 soap.7.1 soap.7.2 soap.7.3 soap.8.1 soap.8.2 soap.8.3 soap.9.1 soap.9.2 soap.9.3 soap.10.1 soap.10.2 soap.10.3 soap.11.1 soap.11.2 soap.11.3 soap.12.1 soap.12.2 soap.12.3 soap.13.1 soap.13.2 soap.13.3 soap.14.1 soap.14.2 soap.14.3 soap.15.1 soap.15.2 soap.15.3 soap.16.1 soap.16.2 soap.16.3 soap.17.1 soap.17.2 soap.17.3 soap.18.1 soap.18.2 soap.18.3 soap.19.1 soap.19.2 soap.19.3 soap.20.1 soap.20.2 soap.20.3 soap.21.1 soap.21.2 soap.21.3 soap.22.1 soap.22.2 soap.22.3 soap.23.1 soap.23.2 soap.23.3 soap.24.1 soap.24.2 soap.24.3 soap.25.1 soap.25.2 soap.25.3 soap.26.1 soap.26.2 soap.26.3 soap.27.1 soap.27.2 soap.27.3 soap.28.1 soap.28.2 soap.28.3 soap.29.1 soap.29.2 soap.29.3 soap.30.1 soap.30.2 soap.30.3 soap.31.1 soap.31.2 soap.31.3 soap.32.1 soap.32.2 soap.32.3 soap.33.1 soap.33.2 soap.33.3 soap.34.1 soap.34.2 soap.34.3 soap.35.1 soap.35.2 soap.35.3 soap.36.1 soap.36.2 soap.36.3 soap.37.1 soap.37.2 soap.37.3 soap.38.1 soap.38.2 soap.38.3 soap.39.1 soap.39.2 soap.39.3 soap.40.1 soap.40.2 soap.40.3 soap.41.1 soap.41.2 soap.41.3 soap.42.1 soap.42.2 soap.42.3 soap.43.1 soap.43.2 soap.43.3 soap.44.1 soap.44.2 soap.44.3 soap.45.1 soap.45.2 soap.45.3 soap.46.1 soap.46.2 soap.46.3 soap.47.1 soap.47.2 soap.47.3 soap.48.1 soap.48.2 soap.48.3 soap.49.1 soap.49.2 soap.49.3 soap.50.1 soap.50.2 soap.50.3 soap.51.1 soap.51.2 soap.51.3 soap.52.1 soap.52.2 soap.52.3 soap.53.1 soap.53.2 soap.53.3 soap.54.1 soap.54.2 soap.54.3 soap.55.1 soap.55.2 soap.55.3 soap.56.1 soap.56.2 soap.56.3 soap.57.1 soap.57.2 soap.57.3 soap.58.1 soap.58.2 soap.58.3 soap.59.1 soap.59.2 soap.59.3 soap.60.1 soap.60.2 soap.60.3 soap.61.1 soap.61.2 soap.61.3 soap.62.1 soap.62.2 soap.62.3 soap.63.1 soap.63.2 soap.63.3 soap.64.1 soap.64.2 soap.64.3 soap.65.1 soap.65.2 soap.65.3 soap.66.1 soap.66.2 soap.66.3 soap.67.1 soap.67.2 soap.67.3 soap.68.1 soap.68.2 soap.68.3 soap.69.1 soap.69.2 soap.69.3 soap.70.1 soap.70.2 soap.70.3 soap.71.1 soap.71.2 soap.71.3 soap.72.1 soap.72.2 soap.72.3 soap.73.1 soap.73.2 soap.73.3 soap.74.1 soap.74.2 soap.74.3 soap.75.1 soap.75.2 soap.75.3 soap.76.1 soap.76.2 soap.76.3
0.000000 5.3739 5.3189 6.4924 6.0785 6.3903 6.9409 5.2246 4.6212 5.9061 4.1511 4.0573 4.7709 4.5764 5.2386 5.4536 6.4097 6.9494 8.0462 8.3058 7.8752 8.8313 8.1728 7.8564 9.1499 9.2198 7.6869 10.0432 10.1818 9.0589 10.5571 7.8038 8.0779 8.1486 8.2261 8.2375 8.9137 13.1112 11.5062 14.2129 5.3234 5.3345 6.4221 6.0131 6.2499 6.8923 4.0665 4.0244 4.6783 5.4611 4.8335 6.1604 4.5678 5.1760 5.4657 6.5298 7.0866 8.2041 8.3052 7.9518 8.8008 8.3534 7.9700 9.2914 8.9858 7.4976 9.8040 10.0939 8.8693 10.4755 7.8831 8.1124 8.1852 8.4525 8.4195 9.0012 12.6083 11.1732 13.7332 3.1853 2.4422 3.0983 5.2847 4.0223 4.7505 5.0764 3.9788 5.3169 2.7503 2.2456 3.0933 7.5482 5.6437 8.4672 4.7878 3.7804 5.2445 6.6407 5.3949 6.5881 5.7626 4.5726 5.4500 9.2051 7.5949 9.2700 10.6522 9.2379 11.5987 6.8246 5.2193 6.7261 8.7895 6.4347 8.5113 9.8873 8.1552 9.4047 7.4054 5.5790 7.6670 9.4045 7.5583 9.4808 9.3070 7.5297 9.3143 3.8911 2.8561 3.8631 4.4872 3.0042 4.1091 4.3846 2.9167 4.0029 3.8727 2.8685 3.8882 3.1977 2.4422 3.1223 5.3178 4.0774 4.8516 5.2391 4.1314 5.3919 2.7439 2.2344 3.0599 7.4101 5.6020 8.4271 4.8090 3.7893 5.2875 5.3773 4.2736 5.1331 6.6020 5.2857 6.5914 9.1471 7.5439 9.1758 10.3645 9.0638 11.3519 6.9691 5.3286 6.8511 8.8125 6.4630 8.4846 9.6834 7.8991 9.1113 7.2170 5.4853 7.5350 9.2268 7.3981 9.4124 9.2451 7.4593 9.2829 4.2800 4.4397 4.6966 6.3508 6.4476 7.6988 7.0824 6.4238 8.0042 4.4644 4.7579 5.9902 6.9691 5.9845 7.2233 5.7645 5.3416 6.2066 4.8573 4.2211 5.0366 4.8218 4.1793 5.0233 4.2408 4.4088 4.6487 6.3222 6.4139 7.6069 6.9824 6.3145 7.8332 4.5577 4.8675 6.2457 6.8375 5.8557 7.1789 5.7201 5.3280 6.1530

0 comments on commit e3369d4

Please sign in to comment.