From 78b5b85ae71eed23b1386e2f301fd83f1ea41165 Mon Sep 17 00:00:00 2001 From: Gareth Aneurin Tribello Date: Wed, 13 Sep 2023 13:48:03 +0100 Subject: [PATCH] Can now do multiple matrix vector products with MATRIX_TIMES_VECTOR The ability to multiply multiple matrices by a single vector or a single matrix by multiple vectors is useful when you calculate Steinhardt parameters. Previously I used multiple MATRIX_VECTOR_PRODUCT actions to do all these operations. When implemented this way, however, there is some additional computational overhead. By allowing all the matrix vector multiplications to take place in a single action you reduce the computational expense. --- .../symfunc/rt-cmap-times-stack/plumed.dat | 12 +- regtest/symfunc/rt-dumpmulti/plumed.dat | 52 +++--- regtest/symfunc/rt-matrix-tricks/plumed.dat | 36 ++-- regtest/symfunc/rt-nbonds-one-q6/plumed.dat | 2 +- regtest/symfunc/rt-nbonds-q6/plumed.dat | 4 +- regtest/symfunc/rt-ntwo-lq6/plumed.dat | 12 +- regtest/symfunc/rt-small-lq6/plumed.dat | 4 +- regtest/symfunc/rt-small-q6/plumed.dat | 4 +- .../rt-two-coord-stack-mult-q1-av/plumed.dat | 12 +- .../plumed.dat | 12 +- .../plumed.dat | 12 +- .../rt-two-coord-stack-mult-q1/plumed.dat | 12 +- regtest/symfunc/rt-two-lq1/plumed.dat | 2 +- regtest/symfunc/rt-two-lq6/plumed.dat | 2 +- regtest/symfunc/rt-two-nonorm/plumed.dat | 2 +- regtest/symfunc/rt-two-norm/plumed.dat | 2 +- regtest/symfunc/rt-two-q6/plumed.dat | 2 +- regtest/volumes/rt-volume/plumed.dat | 52 +++--- src/adjmat/MatrixTimesVector.cpp | 122 +++++++++++--- src/adjmat/StackProduct.cpp | 154 ------------------ src/symfunc/LocalAverage.cpp | 11 +- src/symfunc/LocalSteinhardt.cpp | 4 +- src/symfunc/Steinhardt.cpp | 14 +- 23 files changed, 223 insertions(+), 318 deletions(-) delete mode 100644 src/adjmat/StackProduct.cpp diff --git a/regtest/symfunc/rt-cmap-times-stack/plumed.dat b/regtest/symfunc/rt-cmap-times-stack/plumed.dat index cc9a6a3e98..8da0966e9d 100644 --- a/regtest/symfunc/rt-cmap-times-stack/plumed.dat +++ b/regtest/symfunc/rt-cmap-times-stack/plumed.dat @@ -1,11 +1,11 @@ q1: Q1 SPECIESA=1,2 SPECIESB=1-64 D_0=3.0 R_0=1.5 NN=12 SUM -q1_rmn-n1: CUSTOM ARG=q1_rm-n1,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-n1: CUSTOM ARG=q1_im-n1,q1_denom FUNC=x/y PERIODIC=NO -q1_rmn-0: CUSTOM ARG=q1_rm-0,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-0: CUSTOM ARG=q1_im-0,q1_denom FUNC=x/y PERIODIC=NO -q1_rmn-p1: CUSTOM ARG=q1_rm-p1,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-p1: CUSTOM ARG=q1_im-p1,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-n1: CUSTOM ARG=q1_sp.rm-n1,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-n1: CUSTOM ARG=q1_sp.im-n1,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-0: CUSTOM ARG=q1_sp.rm-0,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-0: CUSTOM ARG=q1_sp.im-0,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-p1: CUSTOM ARG=q1_sp.rm-p1,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-p1: CUSTOM ARG=q1_sp.im-p1,q1_denom FUNC=x/y PERIODIC=NO w1_vstack: VSTACK ARG=q1_rmn-n1,q1_imn-n1,q1_rmn-0,q1_imn-0,q1_rmn-p1,q1_imn-p1 cmat: CONTACT_MATRIX GROUP=1,2 SWITCH={RATIONAL D_0=3.0 R_0=1.5} diff --git a/regtest/symfunc/rt-dumpmulti/plumed.dat b/regtest/symfunc/rt-dumpmulti/plumed.dat index 3dc0dd11d3..20e56a258d 100644 --- a/regtest/symfunc/rt-dumpmulti/plumed.dat +++ b/regtest/symfunc/rt-dumpmulti/plumed.dat @@ -3,32 +3,32 @@ DUMPATOMS ARG=c ATOMS=c FILE=coordination.xyz PRECISION=4 q6: Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 NN=12 MM=24 -q6n_rmn-[-6]: CUSTOM ARG1=q6_rm-n6 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_rmn-[-5]: CUSTOM ARG1=q6_rm-n5 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_rmn-[-4]: CUSTOM ARG1=q6_rm-n4 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_rmn-[-3]: CUSTOM ARG1=q6_rm-n3 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_rmn-[-2]: CUSTOM ARG1=q6_rm-n2 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_rmn-[-1]: CUSTOM ARG1=q6_rm-n1 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_rmn-[0]: CUSTOM ARG1=q6_rm-0 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_rmn-[1]: CUSTOM ARG1=q6_rm-p1 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_rmn-[2]: CUSTOM ARG1=q6_rm-p2 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_rmn-[3]: CUSTOM ARG1=q6_rm-p3 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_rmn-[4]: CUSTOM ARG1=q6_rm-p4 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_rmn-[5]: CUSTOM ARG1=q6_rm-p5 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_rmn-[6]: CUSTOM ARG1=q6_rm-p6 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_imn-[-6]: CUSTOM ARG1=q6_im-n6 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_imn-[-5]: CUSTOM ARG1=q6_im-n5 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_imn-[-4]: CUSTOM ARG1=q6_im-n4 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_imn-[-3]: CUSTOM ARG1=q6_im-n3 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_imn-[-2]: CUSTOM ARG1=q6_im-n2 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_imn-[-1]: CUSTOM ARG1=q6_im-n1 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_imn-[0]: CUSTOM ARG1=q6_im-0 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_imn-[1]: CUSTOM ARG1=q6_im-p1 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_imn-[2]: CUSTOM ARG1=q6_im-p2 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_imn-[3]: CUSTOM ARG1=q6_im-p3 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_imn-[4]: CUSTOM ARG1=q6_im-p4 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_imn-[5]: CUSTOM ARG1=q6_im-p5 ARG2=q6_norm FUNC=x/y PERIODIC=NO -q6n_imn-[6]: CUSTOM ARG1=q6_im-p6 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_rmn-[-6]: CUSTOM ARG1=q6_sp.rm-n6 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_rmn-[-5]: CUSTOM ARG1=q6_sp.rm-n5 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_rmn-[-4]: CUSTOM ARG1=q6_sp.rm-n4 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_rmn-[-3]: CUSTOM ARG1=q6_sp.rm-n3 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_rmn-[-2]: CUSTOM ARG1=q6_sp.rm-n2 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_rmn-[-1]: CUSTOM ARG1=q6_sp.rm-n1 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_rmn-[0]: CUSTOM ARG1=q6_sp.rm-0 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_rmn-[1]: CUSTOM ARG1=q6_sp.rm-p1 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_rmn-[2]: CUSTOM ARG1=q6_sp.rm-p2 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_rmn-[3]: CUSTOM ARG1=q6_sp.rm-p3 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_rmn-[4]: CUSTOM ARG1=q6_sp.rm-p4 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_rmn-[5]: CUSTOM ARG1=q6_sp.rm-p5 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_rmn-[6]: CUSTOM ARG1=q6_sp.rm-p6 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_imn-[-6]: CUSTOM ARG1=q6_sp.im-n6 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_imn-[-5]: CUSTOM ARG1=q6_sp.im-n5 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_imn-[-4]: CUSTOM ARG1=q6_sp.im-n4 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_imn-[-3]: CUSTOM ARG1=q6_sp.im-n3 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_imn-[-2]: CUSTOM ARG1=q6_sp.im-n2 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_imn-[-1]: CUSTOM ARG1=q6_sp.im-n1 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_imn-[0]: CUSTOM ARG1=q6_sp.im-0 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_imn-[1]: CUSTOM ARG1=q6_sp.im-p1 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_imn-[2]: CUSTOM ARG1=q6_sp.im-p2 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_imn-[3]: CUSTOM ARG1=q6_sp.im-p3 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_imn-[4]: CUSTOM ARG1=q6_sp.im-p4 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_imn-[5]: CUSTOM ARG1=q6_sp.im-p5 ARG2=q6_norm FUNC=x/y PERIODIC=NO +q6n_imn-[6]: CUSTOM ARG1=q6_sp.im-p6 ARG2=q6_norm FUNC=x/y PERIODIC=NO DUMPATOMS ATOMS=q6 ARG=q6_anorm,q6n_rmn-[-6],q6n_rmn-[-5],q6n_rmn-[-4],q6n_rmn-[-3],q6n_rmn-[-2],q6n_rmn-[-1],q6n_rmn-[0],q6n_rmn-[1],q6n_rmn-[2],q6n_rmn-[3],q6n_rmn-[4],q6n_rmn-[5],q6n_rmn-[6],q6n_imn-[-6],q6n_imn-[-5],q6n_imn-[-4],q6n_imn-[-3],q6n_imn-[-2],q6n_imn-[-1],q6n_imn-[0],q6n_imn-[1],q6n_imn-[2],q6n_imn-[3],q6n_imn-[4],q6n_imn-[5],q6n_imn-[6] FILE=q6.xyz PRECISION=4 diff --git a/regtest/symfunc/rt-matrix-tricks/plumed.dat b/regtest/symfunc/rt-matrix-tricks/plumed.dat index e425f6e124..47990b3e3c 100644 --- a/regtest/symfunc/rt-matrix-tricks/plumed.dat +++ b/regtest/symfunc/rt-matrix-tricks/plumed.dat @@ -1,23 +1,23 @@ q4: Q4 SPECIES=1-64 D_0=3.0 R_0=1.5 NN=12 MEAN -nq4_rm-n4: CUSTOM ARG=q4_rm-n4,q4_norm FUNC=x/y PERIODIC=NO -nq4_im-n4: CUSTOM ARG=q4_im-n4,q4_norm FUNC=x/y PERIODIC=NO -nq4_rm-n3: CUSTOM ARG=q4_rm-n3,q4_norm FUNC=x/y PERIODIC=NO -nq4_im-n3: CUSTOM ARG=q4_im-n3,q4_norm FUNC=x/y PERIODIC=NO -nq4_rm-n2: CUSTOM ARG=q4_rm-n2,q4_norm FUNC=x/y PERIODIC=NO -nq4_im-n2: CUSTOM ARG=q4_im-n2,q4_norm FUNC=x/y PERIODIC=NO -nq4_rm-n1: CUSTOM ARG=q4_rm-n1,q4_norm FUNC=x/y PERIODIC=NO -nq4_im-n1: CUSTOM ARG=q4_im-n1,q4_norm FUNC=x/y PERIODIC=NO -nq4_rm-0: CUSTOM ARG=q4_rm-0,q4_norm FUNC=x/y PERIODIC=NO -nq4_im-0: CUSTOM ARG=q4_im-0,q4_norm FUNC=x/y PERIODIC=NO -nq4_rm-p1: CUSTOM ARG=q4_rm-p1,q4_norm FUNC=x/y PERIODIC=NO -nq4_im-p1: CUSTOM ARG=q4_im-p1,q4_norm FUNC=x/y PERIODIC=NO -nq4_rm-p2: CUSTOM ARG=q4_rm-p2,q4_norm FUNC=x/y PERIODIC=NO -nq4_im-p2: CUSTOM ARG=q4_im-p2,q4_norm FUNC=x/y PERIODIC=NO -nq4_rm-p3: CUSTOM ARG=q4_rm-p3,q4_norm FUNC=x/y PERIODIC=NO -nq4_im-p3: CUSTOM ARG=q4_im-p3,q4_norm FUNC=x/y PERIODIC=NO -nq4_rm-p4: CUSTOM ARG=q4_rm-p4,q4_norm FUNC=x/y PERIODIC=NO -nq4_im-p4: CUSTOM ARG=q4_im-p4,q4_norm FUNC=x/y PERIODIC=NO +nq4_rm-n4: CUSTOM ARG=q4_sp.rm-n4,q4_norm FUNC=x/y PERIODIC=NO +nq4_im-n4: CUSTOM ARG=q4_sp.im-n4,q4_norm FUNC=x/y PERIODIC=NO +nq4_rm-n3: CUSTOM ARG=q4_sp.rm-n3,q4_norm FUNC=x/y PERIODIC=NO +nq4_im-n3: CUSTOM ARG=q4_sp.im-n3,q4_norm FUNC=x/y PERIODIC=NO +nq4_rm-n2: CUSTOM ARG=q4_sp.rm-n2,q4_norm FUNC=x/y PERIODIC=NO +nq4_im-n2: CUSTOM ARG=q4_sp.im-n2,q4_norm FUNC=x/y PERIODIC=NO +nq4_rm-n1: CUSTOM ARG=q4_sp.rm-n1,q4_norm FUNC=x/y PERIODIC=NO +nq4_im-n1: CUSTOM ARG=q4_sp.im-n1,q4_norm FUNC=x/y PERIODIC=NO +nq4_rm-0: CUSTOM ARG=q4_sp.rm-0,q4_norm FUNC=x/y PERIODIC=NO +nq4_im-0: CUSTOM ARG=q4_sp.im-0,q4_norm FUNC=x/y PERIODIC=NO +nq4_rm-p1: CUSTOM ARG=q4_sp.rm-p1,q4_norm FUNC=x/y PERIODIC=NO +nq4_im-p1: CUSTOM ARG=q4_sp.im-p1,q4_norm FUNC=x/y PERIODIC=NO +nq4_rm-p2: CUSTOM ARG=q4_sp.rm-p2,q4_norm FUNC=x/y PERIODIC=NO +nq4_im-p2: CUSTOM ARG=q4_sp.im-p2,q4_norm FUNC=x/y PERIODIC=NO +nq4_rm-p3: CUSTOM ARG=q4_sp.rm-p3,q4_norm FUNC=x/y PERIODIC=NO +nq4_im-p3: CUSTOM ARG=q4_sp.im-p3,q4_norm FUNC=x/y PERIODIC=NO +nq4_rm-p4: CUSTOM ARG=q4_sp.rm-p4,q4_norm FUNC=x/y PERIODIC=NO +nq4_im-p4: CUSTOM ARG=q4_sp.im-p4,q4_norm FUNC=x/y PERIODIC=NO data4: VSTACK ARG=nq4_rm-n4,nq4_im-n4,nq4_rm-n3,nq4_im-n3,nq4_rm-n2,nq4_im-n2,nq4_rm-n1,nq4_im-n1,nq4_rm-0,nq4_im-0,nq4_rm-p1,nq4_im-p1,nq4_rm-p2,nq4_im-p2,nq4_rm-p3,nq4_im-p3,nq4_rm-p4,nq4_im-p4 diff --git a/regtest/symfunc/rt-nbonds-one-q6/plumed.dat b/regtest/symfunc/rt-nbonds-one-q6/plumed.dat index 0d2343597c..074f8779aa 100644 --- a/regtest/symfunc/rt-nbonds-one-q6/plumed.dat +++ b/regtest/symfunc/rt-nbonds-one-q6/plumed.dat @@ -3,7 +3,7 @@ q6: Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 NN=12 MEAN # Create a normalising matrix q6_uones: ONES SIZE=26 q6_nmat: OUTER_PRODUCT ARG=q6_norm,q6_uones -udata6: VSTACK ARG=q6_rm-n6,q6_im-n6,q6_rm-n5,q6_im-n5,q6_rm-n4,q6_im-n4,q6_rm-n3,q6_im-n3,q6_rm-n2,q6_im-n2,q6_rm-n1,q6_im-n1,q6_rm-0,q6_im-0,q6_rm-p1,q6_im-p1,q6_rm-p2,q6_im-p2,q6_rm-p3,q6_im-p3,q6_rm-p4,q6_im-p4,q6_rm-p5,q6_im-p5,q6_rm-p6,q6_im-p6 +udata6: VSTACK ARG=q6_sp.* data6: CUSTOM ARG=udata6,q6_nmat FUNC=x/y PERIODIC=NO data6T: TRANSPOSE ARG=data6 diff --git a/regtest/symfunc/rt-nbonds-q6/plumed.dat b/regtest/symfunc/rt-nbonds-q6/plumed.dat index eeceff2d47..1b396af1cc 100644 --- a/regtest/symfunc/rt-nbonds-q6/plumed.dat +++ b/regtest/symfunc/rt-nbonds-q6/plumed.dat @@ -4,14 +4,14 @@ q4: Q4 SPECIES=1-64 D_0=3.0 R_0=1.5 NN=12 MEAN # Create a normalising matrix q6_uones: ONES SIZE=26 q6_nmat: OUTER_PRODUCT ARG=q6_norm,q6_uones -udata6: VSTACK ARG=q6_rm-n6,q6_im-n6,q6_rm-n5,q6_im-n5,q6_rm-n4,q6_im-n4,q6_rm-n3,q6_im-n3,q6_rm-n2,q6_im-n2,q6_rm-n1,q6_im-n1,q6_rm-0,q6_im-0,q6_rm-p1,q6_im-p1,q6_rm-p2,q6_im-p2,q6_rm-p3,q6_im-p3,q6_rm-p4,q6_im-p4,q6_rm-p5,q6_im-p5,q6_rm-p6,q6_im-p6 +udata6: VSTACK ARG=q6_sp.* data6: CUSTOM ARG=udata6,q6_nmat FUNC=x/y PERIODIC=NO data6T: TRANSPOSE ARG=data6 # Create a normalising matrix q4_uones: ONES SIZE=18 q4_nmat: OUTER_PRODUCT ARG=q4_norm,q4_uones -udata4: VSTACK ARG=q4_rm-n4,q4_im-n4,q4_rm-n3,q4_im-n3,q4_rm-n2,q4_im-n2,q4_rm-n1,q4_im-n1,q4_rm-0,q4_im-0,q4_rm-p1,q4_im-p1,q4_rm-p2,q4_im-p2,q4_rm-p3,q4_im-p3,q4_rm-p4,q4_im-p4 +udata4: VSTACK ARG=q4_sp.* data4: CUSTOM ARG=udata4,q4_nmat FUNC=x/y PERIODIC=NO data4T: TRANSPOSE ARG=data4 diff --git a/regtest/symfunc/rt-ntwo-lq6/plumed.dat b/regtest/symfunc/rt-ntwo-lq6/plumed.dat index 24dcdf495f..a9ee23f43e 100644 --- a/regtest/symfunc/rt-ntwo-lq6/plumed.dat +++ b/regtest/symfunc/rt-ntwo-lq6/plumed.dat @@ -1,11 +1,11 @@ q1: Q1 SPECIESA=1,2 SPECIESB=1-64 D_0=3.0 R_0=1.5 NN=12 SUM -norm_q1_rm-n1: CUSTOM ARG=q1_rm-n1,q1_norm FUNC=x/y PERIODIC=NO -norm_q1_im-n1: CUSTOM ARG=q1_im-n1,q1_norm FUNC=x/y PERIODIC=NO -norm_q1_rm-0: CUSTOM ARG=q1_rm-0,q1_norm FUNC=x/y PERIODIC=NO -norm_q1_im-0: CUSTOM ARG=q1_im-0,q1_norm FUNC=x/y PERIODIC=NO -norm_q1_rm-p1: CUSTOM ARG=q1_rm-p1,q1_norm FUNC=x/y PERIODIC=NO -norm_q1_im-p1: CUSTOM ARG=q1_im-p1,q1_norm FUNC=x/y PERIODIC=NO +norm_q1_rm-n1: CUSTOM ARG=q1_sp.rm-n1,q1_norm FUNC=x/y PERIODIC=NO +norm_q1_im-n1: CUSTOM ARG=q1_sp.im-n1,q1_norm FUNC=x/y PERIODIC=NO +norm_q1_rm-0: CUSTOM ARG=q1_sp.rm-0,q1_norm FUNC=x/y PERIODIC=NO +norm_q1_im-0: CUSTOM ARG=q1_sp.im-0,q1_norm FUNC=x/y PERIODIC=NO +norm_q1_rm-p1: CUSTOM ARG=q1_sp.rm-p1,q1_norm FUNC=x/y PERIODIC=NO +norm_q1_im-p1: CUSTOM ARG=q1_sp.im-p1,q1_norm FUNC=x/y PERIODIC=NO dd: VSTACK ARG=norm_q1_rm-n1,norm_q1_im-n1,norm_q1_rm-0,norm_q1_im-0,norm_q1_rm-p1,norm_q1_im-p1 diff --git a/regtest/symfunc/rt-small-lq6/plumed.dat b/regtest/symfunc/rt-small-lq6/plumed.dat index 7469cff2d2..3523e1d1bc 100644 --- a/regtest/symfunc/rt-small-lq6/plumed.dat +++ b/regtest/symfunc/rt-small-lq6/plumed.dat @@ -1,8 +1,8 @@ q1a: Q1 SPECIESA=1 SPECIESB=2-64 D_0=3.0 R_0=1.5 NN=12 SUM q1b: Q1 SPECIESA=2 SPECIESB=1,3-64 D_0=3.0 R_0=1.5 NN=12 SUM -ddA: VSTACK ARG=q1a_rm-n1,q1a_im-n1,q1a_rm-0,q1a_im-0,q1a_rm-p1,q1a_im-p1 -ddBT: VSTACK ARG=q1b_rm-n1,q1b_im-n1,q1b_rm-0,q1b_im-0,q1b_rm-p1,q1b_im-p1 +ddA: VSTACK ARG=q1a_sp.rm-n1,q1a_sp.im-n1,q1a_sp.rm-0,q1a_sp.im-0,q1a_sp.rm-p1,q1a_sp.im-p1 +ddBT: VSTACK ARG=q1b_sp.rm-n1,q1b_sp.im-n1,q1b_sp.rm-0,q1b_sp.im-0,q1b_sp.rm-p1,q1b_sp.im-p1 ddB: TRANSPOSE ARG=ddBT con: CONTACT_MATRIX GROUPA=q1a GROUPB=q1b SWITCH={RATIONAL R_0=4} diff --git a/regtest/symfunc/rt-small-q6/plumed.dat b/regtest/symfunc/rt-small-q6/plumed.dat index 167ae87c12..2f25838117 100644 --- a/regtest/symfunc/rt-small-q6/plumed.dat +++ b/regtest/symfunc/rt-small-q6/plumed.dat @@ -1,9 +1,9 @@ q1a: Q1 SPECIESA=1 SPECIESB=2-64 D_0=3.0 R_0=1.5 NN=12 SUM q1b: Q1 SPECIESA=2 SPECIESB=1,3-64 D_0=3.0 R_0=1.5 NN=12 SUM -ddA: VSTACK ARG=q1a_rm-n1,q1a_im-n1,q1a_rm-0,q1a_im-0,q1a_rm-p1,q1a_im-p1 +ddA: VSTACK ARG=q1a_sp.rm-n1,q1a_sp.im-n1,q1a_sp.rm-0,q1a_sp.im-0,q1a_sp.rm-p1,q1a_sp.im-p1 -ddBT: VSTACK ARG=q1b_rm-n1,q1b_im-n1,q1b_rm-0,q1b_im-0,q1b_rm-p1,q1b_im-p1 +ddBT: VSTACK ARG=q1b_sp.rm-n1,q1b_sp.im-n1,q1b_sp.rm-0,q1b_sp.im-0,q1b_sp.rm-p1,q1b_sp.im-p1 ddB: TRANSPOSE ARG=ddBT dd: MATRIX_VECTOR_PRODUCT ARG=ddA,ddB diff --git a/regtest/symfunc/rt-two-coord-stack-mult-q1-av/plumed.dat b/regtest/symfunc/rt-two-coord-stack-mult-q1-av/plumed.dat index 8b10ceffff..0aa9b922f4 100644 --- a/regtest/symfunc/rt-two-coord-stack-mult-q1-av/plumed.dat +++ b/regtest/symfunc/rt-two-coord-stack-mult-q1-av/plumed.dat @@ -1,11 +1,11 @@ q1: Q1 SPECIESA=1,2 SPECIESB=1-64 D_0=3.0 R_0=1.5 NN=12 SUM -q1_rmn-n1: CUSTOM ARG=q1_rm-n1,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-n1: CUSTOM ARG=q1_im-n1,q1_denom FUNC=x/y PERIODIC=NO -q1_rmn-0: CUSTOM ARG=q1_rm-0,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-0: CUSTOM ARG=q1_im-0,q1_denom FUNC=x/y PERIODIC=NO -q1_rmn-p1: CUSTOM ARG=q1_rm-p1,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-p1: CUSTOM ARG=q1_im-p1,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-n1: CUSTOM ARG=q1_sp.rm-n1,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-n1: CUSTOM ARG=q1_sp.im-n1,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-0: CUSTOM ARG=q1_sp.rm-0,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-0: CUSTOM ARG=q1_sp.im-0,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-p1: CUSTOM ARG=q1_sp.rm-p1,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-p1: CUSTOM ARG=q1_sp.im-p1,q1_denom FUNC=x/y PERIODIC=NO w1_vstack: VSTACK ARG=q1_rmn-n1,q1_imn-n1,q1_rmn-0,q1_imn-0,q1_rmn-p1,q1_imn-p1 diff --git a/regtest/symfunc/rt-two-coord-stack-mult-q1-withnorm-matsum/plumed.dat b/regtest/symfunc/rt-two-coord-stack-mult-q1-withnorm-matsum/plumed.dat index 279bc4d2fc..9e93210920 100644 --- a/regtest/symfunc/rt-two-coord-stack-mult-q1-withnorm-matsum/plumed.dat +++ b/regtest/symfunc/rt-two-coord-stack-mult-q1-withnorm-matsum/plumed.dat @@ -1,11 +1,11 @@ q1: Q1 SPECIESA=1,2 SPECIESB=1-64 D_0=3.0 R_0=1.5 NN=12 SUM -q1_rmn-n1: CUSTOM ARG=q1_rm-n1,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-n1: CUSTOM ARG=q1_im-n1,q1_denom FUNC=x/y PERIODIC=NO -q1_rmn-0: CUSTOM ARG=q1_rm-0,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-0: CUSTOM ARG=q1_im-0,q1_denom FUNC=x/y PERIODIC=NO -q1_rmn-p1: CUSTOM ARG=q1_rm-p1,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-p1: CUSTOM ARG=q1_im-p1,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-n1: CUSTOM ARG=q1_sp.rm-n1,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-n1: CUSTOM ARG=q1_sp.im-n1,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-0: CUSTOM ARG=q1_sp.rm-0,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-0: CUSTOM ARG=q1_sp.im-0,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-p1: CUSTOM ARG=q1_sp.rm-p1,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-p1: CUSTOM ARG=q1_sp.im-p1,q1_denom FUNC=x/y PERIODIC=NO w1_vstack: VSTACK ARG=q1_rmn-n1,q1_imn-n1,q1_rmn-0,q1_imn-0,q1_rmn-p1,q1_imn-p1 diff --git a/regtest/symfunc/rt-two-coord-stack-mult-q1-withnorm/plumed.dat b/regtest/symfunc/rt-two-coord-stack-mult-q1-withnorm/plumed.dat index 6f588df38c..f950d1e512 100644 --- a/regtest/symfunc/rt-two-coord-stack-mult-q1-withnorm/plumed.dat +++ b/regtest/symfunc/rt-two-coord-stack-mult-q1-withnorm/plumed.dat @@ -1,11 +1,11 @@ q1: Q1 SPECIESA=1,2 SPECIESB=1-64 D_0=3.0 R_0=1.5 NN=12 SUM -q1_rmn-n1: CUSTOM ARG=q1_rm-n1,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-n1: CUSTOM ARG=q1_im-n1,q1_denom FUNC=x/y PERIODIC=NO -q1_rmn-0: CUSTOM ARG=q1_rm-0,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-0: CUSTOM ARG=q1_im-0,q1_denom FUNC=x/y PERIODIC=NO -q1_rmn-p1: CUSTOM ARG=q1_rm-p1,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-p1: CUSTOM ARG=q1_im-p1,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-n1: CUSTOM ARG=q1_sp.rm-n1,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-n1: CUSTOM ARG=q1_sp.im-n1,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-0: CUSTOM ARG=q1_sp.rm-0,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-0: CUSTOM ARG=q1_sp.im-0,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-p1: CUSTOM ARG=q1_sp.rm-p1,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-p1: CUSTOM ARG=q1_sp.im-p1,q1_denom FUNC=x/y PERIODIC=NO w1_vstack: VSTACK ARG=q1_rmn-n1,q1_imn-n1,q1_rmn-0,q1_imn-0,q1_rmn-p1,q1_imn-p1 cmat: CONTACT_MATRIX GROUP=1,2 SWITCH={RATIONAL D_0=3.0 R_0=1.5} diff --git a/regtest/symfunc/rt-two-coord-stack-mult-q1/plumed.dat b/regtest/symfunc/rt-two-coord-stack-mult-q1/plumed.dat index c829daec79..d6db88fa95 100644 --- a/regtest/symfunc/rt-two-coord-stack-mult-q1/plumed.dat +++ b/regtest/symfunc/rt-two-coord-stack-mult-q1/plumed.dat @@ -1,11 +1,11 @@ q1: Q1 SPECIESA=1,2 SPECIESB=1-64 D_0=3.0 R_0=1.5 NN=12 SUM -q1_rmn-n1: CUSTOM ARG=q1_rm-n1,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-n1: CUSTOM ARG=q1_im-n1,q1_denom FUNC=x/y PERIODIC=NO -q1_rmn-0: CUSTOM ARG=q1_rm-0,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-0: CUSTOM ARG=q1_im-0,q1_denom FUNC=x/y PERIODIC=NO -q1_rmn-p1: CUSTOM ARG=q1_rm-p1,q1_denom FUNC=x/y PERIODIC=NO -q1_imn-p1: CUSTOM ARG=q1_im-p1,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-n1: CUSTOM ARG=q1_sp.rm-n1,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-n1: CUSTOM ARG=q1_sp.im-n1,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-0: CUSTOM ARG=q1_sp.rm-0,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-0: CUSTOM ARG=q1_sp.im-0,q1_denom FUNC=x/y PERIODIC=NO +q1_rmn-p1: CUSTOM ARG=q1_sp.rm-p1,q1_denom FUNC=x/y PERIODIC=NO +q1_imn-p1: CUSTOM ARG=q1_sp.im-p1,q1_denom FUNC=x/y PERIODIC=NO w1_vstack: VSTACK ARG=q1_rmn-n1,q1_imn-n1,q1_rmn-0,q1_imn-0,q1_rmn-p1,q1_imn-p1 cmat: CONTACT_MATRIX GROUP=1,2 SWITCH={RATIONAL D_0=3.0 R_0=1.5} diff --git a/regtest/symfunc/rt-two-lq1/plumed.dat b/regtest/symfunc/rt-two-lq1/plumed.dat index 5794dcf8d4..f936a1ba17 100644 --- a/regtest/symfunc/rt-two-lq1/plumed.dat +++ b/regtest/symfunc/rt-two-lq1/plumed.dat @@ -1,6 +1,6 @@ q1: Q1 SPECIESA=1,2 SPECIESB=1-64 D_0=3.0 R_0=1.5 NN=12 SUM -ddAu: VSTACK ARG=q1_rm-n1,q1_im-n1,q1_rm-0,q1_im-0,q1_rm-p1,q1_im-p1 +ddAu: VSTACK ARG=q1_sp.rm-n1,q1_sp.im-n1,q1_sp.rm-0,q1_sp.im-0,q1_sp.rm-p1,q1_sp.im-p1 tlo: ONES SIZE=6 nsta: OUTER_PRODUCT ARG=q1_norm,tlo diff --git a/regtest/symfunc/rt-two-lq6/plumed.dat b/regtest/symfunc/rt-two-lq6/plumed.dat index 956f550db3..4fb551cce4 100644 --- a/regtest/symfunc/rt-two-lq6/plumed.dat +++ b/regtest/symfunc/rt-two-lq6/plumed.dat @@ -1,6 +1,6 @@ q1: Q1 SPECIESA=1,2 SPECIESB=1-64 D_0=3.0 R_0=1.5 NN=12 SUM -ddA: VSTACK ARG=q1_rm-n1,q1_im-n1,q1_rm-0,q1_im-0,q1_rm-p1,q1_im-p1 +ddA: VSTACK ARG=q1_sp.rm-n1,q1_sp.im-n1,q1_sp.rm-0,q1_sp.im-0,q1_sp.rm-p1,q1_sp.im-p1 ddT: TRANSPOSE ARG=ddA diff --git a/regtest/symfunc/rt-two-nonorm/plumed.dat b/regtest/symfunc/rt-two-nonorm/plumed.dat index d5028fb03f..adf146850d 100644 --- a/regtest/symfunc/rt-two-nonorm/plumed.dat +++ b/regtest/symfunc/rt-two-nonorm/plumed.dat @@ -1,6 +1,6 @@ q1: Q1 SPECIESA=1,2 SPECIESB=1-64 D_0=3.0 R_0=1.5 NN=12 SUM -ddAu: VSTACK ARG=q1_rm-n1,q1_im-n1,q1_rm-0,q1_im-0,q1_rm-p1,q1_im-p1 +ddAu: VSTACK ARG=q1_sp.rm-n1,q1_sp.im-n1,q1_sp.rm-0,q1_sp.im-0,q1_sp.rm-p1,q1_sp.im-p1 tlo: ONES SIZE=6 nsta: OUTER_PRODUCT ARG=q1_norm,tlo diff --git a/regtest/symfunc/rt-two-norm/plumed.dat b/regtest/symfunc/rt-two-norm/plumed.dat index b2232d9d07..191130d3fd 100644 --- a/regtest/symfunc/rt-two-norm/plumed.dat +++ b/regtest/symfunc/rt-two-norm/plumed.dat @@ -1,6 +1,6 @@ q1: Q1 SPECIESA=1,2 SPECIESB=1-64 D_0=3.0 R_0=1.5 NN=12 SUM -ddAu: VSTACK ARG=q1_rm-n1,q1_im-n1,q1_rm-0,q1_im-0,q1_rm-p1,q1_im-p1 +ddAu: VSTACK ARG=q1_sp.rm-n1,q1_sp.im-n1,q1_sp.rm-0,q1_sp.im-0,q1_sp.rm-p1,q1_sp.im-p1 tlo: ONES SIZE=6 nsta: OUTER_PRODUCT ARG=q1_norm,tlo diff --git a/regtest/symfunc/rt-two-q6/plumed.dat b/regtest/symfunc/rt-two-q6/plumed.dat index 3b9e6065c1..0a017f618b 100644 --- a/regtest/symfunc/rt-two-q6/plumed.dat +++ b/regtest/symfunc/rt-two-q6/plumed.dat @@ -1,6 +1,6 @@ q1: Q1 SPECIESA=1,2 SPECIESB=1-64 D_0=3.0 R_0=1.5 NN=12 SUM -dda: VSTACK ARG=q1_rm-n1,q1_im-n1,q1_rm-0,q1_im-0,q1_rm-p1,q1_im-p1 +dda: VSTACK ARG=q1_sp.rm-n1,q1_sp.im-n1,q1_sp.rm-0,q1_sp.im-0,q1_sp.rm-p1,q1_sp.im-p1 ddT: TRANSPOSE ARG=dda dd: MATRIX_PRODUCT ARG=dda,ddT diff --git a/regtest/volumes/rt-volume/plumed.dat b/regtest/volumes/rt-volume/plumed.dat index 530b125d1c..9c3d3888ec 100644 --- a/regtest/volumes/rt-volume/plumed.dat +++ b/regtest/volumes/rt-volume/plumed.dat @@ -1,31 +1,31 @@ q6: Q6 SPECIES=1-64 SWITCH={RATIONAL D_0=3.0 R_0=1.5} -q6_rmn-n6: CUSTOM ARG=q6_rm-n6,q6_denom FUNC=x/y PERIODIC=NO -q6_imn-n6: CUSTOM ARG=q6_im-n6,q6_denom FUNC=x/y PERIODIC=NO -q6_rmn-n5: CUSTOM ARG=q6_rm-n5,q6_denom FUNC=x/y PERIODIC=NO -q6_imn-n5: CUSTOM ARG=q6_im-n5,q6_denom FUNC=x/y PERIODIC=NO -q6_rmn-n4: CUSTOM ARG=q6_rm-n4,q6_denom FUNC=x/y PERIODIC=NO -q6_imn-n4: CUSTOM ARG=q6_im-n4,q6_denom FUNC=x/y PERIODIC=NO -q6_rmn-n3: CUSTOM ARG=q6_rm-n3,q6_denom FUNC=x/y PERIODIC=NO -q6_imn-n3: CUSTOM ARG=q6_im-n3,q6_denom FUNC=x/y PERIODIC=NO -q6_rmn-n2: CUSTOM ARG=q6_rm-n2,q6_denom FUNC=x/y PERIODIC=NO -q6_imn-n2: CUSTOM ARG=q6_im-n2,q6_denom FUNC=x/y PERIODIC=NO -q6_rmn-n1: CUSTOM ARG=q6_rm-n1,q6_denom FUNC=x/y PERIODIC=NO -q6_imn-n1: CUSTOM ARG=q6_im-n1,q6_denom FUNC=x/y PERIODIC=NO -q6_rmn-0: CUSTOM ARG=q6_rm-0,q6_denom FUNC=x/y PERIODIC=NO -q6_imn-0: CUSTOM ARG=q6_im-0,q6_denom FUNC=x/y PERIODIC=NO -q6_rmn-p1: CUSTOM ARG=q6_rm-p1,q6_denom FUNC=x/y PERIODIC=NO -q6_imn-p1: CUSTOM ARG=q6_im-p1,q6_denom FUNC=x/y PERIODIC=NO -q6_rmn-p2: CUSTOM ARG=q6_rm-p2,q6_denom FUNC=x/y PERIODIC=NO -q6_imn-p2: CUSTOM ARG=q6_im-p2,q6_denom FUNC=x/y PERIODIC=NO -q6_rmn-p3: CUSTOM ARG=q6_rm-p3,q6_denom FUNC=x/y PERIODIC=NO -q6_imn-p3: CUSTOM ARG=q6_im-p3,q6_denom FUNC=x/y PERIODIC=NO -q6_rmn-p4: CUSTOM ARG=q6_rm-p4,q6_denom FUNC=x/y PERIODIC=NO -q6_imn-p4: CUSTOM ARG=q6_im-p4,q6_denom FUNC=x/y PERIODIC=NO -q6_rmn-p5: CUSTOM ARG=q6_rm-p5,q6_denom FUNC=x/y PERIODIC=NO -q6_imn-p5: CUSTOM ARG=q6_im-p5,q6_denom FUNC=x/y PERIODIC=NO -q6_rmn-p6: CUSTOM ARG=q6_rm-p6,q6_denom FUNC=x/y PERIODIC=NO -q6_imn-p6: CUSTOM ARG=q6_im-p6,q6_denom FUNC=x/y PERIODIC=NO +q6_rmn-n6: CUSTOM ARG=q6_sp.rm-n6,q6_denom FUNC=x/y PERIODIC=NO +q6_imn-n6: CUSTOM ARG=q6_sp.im-n6,q6_denom FUNC=x/y PERIODIC=NO +q6_rmn-n5: CUSTOM ARG=q6_sp.rm-n5,q6_denom FUNC=x/y PERIODIC=NO +q6_imn-n5: CUSTOM ARG=q6_sp.im-n5,q6_denom FUNC=x/y PERIODIC=NO +q6_rmn-n4: CUSTOM ARG=q6_sp.rm-n4,q6_denom FUNC=x/y PERIODIC=NO +q6_imn-n4: CUSTOM ARG=q6_sp.im-n4,q6_denom FUNC=x/y PERIODIC=NO +q6_rmn-n3: CUSTOM ARG=q6_sp.rm-n3,q6_denom FUNC=x/y PERIODIC=NO +q6_imn-n3: CUSTOM ARG=q6_sp.im-n3,q6_denom FUNC=x/y PERIODIC=NO +q6_rmn-n2: CUSTOM ARG=q6_sp.rm-n2,q6_denom FUNC=x/y PERIODIC=NO +q6_imn-n2: CUSTOM ARG=q6_sp.im-n2,q6_denom FUNC=x/y PERIODIC=NO +q6_rmn-n1: CUSTOM ARG=q6_sp.rm-n1,q6_denom FUNC=x/y PERIODIC=NO +q6_imn-n1: CUSTOM ARG=q6_sp.im-n1,q6_denom FUNC=x/y PERIODIC=NO +q6_rmn-0: CUSTOM ARG=q6_sp.rm-0,q6_denom FUNC=x/y PERIODIC=NO +q6_imn-0: CUSTOM ARG=q6_sp.im-0,q6_denom FUNC=x/y PERIODIC=NO +q6_rmn-p1: CUSTOM ARG=q6_sp.rm-p1,q6_denom FUNC=x/y PERIODIC=NO +q6_imn-p1: CUSTOM ARG=q6_sp.im-p1,q6_denom FUNC=x/y PERIODIC=NO +q6_rmn-p2: CUSTOM ARG=q6_sp.rm-p2,q6_denom FUNC=x/y PERIODIC=NO +q6_imn-p2: CUSTOM ARG=q6_sp.im-p2,q6_denom FUNC=x/y PERIODIC=NO +q6_rmn-p3: CUSTOM ARG=q6_sp.rm-p3,q6_denom FUNC=x/y PERIODIC=NO +q6_imn-p3: CUSTOM ARG=q6_sp.im-p3,q6_denom FUNC=x/y PERIODIC=NO +q6_rmn-p4: CUSTOM ARG=q6_sp.rm-p4,q6_denom FUNC=x/y PERIODIC=NO +q6_imn-p4: CUSTOM ARG=q6_sp.im-p4,q6_denom FUNC=x/y PERIODIC=NO +q6_rmn-p5: CUSTOM ARG=q6_sp.rm-p5,q6_denom FUNC=x/y PERIODIC=NO +q6_imn-p5: CUSTOM ARG=q6_sp.im-p5,q6_denom FUNC=x/y PERIODIC=NO +q6_rmn-p6: CUSTOM ARG=q6_sp.rm-p6,q6_denom FUNC=x/y PERIODIC=NO +q6_imn-p6: CUSTOM ARG=q6_sp.im-p6,q6_denom FUNC=x/y PERIODIC=NO # Create a matrix to hold all the data data6: VSTACK ARG=q6_rmn-n6,q6_imn-n6,q6_rmn-n5,q6_imn-n5,q6_rmn-n4,q6_imn-n4,q6_rmn-n3,q6_imn-n3,q6_rmn-n2,q6_imn-n2,q6_rmn-n1,q6_imn-n1,q6_rmn-0,q6_imn-0,q6_rmn-p1,q6_imn-p1,q6_rmn-p2,q6_imn-p2,q6_rmn-p3,q6_imn-p3,q6_rmn-p4,q6_imn-p4,q6_rmn-p5,q6_imn-p5,q6_rmn-p6,q6_imn-p6 diff --git a/src/adjmat/MatrixTimesVector.cpp b/src/adjmat/MatrixTimesVector.cpp index c08b047613..72dae44610 100644 --- a/src/adjmat/MatrixTimesVector.cpp +++ b/src/adjmat/MatrixTimesVector.cpp @@ -27,9 +27,8 @@ namespace adjmat { class MatrixTimesVector : public ActionWithMatrix { private: - bool stored_matrix; - bool stored_vector; unsigned nderivatives; + std::vector stored_arg; public: static void registerKeywords( Keywords& keys ); explicit MatrixTimesVector(const ActionOptions&); @@ -46,23 +45,64 @@ PLUMED_REGISTER_ACTION(MatrixTimesVector,"MATRIX_VECTOR_PRODUCT") void MatrixTimesVector::registerKeywords( Keywords& keys ) { ActionWithMatrix::registerKeywords(keys); keys.use("ARG"); + ActionWithValue::useCustomisableComponents(keys); } MatrixTimesVector::MatrixTimesVector(const ActionOptions&ao): Action(ao), ActionWithMatrix(ao) { - if( getNumberOfArguments()!=2 ) error("should be two arguments to this action, a matrix and a vector"); - if( getPntrToArgument(0)->getRank()!=2 || getPntrToArgument(0)->hasDerivatives() ) error("first argument to this action should be a matrix"); - if( getPntrToArgument(1)->getRank()!=1 || getPntrToArgument(1)->hasDerivatives() ) error("first argument to this action should be a vector"); - if( getPntrToArgument(0)->getShape()[1]!=getPntrToArgument(1)->getShape()[0] ) error("number of columns in input matrix does not equal number of elements in vector"); - std::vector shape(1); shape[0]=getPntrToArgument(0)->getShape()[0]; addValue( shape ); setNotPeriodic(); - ActionWithVector* av=dynamic_cast( getPntrToArgument(0)->getPntrToAction() ); getPntrToArgument(1)->buildDataStore(); - if( av ) done_in_chain=canBeAfterInChain( av ); - nderivatives = buildArgumentStore(0); - std::string headstr=getFirstActionInChain()->getLabel(); - stored_matrix = getPntrToArgument(0)->ignoreStoredValue( headstr ); - stored_vector = getPntrToArgument(1)->ignoreStoredValue( headstr ); + if( getNumberOfArguments()<2 ) error("Not enough arguments specified"); + unsigned nvectors=0, nmatrices=0; + for(unsigned i=0; ihasDerivatives() ) error("arguments should be vectors or matrices"); + if( getPntrToArgument(i)->getRank()==1 ) nvectors++; + if( getPntrToArgument(i)->getRank()==2 ) nmatrices++; + } + + std::vector shape(1); shape[0]=getPntrToArgument(0)->getShape()[0]; + if( nvectors==1 ) { + unsigned n = getNumberOfArguments()-1; + for(unsigned i=0; igetRank()!=2 || getPntrToArgument(i)->hasDerivatives() ) error("all arguments other than last argument should be matrices"); + if( getPntrToArgument(i)->getShape()[1]!=getPntrToArgument(n)->getShape()[0] ) error("number of columns in input matrix does not equal number of elements in vector"); + } + if( getPntrToArgument(n)->getRank()!=1 || getPntrToArgument(n)->hasDerivatives() ) error("last argument to this action should be a vector"); + getPntrToArgument(n)->buildDataStore(); + + ActionWithVector* av=dynamic_cast( getPntrToArgument(0)->getPntrToAction() ); + if( av ) done_in_chain=canBeAfterInChain( av ); + + if( getNumberOfArguments()==2 ) { + addValue( shape ); setNotPeriodic(); + } else { + for(unsigned i=0; igetName(); + if( name.find_first_of(".")!=std::string::npos ) { std::size_t dot=name.find_first_of("."); name = name.substr(dot+1); } + addComponent( name, shape ); componentIsNotPeriodic( name ); + } + } + } else if( nmatrices==1 ) { + if( getPntrToArgument(0)->getRank()!=2 || getPntrToArgument(0)->hasDerivatives() ) error("first argument to this action should be a matrix"); + for(unsigned i=1; igetRank()!=1 || getPntrToArgument(i)->hasDerivatives() ) error("all arguments other than first argument should be vectors"); + if( getPntrToArgument(0)->getShape()[1]!=getPntrToArgument(i)->getShape()[0] ) error("number of columns in input matrix does not equal number of elements in vector"); + getPntrToArgument(i)->buildDataStore(); + } + + ActionWithVector* av=dynamic_cast( getPntrToArgument(0)->getPntrToAction() ); + if( av ) done_in_chain=canBeAfterInChain( av ); + + for(unsigned i=1; igetName(); + if( name.find_first_of(".")!=std::string::npos ) { std::size_t dot=name.find_first_of("."); name = name.substr(dot+1); } + addComponent( name, shape ); componentIsNotPeriodic( name ); + } + } else error("You should either have one vector or one matrix in input"); + + nderivatives = buildArgumentStore(0); + std::string headstr=getFirstActionInChain()->getLabel(); stored_arg.resize( getNumberOfArguments() ); + for(unsigned i=0; iignoreStoredValue( headstr ); } unsigned MatrixTimesVector::getNumberOfDerivatives() { @@ -77,27 +117,55 @@ void MatrixTimesVector::setupForTask( const unsigned& task_index, std::vectorgetPositionInStream(), ind2=index2; - if( index2>=getPntrToArgument(0)->getShape()[0] ) ind2 = index2 - getPntrToArgument(0)->getShape()[0]; - double matval = getElementOfMatrixArgument( 0, index1, ind2, myvals ), vecval=getArgumentElement( 1, ind2, myvals ); - // And add this part of the product - myvals.addValue( ostrn, matval*vecval ); - // Now lets work out the derivatives - if( doNotCalculateDerivatives() ) return; - addDerivativeOnMatrixArgument( stored_matrix, 0, 0, index1, ind2, vecval, myvals ); addDerivativeOnVectorArgument( stored_vector, 0, 1, ind2, matval, myvals ); + unsigned ind2 = index2; if( index2>=getPntrToArgument(0)->getShape()[0] ) ind2 = index2 - getPntrToArgument(0)->getShape()[0]; + if( getPntrToArgument(1)->getRank()==1 ) { + for(unsigned i=0; igetPositionInStream(); + double matval = getElementOfMatrixArgument( 0, index1, ind2, myvals ), vecval=getArgumentElement( i+1, ind2, myvals ); + // And add this part of the product + myvals.addValue( ostrn, matval*vecval ); + // Now lets work out the derivatives + if( doNotCalculateDerivatives() ) continue; + addDerivativeOnMatrixArgument( stored_arg[0], i, 0, index1, ind2, vecval, myvals ); addDerivativeOnVectorArgument( stored_arg[i+1], i, i+1, ind2, matval, myvals ); + } + } else { + unsigned n=getNumberOfArguments()-1; + for(unsigned i=0; igetPositionInStream(); + double matval = getElementOfMatrixArgument( i, index1, ind2, myvals ), vecval=getArgumentElement( n, ind2, myvals ); + // And add this part of the product + myvals.addValue( ostrn, matval*vecval ); + // Now lets work out the derivatives + if( doNotCalculateDerivatives() ) continue; + addDerivativeOnMatrixArgument( stored_arg[i], i, i, index1, ind2, vecval, myvals ); addDerivativeOnVectorArgument( stored_arg[n], i, n, ind2, matval, myvals ); + } + } } void MatrixTimesVector::runEndOfRowJobs( const unsigned& ind, const std::vector & indices, MultiValue& myvals ) const { if( doNotCalculateDerivatives() || !actionInChain() ) return ; - unsigned ostrn = getConstPntrToComponent(0)->getPositionInStream(); - unsigned istrn = getPntrToArgument(0)->getPositionInMatrixStash(); - std::vector& mat_indices( myvals.getMatrixRowDerivativeIndices( istrn ) ); - for(unsigned i=0; igetRank()==1 ) { + unsigned istrn = getPntrToArgument(0)->getPositionInMatrixStash(); + std::vector& mat_indices( myvals.getMatrixRowDerivativeIndices( istrn ) ); + for(unsigned j=0; jgetPositionInStream(); + for(unsigned i=0; igetPositionInMatrixStash(); + unsigned ostrn = getConstPntrToComponent(j)->getPositionInStream(); + std::vector& mat_indices( myvals.getMatrixRowDerivativeIndices( istrn ) ); + for(unsigned i=0; igetNumberOfValues(); - for(unsigned i=0; igetRank()==1 ) n = 1; + unsigned nvals = getPntrToArgument(n)->getNumberOfValues(); + for(unsigned i=0; i. -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ -#include "ActionWithMatrix.h" -#include "core/ActionRegister.h" - -namespace PLMD { -namespace adjmat { - -class StackProduct : public ActionWithMatrix { -private: - unsigned nderivatives; - std::vector stored_arg; -public: - static void registerKeywords( Keywords& keys ); - explicit StackProduct(const ActionOptions&); - unsigned getNumberOfColumns() const override { plumed_error(); } - unsigned getNumberOfDerivatives(); - bool isInSubChain( unsigned& nder ) override { nder = arg_deriv_starts[0]; return true; } - void setupForTask( const unsigned& task_index, std::vector& indices, MultiValue& myvals ) const ; - void performTask( const std::string& controller, const unsigned& index1, const unsigned& index2, MultiValue& myvals ) const override; - void runEndOfRowJobs( const unsigned& ind, const std::vector & indices, MultiValue& myvals ) const override ; - void updateAdditionalIndices( const unsigned& ostrn, MultiValue& myvals ) const override ; -}; - -PLUMED_REGISTER_ACTION(StackProduct,"STACK_PRODUCT") - -void StackProduct::registerKeywords( Keywords& keys ) { - ActionWithMatrix::registerKeywords(keys); keys.use("ARG"); - ActionWithValue::useCustomisableComponents(keys); -} - -StackProduct::StackProduct(const ActionOptions&ao): -Action(ao), -ActionWithMatrix(ao) -{ - if( getNumberOfArguments()<2 ) error("Not enough arguments specified"); - unsigned nvectors=0, nmatrices=0; - for(unsigned i=0; ihasDerivatives() ) error("arguments should be vectors or matrices"); - if( getPntrToArgument(i)->getRank()==1 ) nvectors++; - if( getPntrToArgument(i)->getRank()==2 ) nmatrices++; - } - - if( nvectors==1 ) { - unsigned n = getNumberOfArguments()-1; - for(unsigned i=0; igetRank()!=2 || getPntrToArgument(i)->hasDerivatives() ) error("all arguments other than last argument should be matrices"); - if( getPntrToArgument(i)->getShape()[1]!=getPntrToArgument(n)->getShape()[0] ) error("number of columns in input matrix does not equal number of elements in vector"); - getPntrToArgument(i)->buildDataStore(); - } - if( getPntrToArgument(n)->getRank()!=1 || getPntrToArgument(n)->hasDerivatives() ) error("first argument to this action should be a vector"); - - ActionWithVector* av=dynamic_cast( getPntrToArgument(0)->getPntrToAction() ); - if( av ) done_in_chain=canBeAfterInChain( av ); - } else if( nmatrices==1 ) { - if( getPntrToArgument(0)->getRank()!=2 || getPntrToArgument(0)->hasDerivatives() ) error("first argument to this action should be a matrix"); - for(unsigned i=1; igetRank()!=1 || getPntrToArgument(i)->hasDerivatives() ) error("all arguments other than first argument should be vectors"); - if( getPntrToArgument(0)->getShape()[1]!=getPntrToArgument(i)->getShape()[0] ) error("number of columns in input matrix does not equal number of elements in vector"); - getPntrToArgument(i)->buildDataStore(); - } - - ActionWithVector* av=dynamic_cast( getPntrToArgument(0)->getPntrToAction() ); - if( av ) done_in_chain=canBeAfterInChain( av ); - } else error("You should either have one vector or one matrix in input"); - - std::vector shape(1); shape[0]=getPntrToArgument(0)->getShape()[0]; - for(unsigned i=1; igetName(), shape ); - componentIsNotPeriodic( getPntrToArgument(i)->getName() ); - } - std::string headstr=getFirstActionInChain()->getLabel(); - nderivatives = buildArgumentStore(0); stored_arg.resize( getNumberOfArguments() ); - for(unsigned i=0; iignoreStoredValue( headstr ); -} - -unsigned StackProduct::getNumberOfDerivatives() { - return nderivatives; -} - -void StackProduct::setupForTask( const unsigned& task_index, std::vector& indices, MultiValue& myvals ) const { - unsigned start_n = getPntrToArgument(0)->getShape()[0], size_v = getPntrToArgument(0)->getShape()[1]; - if( indices.size()!=size_v+1 ) indices.resize( size_v + 1 ); - for(unsigned i=0; i=getPntrToArgument(0)->getShape()[0] ) ind2 = index2 - getPntrToArgument(0)->getShape()[0]; - if( getPntrToArgument(1)->getRank()==1 ) { - for(unsigned i=0; igetPositionInStream(); - double matval = getElementOfMatrixArgument( 0, index1, ind2, myvals ), vecval=getArgumentElement( i+1, ind2, myvals ); - // And add this part of the product - myvals.addValue( ostrn, matval*vecval ); - // Now lets work out the derivatives - if( doNotCalculateDerivatives() ) continue; - addDerivativeOnMatrixArgument( stored_arg[0], i, 0, index1, ind2, vecval, myvals ); addDerivativeOnVectorArgument( stored_arg[i+1], i, i+1, ind2, matval, myvals ); - } - } else { - unsigned n=getNumberOfArguments()-1; - for(unsigned i=0; igetPositionInStream(); - double matval = getElementOfMatrixArgument( i, index1, ind2, myvals ), vecval=getArgumentElement( n, ind2, myvals ); - // And add this part of the product - myvals.addValue( ostrn, matval*vecval ); - // Now lets work out the derivatives - if( doNotCalculateDerivatives() ) continue; - addDerivativeOnMatrixArgument( stored_arg[i], i, i, index1, ind2, vecval, myvals ); addDerivativeOnVectorArgument( stored_arg[n], i, n, ind2, matval, myvals ); - } - } -} - -void StackProduct::runEndOfRowJobs( const unsigned& ind, const std::vector & indices, MultiValue& myvals ) const { - if( doNotCalculateDerivatives() || !actionInChain() ) return ; - - if( getPntrToArgument(1)->getRank()==1 ) { - unsigned istrn = getPntrToArgument(0)->getPositionInMatrixStash(); - std::vector& mat_indices( myvals.getMatrixRowDerivativeIndices( istrn ) ); - for(unsigned j=0; jgetPositionInStream(); - for(unsigned i=0; igetNumberOfValues(); - for(unsigned i=0; i(specB + "_rmn-" + num) ) { - readInputLine( specB + "_rmn-" + num + ": CUSTOM ARG=" + specB + "_rm-" + num + "," + specB + "_denom FUNC=x/y PERIODIC=NO"); + readInputLine( specB + "_rmn-" + num + ": CUSTOM ARG=" + specB + "_sp.rm-" + num + "," + specB + "_denom FUNC=x/y PERIODIC=NO"); } - // readInputLine( getShortcutLabel() + "_prod-rmn-" + num + ": MATRIX_VECTOR_PRODUCT ARG=" + getShortcutLabel() + "_mat.w," + specB + "_rmn-" + num ); - // readInputLine( getShortcutLabel() + "_av-rmn-" + num + ": CUSTOM ARG=" + getShortcutLabel() + "_prod-rmn-" + num + "," + specB + "_rmn-" + num + "," + getShortcutLabel() + "_coord FUNC=(x+y)/(1+z) PERIODIC=NO"); if( !plumed.getActionSet().selectWithLabel(specB + "_imn-" + num) ) { - readInputLine( specB + "_imn-" + num + ": CUSTOM ARG=" + specB + "_im-" + num + "," + specB + "_denom FUNC=x/y PERIODIC=NO"); + readInputLine( specB + "_imn-" + num + ": CUSTOM ARG=" + specB + "_sp.im-" + num + "," + specB + "_denom FUNC=x/y PERIODIC=NO"); } - // readInputLine( getShortcutLabel() + "_prod-imn-" + num + ": MATRIX_VECTOR_PRODUCT ARG=" + getShortcutLabel() + "_mat.w," + specB + "_imn-" + num ); - // readInputLine( getShortcutLabel() + "_av-imn-" + num + ": CUSTOM ARG=" + getShortcutLabel() + "_prod-imn-" + num + "," + specB + "_imn-" + num + "," + getShortcutLabel() + "_coord FUNC=(x+y)/(1+z) PERIODIC=NO"); if( i==-l ) { vargs = "ARG=" + specB + "_rmn-" + num + "," + specB + "_imn-" + num; svargs = "ARG=" + getShortcutLabel() + "_prod." + specB + "_rmn-" + num + "," + getShortcutLabel() + "_prod." + specB + "_imn-" + num; } else { vargs += "," + specB + "_rmn-" + num + "," + specB + "_imn-" + num; svargs += "," + getShortcutLabel() + "_prod." + specB + "_rmn-" + num + "," + getShortcutLabel() + "_prod." + specB + "_imn-" + num; } sargs += "," + specB + "_rmn-" + num + "," + specB + "_imn-" + num; } readInputLine( getShortcutLabel() + "_vstack: VSTACK " + vargs ); - readInputLine( getShortcutLabel() + "_prod: STACK_PRODUCT " + sargs ); + readInputLine( getShortcutLabel() + "_prod: MATRIX_VECTOR_PRODUCT " + sargs ); readInputLine( getShortcutLabel() + "_vpstack: VSTACK " + svargs ); -// readInputLine( getShortcutLabel() + "_prod: MATRIX_PRODUCT ARG=" + getShortcutLabel() + "_mat.w," + getShortcutLabel() + "_vstack"); std::string twolplusone; Tools::convert( 2*(2*l+1), twolplusone ); readInputLine( getShortcutLabel() + "_lones: ONES SIZE=" + twolplusone ); readInputLine( getShortcutLabel() + "_unorm: OUTER_PRODUCT ARG=" + getShortcutLabel() + "_coord," + getShortcutLabel() + "_lones" ); readInputLine( getShortcutLabel() + "_av: CUSTOM ARG=" + getShortcutLabel() + "_vpstack," + getShortcutLabel() + "_vstack," + getShortcutLabel() + "_unorm FUNC=(x+y)/(1+z) PERIODIC=NO"); diff --git a/src/symfunc/LocalSteinhardt.cpp b/src/symfunc/LocalSteinhardt.cpp index 3df3fd39b6..1fe232e067 100644 --- a/src/symfunc/LocalSteinhardt.cpp +++ b/src/symfunc/LocalSteinhardt.cpp @@ -298,10 +298,10 @@ std::string LocalSteinhardt::getSymbol( const int& m ) const { std::string LocalSteinhardt::getArgsForStack( const int& l, const std::string& sp_lab ) const { std::string numstr; Tools::convert( l, numstr ); - std::string data_mat = " ARG=" + sp_lab + "_rm-n" + numstr + "," + sp_lab + "_im-n" + numstr; + std::string data_mat = " ARG=" + sp_lab + "_sp.rm-n" + numstr + "," + sp_lab + "_sp.im-n" + numstr; for(int i=-l+1; i<=l; ++i) { numstr = getSymbol( i ); - data_mat += "," + sp_lab + "_rm-" + numstr + "," + sp_lab + "_im-" + numstr; + data_mat += "," + sp_lab + "_sp.rm-" + numstr + "," + sp_lab + "_sp.im-" + numstr; } return data_mat; } diff --git a/src/symfunc/Steinhardt.cpp b/src/symfunc/Steinhardt.cpp index 9b82c5a190..2cf957e41d 100644 --- a/src/symfunc/Steinhardt.cpp +++ b/src/symfunc/Steinhardt.cpp @@ -304,14 +304,10 @@ ActionShortcut(ao) std::string size; Tools::convert( (av->copyOutput(0))->getShape()[1], size ); readInputLine( getShortcutLabel() + "_denom_ones: ONES SIZE=" + size ); readInputLine( getShortcutLabel() + "_denom: MATRIX_VECTOR_PRODUCT ARG=" + getShortcutLabel() + "_mat.w," + getShortcutLabel() + "_denom_ones" ); - std::string snum; Tools::convert( -l, snum ); std::string arg2=getShortcutLabel() + "_denom_ones," + getShortcutLabel() + "_denom_ones"; - for(int i=-l; i<=l; ++i) { - snum = getSymbol(i ); - readInputLine( getShortcutLabel() + "_rm-" + snum + ": MATRIX_VECTOR_PRODUCT ARG=" + getShortcutLabel() + "_sh.rm-" + snum + "," + getShortcutLabel() + "_denom_ones" ); - readInputLine( getShortcutLabel() + "_im-" + snum + ": MATRIX_VECTOR_PRODUCT ARG=" + getShortcutLabel() + "_sh.im-" + snum + "," + getShortcutLabel() + "_denom_ones" ); - } + readInputLine( getShortcutLabel() + "_sp: MATRIX_VECTOR_PRODUCT ARG=" + getShortcutLabel() + "_sh.*," + getShortcutLabel() + "_denom_ones"); // If we are doing VMEAN determine sum of vector components + std::string snum; bool do_vmean; parseFlag("VMEAN",do_vmean); bool do_vsum; parseFlag("VSUM",do_vsum); if( do_vmean || do_vsum ) { @@ -319,9 +315,9 @@ ActionShortcut(ao) for(int i=-l; i<=l; ++i) { snum = getSymbol( i ); // Real part - readInputLine( getShortcutLabel() + "_rmn-" + snum + ": CUSTOM ARG=" + getShortcutLabel() + "_rm-" + snum + "," + getShortcutLabel() + "_denom FUNC=x/y PERIODIC=NO"); + readInputLine( getShortcutLabel() + "_rmn-" + snum + ": CUSTOM ARG=" + getShortcutLabel() + "_sp.rm-" + snum + "," + getShortcutLabel() + "_denom FUNC=x/y PERIODIC=NO"); // Imaginary part - readInputLine( getShortcutLabel() + "_imn-" + snum + ": CUSTOM ARG=" + getShortcutLabel() + "_im-" + snum + "," + getShortcutLabel() + "_denom FUNC=x/y PERIODIC=NO"); + readInputLine( getShortcutLabel() + "_imn-" + snum + ": CUSTOM ARG=" + getShortcutLabel() + "_sp.im-" + snum + "," + getShortcutLabel() + "_denom FUNC=x/y PERIODIC=NO"); } } @@ -349,7 +345,7 @@ ActionShortcut(ao) } // Now calculate the total length of the vector - createVectorNormInput( getShortcutLabel(), getShortcutLabel() + "_norm", l, "_", "m" ); + createVectorNormInput( getShortcutLabel() + "_sp", getShortcutLabel() + "_norm", l, ".", "m" ); // And take average readInputLine( getShortcutLabel() + "_anorm: CUSTOM ARG=" + getShortcutLabel() + "_norm," + getShortcutLabel() + "_denom FUNC=x/y PERIODIC=NO"); multicolvar::MultiColvarShortcuts::expandFunctions( getShortcutLabel(), getShortcutLabel() + "_anorm", "", this );