diff --git a/regtest/.gitignore b/regtest/.gitignore
index e0fa2957c0eedf46e72c27c6c848909bf4306297..53f6adae9360e84cf797d8a2b2139e8cb1859c41 100644
--- a/regtest/.gitignore
+++ b/regtest/.gitignore
@@ -6,6 +6,7 @@
 !/function
 !/analysis
 !/basic
+!/crystallization
 !/multicolvar
 !/secondarystructure
 !/trajectories
@@ -16,4 +17,3 @@
 # These files we just want to ignore completely
 tmp
 report.txt
-crystallization
diff --git a/regtest/crystallization/.gitignore b/regtest/crystallization/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..1774e730ac0b0f39a477383ecc38e28eec46c933
--- /dev/null
+++ b/regtest/crystallization/.gitignore
@@ -0,0 +1,2 @@
+tmp
+report.txt
diff --git a/regtest/crystallization/Makefile b/regtest/crystallization/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..42480767ae852294cf2d7269ac5a1c16064d1849
--- /dev/null
+++ b/regtest/crystallization/Makefile
@@ -0,0 +1,2 @@
+include ../scripts/module.make
+
diff --git a/regtest/crystallization/rt-average-vec/LJ75C_global-minima.xyz b/regtest/crystallization/rt-average-vec/LJ75C_global-minima.xyz
new file mode 100644
index 0000000000000000000000000000000000000000..7a7838540c0ffca19332460bf2432370d44f17ef
--- /dev/null
+++ b/regtest/crystallization/rt-average-vec/LJ75C_global-minima.xyz
@@ -0,0 +1,77 @@
+75                     
+20.0 20.0 20.0
+  Ar         2.156314665600000          0.332416216700000          0.513126025200000 
+  Ar        -2.156300474800000         -0.332412410700000         -0.513124876500000 
+  Ar        -0.702793674600000          2.171863642800000         -0.858784503500000 
+  Ar         0.659045453900000          1.787780916200000         -1.522472201000000 
+  Ar         0.798449910200000         -2.248251783800000          0.506226343900000 
+  Ar        -0.022636417900000         -2.295872820200000         -0.822727880400000 
+  Ar        -0.756863594600000         -1.513752823700000          1.756176946900000 
+  Ar         0.051864419700000         -0.348964899200000          2.413282592900000 
+  Ar         0.114224421200000         -1.090981090200000         -2.178339734900000 
+  Ar        -0.034338688200000          2.145430444700000          1.159468509200000 
+  Ar         1.070320378200000          0.145259276700000         -2.186711386800000 
+  Ar        -1.177239405500000          1.247469885700000          1.733878573200000 
+  Ar         0.010844723900000         -0.018042493100000         -2.438845596400000 
+  Ar        -1.093809429700000          1.982092729600000          0.907363491000000 
+  Ar        -0.117770227300000          1.410814751600000          1.985981610200000 
+  Ar         1.173690836800000         -0.927676514000000         -1.926197168900000 
+  Ar        -1.007603949500000         -0.512322527600000          2.161176171000000 
+  Ar         0.302601633400000         -1.350397093600000          2.008299558700000 
+  Ar        -0.261011523000000         -2.411582646900000          0.254092900100000 
+  Ar         1.036829515600000         -2.132552598000000         -0.570596656300000 
+  Ar         0.356676405400000          2.335191057400000         -0.606680557200000 
+  Ar        -0.400425624500000          1.624470895400000         -1.774581006300000 
+  Ar         1.349148818900000          0.926092205800000         -1.454662633700000 
+  Ar        -0.564466336500000         -1.552560006200000         -1.436945362700000 
+  Ar        -1.378122819300000          1.696930711100000         -0.122776624400000 
+  Ar         1.078388723900000         -1.457641190100000          1.227279110900000 
+  Ar         0.575519981700000          0.550681434300000          2.039449397100000 
+  Ar        -1.545431600800000          0.223683232300000          1.534762826600000 
+  Ar        -1.042548187100000         -1.784615887600000          0.722556802300000 
+  Ar         0.742830086900000          2.023907149300000          0.381913813000000 
+  Ar         1.556488992400000         -1.225623767800000         -0.932202708400000 
+  Ar        -0.771799746600000          0.599152152500000         -1.959385975200000 
+  Ar         1.745878547400000          0.627498670300000         -0.470657762200000 
+  Ar        -1.760343983900000          0.681454293600000         -0.316521837600000 
+  Ar        -1.354310310500000         -0.940115477200000         -0.972314742200000 
+  Ar         1.849356012400000         -0.446260911400000         -0.209937642600000 
+  Ar         1.610773063900000         -0.562042410600000          0.867687532800000 
+  Ar        -1.843837957400000         -0.053731949600000          0.510633022800000 
+  Ar         1.359827429100000          0.440160015000000          1.272977638900000 
+  Ar         1.443325159700000          1.175334182300000          0.445833172900000 
+  Ar        -1.592886743700000         -1.055916847200000          0.105328100700000 
+  Ar        -1.457777920800000          0.133636901400000         -1.233032111000000 
+  Ar        -1.076487121600000          1.148907502800000         -1.042104966700000 
+  Ar         0.828272207800000         -0.453763210700000          1.634879884000000 
+  Ar         1.319158943500000         -1.342662121700000          0.147803726500000 
+  Ar        -0.804802818000000         -1.670085100500000         -0.357641985000000 
+  Ar        -0.669308472100000         -0.477199145600000         -1.699732539500000 
+  Ar         0.660344455700000          1.288464576900000          1.211845922900000 
+  Ar         1.047478118400000          1.476333464500000         -0.536671658000000 
+  Ar        -1.295696717800000         -0.781217521500000          1.129462457400000 
+  Ar         1.454651107900000         -0.149798804300000         -1.194276651500000 
+  Ar        -1.463622086600000          0.961017498400000          0.706433381100000 
+  Ar         0.017818765500000         -1.612093134200000          0.969488030600000 
+  Ar        -0.482253277000000          0.385020251300000          1.777145426100000 
+  Ar        -0.315878924400000          1.850046605700000          0.128851061600000 
+  Ar         0.287065951400000          0.758371962700000         -1.697510602900000 
+  Ar         0.493241127600000         -1.381350362800000         -1.177970225000000 
+  Ar        -0.232532468700000         -0.614374457300000          1.375192981300000 
+  Ar         0.255877017100000         -1.498767288700000         -0.104386431400000 
+  Ar        -0.014431970900000          1.305992147000000         -0.785402010600000 
+  Ar        -0.399611419500000          1.119060383400000          0.954295218000000 
+  Ar         0.390688302700000         -0.311916192400000         -1.439703399700000 
+  Ar        -1.068344333300000         -0.164686987700000         -0.254226648300000 
+  Ar         1.068339195400000          0.164695077000000          0.254225311900000 
+  Ar        -0.688853047800000          0.838281616600000         -0.062441472700000 
+  Ar         0.374609000600000          1.002225786100000          0.190625601700000 
+  Ar        -0.388945345900000          0.295265142100000         -0.970914657300000 
+  Ar        -0.771620441500000          0.109542329000000          0.757460793900000 
+  Ar         0.291841482800000          0.273493762700000          1.010522496000000 
+  Ar         0.674512112800000          0.459200123500000         -0.717840848000000 
+  Ar         0.777079029300000         -0.605146646100000         -0.459410991300000 
+  Ar        -0.286381855900000         -0.769080419800000         -0.712481556500000 
+  Ar         0.540589242000000         -0.719920721500000          0.608779082400000 
+  Ar        -0.522870216900000         -0.883863029800000          0.355710852500000 
+  Ar        -0.000006107200000          0.000004299100000         -0.000000755700000 
diff --git a/regtest/crystallization/rt-average-vec/Makefile b/regtest/crystallization/rt-average-vec/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..3703b27cea227aa053fb6d1d73f861e4384dbcee
--- /dev/null
+++ b/regtest/crystallization/rt-average-vec/Makefile
@@ -0,0 +1 @@
+include ../../scripts/test.make
diff --git a/regtest/crystallization/rt-average-vec/colvar.reference b/regtest/crystallization/rt-average-vec/colvar.reference
new file mode 100644
index 0000000000000000000000000000000000000000..f8c55b9298ce5358e0455a1b7f3e5ef3c042e77d
--- /dev/null
+++ b/regtest/crystallization/rt-average-vec/colvar.reference
@@ -0,0 +1,2 @@
+#! FIELDS time a6a
+ 0.000000   0.3079
diff --git a/regtest/crystallization/rt-average-vec/config b/regtest/crystallization/rt-average-vec/config
new file mode 100644
index 0000000000000000000000000000000000000000..2048daf60309595eadf1a6dc9d834de4e1e73784
--- /dev/null
+++ b/regtest/crystallization/rt-average-vec/config
@@ -0,0 +1,3 @@
+type=driver
+# this is to test a different name
+arg="--plumed plumed.dat --ixyz LJ75C_global-minima.xyz"
diff --git a/regtest/crystallization/rt-average-vec/derivatives.reference b/regtest/crystallization/rt-average-vec/derivatives.reference
new file mode 100644
index 0000000000000000000000000000000000000000..d20a6882e1e954bf8a9c1fc479eaa109df78afa7
--- /dev/null
+++ b/regtest/crystallization/rt-average-vec/derivatives.reference
@@ -0,0 +1,235 @@
+#! FIELDS time parameter a6a
+ 0.000000 0  -0.0122
+ 0.000000 1  -0.0019
+ 0.000000 2  -0.0029
+ 0.000000 3   0.0122
+ 0.000000 4   0.0019
+ 0.000000 5   0.0029
+ 0.000000 6  -0.0006
+ 0.000000 7   0.0021
+ 0.000000 8  -0.0015
+ 0.000000 9   0.0006
+ 0.000000 10   0.0023
+ 0.000000 11  -0.0012
+ 0.000000 12   0.0011
+ 0.000000 13  -0.0024
+ 0.000000 14  -0.0001
+ 0.000000 15  -0.0002
+ 0.000000 16  -0.0026
+ 0.000000 17  -0.0003
+ 0.000000 18  -0.0010
+ 0.000000 19  -0.0011
+ 0.000000 20   0.0022
+ 0.000000 21   0.0002
+ 0.000000 22  -0.0010
+ 0.000000 23   0.0025
+ 0.000000 24   0.0000
+ 0.000000 25  -0.0006
+ 0.000000 26  -0.0026
+ 0.000000 27  -0.0001
+ 0.000000 28   0.0020
+ 0.000000 29   0.0018
+ 0.000000 30   0.0013
+ 0.000000 31  -0.0005
+ 0.000000 32  -0.0023
+ 0.000000 33  -0.0013
+ 0.000000 34   0.0018
+ 0.000000 35   0.0014
+ 0.000000 36   0.0001
+ 0.000000 37  -0.0007
+ 0.000000 38  -0.0026
+ 0.000000 39  -0.0013
+ 0.000000 40   0.0018
+ 0.000000 41   0.0015
+ 0.000000 42  -0.0001
+ 0.000000 43   0.0020
+ 0.000000 44   0.0017
+ 0.000000 45   0.0013
+ 0.000000 46  -0.0004
+ 0.000000 47  -0.0023
+ 0.000000 48  -0.0010
+ 0.000000 49  -0.0012
+ 0.000000 50   0.0022
+ 0.000000 51   0.0002
+ 0.000000 52  -0.0009
+ 0.000000 53   0.0025
+ 0.000000 54  -0.0002
+ 0.000000 55  -0.0026
+ 0.000000 56  -0.0004
+ 0.000000 57   0.0010
+ 0.000000 58  -0.0025
+ 0.000000 59   0.0000
+ 0.000000 60   0.0006
+ 0.000000 61   0.0023
+ 0.000000 62  -0.0012
+ 0.000000 63  -0.0007
+ 0.000000 64   0.0021
+ 0.000000 65  -0.0014
+ 0.000000 66  -0.0023
+ 0.000000 67  -0.0001
+ 0.000000 68  -0.0011
+ 0.000000 69   0.0026
+ 0.000000 70  -0.0001
+ 0.000000 71   0.0002
+ 0.000000 72   0.0023
+ 0.000000 73   0.0010
+ 0.000000 74   0.0006
+ 0.000000 75  -0.0024
+ 0.000000 76  -0.0009
+ 0.000000 77  -0.0003
+ 0.000000 78  -0.0026
+ 0.000000 79  -0.0002
+ 0.000000 80  -0.0000
+ 0.000000 81   0.0023
+ 0.000000 82   0.0005
+ 0.000000 83   0.0011
+ 0.000000 84   0.0024
+ 0.000000 85  -0.0001
+ 0.000000 86   0.0009
+ 0.000000 87  -0.0025
+ 0.000000 88   0.0002
+ 0.000000 89  -0.0005
+ 0.000000 90  -0.0023
+ 0.000000 91  -0.0008
+ 0.000000 92  -0.0010
+ 0.000000 93   0.0025
+ 0.000000 94   0.0006
+ 0.000000 95   0.0000
+ 0.000000 96  -0.0037
+ 0.000000 97  -0.0005
+ 0.000000 98  -0.0011
+ 0.000000 99   0.0037
+ 0.000000 100   0.0008
+ 0.000000 101   0.0009
+ 0.000000 102   0.0038
+ 0.000000 103   0.0004
+ 0.000000 104   0.0008
+ 0.000000 105  -0.0037
+ 0.000000 106  -0.0007
+ 0.000000 107  -0.0010
+ 0.000000 108  -0.0038
+ 0.000000 109  -0.0008
+ 0.000000 110  -0.0008
+ 0.000000 111   0.0037
+ 0.000000 112   0.0006
+ 0.000000 113   0.0011
+ 0.000000 114  -0.0038
+ 0.000000 115  -0.0005
+ 0.000000 116  -0.0007
+ 0.000000 117  -0.0038
+ 0.000000 118  -0.0004
+ 0.000000 119  -0.0009
+ 0.000000 120   0.0038
+ 0.000000 121   0.0004
+ 0.000000 122   0.0010
+ 0.000000 123   0.0038
+ 0.000000 124   0.0007
+ 0.000000 125   0.0007
+ 0.000000 126   0.0018
+ 0.000000 127   0.0010
+ 0.000000 128   0.0000
+ 0.000000 129  -0.0019
+ 0.000000 130  -0.0006
+ 0.000000 131   0.0003
+ 0.000000 132  -0.0016
+ 0.000000 133  -0.0011
+ 0.000000 134  -0.0005
+ 0.000000 135   0.0019
+ 0.000000 136  -0.0005
+ 0.000000 137   0.0004
+ 0.000000 138   0.0020
+ 0.000000 139   0.0001
+ 0.000000 140  -0.0004
+ 0.000000 141  -0.0020
+ 0.000000 142   0.0003
+ 0.000000 143   0.0001
+ 0.000000 144  -0.0018
+ 0.000000 145   0.0004
+ 0.000000 146  -0.0008
+ 0.000000 147   0.0016
+ 0.000000 148  -0.0001
+ 0.000000 149   0.0012
+ 0.000000 150  -0.0016
+ 0.000000 151  -0.0004
+ 0.000000 152  -0.0012
+ 0.000000 153   0.0016
+ 0.000000 154   0.0009
+ 0.000000 155   0.0009
+ 0.000000 156   0.0000
+ 0.000000 157  -0.0013
+ 0.000000 158   0.0008
+ 0.000000 159  -0.0004
+ 0.000000 160   0.0003
+ 0.000000 161   0.0015
+ 0.000000 162  -0.0003
+ 0.000000 163   0.0015
+ 0.000000 164   0.0001
+ 0.000000 165   0.0002
+ 0.000000 166   0.0006
+ 0.000000 167  -0.0014
+ 0.000000 168   0.0004
+ 0.000000 169  -0.0012
+ 0.000000 170  -0.0010
+ 0.000000 171  -0.0001
+ 0.000000 172  -0.0002
+ 0.000000 173   0.0004
+ 0.000000 174   0.0001
+ 0.000000 175  -0.0005
+ 0.000000 176  -0.0000
+ 0.000000 177  -0.0000
+ 0.000000 178   0.0004
+ 0.000000 179  -0.0002
+ 0.000000 180  -0.0001
+ 0.000000 181   0.0003
+ 0.000000 182   0.0003
+ 0.000000 183   0.0001
+ 0.000000 184  -0.0001
+ 0.000000 185  -0.0004
+ 0.000000 186  -0.0005
+ 0.000000 187  -0.0001
+ 0.000000 188  -0.0001
+ 0.000000 189   0.0005
+ 0.000000 190   0.0001
+ 0.000000 191   0.0001
+ 0.000000 192  -0.0002
+ 0.000000 193  -0.0003
+ 0.000000 194  -0.0001
+ 0.000000 195   0.0003
+ 0.000000 196  -0.0003
+ 0.000000 197   0.0000
+ 0.000000 198  -0.0002
+ 0.000000 199  -0.0002
+ 0.000000 200   0.0002
+ 0.000000 201  -0.0001
+ 0.000000 202  -0.0001
+ 0.000000 203  -0.0003
+ 0.000000 204   0.0003
+ 0.000000 205  -0.0000
+ 0.000000 206  -0.0002
+ 0.000000 207   0.0002
+ 0.000000 208  -0.0001
+ 0.000000 209   0.0003
+ 0.000000 210   0.0001
+ 0.000000 211   0.0003
+ 0.000000 212   0.0002
+ 0.000000 213  -0.0003
+ 0.000000 214   0.0002
+ 0.000000 215   0.0001
+ 0.000000 216   0.0002
+ 0.000000 217   0.0003
+ 0.000000 218  -0.0001
+ 0.000000 219  -0.0002
+ 0.000000 220   0.0002
+ 0.000000 221  -0.0002
+ 0.000000 222   0.0000
+ 0.000000 223   0.0000
+ 0.000000 224   0.0000
+ 0.000000 225   0.1428
+ 0.000000 226   0.0344
+ 0.000000 227   0.0531
+ 0.000000 228   0.0344
+ 0.000000 229  -0.0751
+ 0.000000 230   0.0082
+ 0.000000 231   0.0531
+ 0.000000 232   0.0082
+ 0.000000 233  -0.0678
diff --git a/regtest/crystallization/rt-average-vec/plumed.dat b/regtest/crystallization/rt-average-vec/plumed.dat
new file mode 100644
index 0000000000000000000000000000000000000000..20f3aca06846dfacacb7b5d952e3bd877ae4f80a
--- /dev/null
+++ b/regtest/crystallization/rt-average-vec/plumed.dat
@@ -0,0 +1,5 @@
+Q6 SPECIES=1-75 SWITCH={GAUSSIAN D_0=1.391 R_0=0.01} LABEL=q6 
+AVERAGE_VECTOR ARG=q6 LABEL=a6a
+
+PRINT ARG=a6a FILE=colvar FMT=%8.4f
+DUMPDERIVATIVES ARG=a6a FILE=derivatives FMT=%8.4f
diff --git a/regtest/crystallization/rt-averaged-q6-lowmem/64.xyz b/regtest/crystallization/rt-averaged-q6-lowmem/64.xyz
new file mode 100755
index 0000000000000000000000000000000000000000..90b3ae19c7598dd32c498e7105925df054c3e788
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6-lowmem/64.xyz
@@ -0,0 +1,66 @@
+   64
+12.41642 12.41642 12.41642 
+  Ge       1.473000000000      2.211000000000      8.700200000000
+  Ge       4.886500000000      3.830000000000      6.593500000000
+  Ge       3.807000000000      1.978700000000     10.045000000000
+  Ge       5.002000000000      3.883500000000      1.357000000000
+  Ge       9.636000000000      1.604000000000      8.697700000000
+  Ge       6.559800000000     11.084000000000      9.650400000000
+  Ge       0.627000000000      0.390000000000      2.224300000000
+  Ge       3.341900000000      6.765300000000      1.369500000000
+  Ge       5.032000000000      9.650500000000      2.785000000000
+  Ge       1.682700000000     10.392700000000      5.459500000000
+  Ge       3.517300000000     12.039000000000      5.930600000000
+  Ge       1.072000000000      5.374900000000     12.335000000000
+  Ge       0.863390000000     11.308000000000      0.275000000000
+  Ge       5.867800000000      0.672000000000      6.605200000000
+  Ge       3.961000000000      8.414000000000      8.691600000000
+  Ge      11.570960000000     10.444000000000      2.125000000000
+  Ge       1.736000000000      6.845200000000      6.129000000000
+  Ge       7.557300000000      8.842800000000      6.611800000000
+  Ge       2.785800000000      2.591200000000      1.833300000000
+  Ge      11.564000000000     11.555000000000     10.928000000000
+  Ge       3.324000000000     11.334000000000     12.095000000000
+  Ge      10.532000000000      9.377700000000      6.724000000000
+  Ge       7.157000000000     11.468000000000     12.063000000000
+  Ge       0.027000000000      4.622000000000      5.996200000000
+  Ge       4.564000000000      6.513200000000      5.370200000000
+  Ge      12.189770000000      7.981000000000      2.257000000000
+  Ge       8.973100000000      0.437000000000      4.852800000000
+  Ge       9.086200000000      9.857000000000      0.975000000000
+  Ge       6.516500000000     12.170000000000      2.438600000000
+  Ge       8.955900000000      4.612000000000      4.478000000000
+  Ge       7.419000000000      3.301600000000      0.450000000000
+  Ge      10.808000000000      7.170600000000     11.109000000000
+  Te       4.818200000000      9.096200000000      6.189300000000
+  Te      10.663400000000      6.726900000000      5.343000000000
+  Te       7.021700000000      4.814600000000     10.649000000000
+  Te       3.253500000000      5.713300000000      8.267800000000
+  Te      10.322000000000      1.250000000000      2.209500000000
+  Te       0.300000000000      5.033000000000      8.902400000000
+  Te      12.092000000000      0.227000000000      8.527200000000
+  Te       6.329000000000      2.634100000000      8.525500000000
+  Te       8.044800000000     11.712000000000      7.575400000000
+  Te       2.150000000000      8.302000000000      3.591400000000
+  Te      11.581000000000     11.201000000000      4.824700000000
+  Te       3.960900000000      4.755000000000     11.528710000000
+  Te       3.815300000000     12.139000000000      3.263700000000
+  Te       9.419700000000      7.232700000000      1.010000000000
+  Te       1.211700000000      1.726300000000     12.223470000000
+  Te       0.798460000000      8.988100000000      7.517700000000
+  Te      10.078000000000      9.503000000000      9.977500000000
+  Te       9.336700000000      0.894000000000     11.469560000000
+  Te       7.251000000000      5.783400000000      6.399000000000
+  Te       3.740000000000     11.515000000000      9.383700000000
+  Te      10.329000000000      2.726600000000      5.835100000000
+  Te       6.722900000000      8.386100000000      9.226500000000
+  Te       1.247000000000      4.660000000000      2.609100000000
+  Te       5.628500000000      6.170200000000      2.845000000000
+  Te       4.742900000000      9.191800000000      0.212000000000
+  Te       5.134400000000      0.984830000000     12.244000000000
+  Te       8.033800000000     10.061100000000      3.578600000000
+  Te       9.840000000000      4.825000000000      9.743000000000
+  Te       6.760000000000      2.189000000000      4.410700000000
+  Te       2.334000000000      2.201000000000      6.079000000000
+  Te       9.930600000000      3.982900000000      1.562000000000
+  Te       0.806810000000      8.091100000000     12.264000000000
diff --git a/regtest/crystallization/rt-averaged-q6-lowmem/Makefile b/regtest/crystallization/rt-averaged-q6-lowmem/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..3703b27cea227aa053fb6d1d73f861e4384dbcee
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6-lowmem/Makefile
@@ -0,0 +1 @@
+include ../../scripts/test.make
diff --git a/regtest/crystallization/rt-averaged-q6-lowmem/colv.reference b/regtest/crystallization/rt-averaged-q6-lowmem/colv.reference
new file mode 100644
index 0000000000000000000000000000000000000000..8d69c80ee2192c76108352c9c7255dee723a579b
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6-lowmem/colv.reference
@@ -0,0 +1,2 @@
+#! FIELDS time q6.mean
+ 0.000000 0.245096
diff --git a/regtest/crystallization/rt-averaged-q6-lowmem/colv3.reference b/regtest/crystallization/rt-averaged-q6-lowmem/colv3.reference
new file mode 100644
index 0000000000000000000000000000000000000000..bb98831d129bc94a645980f032244eb7a5b1982e
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6-lowmem/colv3.reference
@@ -0,0 +1,2 @@
+#! FIELDS time w6.mean
+ 0.000000 0.065847
diff --git a/regtest/crystallization/rt-averaged-q6-lowmem/config b/regtest/crystallization/rt-averaged-q6-lowmem/config
new file mode 100644
index 0000000000000000000000000000000000000000..e07432072a91405171ff68d3c3d22a09fde3346c
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6-lowmem/config
@@ -0,0 +1,3 @@
+type=driver
+# this is to test a different name
+arg="--plumed plumed.dat --ixyz 64.xyz"
diff --git a/regtest/crystallization/rt-averaged-q6-lowmem/deriv3.reference b/regtest/crystallization/rt-averaged-q6-lowmem/deriv3.reference
new file mode 100644
index 0000000000000000000000000000000000000000..a4db1306390ea48453f5fd99e61681cce3b7da31
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6-lowmem/deriv3.reference
@@ -0,0 +1,202 @@
+#! FIELDS time parameter w6.mean
+ 0.000000 0   0.0018
+ 0.000000 1   0.0008
+ 0.000000 2  -0.0002
+ 0.000000 3  -0.0006
+ 0.000000 4  -0.0002
+ 0.000000 5  -0.0068
+ 0.000000 6   0.0016
+ 0.000000 7   0.0024
+ 0.000000 8  -0.0052
+ 0.000000 9  -0.0011
+ 0.000000 10  -0.0004
+ 0.000000 11   0.0032
+ 0.000000 12   0.0009
+ 0.000000 13   0.0012
+ 0.000000 14  -0.0001
+ 0.000000 15  -0.0013
+ 0.000000 16  -0.0039
+ 0.000000 17  -0.0010
+ 0.000000 18  -0.0018
+ 0.000000 19   0.0008
+ 0.000000 20   0.0005
+ 0.000000 21  -0.0016
+ 0.000000 22  -0.0004
+ 0.000000 23  -0.0013
+ 0.000000 24   0.0041
+ 0.000000 25  -0.0011
+ 0.000000 26  -0.0032
+ 0.000000 27  -0.0009
+ 0.000000 28  -0.0018
+ 0.000000 29   0.0040
+ 0.000000 30  -0.0014
+ 0.000000 31   0.0030
+ 0.000000 32   0.0020
+ 0.000000 33   0.0010
+ 0.000000 34  -0.0015
+ 0.000000 35   0.0025
+ 0.000000 36   0.0000
+ 0.000000 37   0.0010
+ 0.000000 38  -0.0022
+ 0.000000 39  -0.0003
+ 0.000000 40   0.0014
+ 0.000000 41  -0.0002
+ 0.000000 42   0.0003
+ 0.000000 43  -0.0000
+ 0.000000 44   0.0001
+ 0.000000 45  -0.0000
+ 0.000000 46  -0.0014
+ 0.000000 47  -0.0006
+ 0.000000 48  -0.0012
+ 0.000000 49   0.0000
+ 0.000000 50  -0.0018
+ 0.000000 51  -0.0005
+ 0.000000 52   0.0005
+ 0.000000 53   0.0001
+ 0.000000 54  -0.0012
+ 0.000000 55   0.0039
+ 0.000000 56   0.0024
+ 0.000000 57  -0.0011
+ 0.000000 58  -0.0029
+ 0.000000 59  -0.0025
+ 0.000000 60   0.0002
+ 0.000000 61  -0.0043
+ 0.000000 62  -0.0021
+ 0.000000 63  -0.0045
+ 0.000000 64   0.0030
+ 0.000000 65   0.0025
+ 0.000000 66  -0.0003
+ 0.000000 67  -0.0016
+ 0.000000 68   0.0003
+ 0.000000 69   0.0008
+ 0.000000 70  -0.0019
+ 0.000000 71  -0.0008
+ 0.000000 72   0.0011
+ 0.000000 73   0.0022
+ 0.000000 74   0.0026
+ 0.000000 75  -0.0006
+ 0.000000 76  -0.0032
+ 0.000000 77  -0.0009
+ 0.000000 78   0.0016
+ 0.000000 79  -0.0015
+ 0.000000 80   0.0008
+ 0.000000 81  -0.0002
+ 0.000000 82  -0.0003
+ 0.000000 83  -0.0006
+ 0.000000 84   0.0038
+ 0.000000 85   0.0018
+ 0.000000 86  -0.0012
+ 0.000000 87  -0.0006
+ 0.000000 88  -0.0017
+ 0.000000 89   0.0053
+ 0.000000 90   0.0004
+ 0.000000 91   0.0027
+ 0.000000 92   0.0013
+ 0.000000 93   0.0044
+ 0.000000 94   0.0031
+ 0.000000 95  -0.0037
+ 0.000000 96   0.0011
+ 0.000000 97  -0.0000
+ 0.000000 98   0.0011
+ 0.000000 99  -0.0003
+ 0.000000 100   0.0007
+ 0.000000 101  -0.0025
+ 0.000000 102  -0.0018
+ 0.000000 103  -0.0017
+ 0.000000 104  -0.0015
+ 0.000000 105   0.0034
+ 0.000000 106  -0.0002
+ 0.000000 107   0.0025
+ 0.000000 108   0.0017
+ 0.000000 109   0.0046
+ 0.000000 110   0.0002
+ 0.000000 111   0.0014
+ 0.000000 112   0.0005
+ 0.000000 113  -0.0020
+ 0.000000 114   0.0051
+ 0.000000 115   0.0000
+ 0.000000 116  -0.0030
+ 0.000000 117   0.0030
+ 0.000000 118  -0.0012
+ 0.000000 119   0.0041
+ 0.000000 120  -0.0030
+ 0.000000 121  -0.0009
+ 0.000000 122   0.0019
+ 0.000000 123   0.0034
+ 0.000000 124  -0.0002
+ 0.000000 125  -0.0045
+ 0.000000 126   0.0011
+ 0.000000 127  -0.0012
+ 0.000000 128   0.0004
+ 0.000000 129   0.0021
+ 0.000000 130  -0.0040
+ 0.000000 131  -0.0011
+ 0.000000 132  -0.0010
+ 0.000000 133  -0.0012
+ 0.000000 134  -0.0025
+ 0.000000 135  -0.0004
+ 0.000000 136  -0.0017
+ 0.000000 137   0.0011
+ 0.000000 138   0.0039
+ 0.000000 139  -0.0019
+ 0.000000 140  -0.0017
+ 0.000000 141  -0.0004
+ 0.000000 142   0.0017
+ 0.000000 143   0.0045
+ 0.000000 144   0.0005
+ 0.000000 145   0.0003
+ 0.000000 146   0.0001
+ 0.000000 147  -0.0043
+ 0.000000 148   0.0001
+ 0.000000 149  -0.0005
+ 0.000000 150  -0.0012
+ 0.000000 151   0.0029
+ 0.000000 152   0.0046
+ 0.000000 153  -0.0024
+ 0.000000 154   0.0018
+ 0.000000 155  -0.0015
+ 0.000000 156   0.0025
+ 0.000000 157   0.0005
+ 0.000000 158  -0.0039
+ 0.000000 159  -0.0007
+ 0.000000 160  -0.0028
+ 0.000000 161  -0.0002
+ 0.000000 162  -0.0054
+ 0.000000 163  -0.0020
+ 0.000000 164   0.0052
+ 0.000000 165   0.0020
+ 0.000000 166  -0.0019
+ 0.000000 167   0.0049
+ 0.000000 168  -0.0006
+ 0.000000 169   0.0044
+ 0.000000 170   0.0033
+ 0.000000 171   0.0004
+ 0.000000 172   0.0019
+ 0.000000 173  -0.0009
+ 0.000000 174   0.0006
+ 0.000000 175  -0.0041
+ 0.000000 176   0.0042
+ 0.000000 177  -0.0045
+ 0.000000 178   0.0009
+ 0.000000 179   0.0022
+ 0.000000 180  -0.0009
+ 0.000000 181   0.0016
+ 0.000000 182  -0.0062
+ 0.000000 183  -0.0018
+ 0.000000 184  -0.0019
+ 0.000000 185  -0.0013
+ 0.000000 186  -0.0031
+ 0.000000 187   0.0001
+ 0.000000 188   0.0002
+ 0.000000 189  -0.0034
+ 0.000000 190   0.0051
+ 0.000000 191  -0.0007
+ 0.000000 192  -0.0552
+ 0.000000 193  -0.0319
+ 0.000000 194  -0.0141
+ 0.000000 195  -0.0319
+ 0.000000 196  -0.0972
+ 0.000000 197   0.0628
+ 0.000000 198  -0.0141
+ 0.000000 199   0.0628
+ 0.000000 200  -0.0608
diff --git a/regtest/crystallization/rt-averaged-q6-lowmem/plumed.dat b/regtest/crystallization/rt-averaged-q6-lowmem/plumed.dat
new file mode 100644
index 0000000000000000000000000000000000000000..d4e57b0e2329aaf37d4f191430822ebd172aa3b1
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6-lowmem/plumed.dat
@@ -0,0 +1,7 @@
+Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN LABEL=q6 
+PRINT ARG=q6.* FILE=colv 
+
+LOCAL_AVERAGE ARG=q6 SWITCH={RATIONAL D_0=3.0 R_0=1.5} MEAN LOWMEM LABEL=w6
+PRINT ARG=w6.* FILE=colv3
+DUMPDERIVATIVES ARG=w6.* FILE=deriv3 FMT=%8.4f
+
diff --git a/regtest/crystallization/rt-averaged-q6/64.xyz b/regtest/crystallization/rt-averaged-q6/64.xyz
new file mode 100755
index 0000000000000000000000000000000000000000..90b3ae19c7598dd32c498e7105925df054c3e788
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6/64.xyz
@@ -0,0 +1,66 @@
+   64
+12.41642 12.41642 12.41642 
+  Ge       1.473000000000      2.211000000000      8.700200000000
+  Ge       4.886500000000      3.830000000000      6.593500000000
+  Ge       3.807000000000      1.978700000000     10.045000000000
+  Ge       5.002000000000      3.883500000000      1.357000000000
+  Ge       9.636000000000      1.604000000000      8.697700000000
+  Ge       6.559800000000     11.084000000000      9.650400000000
+  Ge       0.627000000000      0.390000000000      2.224300000000
+  Ge       3.341900000000      6.765300000000      1.369500000000
+  Ge       5.032000000000      9.650500000000      2.785000000000
+  Ge       1.682700000000     10.392700000000      5.459500000000
+  Ge       3.517300000000     12.039000000000      5.930600000000
+  Ge       1.072000000000      5.374900000000     12.335000000000
+  Ge       0.863390000000     11.308000000000      0.275000000000
+  Ge       5.867800000000      0.672000000000      6.605200000000
+  Ge       3.961000000000      8.414000000000      8.691600000000
+  Ge      11.570960000000     10.444000000000      2.125000000000
+  Ge       1.736000000000      6.845200000000      6.129000000000
+  Ge       7.557300000000      8.842800000000      6.611800000000
+  Ge       2.785800000000      2.591200000000      1.833300000000
+  Ge      11.564000000000     11.555000000000     10.928000000000
+  Ge       3.324000000000     11.334000000000     12.095000000000
+  Ge      10.532000000000      9.377700000000      6.724000000000
+  Ge       7.157000000000     11.468000000000     12.063000000000
+  Ge       0.027000000000      4.622000000000      5.996200000000
+  Ge       4.564000000000      6.513200000000      5.370200000000
+  Ge      12.189770000000      7.981000000000      2.257000000000
+  Ge       8.973100000000      0.437000000000      4.852800000000
+  Ge       9.086200000000      9.857000000000      0.975000000000
+  Ge       6.516500000000     12.170000000000      2.438600000000
+  Ge       8.955900000000      4.612000000000      4.478000000000
+  Ge       7.419000000000      3.301600000000      0.450000000000
+  Ge      10.808000000000      7.170600000000     11.109000000000
+  Te       4.818200000000      9.096200000000      6.189300000000
+  Te      10.663400000000      6.726900000000      5.343000000000
+  Te       7.021700000000      4.814600000000     10.649000000000
+  Te       3.253500000000      5.713300000000      8.267800000000
+  Te      10.322000000000      1.250000000000      2.209500000000
+  Te       0.300000000000      5.033000000000      8.902400000000
+  Te      12.092000000000      0.227000000000      8.527200000000
+  Te       6.329000000000      2.634100000000      8.525500000000
+  Te       8.044800000000     11.712000000000      7.575400000000
+  Te       2.150000000000      8.302000000000      3.591400000000
+  Te      11.581000000000     11.201000000000      4.824700000000
+  Te       3.960900000000      4.755000000000     11.528710000000
+  Te       3.815300000000     12.139000000000      3.263700000000
+  Te       9.419700000000      7.232700000000      1.010000000000
+  Te       1.211700000000      1.726300000000     12.223470000000
+  Te       0.798460000000      8.988100000000      7.517700000000
+  Te      10.078000000000      9.503000000000      9.977500000000
+  Te       9.336700000000      0.894000000000     11.469560000000
+  Te       7.251000000000      5.783400000000      6.399000000000
+  Te       3.740000000000     11.515000000000      9.383700000000
+  Te      10.329000000000      2.726600000000      5.835100000000
+  Te       6.722900000000      8.386100000000      9.226500000000
+  Te       1.247000000000      4.660000000000      2.609100000000
+  Te       5.628500000000      6.170200000000      2.845000000000
+  Te       4.742900000000      9.191800000000      0.212000000000
+  Te       5.134400000000      0.984830000000     12.244000000000
+  Te       8.033800000000     10.061100000000      3.578600000000
+  Te       9.840000000000      4.825000000000      9.743000000000
+  Te       6.760000000000      2.189000000000      4.410700000000
+  Te       2.334000000000      2.201000000000      6.079000000000
+  Te       9.930600000000      3.982900000000      1.562000000000
+  Te       0.806810000000      8.091100000000     12.264000000000
diff --git a/regtest/crystallization/rt-averaged-q6/Makefile b/regtest/crystallization/rt-averaged-q6/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..3703b27cea227aa053fb6d1d73f861e4384dbcee
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6/Makefile
@@ -0,0 +1 @@
+include ../../scripts/test.make
diff --git a/regtest/crystallization/rt-averaged-q6/colv.reference b/regtest/crystallization/rt-averaged-q6/colv.reference
new file mode 100644
index 0000000000000000000000000000000000000000..8d69c80ee2192c76108352c9c7255dee723a579b
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6/colv.reference
@@ -0,0 +1,2 @@
+#! FIELDS time q6.mean
+ 0.000000 0.245096
diff --git a/regtest/crystallization/rt-averaged-q6/colv3.reference b/regtest/crystallization/rt-averaged-q6/colv3.reference
new file mode 100644
index 0000000000000000000000000000000000000000..bb98831d129bc94a645980f032244eb7a5b1982e
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6/colv3.reference
@@ -0,0 +1,2 @@
+#! FIELDS time w6.mean
+ 0.000000 0.065847
diff --git a/regtest/crystallization/rt-averaged-q6/config b/regtest/crystallization/rt-averaged-q6/config
new file mode 100644
index 0000000000000000000000000000000000000000..e07432072a91405171ff68d3c3d22a09fde3346c
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6/config
@@ -0,0 +1,3 @@
+type=driver
+# this is to test a different name
+arg="--plumed plumed.dat --ixyz 64.xyz"
diff --git a/regtest/crystallization/rt-averaged-q6/deriv.reference b/regtest/crystallization/rt-averaged-q6/deriv.reference
new file mode 100644
index 0000000000000000000000000000000000000000..a7c522e7376756146f4ece8e74bc7b27bf920713
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6/deriv.reference
@@ -0,0 +1,202 @@
+#! FIELDS time parameter q6.mean
+ 0.000000 0   0.0012
+ 0.000000 1   0.0016
+ 0.000000 2  -0.0017
+ 0.000000 3  -0.0003
+ 0.000000 4   0.0017
+ 0.000000 5  -0.0031
+ 0.000000 6  -0.0013
+ 0.000000 7  -0.0015
+ 0.000000 8  -0.0023
+ 0.000000 9   0.0000
+ 0.000000 10   0.0022
+ 0.000000 11   0.0030
+ 0.000000 12  -0.0009
+ 0.000000 13  -0.0010
+ 0.000000 14  -0.0002
+ 0.000000 15  -0.0018
+ 0.000000 16  -0.0026
+ 0.000000 17  -0.0006
+ 0.000000 18   0.0009
+ 0.000000 19  -0.0008
+ 0.000000 20   0.0013
+ 0.000000 21  -0.0024
+ 0.000000 22   0.0041
+ 0.000000 23  -0.0008
+ 0.000000 24   0.0026
+ 0.000000 25  -0.0023
+ 0.000000 26  -0.0015
+ 0.000000 27  -0.0021
+ 0.000000 28   0.0029
+ 0.000000 29   0.0037
+ 0.000000 30  -0.0017
+ 0.000000 31  -0.0015
+ 0.000000 32   0.0018
+ 0.000000 33  -0.0027
+ 0.000000 34  -0.0000
+ 0.000000 35   0.0003
+ 0.000000 36   0.0006
+ 0.000000 37  -0.0016
+ 0.000000 38   0.0004
+ 0.000000 39  -0.0020
+ 0.000000 40   0.0019
+ 0.000000 41  -0.0005
+ 0.000000 42   0.0016
+ 0.000000 43  -0.0053
+ 0.000000 44   0.0001
+ 0.000000 45  -0.0031
+ 0.000000 46  -0.0020
+ 0.000000 47  -0.0020
+ 0.000000 48  -0.0014
+ 0.000000 49   0.0010
+ 0.000000 50  -0.0059
+ 0.000000 51   0.0021
+ 0.000000 52  -0.0023
+ 0.000000 53   0.0027
+ 0.000000 54   0.0011
+ 0.000000 55   0.0006
+ 0.000000 56  -0.0010
+ 0.000000 57  -0.0005
+ 0.000000 58  -0.0017
+ 0.000000 59  -0.0010
+ 0.000000 60  -0.0001
+ 0.000000 61   0.0010
+ 0.000000 62   0.0016
+ 0.000000 63   0.0017
+ 0.000000 64   0.0000
+ 0.000000 65  -0.0029
+ 0.000000 66   0.0003
+ 0.000000 67   0.0033
+ 0.000000 68  -0.0041
+ 0.000000 69  -0.0007
+ 0.000000 70   0.0014
+ 0.000000 71  -0.0004
+ 0.000000 72   0.0029
+ 0.000000 73   0.0013
+ 0.000000 74  -0.0008
+ 0.000000 75   0.0017
+ 0.000000 76  -0.0046
+ 0.000000 77  -0.0000
+ 0.000000 78   0.0009
+ 0.000000 79  -0.0008
+ 0.000000 80   0.0009
+ 0.000000 81  -0.0001
+ 0.000000 82  -0.0002
+ 0.000000 83  -0.0006
+ 0.000000 84   0.0009
+ 0.000000 85  -0.0012
+ 0.000000 86   0.0001
+ 0.000000 87   0.0015
+ 0.000000 88   0.0018
+ 0.000000 89  -0.0039
+ 0.000000 90   0.0008
+ 0.000000 91   0.0005
+ 0.000000 92   0.0029
+ 0.000000 93   0.0025
+ 0.000000 94   0.0016
+ 0.000000 95   0.0016
+ 0.000000 96  -0.0017
+ 0.000000 97  -0.0001
+ 0.000000 98   0.0022
+ 0.000000 99  -0.0024
+ 0.000000 100   0.0009
+ 0.000000 101   0.0004
+ 0.000000 102  -0.0017
+ 0.000000 103  -0.0014
+ 0.000000 104   0.0004
+ 0.000000 105   0.0002
+ 0.000000 106  -0.0033
+ 0.000000 107  -0.0020
+ 0.000000 108  -0.0001
+ 0.000000 109   0.0039
+ 0.000000 110   0.0014
+ 0.000000 111  -0.0004
+ 0.000000 112   0.0018
+ 0.000000 113  -0.0021
+ 0.000000 114   0.0037
+ 0.000000 115  -0.0004
+ 0.000000 116   0.0011
+ 0.000000 117   0.0042
+ 0.000000 118  -0.0016
+ 0.000000 119  -0.0004
+ 0.000000 120   0.0011
+ 0.000000 121  -0.0003
+ 0.000000 122   0.0016
+ 0.000000 123   0.0018
+ 0.000000 124   0.0034
+ 0.000000 125   0.0002
+ 0.000000 126   0.0009
+ 0.000000 127   0.0013
+ 0.000000 128   0.0007
+ 0.000000 129   0.0010
+ 0.000000 130  -0.0032
+ 0.000000 131   0.0021
+ 0.000000 132  -0.0027
+ 0.000000 133  -0.0000
+ 0.000000 134   0.0009
+ 0.000000 135  -0.0045
+ 0.000000 136  -0.0014
+ 0.000000 137  -0.0014
+ 0.000000 138   0.0004
+ 0.000000 139  -0.0003
+ 0.000000 140  -0.0025
+ 0.000000 141   0.0032
+ 0.000000 142   0.0037
+ 0.000000 143   0.0005
+ 0.000000 144  -0.0003
+ 0.000000 145   0.0047
+ 0.000000 146  -0.0015
+ 0.000000 147  -0.0011
+ 0.000000 148   0.0004
+ 0.000000 149  -0.0015
+ 0.000000 150  -0.0006
+ 0.000000 151  -0.0028
+ 0.000000 152   0.0036
+ 0.000000 153  -0.0040
+ 0.000000 154  -0.0003
+ 0.000000 155  -0.0031
+ 0.000000 156   0.0021
+ 0.000000 157  -0.0002
+ 0.000000 158   0.0002
+ 0.000000 159   0.0016
+ 0.000000 160   0.0010
+ 0.000000 161   0.0036
+ 0.000000 162  -0.0004
+ 0.000000 163  -0.0028
+ 0.000000 164   0.0055
+ 0.000000 165   0.0014
+ 0.000000 166  -0.0034
+ 0.000000 167   0.0023
+ 0.000000 168  -0.0002
+ 0.000000 169  -0.0002
+ 0.000000 170  -0.0006
+ 0.000000 171  -0.0009
+ 0.000000 172   0.0009
+ 0.000000 173  -0.0003
+ 0.000000 174   0.0032
+ 0.000000 175  -0.0053
+ 0.000000 176   0.0037
+ 0.000000 177  -0.0019
+ 0.000000 178  -0.0020
+ 0.000000 179   0.0011
+ 0.000000 180  -0.0000
+ 0.000000 181   0.0060
+ 0.000000 182  -0.0033
+ 0.000000 183  -0.0027
+ 0.000000 184   0.0016
+ 0.000000 185   0.0005
+ 0.000000 186  -0.0009
+ 0.000000 187  -0.0031
+ 0.000000 188  -0.0009
+ 0.000000 189  -0.0005
+ 0.000000 190   0.0049
+ 0.000000 191   0.0003
+ 0.000000 192  -0.1431
+ 0.000000 193  -0.0326
+ 0.000000 194   0.0101
+ 0.000000 195  -0.0326
+ 0.000000 196  -0.1712
+ 0.000000 197   0.0351
+ 0.000000 198   0.0101
+ 0.000000 199   0.0351
+ 0.000000 200  -0.1192
diff --git a/regtest/crystallization/rt-averaged-q6/deriv3.reference b/regtest/crystallization/rt-averaged-q6/deriv3.reference
new file mode 100644
index 0000000000000000000000000000000000000000..a4db1306390ea48453f5fd99e61681cce3b7da31
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6/deriv3.reference
@@ -0,0 +1,202 @@
+#! FIELDS time parameter w6.mean
+ 0.000000 0   0.0018
+ 0.000000 1   0.0008
+ 0.000000 2  -0.0002
+ 0.000000 3  -0.0006
+ 0.000000 4  -0.0002
+ 0.000000 5  -0.0068
+ 0.000000 6   0.0016
+ 0.000000 7   0.0024
+ 0.000000 8  -0.0052
+ 0.000000 9  -0.0011
+ 0.000000 10  -0.0004
+ 0.000000 11   0.0032
+ 0.000000 12   0.0009
+ 0.000000 13   0.0012
+ 0.000000 14  -0.0001
+ 0.000000 15  -0.0013
+ 0.000000 16  -0.0039
+ 0.000000 17  -0.0010
+ 0.000000 18  -0.0018
+ 0.000000 19   0.0008
+ 0.000000 20   0.0005
+ 0.000000 21  -0.0016
+ 0.000000 22  -0.0004
+ 0.000000 23  -0.0013
+ 0.000000 24   0.0041
+ 0.000000 25  -0.0011
+ 0.000000 26  -0.0032
+ 0.000000 27  -0.0009
+ 0.000000 28  -0.0018
+ 0.000000 29   0.0040
+ 0.000000 30  -0.0014
+ 0.000000 31   0.0030
+ 0.000000 32   0.0020
+ 0.000000 33   0.0010
+ 0.000000 34  -0.0015
+ 0.000000 35   0.0025
+ 0.000000 36   0.0000
+ 0.000000 37   0.0010
+ 0.000000 38  -0.0022
+ 0.000000 39  -0.0003
+ 0.000000 40   0.0014
+ 0.000000 41  -0.0002
+ 0.000000 42   0.0003
+ 0.000000 43  -0.0000
+ 0.000000 44   0.0001
+ 0.000000 45  -0.0000
+ 0.000000 46  -0.0014
+ 0.000000 47  -0.0006
+ 0.000000 48  -0.0012
+ 0.000000 49   0.0000
+ 0.000000 50  -0.0018
+ 0.000000 51  -0.0005
+ 0.000000 52   0.0005
+ 0.000000 53   0.0001
+ 0.000000 54  -0.0012
+ 0.000000 55   0.0039
+ 0.000000 56   0.0024
+ 0.000000 57  -0.0011
+ 0.000000 58  -0.0029
+ 0.000000 59  -0.0025
+ 0.000000 60   0.0002
+ 0.000000 61  -0.0043
+ 0.000000 62  -0.0021
+ 0.000000 63  -0.0045
+ 0.000000 64   0.0030
+ 0.000000 65   0.0025
+ 0.000000 66  -0.0003
+ 0.000000 67  -0.0016
+ 0.000000 68   0.0003
+ 0.000000 69   0.0008
+ 0.000000 70  -0.0019
+ 0.000000 71  -0.0008
+ 0.000000 72   0.0011
+ 0.000000 73   0.0022
+ 0.000000 74   0.0026
+ 0.000000 75  -0.0006
+ 0.000000 76  -0.0032
+ 0.000000 77  -0.0009
+ 0.000000 78   0.0016
+ 0.000000 79  -0.0015
+ 0.000000 80   0.0008
+ 0.000000 81  -0.0002
+ 0.000000 82  -0.0003
+ 0.000000 83  -0.0006
+ 0.000000 84   0.0038
+ 0.000000 85   0.0018
+ 0.000000 86  -0.0012
+ 0.000000 87  -0.0006
+ 0.000000 88  -0.0017
+ 0.000000 89   0.0053
+ 0.000000 90   0.0004
+ 0.000000 91   0.0027
+ 0.000000 92   0.0013
+ 0.000000 93   0.0044
+ 0.000000 94   0.0031
+ 0.000000 95  -0.0037
+ 0.000000 96   0.0011
+ 0.000000 97  -0.0000
+ 0.000000 98   0.0011
+ 0.000000 99  -0.0003
+ 0.000000 100   0.0007
+ 0.000000 101  -0.0025
+ 0.000000 102  -0.0018
+ 0.000000 103  -0.0017
+ 0.000000 104  -0.0015
+ 0.000000 105   0.0034
+ 0.000000 106  -0.0002
+ 0.000000 107   0.0025
+ 0.000000 108   0.0017
+ 0.000000 109   0.0046
+ 0.000000 110   0.0002
+ 0.000000 111   0.0014
+ 0.000000 112   0.0005
+ 0.000000 113  -0.0020
+ 0.000000 114   0.0051
+ 0.000000 115   0.0000
+ 0.000000 116  -0.0030
+ 0.000000 117   0.0030
+ 0.000000 118  -0.0012
+ 0.000000 119   0.0041
+ 0.000000 120  -0.0030
+ 0.000000 121  -0.0009
+ 0.000000 122   0.0019
+ 0.000000 123   0.0034
+ 0.000000 124  -0.0002
+ 0.000000 125  -0.0045
+ 0.000000 126   0.0011
+ 0.000000 127  -0.0012
+ 0.000000 128   0.0004
+ 0.000000 129   0.0021
+ 0.000000 130  -0.0040
+ 0.000000 131  -0.0011
+ 0.000000 132  -0.0010
+ 0.000000 133  -0.0012
+ 0.000000 134  -0.0025
+ 0.000000 135  -0.0004
+ 0.000000 136  -0.0017
+ 0.000000 137   0.0011
+ 0.000000 138   0.0039
+ 0.000000 139  -0.0019
+ 0.000000 140  -0.0017
+ 0.000000 141  -0.0004
+ 0.000000 142   0.0017
+ 0.000000 143   0.0045
+ 0.000000 144   0.0005
+ 0.000000 145   0.0003
+ 0.000000 146   0.0001
+ 0.000000 147  -0.0043
+ 0.000000 148   0.0001
+ 0.000000 149  -0.0005
+ 0.000000 150  -0.0012
+ 0.000000 151   0.0029
+ 0.000000 152   0.0046
+ 0.000000 153  -0.0024
+ 0.000000 154   0.0018
+ 0.000000 155  -0.0015
+ 0.000000 156   0.0025
+ 0.000000 157   0.0005
+ 0.000000 158  -0.0039
+ 0.000000 159  -0.0007
+ 0.000000 160  -0.0028
+ 0.000000 161  -0.0002
+ 0.000000 162  -0.0054
+ 0.000000 163  -0.0020
+ 0.000000 164   0.0052
+ 0.000000 165   0.0020
+ 0.000000 166  -0.0019
+ 0.000000 167   0.0049
+ 0.000000 168  -0.0006
+ 0.000000 169   0.0044
+ 0.000000 170   0.0033
+ 0.000000 171   0.0004
+ 0.000000 172   0.0019
+ 0.000000 173  -0.0009
+ 0.000000 174   0.0006
+ 0.000000 175  -0.0041
+ 0.000000 176   0.0042
+ 0.000000 177  -0.0045
+ 0.000000 178   0.0009
+ 0.000000 179   0.0022
+ 0.000000 180  -0.0009
+ 0.000000 181   0.0016
+ 0.000000 182  -0.0062
+ 0.000000 183  -0.0018
+ 0.000000 184  -0.0019
+ 0.000000 185  -0.0013
+ 0.000000 186  -0.0031
+ 0.000000 187   0.0001
+ 0.000000 188   0.0002
+ 0.000000 189  -0.0034
+ 0.000000 190   0.0051
+ 0.000000 191  -0.0007
+ 0.000000 192  -0.0552
+ 0.000000 193  -0.0319
+ 0.000000 194  -0.0141
+ 0.000000 195  -0.0319
+ 0.000000 196  -0.0972
+ 0.000000 197   0.0628
+ 0.000000 198  -0.0141
+ 0.000000 199   0.0628
+ 0.000000 200  -0.0608
diff --git a/regtest/crystallization/rt-averaged-q6/plumed.dat b/regtest/crystallization/rt-averaged-q6/plumed.dat
new file mode 100644
index 0000000000000000000000000000000000000000..90d5b57759bd3b969b81498f00bd36b1133b6f87
--- /dev/null
+++ b/regtest/crystallization/rt-averaged-q6/plumed.dat
@@ -0,0 +1,10 @@
+Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN LABEL=q6 
+# Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN NUMERICAL_DERIVATIVES LABEL=q6n
+PRINT ARG=q6.* FILE=colv 
+DUMPDERIVATIVES ARG=q6.* FILE=deriv FMT=%8.4f
+
+LOCAL_AVERAGE ARG=q6 SWITCH={RATIONAL D_0=3.0 R_0=1.5} MEAN LABEL=w6
+# LOCAL_AVERAGE ARG=q6 SWITCH={RATIONAL D_0=3.0 R_0=1.5} MEAN NUMERICAL_DERIVATIVES LABEL=w6n
+PRINT ARG=w6.* FILE=colv3
+DUMPDERIVATIVES ARG=w6.* FILE=deriv3 FMT=%8.4f
+
diff --git a/regtest/crystallization/rt-nbonds-q6-lowmem/64.xyz b/regtest/crystallization/rt-nbonds-q6-lowmem/64.xyz
new file mode 100755
index 0000000000000000000000000000000000000000..90b3ae19c7598dd32c498e7105925df054c3e788
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6-lowmem/64.xyz
@@ -0,0 +1,66 @@
+   64
+12.41642 12.41642 12.41642 
+  Ge       1.473000000000      2.211000000000      8.700200000000
+  Ge       4.886500000000      3.830000000000      6.593500000000
+  Ge       3.807000000000      1.978700000000     10.045000000000
+  Ge       5.002000000000      3.883500000000      1.357000000000
+  Ge       9.636000000000      1.604000000000      8.697700000000
+  Ge       6.559800000000     11.084000000000      9.650400000000
+  Ge       0.627000000000      0.390000000000      2.224300000000
+  Ge       3.341900000000      6.765300000000      1.369500000000
+  Ge       5.032000000000      9.650500000000      2.785000000000
+  Ge       1.682700000000     10.392700000000      5.459500000000
+  Ge       3.517300000000     12.039000000000      5.930600000000
+  Ge       1.072000000000      5.374900000000     12.335000000000
+  Ge       0.863390000000     11.308000000000      0.275000000000
+  Ge       5.867800000000      0.672000000000      6.605200000000
+  Ge       3.961000000000      8.414000000000      8.691600000000
+  Ge      11.570960000000     10.444000000000      2.125000000000
+  Ge       1.736000000000      6.845200000000      6.129000000000
+  Ge       7.557300000000      8.842800000000      6.611800000000
+  Ge       2.785800000000      2.591200000000      1.833300000000
+  Ge      11.564000000000     11.555000000000     10.928000000000
+  Ge       3.324000000000     11.334000000000     12.095000000000
+  Ge      10.532000000000      9.377700000000      6.724000000000
+  Ge       7.157000000000     11.468000000000     12.063000000000
+  Ge       0.027000000000      4.622000000000      5.996200000000
+  Ge       4.564000000000      6.513200000000      5.370200000000
+  Ge      12.189770000000      7.981000000000      2.257000000000
+  Ge       8.973100000000      0.437000000000      4.852800000000
+  Ge       9.086200000000      9.857000000000      0.975000000000
+  Ge       6.516500000000     12.170000000000      2.438600000000
+  Ge       8.955900000000      4.612000000000      4.478000000000
+  Ge       7.419000000000      3.301600000000      0.450000000000
+  Ge      10.808000000000      7.170600000000     11.109000000000
+  Te       4.818200000000      9.096200000000      6.189300000000
+  Te      10.663400000000      6.726900000000      5.343000000000
+  Te       7.021700000000      4.814600000000     10.649000000000
+  Te       3.253500000000      5.713300000000      8.267800000000
+  Te      10.322000000000      1.250000000000      2.209500000000
+  Te       0.300000000000      5.033000000000      8.902400000000
+  Te      12.092000000000      0.227000000000      8.527200000000
+  Te       6.329000000000      2.634100000000      8.525500000000
+  Te       8.044800000000     11.712000000000      7.575400000000
+  Te       2.150000000000      8.302000000000      3.591400000000
+  Te      11.581000000000     11.201000000000      4.824700000000
+  Te       3.960900000000      4.755000000000     11.528710000000
+  Te       3.815300000000     12.139000000000      3.263700000000
+  Te       9.419700000000      7.232700000000      1.010000000000
+  Te       1.211700000000      1.726300000000     12.223470000000
+  Te       0.798460000000      8.988100000000      7.517700000000
+  Te      10.078000000000      9.503000000000      9.977500000000
+  Te       9.336700000000      0.894000000000     11.469560000000
+  Te       7.251000000000      5.783400000000      6.399000000000
+  Te       3.740000000000     11.515000000000      9.383700000000
+  Te      10.329000000000      2.726600000000      5.835100000000
+  Te       6.722900000000      8.386100000000      9.226500000000
+  Te       1.247000000000      4.660000000000      2.609100000000
+  Te       5.628500000000      6.170200000000      2.845000000000
+  Te       4.742900000000      9.191800000000      0.212000000000
+  Te       5.134400000000      0.984830000000     12.244000000000
+  Te       8.033800000000     10.061100000000      3.578600000000
+  Te       9.840000000000      4.825000000000      9.743000000000
+  Te       6.760000000000      2.189000000000      4.410700000000
+  Te       2.334000000000      2.201000000000      6.079000000000
+  Te       9.930600000000      3.982900000000      1.562000000000
+  Te       0.806810000000      8.091100000000     12.264000000000
diff --git a/regtest/crystallization/rt-nbonds-q6-lowmem/Makefile b/regtest/crystallization/rt-nbonds-q6-lowmem/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..3703b27cea227aa053fb6d1d73f861e4384dbcee
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6-lowmem/Makefile
@@ -0,0 +1 @@
+include ../../scripts/test.make
diff --git a/regtest/crystallization/rt-nbonds-q6-lowmem/colv1.reference b/regtest/crystallization/rt-nbonds-q6-lowmem/colv1.reference
new file mode 100644
index 0000000000000000000000000000000000000000..f7e414b390cb145b2d13e7b838d33dd429d5958f
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6-lowmem/colv1.reference
@@ -0,0 +1,2 @@
+#! FIELDS time w6
+ 0.000000 15.644050
diff --git a/regtest/crystallization/rt-nbonds-q6-lowmem/colv2.reference b/regtest/crystallization/rt-nbonds-q6-lowmem/colv2.reference
new file mode 100644
index 0000000000000000000000000000000000000000..451673022fb702691286987acf2d5b277bc7bfe5
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6-lowmem/colv2.reference
@@ -0,0 +1,2 @@
+#! FIELDS time w4
+ 0.000000 33.811763
diff --git a/regtest/crystallization/rt-nbonds-q6-lowmem/config b/regtest/crystallization/rt-nbonds-q6-lowmem/config
new file mode 100644
index 0000000000000000000000000000000000000000..e07432072a91405171ff68d3c3d22a09fde3346c
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6-lowmem/config
@@ -0,0 +1,3 @@
+type=driver
+# this is to test a different name
+arg="--plumed plumed.dat --ixyz 64.xyz"
diff --git a/regtest/crystallization/rt-nbonds-q6-lowmem/deriv1.reference b/regtest/crystallization/rt-nbonds-q6-lowmem/deriv1.reference
new file mode 100644
index 0000000000000000000000000000000000000000..4ae8c2f9ab79270caaf5636b4dfab792b761672d
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6-lowmem/deriv1.reference
@@ -0,0 +1,202 @@
+#! FIELDS time parameter w6
+ 0.000000 0   0.7514
+ 0.000000 1   0.8829
+ 0.000000 2   2.4315
+ 0.000000 3  -3.5375
+ 0.000000 4   0.4772
+ 0.000000 5  -7.9712
+ 0.000000 6   2.0752
+ 0.000000 7   1.1725
+ 0.000000 8  -8.6674
+ 0.000000 9  -1.9002
+ 0.000000 10   0.5045
+ 0.000000 11   2.9522
+ 0.000000 12  -0.0081
+ 0.000000 13   0.0463
+ 0.000000 14   0.0087
+ 0.000000 15  -0.2558
+ 0.000000 16  -3.3394
+ 0.000000 17  -0.2597
+ 0.000000 18  -3.1012
+ 0.000000 19  -0.1783
+ 0.000000 20   0.0649
+ 0.000000 21  -0.7516
+ 0.000000 22  -0.5258
+ 0.000000 23  -0.8601
+ 0.000000 24   3.2547
+ 0.000000 25  -1.6845
+ 0.000000 26  -2.5631
+ 0.000000 27   0.8457
+ 0.000000 28  -3.3966
+ 0.000000 29   0.5749
+ 0.000000 30  -1.3306
+ 0.000000 31   5.7719
+ 0.000000 32   1.3995
+ 0.000000 33   1.2680
+ 0.000000 34  -0.2292
+ 0.000000 35   3.0950
+ 0.000000 36   0.0658
+ 0.000000 37  -0.1235
+ 0.000000 38  -2.4627
+ 0.000000 39   0.7487
+ 0.000000 40   1.8047
+ 0.000000 41   2.7807
+ 0.000000 42  -0.8925
+ 0.000000 43   2.1895
+ 0.000000 44   0.6505
+ 0.000000 45   5.0409
+ 0.000000 46   0.9839
+ 0.000000 47   1.7225
+ 0.000000 48  -1.6594
+ 0.000000 49  -0.4666
+ 0.000000 50  -1.9308
+ 0.000000 51  -1.1826
+ 0.000000 52   1.9000
+ 0.000000 53  -2.8092
+ 0.000000 54  -0.3462
+ 0.000000 55   3.0319
+ 0.000000 56   3.5796
+ 0.000000 57  -0.2071
+ 0.000000 58  -1.4985
+ 0.000000 59  -2.6203
+ 0.000000 60  -0.4259
+ 0.000000 61  -4.6751
+ 0.000000 62  -1.0700
+ 0.000000 63  -3.6946
+ 0.000000 64   4.2730
+ 0.000000 65   3.1233
+ 0.000000 66  -0.0293
+ 0.000000 67   1.2701
+ 0.000000 68  -3.1647
+ 0.000000 69   1.8323
+ 0.000000 70  -2.1267
+ 0.000000 71  -0.8128
+ 0.000000 72   2.0135
+ 0.000000 73   4.0780
+ 0.000000 74   4.1323
+ 0.000000 75  -1.8653
+ 0.000000 76  -3.2481
+ 0.000000 77  -0.3972
+ 0.000000 78   2.6436
+ 0.000000 79  -4.5409
+ 0.000000 80  -0.4981
+ 0.000000 81  -1.4292
+ 0.000000 82  -1.3215
+ 0.000000 83   0.3626
+ 0.000000 84   1.6686
+ 0.000000 85   0.4591
+ 0.000000 86  -0.4051
+ 0.000000 87  -0.2418
+ 0.000000 88  -3.1329
+ 0.000000 89   8.6219
+ 0.000000 90   0.6028
+ 0.000000 91   1.6546
+ 0.000000 92   2.4560
+ 0.000000 93   3.0714
+ 0.000000 94   1.1745
+ 0.000000 95  -4.8228
+ 0.000000 96   2.9876
+ 0.000000 97   2.7857
+ 0.000000 98  -0.5444
+ 0.000000 99   0.2690
+ 0.000000 100   1.0255
+ 0.000000 101  -1.3537
+ 0.000000 102  -1.9146
+ 0.000000 103  -2.3371
+ 0.000000 104  -0.6904
+ 0.000000 105   6.5071
+ 0.000000 106   0.0346
+ 0.000000 107   3.0002
+ 0.000000 108   0.2787
+ 0.000000 109   5.2995
+ 0.000000 110  -0.4218
+ 0.000000 111   0.5027
+ 0.000000 112   0.8729
+ 0.000000 113  -1.3573
+ 0.000000 114   3.9230
+ 0.000000 115  -1.8850
+ 0.000000 116  -5.0122
+ 0.000000 117   3.8191
+ 0.000000 118   0.4467
+ 0.000000 119   5.0885
+ 0.000000 120  -2.2489
+ 0.000000 121  -2.3297
+ 0.000000 122   1.1179
+ 0.000000 123   1.4748
+ 0.000000 124  -2.1647
+ 0.000000 125  -5.6072
+ 0.000000 126  -1.3841
+ 0.000000 127  -1.6793
+ 0.000000 128   0.6054
+ 0.000000 129   0.0390
+ 0.000000 130  -5.9543
+ 0.000000 131  -1.5910
+ 0.000000 132  -1.6559
+ 0.000000 133   0.2025
+ 0.000000 134  -3.6084
+ 0.000000 135   2.8223
+ 0.000000 136  -0.9791
+ 0.000000 137   3.9020
+ 0.000000 138   4.3932
+ 0.000000 139  -0.1796
+ 0.000000 140  -0.5022
+ 0.000000 141  -0.9469
+ 0.000000 142   1.1155
+ 0.000000 143   5.3109
+ 0.000000 144   1.3264
+ 0.000000 145   0.5365
+ 0.000000 146   0.5109
+ 0.000000 147  -3.5125
+ 0.000000 148   0.3803
+ 0.000000 149  -1.2272
+ 0.000000 150  -2.2695
+ 0.000000 151   3.1281
+ 0.000000 152   4.3139
+ 0.000000 153  -2.2924
+ 0.000000 154   0.0233
+ 0.000000 155  -3.1646
+ 0.000000 156   2.7875
+ 0.000000 157  -0.7124
+ 0.000000 158  -5.9856
+ 0.000000 159  -3.0120
+ 0.000000 160  -2.8344
+ 0.000000 161  -1.8310
+ 0.000000 162  -3.4288
+ 0.000000 163  -3.9051
+ 0.000000 164   5.2396
+ 0.000000 165   2.7985
+ 0.000000 166  -1.7127
+ 0.000000 167   5.7990
+ 0.000000 168   2.6108
+ 0.000000 169   3.8428
+ 0.000000 170   3.0649
+ 0.000000 171  -0.4821
+ 0.000000 172   5.3284
+ 0.000000 173   0.2070
+ 0.000000 174  -0.2515
+ 0.000000 175  -4.1468
+ 0.000000 176   6.4385
+ 0.000000 177  -4.7109
+ 0.000000 178   1.1203
+ 0.000000 179   0.4099
+ 0.000000 180  -0.3328
+ 0.000000 181   0.4363
+ 0.000000 182  -8.0394
+ 0.000000 183  -1.0587
+ 0.000000 184  -4.6100
+ 0.000000 185   1.0052
+ 0.000000 186  -3.3639
+ 0.000000 187  -0.1659
+ 0.000000 188   0.2976
+ 0.000000 189  -6.6979
+ 0.000000 190   7.8299
+ 0.000000 191  -2.0159
+ 0.000000 192  41.4373
+ 0.000000 193 -31.4183
+ 0.000000 194 -11.1354
+ 0.000000 195 -31.4183
+ 0.000000 196 -29.9501
+ 0.000000 197  42.7567
+ 0.000000 198 -11.1354
+ 0.000000 199  42.7567
+ 0.000000 200   0.8950
diff --git a/regtest/crystallization/rt-nbonds-q6-lowmem/deriv2.reference b/regtest/crystallization/rt-nbonds-q6-lowmem/deriv2.reference
new file mode 100644
index 0000000000000000000000000000000000000000..bf0d41c9add811736cc319922cde8e3439a8608e
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6-lowmem/deriv2.reference
@@ -0,0 +1,202 @@
+#! FIELDS time parameter w4
+ 0.000000 0  -0.2546
+ 0.000000 1   1.7915
+ 0.000000 2   1.4219
+ 0.000000 3  -3.4107
+ 0.000000 4  -3.2102
+ 0.000000 5  -3.8684
+ 0.000000 6   0.5841
+ 0.000000 7   0.5244
+ 0.000000 8  -0.5506
+ 0.000000 9   1.6802
+ 0.000000 10  -2.4090
+ 0.000000 11   4.3098
+ 0.000000 12   0.5170
+ 0.000000 13   3.1692
+ 0.000000 14  -0.7917
+ 0.000000 15   8.7314
+ 0.000000 16   3.2534
+ 0.000000 17   4.5937
+ 0.000000 18   0.1529
+ 0.000000 19  -1.3610
+ 0.000000 20   0.6062
+ 0.000000 21   2.1473
+ 0.000000 22   1.1462
+ 0.000000 23   1.7843
+ 0.000000 24  -2.5136
+ 0.000000 25   2.2836
+ 0.000000 26  -3.1486
+ 0.000000 27  -3.4742
+ 0.000000 28  -0.1403
+ 0.000000 29   0.3266
+ 0.000000 30   6.6218
+ 0.000000 31  -0.2614
+ 0.000000 32  -2.2848
+ 0.000000 33   0.9558
+ 0.000000 34  -3.4443
+ 0.000000 35  -1.7551
+ 0.000000 36  -5.0356
+ 0.000000 37   2.2322
+ 0.000000 38  -5.9115
+ 0.000000 39  -0.3786
+ 0.000000 40  -7.1256
+ 0.000000 41   0.3157
+ 0.000000 42   2.2955
+ 0.000000 43  -1.3930
+ 0.000000 44   0.4939
+ 0.000000 45   1.7099
+ 0.000000 46  -0.1880
+ 0.000000 47   2.4970
+ 0.000000 48  -5.8590
+ 0.000000 49  -4.2949
+ 0.000000 50  -1.0078
+ 0.000000 51  -4.0462
+ 0.000000 52   2.7627
+ 0.000000 53   0.5621
+ 0.000000 54  -0.4197
+ 0.000000 55   0.7168
+ 0.000000 56   1.4767
+ 0.000000 57   0.0492
+ 0.000000 58  -1.3670
+ 0.000000 59   6.6129
+ 0.000000 60  -3.1318
+ 0.000000 61   1.9615
+ 0.000000 62   4.0257
+ 0.000000 63   3.3679
+ 0.000000 64   5.1249
+ 0.000000 65   1.0571
+ 0.000000 66  -2.6718
+ 0.000000 67   1.9511
+ 0.000000 68  -3.0899
+ 0.000000 69   3.3844
+ 0.000000 70   3.5373
+ 0.000000 71  -2.5662
+ 0.000000 72   1.3854
+ 0.000000 73  -0.8866
+ 0.000000 74   3.2630
+ 0.000000 75  -5.8850
+ 0.000000 76  -7.2364
+ 0.000000 77  -2.0470
+ 0.000000 78   1.2118
+ 0.000000 79   2.7032
+ 0.000000 80  -2.0353
+ 0.000000 81  -0.2827
+ 0.000000 82  -1.6227
+ 0.000000 83   0.6232
+ 0.000000 84   1.2917
+ 0.000000 85   3.0123
+ 0.000000 86   7.6244
+ 0.000000 87  -1.9792
+ 0.000000 88   0.8384
+ 0.000000 89   6.2483
+ 0.000000 90  -1.2618
+ 0.000000 91   1.6919
+ 0.000000 92   4.9239
+ 0.000000 93  -0.0553
+ 0.000000 94   6.5349
+ 0.000000 95  -6.0543
+ 0.000000 96  -1.0205
+ 0.000000 97   0.3694
+ 0.000000 98  -7.0517
+ 0.000000 99  -0.9435
+ 0.000000 100  -1.6073
+ 0.000000 101   9.8342
+ 0.000000 102  -4.7203
+ 0.000000 103   2.7525
+ 0.000000 104  -7.9241
+ 0.000000 105   5.5616
+ 0.000000 106   1.2297
+ 0.000000 107   3.8689
+ 0.000000 108  -2.2532
+ 0.000000 109  -0.5728
+ 0.000000 110  -2.1037
+ 0.000000 111  -0.3446
+ 0.000000 112  -1.8839
+ 0.000000 113   1.1764
+ 0.000000 114  -0.9034
+ 0.000000 115  -2.5301
+ 0.000000 116  -3.4934
+ 0.000000 117   3.9375
+ 0.000000 118   0.0475
+ 0.000000 119   1.0507
+ 0.000000 120  -4.9949
+ 0.000000 121  -2.8268
+ 0.000000 122   0.4098
+ 0.000000 123   1.7328
+ 0.000000 124  -3.0211
+ 0.000000 125  -0.2859
+ 0.000000 126   1.8651
+ 0.000000 127   2.0405
+ 0.000000 128  -2.1358
+ 0.000000 129  -2.7030
+ 0.000000 130   2.5471
+ 0.000000 131  -0.2810
+ 0.000000 132   1.5934
+ 0.000000 133  -3.1017
+ 0.000000 134  -1.6080
+ 0.000000 135   0.7564
+ 0.000000 136   3.7250
+ 0.000000 137   0.8031
+ 0.000000 138   0.7069
+ 0.000000 139  -0.2153
+ 0.000000 140  -1.0334
+ 0.000000 141   1.1444
+ 0.000000 142   1.5002
+ 0.000000 143   1.0250
+ 0.000000 144  -0.4688
+ 0.000000 145  -2.3582
+ 0.000000 146   6.2597
+ 0.000000 147   3.1187
+ 0.000000 148  -2.1759
+ 0.000000 149   2.7629
+ 0.000000 150  -2.4924
+ 0.000000 151  -3.7095
+ 0.000000 152  -1.7532
+ 0.000000 153  -4.1347
+ 0.000000 154  -1.7478
+ 0.000000 155  -2.9066
+ 0.000000 156   1.3769
+ 0.000000 157  -1.3631
+ 0.000000 158  -7.2793
+ 0.000000 159  -1.2756
+ 0.000000 160  -0.2989
+ 0.000000 161   0.2878
+ 0.000000 162   1.8778
+ 0.000000 163  -3.2438
+ 0.000000 164  -5.5374
+ 0.000000 165  -3.6191
+ 0.000000 166   6.7136
+ 0.000000 167   2.8478
+ 0.000000 168   5.8495
+ 0.000000 169  -3.5060
+ 0.000000 170   2.3624
+ 0.000000 171   2.2127
+ 0.000000 172   1.3909
+ 0.000000 173  -0.8028
+ 0.000000 174  -3.6181
+ 0.000000 175  -4.5232
+ 0.000000 176  -1.1553
+ 0.000000 177   1.1278
+ 0.000000 178   0.8887
+ 0.000000 179   5.3118
+ 0.000000 180   0.6350
+ 0.000000 181  -0.7556
+ 0.000000 182  -3.5560
+ 0.000000 183   0.0509
+ 0.000000 184   1.2030
+ 0.000000 185   0.0213
+ 0.000000 186   3.0273
+ 0.000000 187   2.3146
+ 0.000000 188  -3.1933
+ 0.000000 189   1.4907
+ 0.000000 190   2.4234
+ 0.000000 191  -3.5761
+ 0.000000 192 -43.8368
+ 0.000000 193  28.3463
+ 0.000000 194 -28.0159
+ 0.000000 195  28.3463
+ 0.000000 196 -48.0443
+ 0.000000 197  -6.5965
+ 0.000000 198 -28.0159
+ 0.000000 199  -6.5965
+ 0.000000 200 -183.6319
diff --git a/regtest/crystallization/rt-nbonds-q6-lowmem/plumed.dat b/regtest/crystallization/rt-nbonds-q6-lowmem/plumed.dat
new file mode 100644
index 0000000000000000000000000000000000000000..eef159413816426636a931c0ba5a0c26d32d0fa8
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6-lowmem/plumed.dat
@@ -0,0 +1,15 @@
+Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN LABEL=q6 
+# Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN NUMERICAL_DERIVATIVES LABEL=q6n
+
+NLINKS ARG=q6 SWITCH={RATIONAL D_0=3.0 R_0=1.5} LOWMEM LABEL=w6
+# NLINKS ARG=q6n SWITCH={RATIONAL D_0=3.0 R_0=1.5} NUMERICAL_DERIVATIVES LABEL=w6n
+PRINT ARG=w6 FILE=colv1
+DUMPDERIVATIVES ARG=w6 FILE=deriv1 FMT=%8.4f
+
+Q4 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN LABEL=q4
+# Q4 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN NUMERICAL_DERIVATIVES LABEL=q4n
+
+NLINKS ARG=q4 SWITCH={RATIONAL D_0=3.0 R_0=1.5} LOWMEM LABEL=w4
+# NLINKS ARG=q4n SWITCH={RATIONAL D_0=3.0 R_0=1.5} NUMERICAL_DERIVATIVES LABEL=w4n
+PRINT ARG=w4 FILE=colv2
+DUMPDERIVATIVES ARG=w4 FILE=deriv2 FMT=%8.4f
diff --git a/regtest/crystallization/rt-nbonds-q6/64.xyz b/regtest/crystallization/rt-nbonds-q6/64.xyz
new file mode 100755
index 0000000000000000000000000000000000000000..90b3ae19c7598dd32c498e7105925df054c3e788
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6/64.xyz
@@ -0,0 +1,66 @@
+   64
+12.41642 12.41642 12.41642 
+  Ge       1.473000000000      2.211000000000      8.700200000000
+  Ge       4.886500000000      3.830000000000      6.593500000000
+  Ge       3.807000000000      1.978700000000     10.045000000000
+  Ge       5.002000000000      3.883500000000      1.357000000000
+  Ge       9.636000000000      1.604000000000      8.697700000000
+  Ge       6.559800000000     11.084000000000      9.650400000000
+  Ge       0.627000000000      0.390000000000      2.224300000000
+  Ge       3.341900000000      6.765300000000      1.369500000000
+  Ge       5.032000000000      9.650500000000      2.785000000000
+  Ge       1.682700000000     10.392700000000      5.459500000000
+  Ge       3.517300000000     12.039000000000      5.930600000000
+  Ge       1.072000000000      5.374900000000     12.335000000000
+  Ge       0.863390000000     11.308000000000      0.275000000000
+  Ge       5.867800000000      0.672000000000      6.605200000000
+  Ge       3.961000000000      8.414000000000      8.691600000000
+  Ge      11.570960000000     10.444000000000      2.125000000000
+  Ge       1.736000000000      6.845200000000      6.129000000000
+  Ge       7.557300000000      8.842800000000      6.611800000000
+  Ge       2.785800000000      2.591200000000      1.833300000000
+  Ge      11.564000000000     11.555000000000     10.928000000000
+  Ge       3.324000000000     11.334000000000     12.095000000000
+  Ge      10.532000000000      9.377700000000      6.724000000000
+  Ge       7.157000000000     11.468000000000     12.063000000000
+  Ge       0.027000000000      4.622000000000      5.996200000000
+  Ge       4.564000000000      6.513200000000      5.370200000000
+  Ge      12.189770000000      7.981000000000      2.257000000000
+  Ge       8.973100000000      0.437000000000      4.852800000000
+  Ge       9.086200000000      9.857000000000      0.975000000000
+  Ge       6.516500000000     12.170000000000      2.438600000000
+  Ge       8.955900000000      4.612000000000      4.478000000000
+  Ge       7.419000000000      3.301600000000      0.450000000000
+  Ge      10.808000000000      7.170600000000     11.109000000000
+  Te       4.818200000000      9.096200000000      6.189300000000
+  Te      10.663400000000      6.726900000000      5.343000000000
+  Te       7.021700000000      4.814600000000     10.649000000000
+  Te       3.253500000000      5.713300000000      8.267800000000
+  Te      10.322000000000      1.250000000000      2.209500000000
+  Te       0.300000000000      5.033000000000      8.902400000000
+  Te      12.092000000000      0.227000000000      8.527200000000
+  Te       6.329000000000      2.634100000000      8.525500000000
+  Te       8.044800000000     11.712000000000      7.575400000000
+  Te       2.150000000000      8.302000000000      3.591400000000
+  Te      11.581000000000     11.201000000000      4.824700000000
+  Te       3.960900000000      4.755000000000     11.528710000000
+  Te       3.815300000000     12.139000000000      3.263700000000
+  Te       9.419700000000      7.232700000000      1.010000000000
+  Te       1.211700000000      1.726300000000     12.223470000000
+  Te       0.798460000000      8.988100000000      7.517700000000
+  Te      10.078000000000      9.503000000000      9.977500000000
+  Te       9.336700000000      0.894000000000     11.469560000000
+  Te       7.251000000000      5.783400000000      6.399000000000
+  Te       3.740000000000     11.515000000000      9.383700000000
+  Te      10.329000000000      2.726600000000      5.835100000000
+  Te       6.722900000000      8.386100000000      9.226500000000
+  Te       1.247000000000      4.660000000000      2.609100000000
+  Te       5.628500000000      6.170200000000      2.845000000000
+  Te       4.742900000000      9.191800000000      0.212000000000
+  Te       5.134400000000      0.984830000000     12.244000000000
+  Te       8.033800000000     10.061100000000      3.578600000000
+  Te       9.840000000000      4.825000000000      9.743000000000
+  Te       6.760000000000      2.189000000000      4.410700000000
+  Te       2.334000000000      2.201000000000      6.079000000000
+  Te       9.930600000000      3.982900000000      1.562000000000
+  Te       0.806810000000      8.091100000000     12.264000000000
diff --git a/regtest/crystallization/rt-nbonds-q6/Makefile b/regtest/crystallization/rt-nbonds-q6/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..3703b27cea227aa053fb6d1d73f861e4384dbcee
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6/Makefile
@@ -0,0 +1 @@
+include ../../scripts/test.make
diff --git a/regtest/crystallization/rt-nbonds-q6/colv1.reference b/regtest/crystallization/rt-nbonds-q6/colv1.reference
new file mode 100644
index 0000000000000000000000000000000000000000..f7e414b390cb145b2d13e7b838d33dd429d5958f
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6/colv1.reference
@@ -0,0 +1,2 @@
+#! FIELDS time w6
+ 0.000000 15.644050
diff --git a/regtest/crystallization/rt-nbonds-q6/colv2.reference b/regtest/crystallization/rt-nbonds-q6/colv2.reference
new file mode 100644
index 0000000000000000000000000000000000000000..451673022fb702691286987acf2d5b277bc7bfe5
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6/colv2.reference
@@ -0,0 +1,2 @@
+#! FIELDS time w4
+ 0.000000 33.811763
diff --git a/regtest/crystallization/rt-nbonds-q6/config b/regtest/crystallization/rt-nbonds-q6/config
new file mode 100644
index 0000000000000000000000000000000000000000..e07432072a91405171ff68d3c3d22a09fde3346c
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6/config
@@ -0,0 +1,3 @@
+type=driver
+# this is to test a different name
+arg="--plumed plumed.dat --ixyz 64.xyz"
diff --git a/regtest/crystallization/rt-nbonds-q6/deriv1.reference b/regtest/crystallization/rt-nbonds-q6/deriv1.reference
new file mode 100644
index 0000000000000000000000000000000000000000..4ae8c2f9ab79270caaf5636b4dfab792b761672d
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6/deriv1.reference
@@ -0,0 +1,202 @@
+#! FIELDS time parameter w6
+ 0.000000 0   0.7514
+ 0.000000 1   0.8829
+ 0.000000 2   2.4315
+ 0.000000 3  -3.5375
+ 0.000000 4   0.4772
+ 0.000000 5  -7.9712
+ 0.000000 6   2.0752
+ 0.000000 7   1.1725
+ 0.000000 8  -8.6674
+ 0.000000 9  -1.9002
+ 0.000000 10   0.5045
+ 0.000000 11   2.9522
+ 0.000000 12  -0.0081
+ 0.000000 13   0.0463
+ 0.000000 14   0.0087
+ 0.000000 15  -0.2558
+ 0.000000 16  -3.3394
+ 0.000000 17  -0.2597
+ 0.000000 18  -3.1012
+ 0.000000 19  -0.1783
+ 0.000000 20   0.0649
+ 0.000000 21  -0.7516
+ 0.000000 22  -0.5258
+ 0.000000 23  -0.8601
+ 0.000000 24   3.2547
+ 0.000000 25  -1.6845
+ 0.000000 26  -2.5631
+ 0.000000 27   0.8457
+ 0.000000 28  -3.3966
+ 0.000000 29   0.5749
+ 0.000000 30  -1.3306
+ 0.000000 31   5.7719
+ 0.000000 32   1.3995
+ 0.000000 33   1.2680
+ 0.000000 34  -0.2292
+ 0.000000 35   3.0950
+ 0.000000 36   0.0658
+ 0.000000 37  -0.1235
+ 0.000000 38  -2.4627
+ 0.000000 39   0.7487
+ 0.000000 40   1.8047
+ 0.000000 41   2.7807
+ 0.000000 42  -0.8925
+ 0.000000 43   2.1895
+ 0.000000 44   0.6505
+ 0.000000 45   5.0409
+ 0.000000 46   0.9839
+ 0.000000 47   1.7225
+ 0.000000 48  -1.6594
+ 0.000000 49  -0.4666
+ 0.000000 50  -1.9308
+ 0.000000 51  -1.1826
+ 0.000000 52   1.9000
+ 0.000000 53  -2.8092
+ 0.000000 54  -0.3462
+ 0.000000 55   3.0319
+ 0.000000 56   3.5796
+ 0.000000 57  -0.2071
+ 0.000000 58  -1.4985
+ 0.000000 59  -2.6203
+ 0.000000 60  -0.4259
+ 0.000000 61  -4.6751
+ 0.000000 62  -1.0700
+ 0.000000 63  -3.6946
+ 0.000000 64   4.2730
+ 0.000000 65   3.1233
+ 0.000000 66  -0.0293
+ 0.000000 67   1.2701
+ 0.000000 68  -3.1647
+ 0.000000 69   1.8323
+ 0.000000 70  -2.1267
+ 0.000000 71  -0.8128
+ 0.000000 72   2.0135
+ 0.000000 73   4.0780
+ 0.000000 74   4.1323
+ 0.000000 75  -1.8653
+ 0.000000 76  -3.2481
+ 0.000000 77  -0.3972
+ 0.000000 78   2.6436
+ 0.000000 79  -4.5409
+ 0.000000 80  -0.4981
+ 0.000000 81  -1.4292
+ 0.000000 82  -1.3215
+ 0.000000 83   0.3626
+ 0.000000 84   1.6686
+ 0.000000 85   0.4591
+ 0.000000 86  -0.4051
+ 0.000000 87  -0.2418
+ 0.000000 88  -3.1329
+ 0.000000 89   8.6219
+ 0.000000 90   0.6028
+ 0.000000 91   1.6546
+ 0.000000 92   2.4560
+ 0.000000 93   3.0714
+ 0.000000 94   1.1745
+ 0.000000 95  -4.8228
+ 0.000000 96   2.9876
+ 0.000000 97   2.7857
+ 0.000000 98  -0.5444
+ 0.000000 99   0.2690
+ 0.000000 100   1.0255
+ 0.000000 101  -1.3537
+ 0.000000 102  -1.9146
+ 0.000000 103  -2.3371
+ 0.000000 104  -0.6904
+ 0.000000 105   6.5071
+ 0.000000 106   0.0346
+ 0.000000 107   3.0002
+ 0.000000 108   0.2787
+ 0.000000 109   5.2995
+ 0.000000 110  -0.4218
+ 0.000000 111   0.5027
+ 0.000000 112   0.8729
+ 0.000000 113  -1.3573
+ 0.000000 114   3.9230
+ 0.000000 115  -1.8850
+ 0.000000 116  -5.0122
+ 0.000000 117   3.8191
+ 0.000000 118   0.4467
+ 0.000000 119   5.0885
+ 0.000000 120  -2.2489
+ 0.000000 121  -2.3297
+ 0.000000 122   1.1179
+ 0.000000 123   1.4748
+ 0.000000 124  -2.1647
+ 0.000000 125  -5.6072
+ 0.000000 126  -1.3841
+ 0.000000 127  -1.6793
+ 0.000000 128   0.6054
+ 0.000000 129   0.0390
+ 0.000000 130  -5.9543
+ 0.000000 131  -1.5910
+ 0.000000 132  -1.6559
+ 0.000000 133   0.2025
+ 0.000000 134  -3.6084
+ 0.000000 135   2.8223
+ 0.000000 136  -0.9791
+ 0.000000 137   3.9020
+ 0.000000 138   4.3932
+ 0.000000 139  -0.1796
+ 0.000000 140  -0.5022
+ 0.000000 141  -0.9469
+ 0.000000 142   1.1155
+ 0.000000 143   5.3109
+ 0.000000 144   1.3264
+ 0.000000 145   0.5365
+ 0.000000 146   0.5109
+ 0.000000 147  -3.5125
+ 0.000000 148   0.3803
+ 0.000000 149  -1.2272
+ 0.000000 150  -2.2695
+ 0.000000 151   3.1281
+ 0.000000 152   4.3139
+ 0.000000 153  -2.2924
+ 0.000000 154   0.0233
+ 0.000000 155  -3.1646
+ 0.000000 156   2.7875
+ 0.000000 157  -0.7124
+ 0.000000 158  -5.9856
+ 0.000000 159  -3.0120
+ 0.000000 160  -2.8344
+ 0.000000 161  -1.8310
+ 0.000000 162  -3.4288
+ 0.000000 163  -3.9051
+ 0.000000 164   5.2396
+ 0.000000 165   2.7985
+ 0.000000 166  -1.7127
+ 0.000000 167   5.7990
+ 0.000000 168   2.6108
+ 0.000000 169   3.8428
+ 0.000000 170   3.0649
+ 0.000000 171  -0.4821
+ 0.000000 172   5.3284
+ 0.000000 173   0.2070
+ 0.000000 174  -0.2515
+ 0.000000 175  -4.1468
+ 0.000000 176   6.4385
+ 0.000000 177  -4.7109
+ 0.000000 178   1.1203
+ 0.000000 179   0.4099
+ 0.000000 180  -0.3328
+ 0.000000 181   0.4363
+ 0.000000 182  -8.0394
+ 0.000000 183  -1.0587
+ 0.000000 184  -4.6100
+ 0.000000 185   1.0052
+ 0.000000 186  -3.3639
+ 0.000000 187  -0.1659
+ 0.000000 188   0.2976
+ 0.000000 189  -6.6979
+ 0.000000 190   7.8299
+ 0.000000 191  -2.0159
+ 0.000000 192  41.4373
+ 0.000000 193 -31.4183
+ 0.000000 194 -11.1354
+ 0.000000 195 -31.4183
+ 0.000000 196 -29.9501
+ 0.000000 197  42.7567
+ 0.000000 198 -11.1354
+ 0.000000 199  42.7567
+ 0.000000 200   0.8950
diff --git a/regtest/crystallization/rt-nbonds-q6/deriv2.reference b/regtest/crystallization/rt-nbonds-q6/deriv2.reference
new file mode 100644
index 0000000000000000000000000000000000000000..bf0d41c9add811736cc319922cde8e3439a8608e
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6/deriv2.reference
@@ -0,0 +1,202 @@
+#! FIELDS time parameter w4
+ 0.000000 0  -0.2546
+ 0.000000 1   1.7915
+ 0.000000 2   1.4219
+ 0.000000 3  -3.4107
+ 0.000000 4  -3.2102
+ 0.000000 5  -3.8684
+ 0.000000 6   0.5841
+ 0.000000 7   0.5244
+ 0.000000 8  -0.5506
+ 0.000000 9   1.6802
+ 0.000000 10  -2.4090
+ 0.000000 11   4.3098
+ 0.000000 12   0.5170
+ 0.000000 13   3.1692
+ 0.000000 14  -0.7917
+ 0.000000 15   8.7314
+ 0.000000 16   3.2534
+ 0.000000 17   4.5937
+ 0.000000 18   0.1529
+ 0.000000 19  -1.3610
+ 0.000000 20   0.6062
+ 0.000000 21   2.1473
+ 0.000000 22   1.1462
+ 0.000000 23   1.7843
+ 0.000000 24  -2.5136
+ 0.000000 25   2.2836
+ 0.000000 26  -3.1486
+ 0.000000 27  -3.4742
+ 0.000000 28  -0.1403
+ 0.000000 29   0.3266
+ 0.000000 30   6.6218
+ 0.000000 31  -0.2614
+ 0.000000 32  -2.2848
+ 0.000000 33   0.9558
+ 0.000000 34  -3.4443
+ 0.000000 35  -1.7551
+ 0.000000 36  -5.0356
+ 0.000000 37   2.2322
+ 0.000000 38  -5.9115
+ 0.000000 39  -0.3786
+ 0.000000 40  -7.1256
+ 0.000000 41   0.3157
+ 0.000000 42   2.2955
+ 0.000000 43  -1.3930
+ 0.000000 44   0.4939
+ 0.000000 45   1.7099
+ 0.000000 46  -0.1880
+ 0.000000 47   2.4970
+ 0.000000 48  -5.8590
+ 0.000000 49  -4.2949
+ 0.000000 50  -1.0078
+ 0.000000 51  -4.0462
+ 0.000000 52   2.7627
+ 0.000000 53   0.5621
+ 0.000000 54  -0.4197
+ 0.000000 55   0.7168
+ 0.000000 56   1.4767
+ 0.000000 57   0.0492
+ 0.000000 58  -1.3670
+ 0.000000 59   6.6129
+ 0.000000 60  -3.1318
+ 0.000000 61   1.9615
+ 0.000000 62   4.0257
+ 0.000000 63   3.3679
+ 0.000000 64   5.1249
+ 0.000000 65   1.0571
+ 0.000000 66  -2.6718
+ 0.000000 67   1.9511
+ 0.000000 68  -3.0899
+ 0.000000 69   3.3844
+ 0.000000 70   3.5373
+ 0.000000 71  -2.5662
+ 0.000000 72   1.3854
+ 0.000000 73  -0.8866
+ 0.000000 74   3.2630
+ 0.000000 75  -5.8850
+ 0.000000 76  -7.2364
+ 0.000000 77  -2.0470
+ 0.000000 78   1.2118
+ 0.000000 79   2.7032
+ 0.000000 80  -2.0353
+ 0.000000 81  -0.2827
+ 0.000000 82  -1.6227
+ 0.000000 83   0.6232
+ 0.000000 84   1.2917
+ 0.000000 85   3.0123
+ 0.000000 86   7.6244
+ 0.000000 87  -1.9792
+ 0.000000 88   0.8384
+ 0.000000 89   6.2483
+ 0.000000 90  -1.2618
+ 0.000000 91   1.6919
+ 0.000000 92   4.9239
+ 0.000000 93  -0.0553
+ 0.000000 94   6.5349
+ 0.000000 95  -6.0543
+ 0.000000 96  -1.0205
+ 0.000000 97   0.3694
+ 0.000000 98  -7.0517
+ 0.000000 99  -0.9435
+ 0.000000 100  -1.6073
+ 0.000000 101   9.8342
+ 0.000000 102  -4.7203
+ 0.000000 103   2.7525
+ 0.000000 104  -7.9241
+ 0.000000 105   5.5616
+ 0.000000 106   1.2297
+ 0.000000 107   3.8689
+ 0.000000 108  -2.2532
+ 0.000000 109  -0.5728
+ 0.000000 110  -2.1037
+ 0.000000 111  -0.3446
+ 0.000000 112  -1.8839
+ 0.000000 113   1.1764
+ 0.000000 114  -0.9034
+ 0.000000 115  -2.5301
+ 0.000000 116  -3.4934
+ 0.000000 117   3.9375
+ 0.000000 118   0.0475
+ 0.000000 119   1.0507
+ 0.000000 120  -4.9949
+ 0.000000 121  -2.8268
+ 0.000000 122   0.4098
+ 0.000000 123   1.7328
+ 0.000000 124  -3.0211
+ 0.000000 125  -0.2859
+ 0.000000 126   1.8651
+ 0.000000 127   2.0405
+ 0.000000 128  -2.1358
+ 0.000000 129  -2.7030
+ 0.000000 130   2.5471
+ 0.000000 131  -0.2810
+ 0.000000 132   1.5934
+ 0.000000 133  -3.1017
+ 0.000000 134  -1.6080
+ 0.000000 135   0.7564
+ 0.000000 136   3.7250
+ 0.000000 137   0.8031
+ 0.000000 138   0.7069
+ 0.000000 139  -0.2153
+ 0.000000 140  -1.0334
+ 0.000000 141   1.1444
+ 0.000000 142   1.5002
+ 0.000000 143   1.0250
+ 0.000000 144  -0.4688
+ 0.000000 145  -2.3582
+ 0.000000 146   6.2597
+ 0.000000 147   3.1187
+ 0.000000 148  -2.1759
+ 0.000000 149   2.7629
+ 0.000000 150  -2.4924
+ 0.000000 151  -3.7095
+ 0.000000 152  -1.7532
+ 0.000000 153  -4.1347
+ 0.000000 154  -1.7478
+ 0.000000 155  -2.9066
+ 0.000000 156   1.3769
+ 0.000000 157  -1.3631
+ 0.000000 158  -7.2793
+ 0.000000 159  -1.2756
+ 0.000000 160  -0.2989
+ 0.000000 161   0.2878
+ 0.000000 162   1.8778
+ 0.000000 163  -3.2438
+ 0.000000 164  -5.5374
+ 0.000000 165  -3.6191
+ 0.000000 166   6.7136
+ 0.000000 167   2.8478
+ 0.000000 168   5.8495
+ 0.000000 169  -3.5060
+ 0.000000 170   2.3624
+ 0.000000 171   2.2127
+ 0.000000 172   1.3909
+ 0.000000 173  -0.8028
+ 0.000000 174  -3.6181
+ 0.000000 175  -4.5232
+ 0.000000 176  -1.1553
+ 0.000000 177   1.1278
+ 0.000000 178   0.8887
+ 0.000000 179   5.3118
+ 0.000000 180   0.6350
+ 0.000000 181  -0.7556
+ 0.000000 182  -3.5560
+ 0.000000 183   0.0509
+ 0.000000 184   1.2030
+ 0.000000 185   0.0213
+ 0.000000 186   3.0273
+ 0.000000 187   2.3146
+ 0.000000 188  -3.1933
+ 0.000000 189   1.4907
+ 0.000000 190   2.4234
+ 0.000000 191  -3.5761
+ 0.000000 192 -43.8368
+ 0.000000 193  28.3463
+ 0.000000 194 -28.0159
+ 0.000000 195  28.3463
+ 0.000000 196 -48.0443
+ 0.000000 197  -6.5965
+ 0.000000 198 -28.0159
+ 0.000000 199  -6.5965
+ 0.000000 200 -183.6319
diff --git a/regtest/crystallization/rt-nbonds-q6/plumed.dat b/regtest/crystallization/rt-nbonds-q6/plumed.dat
new file mode 100644
index 0000000000000000000000000000000000000000..0d6d4a995ef20dbe68d26a802fce12464fd194a5
--- /dev/null
+++ b/regtest/crystallization/rt-nbonds-q6/plumed.dat
@@ -0,0 +1,15 @@
+Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN LABEL=q6 
+# Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN NUMERICAL_DERIVATIVES LABEL=q6n
+
+NLINKS ARG=q6 SWITCH={RATIONAL D_0=3.0 R_0=1.5} LABEL=w6
+# NLINKS ARG=q6 SWITCH={RATIONAL D_0=3.0 R_0=1.5} NUMERICAL_DERIVATIVES LABEL=w6n
+PRINT ARG=w6 FILE=colv1
+DUMPDERIVATIVES ARG=w6 FILE=deriv1 FMT=%8.4f
+
+Q4 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN LABEL=q4
+# Q4 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN NUMERICAL_DERIVATIVES LABEL=q4n
+
+NLINKS ARG=q4 SWITCH={RATIONAL D_0=3.0 R_0=1.5} LABEL=w4
+# NLINKS ARG=q4 SWITCH={RATIONAL D_0=3.0 R_0=1.5} NUMERICAL_DERIVATIVES LABEL=w4n
+PRINT ARG=w4 FILE=colv2
+DUMPDERIVATIVES ARG=w4 FILE=deriv2 FMT=%8.4f
diff --git a/regtest/crystallization/rt-q6-lowmem/64.xyz b/regtest/crystallization/rt-q6-lowmem/64.xyz
new file mode 100755
index 0000000000000000000000000000000000000000..90b3ae19c7598dd32c498e7105925df054c3e788
--- /dev/null
+++ b/regtest/crystallization/rt-q6-lowmem/64.xyz
@@ -0,0 +1,66 @@
+   64
+12.41642 12.41642 12.41642 
+  Ge       1.473000000000      2.211000000000      8.700200000000
+  Ge       4.886500000000      3.830000000000      6.593500000000
+  Ge       3.807000000000      1.978700000000     10.045000000000
+  Ge       5.002000000000      3.883500000000      1.357000000000
+  Ge       9.636000000000      1.604000000000      8.697700000000
+  Ge       6.559800000000     11.084000000000      9.650400000000
+  Ge       0.627000000000      0.390000000000      2.224300000000
+  Ge       3.341900000000      6.765300000000      1.369500000000
+  Ge       5.032000000000      9.650500000000      2.785000000000
+  Ge       1.682700000000     10.392700000000      5.459500000000
+  Ge       3.517300000000     12.039000000000      5.930600000000
+  Ge       1.072000000000      5.374900000000     12.335000000000
+  Ge       0.863390000000     11.308000000000      0.275000000000
+  Ge       5.867800000000      0.672000000000      6.605200000000
+  Ge       3.961000000000      8.414000000000      8.691600000000
+  Ge      11.570960000000     10.444000000000      2.125000000000
+  Ge       1.736000000000      6.845200000000      6.129000000000
+  Ge       7.557300000000      8.842800000000      6.611800000000
+  Ge       2.785800000000      2.591200000000      1.833300000000
+  Ge      11.564000000000     11.555000000000     10.928000000000
+  Ge       3.324000000000     11.334000000000     12.095000000000
+  Ge      10.532000000000      9.377700000000      6.724000000000
+  Ge       7.157000000000     11.468000000000     12.063000000000
+  Ge       0.027000000000      4.622000000000      5.996200000000
+  Ge       4.564000000000      6.513200000000      5.370200000000
+  Ge      12.189770000000      7.981000000000      2.257000000000
+  Ge       8.973100000000      0.437000000000      4.852800000000
+  Ge       9.086200000000      9.857000000000      0.975000000000
+  Ge       6.516500000000     12.170000000000      2.438600000000
+  Ge       8.955900000000      4.612000000000      4.478000000000
+  Ge       7.419000000000      3.301600000000      0.450000000000
+  Ge      10.808000000000      7.170600000000     11.109000000000
+  Te       4.818200000000      9.096200000000      6.189300000000
+  Te      10.663400000000      6.726900000000      5.343000000000
+  Te       7.021700000000      4.814600000000     10.649000000000
+  Te       3.253500000000      5.713300000000      8.267800000000
+  Te      10.322000000000      1.250000000000      2.209500000000
+  Te       0.300000000000      5.033000000000      8.902400000000
+  Te      12.092000000000      0.227000000000      8.527200000000
+  Te       6.329000000000      2.634100000000      8.525500000000
+  Te       8.044800000000     11.712000000000      7.575400000000
+  Te       2.150000000000      8.302000000000      3.591400000000
+  Te      11.581000000000     11.201000000000      4.824700000000
+  Te       3.960900000000      4.755000000000     11.528710000000
+  Te       3.815300000000     12.139000000000      3.263700000000
+  Te       9.419700000000      7.232700000000      1.010000000000
+  Te       1.211700000000      1.726300000000     12.223470000000
+  Te       0.798460000000      8.988100000000      7.517700000000
+  Te      10.078000000000      9.503000000000      9.977500000000
+  Te       9.336700000000      0.894000000000     11.469560000000
+  Te       7.251000000000      5.783400000000      6.399000000000
+  Te       3.740000000000     11.515000000000      9.383700000000
+  Te      10.329000000000      2.726600000000      5.835100000000
+  Te       6.722900000000      8.386100000000      9.226500000000
+  Te       1.247000000000      4.660000000000      2.609100000000
+  Te       5.628500000000      6.170200000000      2.845000000000
+  Te       4.742900000000      9.191800000000      0.212000000000
+  Te       5.134400000000      0.984830000000     12.244000000000
+  Te       8.033800000000     10.061100000000      3.578600000000
+  Te       9.840000000000      4.825000000000      9.743000000000
+  Te       6.760000000000      2.189000000000      4.410700000000
+  Te       2.334000000000      2.201000000000      6.079000000000
+  Te       9.930600000000      3.982900000000      1.562000000000
+  Te       0.806810000000      8.091100000000     12.264000000000
diff --git a/regtest/crystallization/rt-q6-lowmem/Makefile b/regtest/crystallization/rt-q6-lowmem/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..3703b27cea227aa053fb6d1d73f861e4384dbcee
--- /dev/null
+++ b/regtest/crystallization/rt-q6-lowmem/Makefile
@@ -0,0 +1 @@
+include ../../scripts/test.make
diff --git a/regtest/crystallization/rt-q6-lowmem/colv.reference b/regtest/crystallization/rt-q6-lowmem/colv.reference
new file mode 100644
index 0000000000000000000000000000000000000000..8d69c80ee2192c76108352c9c7255dee723a579b
--- /dev/null
+++ b/regtest/crystallization/rt-q6-lowmem/colv.reference
@@ -0,0 +1,2 @@
+#! FIELDS time q6.mean
+ 0.000000 0.245096
diff --git a/regtest/crystallization/rt-q6-lowmem/colv3.reference b/regtest/crystallization/rt-q6-lowmem/colv3.reference
new file mode 100644
index 0000000000000000000000000000000000000000..511ac4b2209d7e98efef88f378746a702b6b6fa7
--- /dev/null
+++ b/regtest/crystallization/rt-q6-lowmem/colv3.reference
@@ -0,0 +1,2 @@
+#! FIELDS time w6.mean
+ 0.000000 0.036242
diff --git a/regtest/crystallization/rt-q6-lowmem/config b/regtest/crystallization/rt-q6-lowmem/config
new file mode 100644
index 0000000000000000000000000000000000000000..e07432072a91405171ff68d3c3d22a09fde3346c
--- /dev/null
+++ b/regtest/crystallization/rt-q6-lowmem/config
@@ -0,0 +1,3 @@
+type=driver
+# this is to test a different name
+arg="--plumed plumed.dat --ixyz 64.xyz"
diff --git a/regtest/crystallization/rt-q6-lowmem/deriv.reference b/regtest/crystallization/rt-q6-lowmem/deriv.reference
new file mode 100644
index 0000000000000000000000000000000000000000..a7c522e7376756146f4ece8e74bc7b27bf920713
--- /dev/null
+++ b/regtest/crystallization/rt-q6-lowmem/deriv.reference
@@ -0,0 +1,202 @@
+#! FIELDS time parameter q6.mean
+ 0.000000 0   0.0012
+ 0.000000 1   0.0016
+ 0.000000 2  -0.0017
+ 0.000000 3  -0.0003
+ 0.000000 4   0.0017
+ 0.000000 5  -0.0031
+ 0.000000 6  -0.0013
+ 0.000000 7  -0.0015
+ 0.000000 8  -0.0023
+ 0.000000 9   0.0000
+ 0.000000 10   0.0022
+ 0.000000 11   0.0030
+ 0.000000 12  -0.0009
+ 0.000000 13  -0.0010
+ 0.000000 14  -0.0002
+ 0.000000 15  -0.0018
+ 0.000000 16  -0.0026
+ 0.000000 17  -0.0006
+ 0.000000 18   0.0009
+ 0.000000 19  -0.0008
+ 0.000000 20   0.0013
+ 0.000000 21  -0.0024
+ 0.000000 22   0.0041
+ 0.000000 23  -0.0008
+ 0.000000 24   0.0026
+ 0.000000 25  -0.0023
+ 0.000000 26  -0.0015
+ 0.000000 27  -0.0021
+ 0.000000 28   0.0029
+ 0.000000 29   0.0037
+ 0.000000 30  -0.0017
+ 0.000000 31  -0.0015
+ 0.000000 32   0.0018
+ 0.000000 33  -0.0027
+ 0.000000 34  -0.0000
+ 0.000000 35   0.0003
+ 0.000000 36   0.0006
+ 0.000000 37  -0.0016
+ 0.000000 38   0.0004
+ 0.000000 39  -0.0020
+ 0.000000 40   0.0019
+ 0.000000 41  -0.0005
+ 0.000000 42   0.0016
+ 0.000000 43  -0.0053
+ 0.000000 44   0.0001
+ 0.000000 45  -0.0031
+ 0.000000 46  -0.0020
+ 0.000000 47  -0.0020
+ 0.000000 48  -0.0014
+ 0.000000 49   0.0010
+ 0.000000 50  -0.0059
+ 0.000000 51   0.0021
+ 0.000000 52  -0.0023
+ 0.000000 53   0.0027
+ 0.000000 54   0.0011
+ 0.000000 55   0.0006
+ 0.000000 56  -0.0010
+ 0.000000 57  -0.0005
+ 0.000000 58  -0.0017
+ 0.000000 59  -0.0010
+ 0.000000 60  -0.0001
+ 0.000000 61   0.0010
+ 0.000000 62   0.0016
+ 0.000000 63   0.0017
+ 0.000000 64   0.0000
+ 0.000000 65  -0.0029
+ 0.000000 66   0.0003
+ 0.000000 67   0.0033
+ 0.000000 68  -0.0041
+ 0.000000 69  -0.0007
+ 0.000000 70   0.0014
+ 0.000000 71  -0.0004
+ 0.000000 72   0.0029
+ 0.000000 73   0.0013
+ 0.000000 74  -0.0008
+ 0.000000 75   0.0017
+ 0.000000 76  -0.0046
+ 0.000000 77  -0.0000
+ 0.000000 78   0.0009
+ 0.000000 79  -0.0008
+ 0.000000 80   0.0009
+ 0.000000 81  -0.0001
+ 0.000000 82  -0.0002
+ 0.000000 83  -0.0006
+ 0.000000 84   0.0009
+ 0.000000 85  -0.0012
+ 0.000000 86   0.0001
+ 0.000000 87   0.0015
+ 0.000000 88   0.0018
+ 0.000000 89  -0.0039
+ 0.000000 90   0.0008
+ 0.000000 91   0.0005
+ 0.000000 92   0.0029
+ 0.000000 93   0.0025
+ 0.000000 94   0.0016
+ 0.000000 95   0.0016
+ 0.000000 96  -0.0017
+ 0.000000 97  -0.0001
+ 0.000000 98   0.0022
+ 0.000000 99  -0.0024
+ 0.000000 100   0.0009
+ 0.000000 101   0.0004
+ 0.000000 102  -0.0017
+ 0.000000 103  -0.0014
+ 0.000000 104   0.0004
+ 0.000000 105   0.0002
+ 0.000000 106  -0.0033
+ 0.000000 107  -0.0020
+ 0.000000 108  -0.0001
+ 0.000000 109   0.0039
+ 0.000000 110   0.0014
+ 0.000000 111  -0.0004
+ 0.000000 112   0.0018
+ 0.000000 113  -0.0021
+ 0.000000 114   0.0037
+ 0.000000 115  -0.0004
+ 0.000000 116   0.0011
+ 0.000000 117   0.0042
+ 0.000000 118  -0.0016
+ 0.000000 119  -0.0004
+ 0.000000 120   0.0011
+ 0.000000 121  -0.0003
+ 0.000000 122   0.0016
+ 0.000000 123   0.0018
+ 0.000000 124   0.0034
+ 0.000000 125   0.0002
+ 0.000000 126   0.0009
+ 0.000000 127   0.0013
+ 0.000000 128   0.0007
+ 0.000000 129   0.0010
+ 0.000000 130  -0.0032
+ 0.000000 131   0.0021
+ 0.000000 132  -0.0027
+ 0.000000 133  -0.0000
+ 0.000000 134   0.0009
+ 0.000000 135  -0.0045
+ 0.000000 136  -0.0014
+ 0.000000 137  -0.0014
+ 0.000000 138   0.0004
+ 0.000000 139  -0.0003
+ 0.000000 140  -0.0025
+ 0.000000 141   0.0032
+ 0.000000 142   0.0037
+ 0.000000 143   0.0005
+ 0.000000 144  -0.0003
+ 0.000000 145   0.0047
+ 0.000000 146  -0.0015
+ 0.000000 147  -0.0011
+ 0.000000 148   0.0004
+ 0.000000 149  -0.0015
+ 0.000000 150  -0.0006
+ 0.000000 151  -0.0028
+ 0.000000 152   0.0036
+ 0.000000 153  -0.0040
+ 0.000000 154  -0.0003
+ 0.000000 155  -0.0031
+ 0.000000 156   0.0021
+ 0.000000 157  -0.0002
+ 0.000000 158   0.0002
+ 0.000000 159   0.0016
+ 0.000000 160   0.0010
+ 0.000000 161   0.0036
+ 0.000000 162  -0.0004
+ 0.000000 163  -0.0028
+ 0.000000 164   0.0055
+ 0.000000 165   0.0014
+ 0.000000 166  -0.0034
+ 0.000000 167   0.0023
+ 0.000000 168  -0.0002
+ 0.000000 169  -0.0002
+ 0.000000 170  -0.0006
+ 0.000000 171  -0.0009
+ 0.000000 172   0.0009
+ 0.000000 173  -0.0003
+ 0.000000 174   0.0032
+ 0.000000 175  -0.0053
+ 0.000000 176   0.0037
+ 0.000000 177  -0.0019
+ 0.000000 178  -0.0020
+ 0.000000 179   0.0011
+ 0.000000 180  -0.0000
+ 0.000000 181   0.0060
+ 0.000000 182  -0.0033
+ 0.000000 183  -0.0027
+ 0.000000 184   0.0016
+ 0.000000 185   0.0005
+ 0.000000 186  -0.0009
+ 0.000000 187  -0.0031
+ 0.000000 188  -0.0009
+ 0.000000 189  -0.0005
+ 0.000000 190   0.0049
+ 0.000000 191   0.0003
+ 0.000000 192  -0.1431
+ 0.000000 193  -0.0326
+ 0.000000 194   0.0101
+ 0.000000 195  -0.0326
+ 0.000000 196  -0.1712
+ 0.000000 197   0.0351
+ 0.000000 198   0.0101
+ 0.000000 199   0.0351
+ 0.000000 200  -0.1192
diff --git a/regtest/crystallization/rt-q6-lowmem/deriv3.reference b/regtest/crystallization/rt-q6-lowmem/deriv3.reference
new file mode 100644
index 0000000000000000000000000000000000000000..2692feba41081ea512941549a0bebe17769351ab
--- /dev/null
+++ b/regtest/crystallization/rt-q6-lowmem/deriv3.reference
@@ -0,0 +1,202 @@
+#! FIELDS time parameter w6.mean
+ 0.000000 0   0.0017
+ 0.000000 1   0.0017
+ 0.000000 2   0.0049
+ 0.000000 3  -0.0079
+ 0.000000 4   0.0010
+ 0.000000 5  -0.0191
+ 0.000000 6   0.0042
+ 0.000000 7   0.0026
+ 0.000000 8  -0.0191
+ 0.000000 9  -0.0045
+ 0.000000 10   0.0010
+ 0.000000 11   0.0068
+ 0.000000 12  -0.0001
+ 0.000000 13   0.0001
+ 0.000000 14   0.0001
+ 0.000000 15  -0.0004
+ 0.000000 16  -0.0072
+ 0.000000 17  -0.0002
+ 0.000000 18  -0.0069
+ 0.000000 19  -0.0003
+ 0.000000 20  -0.0000
+ 0.000000 21  -0.0015
+ 0.000000 22  -0.0003
+ 0.000000 23  -0.0023
+ 0.000000 24   0.0072
+ 0.000000 25  -0.0040
+ 0.000000 26  -0.0057
+ 0.000000 27   0.0023
+ 0.000000 28  -0.0078
+ 0.000000 29   0.0012
+ 0.000000 30  -0.0029
+ 0.000000 31   0.0131
+ 0.000000 32   0.0032
+ 0.000000 33   0.0033
+ 0.000000 34  -0.0012
+ 0.000000 35   0.0079
+ 0.000000 36   0.0002
+ 0.000000 37  -0.0002
+ 0.000000 38  -0.0054
+ 0.000000 39   0.0017
+ 0.000000 40   0.0049
+ 0.000000 41   0.0065
+ 0.000000 42  -0.0022
+ 0.000000 43   0.0053
+ 0.000000 44   0.0015
+ 0.000000 45   0.0113
+ 0.000000 46   0.0021
+ 0.000000 47   0.0040
+ 0.000000 48  -0.0040
+ 0.000000 49  -0.0010
+ 0.000000 50  -0.0038
+ 0.000000 51  -0.0027
+ 0.000000 52   0.0047
+ 0.000000 53  -0.0066
+ 0.000000 54   0.0000
+ 0.000000 55   0.0066
+ 0.000000 56   0.0076
+ 0.000000 57  -0.0008
+ 0.000000 58  -0.0033
+ 0.000000 59  -0.0064
+ 0.000000 60  -0.0007
+ 0.000000 61  -0.0101
+ 0.000000 62  -0.0022
+ 0.000000 63  -0.0087
+ 0.000000 64   0.0100
+ 0.000000 65   0.0074
+ 0.000000 66  -0.0004
+ 0.000000 67   0.0031
+ 0.000000 68  -0.0076
+ 0.000000 69   0.0045
+ 0.000000 70  -0.0045
+ 0.000000 71  -0.0019
+ 0.000000 72   0.0048
+ 0.000000 73   0.0098
+ 0.000000 74   0.0093
+ 0.000000 75  -0.0042
+ 0.000000 76  -0.0076
+ 0.000000 77  -0.0009
+ 0.000000 78   0.0060
+ 0.000000 79  -0.0106
+ 0.000000 80  -0.0006
+ 0.000000 81  -0.0031
+ 0.000000 82  -0.0031
+ 0.000000 83   0.0004
+ 0.000000 84   0.0034
+ 0.000000 85   0.0012
+ 0.000000 86  -0.0012
+ 0.000000 87  -0.0002
+ 0.000000 88  -0.0075
+ 0.000000 89   0.0214
+ 0.000000 90   0.0007
+ 0.000000 91   0.0037
+ 0.000000 92   0.0057
+ 0.000000 93   0.0081
+ 0.000000 94   0.0026
+ 0.000000 95  -0.0120
+ 0.000000 96   0.0061
+ 0.000000 97   0.0051
+ 0.000000 98  -0.0013
+ 0.000000 99   0.0005
+ 0.000000 100   0.0022
+ 0.000000 101  -0.0038
+ 0.000000 102  -0.0045
+ 0.000000 103  -0.0058
+ 0.000000 104  -0.0015
+ 0.000000 105   0.0149
+ 0.000000 106  -0.0006
+ 0.000000 107   0.0064
+ 0.000000 108   0.0011
+ 0.000000 109   0.0127
+ 0.000000 110  -0.0015
+ 0.000000 111   0.0012
+ 0.000000 112   0.0023
+ 0.000000 113  -0.0029
+ 0.000000 114   0.0085
+ 0.000000 115  -0.0047
+ 0.000000 116  -0.0120
+ 0.000000 117   0.0090
+ 0.000000 118   0.0005
+ 0.000000 119   0.0119
+ 0.000000 120  -0.0053
+ 0.000000 121  -0.0054
+ 0.000000 122   0.0036
+ 0.000000 123   0.0026
+ 0.000000 124  -0.0051
+ 0.000000 125  -0.0119
+ 0.000000 126  -0.0028
+ 0.000000 127  -0.0041
+ 0.000000 128   0.0008
+ 0.000000 129   0.0006
+ 0.000000 130  -0.0136
+ 0.000000 131  -0.0040
+ 0.000000 132  -0.0037
+ 0.000000 133   0.0007
+ 0.000000 134  -0.0078
+ 0.000000 135   0.0070
+ 0.000000 136  -0.0022
+ 0.000000 137   0.0096
+ 0.000000 138   0.0094
+ 0.000000 139  -0.0005
+ 0.000000 140  -0.0005
+ 0.000000 141  -0.0022
+ 0.000000 142   0.0025
+ 0.000000 143   0.0113
+ 0.000000 144   0.0033
+ 0.000000 145   0.0013
+ 0.000000 146   0.0012
+ 0.000000 147  -0.0076
+ 0.000000 148   0.0015
+ 0.000000 149  -0.0030
+ 0.000000 150  -0.0055
+ 0.000000 151   0.0080
+ 0.000000 152   0.0098
+ 0.000000 153  -0.0048
+ 0.000000 154   0.0001
+ 0.000000 155  -0.0062
+ 0.000000 156   0.0065
+ 0.000000 157  -0.0024
+ 0.000000 158  -0.0151
+ 0.000000 159  -0.0066
+ 0.000000 160  -0.0061
+ 0.000000 161  -0.0043
+ 0.000000 162  -0.0081
+ 0.000000 163  -0.0085
+ 0.000000 164   0.0119
+ 0.000000 165   0.0063
+ 0.000000 166  -0.0047
+ 0.000000 167   0.0134
+ 0.000000 168   0.0060
+ 0.000000 169   0.0087
+ 0.000000 170   0.0066
+ 0.000000 171  -0.0009
+ 0.000000 172   0.0114
+ 0.000000 173   0.0004
+ 0.000000 174  -0.0004
+ 0.000000 175  -0.0097
+ 0.000000 176   0.0144
+ 0.000000 177  -0.0117
+ 0.000000 178   0.0026
+ 0.000000 179   0.0020
+ 0.000000 180  -0.0007
+ 0.000000 181   0.0015
+ 0.000000 182  -0.0189
+ 0.000000 183  -0.0024
+ 0.000000 184  -0.0105
+ 0.000000 185   0.0025
+ 0.000000 186  -0.0088
+ 0.000000 187  -0.0002
+ 0.000000 188   0.0007
+ 0.000000 189  -0.0152
+ 0.000000 190   0.0183
+ 0.000000 191  -0.0046
+ 0.000000 192   0.0519
+ 0.000000 193  -0.0782
+ 0.000000 194  -0.0255
+ 0.000000 195  -0.0782
+ 0.000000 196  -0.1128
+ 0.000000 197   0.0867
+ 0.000000 198  -0.0255
+ 0.000000 199   0.0867
+ 0.000000 200  -0.0399
diff --git a/regtest/crystallization/rt-q6-lowmem/plumed.dat b/regtest/crystallization/rt-q6-lowmem/plumed.dat
new file mode 100644
index 0000000000000000000000000000000000000000..7c76774d7961b9cc0f05274803f50696b5326f37
--- /dev/null
+++ b/regtest/crystallization/rt-q6-lowmem/plumed.dat
@@ -0,0 +1,9 @@
+Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN LABEL=q6 
+# Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN NUMERICAL_DERIVATIVES LABEL=q6n
+PRINT ARG=q6.* FILE=colv 
+DUMPDERIVATIVES ARG=q6.* FILE=deriv FMT=%8.4f
+
+LOCAL_Q6 ARG=q6 SWITCH={RATIONAL D_0=3.0 R_0=1.5} MEAN LOWMEM LABEL=w6
+PRINT ARG=w6.* FILE=colv3
+DUMPDERIVATIVES ARG=w6.* FILE=deriv3 FMT=%8.4f
+
diff --git a/regtest/crystallization/rt-q6-subset/64.xyz b/regtest/crystallization/rt-q6-subset/64.xyz
new file mode 100755
index 0000000000000000000000000000000000000000..90b3ae19c7598dd32c498e7105925df054c3e788
--- /dev/null
+++ b/regtest/crystallization/rt-q6-subset/64.xyz
@@ -0,0 +1,66 @@
+   64
+12.41642 12.41642 12.41642 
+  Ge       1.473000000000      2.211000000000      8.700200000000
+  Ge       4.886500000000      3.830000000000      6.593500000000
+  Ge       3.807000000000      1.978700000000     10.045000000000
+  Ge       5.002000000000      3.883500000000      1.357000000000
+  Ge       9.636000000000      1.604000000000      8.697700000000
+  Ge       6.559800000000     11.084000000000      9.650400000000
+  Ge       0.627000000000      0.390000000000      2.224300000000
+  Ge       3.341900000000      6.765300000000      1.369500000000
+  Ge       5.032000000000      9.650500000000      2.785000000000
+  Ge       1.682700000000     10.392700000000      5.459500000000
+  Ge       3.517300000000     12.039000000000      5.930600000000
+  Ge       1.072000000000      5.374900000000     12.335000000000
+  Ge       0.863390000000     11.308000000000      0.275000000000
+  Ge       5.867800000000      0.672000000000      6.605200000000
+  Ge       3.961000000000      8.414000000000      8.691600000000
+  Ge      11.570960000000     10.444000000000      2.125000000000
+  Ge       1.736000000000      6.845200000000      6.129000000000
+  Ge       7.557300000000      8.842800000000      6.611800000000
+  Ge       2.785800000000      2.591200000000      1.833300000000
+  Ge      11.564000000000     11.555000000000     10.928000000000
+  Ge       3.324000000000     11.334000000000     12.095000000000
+  Ge      10.532000000000      9.377700000000      6.724000000000
+  Ge       7.157000000000     11.468000000000     12.063000000000
+  Ge       0.027000000000      4.622000000000      5.996200000000
+  Ge       4.564000000000      6.513200000000      5.370200000000
+  Ge      12.189770000000      7.981000000000      2.257000000000
+  Ge       8.973100000000      0.437000000000      4.852800000000
+  Ge       9.086200000000      9.857000000000      0.975000000000
+  Ge       6.516500000000     12.170000000000      2.438600000000
+  Ge       8.955900000000      4.612000000000      4.478000000000
+  Ge       7.419000000000      3.301600000000      0.450000000000
+  Ge      10.808000000000      7.170600000000     11.109000000000
+  Te       4.818200000000      9.096200000000      6.189300000000
+  Te      10.663400000000      6.726900000000      5.343000000000
+  Te       7.021700000000      4.814600000000     10.649000000000
+  Te       3.253500000000      5.713300000000      8.267800000000
+  Te      10.322000000000      1.250000000000      2.209500000000
+  Te       0.300000000000      5.033000000000      8.902400000000
+  Te      12.092000000000      0.227000000000      8.527200000000
+  Te       6.329000000000      2.634100000000      8.525500000000
+  Te       8.044800000000     11.712000000000      7.575400000000
+  Te       2.150000000000      8.302000000000      3.591400000000
+  Te      11.581000000000     11.201000000000      4.824700000000
+  Te       3.960900000000      4.755000000000     11.528710000000
+  Te       3.815300000000     12.139000000000      3.263700000000
+  Te       9.419700000000      7.232700000000      1.010000000000
+  Te       1.211700000000      1.726300000000     12.223470000000
+  Te       0.798460000000      8.988100000000      7.517700000000
+  Te      10.078000000000      9.503000000000      9.977500000000
+  Te       9.336700000000      0.894000000000     11.469560000000
+  Te       7.251000000000      5.783400000000      6.399000000000
+  Te       3.740000000000     11.515000000000      9.383700000000
+  Te      10.329000000000      2.726600000000      5.835100000000
+  Te       6.722900000000      8.386100000000      9.226500000000
+  Te       1.247000000000      4.660000000000      2.609100000000
+  Te       5.628500000000      6.170200000000      2.845000000000
+  Te       4.742900000000      9.191800000000      0.212000000000
+  Te       5.134400000000      0.984830000000     12.244000000000
+  Te       8.033800000000     10.061100000000      3.578600000000
+  Te       9.840000000000      4.825000000000      9.743000000000
+  Te       6.760000000000      2.189000000000      4.410700000000
+  Te       2.334000000000      2.201000000000      6.079000000000
+  Te       9.930600000000      3.982900000000      1.562000000000
+  Te       0.806810000000      8.091100000000     12.264000000000
diff --git a/regtest/crystallization/rt-q6-subset/Makefile b/regtest/crystallization/rt-q6-subset/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..3703b27cea227aa053fb6d1d73f861e4384dbcee
--- /dev/null
+++ b/regtest/crystallization/rt-q6-subset/Makefile
@@ -0,0 +1 @@
+include ../../scripts/test.make
diff --git a/regtest/crystallization/rt-q6-subset/colv3.reference b/regtest/crystallization/rt-q6-subset/colv3.reference
new file mode 100644
index 0000000000000000000000000000000000000000..17de575c442c0e27b62129b798bed4017a7bba0a
--- /dev/null
+++ b/regtest/crystallization/rt-q6-subset/colv3.reference
@@ -0,0 +1,2 @@
+#! FIELDS time w6.mean
+ 0.000000 -0.005288
diff --git a/regtest/crystallization/rt-q6-subset/config b/regtest/crystallization/rt-q6-subset/config
new file mode 100644
index 0000000000000000000000000000000000000000..e07432072a91405171ff68d3c3d22a09fde3346c
--- /dev/null
+++ b/regtest/crystallization/rt-q6-subset/config
@@ -0,0 +1,3 @@
+type=driver
+# this is to test a different name
+arg="--plumed plumed.dat --ixyz 64.xyz"
diff --git a/regtest/crystallization/rt-q6-subset/deriv3.reference b/regtest/crystallization/rt-q6-subset/deriv3.reference
new file mode 100644
index 0000000000000000000000000000000000000000..4baa519f0d44d453d73b38a5c014931119a14e23
--- /dev/null
+++ b/regtest/crystallization/rt-q6-subset/deriv3.reference
@@ -0,0 +1,586 @@
+#! FIELDS time parameter w6.mean
+ 0.000000 0  -0.0191
+ 0.000000 1  -0.0137
+ 0.000000 2   0.0086
+ 0.000000 3  -0.0108
+ 0.000000 4   0.0103
+ 0.000000 5  -0.0439
+ 0.000000 6   0.0300
+ 0.000000 7  -0.0181
+ 0.000000 8  -0.0697
+ 0.000000 9  -0.0128
+ 0.000000 10  -0.0013
+ 0.000000 11   0.0243
+ 0.000000 12   0.0036
+ 0.000000 13   0.0324
+ 0.000000 14   0.0102
+ 0.000000 15  -0.0072
+ 0.000000 16   0.0092
+ 0.000000 17   0.0004
+ 0.000000 18  -0.0106
+ 0.000000 19  -0.0049
+ 0.000000 20  -0.0031
+ 0.000000 21   0.0087
+ 0.000000 22  -0.0073
+ 0.000000 23  -0.0134
+ 0.000000 24  -0.0027
+ 0.000000 25   0.0038
+ 0.000000 26  -0.0061
+ 0.000000 27  -0.0024
+ 0.000000 28   0.0045
+ 0.000000 29  -0.0032
+ 0.000000 30  -0.0134
+ 0.000000 31  -0.0220
+ 0.000000 32   0.0061
+ 0.000000 33   0.0000
+ 0.000000 34   0.0000
+ 0.000000 35  -0.0000
+ 0.000000 36   0.0091
+ 0.000000 37   0.0053
+ 0.000000 38  -0.0099
+ 0.000000 39  -0.0000
+ 0.000000 40   0.0000
+ 0.000000 41   0.0000
+ 0.000000 42   0.0000
+ 0.000000 43  -0.0001
+ 0.000000 44  -0.0001
+ 0.000000 45  -0.0133
+ 0.000000 46   0.0004
+ 0.000000 47   0.0048
+ 0.000000 48   0.0117
+ 0.000000 49  -0.0055
+ 0.000000 50   0.0012
+ 0.000000 51  -0.0006
+ 0.000000 52  -0.0006
+ 0.000000 53   0.0005
+ 0.000000 54   0.0070
+ 0.000000 55   0.0014
+ 0.000000 56   0.0147
+ 0.000000 57  -0.0000
+ 0.000000 58   0.0002
+ 0.000000 59   0.0002
+ 0.000000 60   0.0000
+ 0.000000 61   0.0000
+ 0.000000 62   0.0000
+ 0.000000 63   0.0096
+ 0.000000 64  -0.0058
+ 0.000000 65   0.0032
+ 0.000000 66   0.0000
+ 0.000000 67   0.0000
+ 0.000000 68   0.0000
+ 0.000000 69  -0.0040
+ 0.000000 70  -0.0035
+ 0.000000 71   0.0148
+ 0.000000 72  -0.0008
+ 0.000000 73   0.0051
+ 0.000000 74   0.0074
+ 0.000000 75   0.0005
+ 0.000000 76  -0.0009
+ 0.000000 77  -0.0009
+ 0.000000 78   0.0003
+ 0.000000 79  -0.0005
+ 0.000000 80  -0.0002
+ 0.000000 81   0.0035
+ 0.000000 82   0.0005
+ 0.000000 83  -0.0010
+ 0.000000 84   0.0037
+ 0.000000 85   0.0027
+ 0.000000 86  -0.0008
+ 0.000000 87   0.0077
+ 0.000000 88   0.0014
+ 0.000000 89  -0.0000
+ 0.000000 90  -0.0000
+ 0.000000 91   0.0000
+ 0.000000 92   0.0000
+ 0.000000 93   0.0074
+ 0.000000 94  -0.0047
+ 0.000000 95   0.0023
+ 0.000000 96  -0.0000
+ 0.000000 97  -0.0000
+ 0.000000 98   0.0000
+ 0.000000 99  -0.0101
+ 0.000000 100   0.0184
+ 0.000000 101  -0.0038
+ 0.000000 102  -0.0063
+ 0.000000 103  -0.0019
+ 0.000000 104   0.0027
+ 0.000000 105   0.0025
+ 0.000000 106   0.0028
+ 0.000000 107   0.0029
+ 0.000000 108   0.0000
+ 0.000000 109   0.0000
+ 0.000000 110   0.0000
+ 0.000000 111  -0.0000
+ 0.000000 112   0.0001
+ 0.000000 113  -0.0001
+ 0.000000 114   0.0000
+ 0.000000 115   0.0000
+ 0.000000 116  -0.0000
+ 0.000000 117  -0.0030
+ 0.000000 118  -0.0143
+ 0.000000 119  -0.0110
+ 0.000000 120   0.0055
+ 0.000000 121   0.0043
+ 0.000000 122   0.0234
+ 0.000000 123  -0.0000
+ 0.000000 124   0.0000
+ 0.000000 125   0.0000
+ 0.000000 126  -0.0040
+ 0.000000 127   0.0007
+ 0.000000 128  -0.0057
+ 0.000000 129   0.0024
+ 0.000000 130  -0.0056
+ 0.000000 131  -0.0244
+ 0.000000 132   0.0020
+ 0.000000 133  -0.0059
+ 0.000000 134   0.0076
+ 0.000000 135  -0.0070
+ 0.000000 136   0.0009
+ 0.000000 137   0.0080
+ 0.000000 138  -0.0000
+ 0.000000 139   0.0000
+ 0.000000 140   0.0000
+ 0.000000 141   0.0000
+ 0.000000 142  -0.0002
+ 0.000000 143  -0.0001
+ 0.000000 144  -0.0003
+ 0.000000 145  -0.0181
+ 0.000000 146   0.0127
+ 0.000000 147   0.0003
+ 0.000000 148  -0.0033
+ 0.000000 149   0.0012
+ 0.000000 150  -0.0001
+ 0.000000 151  -0.0000
+ 0.000000 152   0.0000
+ 0.000000 153   0.0085
+ 0.000000 154  -0.0073
+ 0.000000 155   0.0006
+ 0.000000 156  -0.0000
+ 0.000000 157   0.0000
+ 0.000000 158   0.0000
+ 0.000000 159  -0.0000
+ 0.000000 160  -0.0001
+ 0.000000 161  -0.0004
+ 0.000000 162  -0.0097
+ 0.000000 163   0.0027
+ 0.000000 164  -0.0004
+ 0.000000 165   0.0014
+ 0.000000 166  -0.0010
+ 0.000000 167   0.0075
+ 0.000000 168   0.0057
+ 0.000000 169  -0.0039
+ 0.000000 170   0.0127
+ 0.000000 171   0.0075
+ 0.000000 172  -0.0013
+ 0.000000 173   0.0002
+ 0.000000 174  -0.0000
+ 0.000000 175  -0.0000
+ 0.000000 176  -0.0000
+ 0.000000 177   0.0019
+ 0.000000 178   0.0004
+ 0.000000 179   0.0028
+ 0.000000 180  -0.0020
+ 0.000000 181  -0.0043
+ 0.000000 182   0.0106
+ 0.000000 183  -0.0000
+ 0.000000 184  -0.0001
+ 0.000000 185   0.0000
+ 0.000000 186   0.0051
+ 0.000000 187   0.0206
+ 0.000000 188  -0.0031
+ 0.000000 189   0.0000
+ 0.000000 190   0.0000
+ 0.000000 191   0.0000
+ 0.000000 192   0.0019
+ 0.000000 193   0.0029
+ 0.000000 194  -0.0073
+ 0.000000 195   0.0023
+ 0.000000 196   0.0096
+ 0.000000 197  -0.0043
+ 0.000000 198   0.0013
+ 0.000000 199   0.0055
+ 0.000000 200   0.0042
+ 0.000000 201   0.0019
+ 0.000000 202  -0.0002
+ 0.000000 203  -0.0001
+ 0.000000 204  -0.0000
+ 0.000000 205   0.0000
+ 0.000000 206  -0.0000
+ 0.000000 207   0.0012
+ 0.000000 208  -0.0027
+ 0.000000 209   0.0013
+ 0.000000 210   0.0000
+ 0.000000 211  -0.0003
+ 0.000000 212  -0.0001
+ 0.000000 213   0.0013
+ 0.000000 214   0.0109
+ 0.000000 215  -0.0054
+ 0.000000 216  -0.0001
+ 0.000000 217   0.0002
+ 0.000000 218   0.0004
+ 0.000000 219  -0.0003
+ 0.000000 220  -0.0015
+ 0.000000 221  -0.0009
+ 0.000000 222  -0.0018
+ 0.000000 223   0.0074
+ 0.000000 224   0.0049
+ 0.000000 225  -0.0098
+ 0.000000 226   0.0064
+ 0.000000 227   0.0011
+ 0.000000 228   0.0016
+ 0.000000 229   0.0001
+ 0.000000 230   0.0016
+ 0.000000 231  -0.0085
+ 0.000000 232   0.0037
+ 0.000000 233  -0.0005
+ 0.000000 234  -0.0006
+ 0.000000 235  -0.0015
+ 0.000000 236   0.0006
+ 0.000000 237  -0.0000
+ 0.000000 238  -0.0000
+ 0.000000 239   0.0000
+ 0.000000 240   0.0069
+ 0.000000 241  -0.0061
+ 0.000000 242   0.0014
+ 0.000000 243  -0.0003
+ 0.000000 244  -0.0006
+ 0.000000 245   0.0003
+ 0.000000 246   0.0048
+ 0.000000 247  -0.0115
+ 0.000000 248   0.0025
+ 0.000000 249   0.0009
+ 0.000000 250   0.0041
+ 0.000000 251  -0.0083
+ 0.000000 252  -0.0006
+ 0.000000 253   0.0068
+ 0.000000 254   0.0001
+ 0.000000 255   0.0000
+ 0.000000 256   0.0009
+ 0.000000 257  -0.0004
+ 0.000000 258   0.0008
+ 0.000000 259   0.0038
+ 0.000000 260  -0.0048
+ 0.000000 261  -0.0014
+ 0.000000 262  -0.0003
+ 0.000000 263  -0.0011
+ 0.000000 264   0.0004
+ 0.000000 265   0.0107
+ 0.000000 266   0.0161
+ 0.000000 267   0.0001
+ 0.000000 268   0.0000
+ 0.000000 269   0.0000
+ 0.000000 270   0.0019
+ 0.000000 271  -0.0042
+ 0.000000 272   0.0042
+ 0.000000 273   0.0001
+ 0.000000 274   0.0000
+ 0.000000 275  -0.0000
+ 0.000000 276  -0.0000
+ 0.000000 277  -0.0006
+ 0.000000 278  -0.0035
+ 0.000000 279  -0.0038
+ 0.000000 280  -0.0016
+ 0.000000 281   0.0070
+ 0.000000 282   0.0031
+ 0.000000 283  -0.0100
+ 0.000000 284  -0.0019
+ 0.000000 285   0.0000
+ 0.000000 286   0.0002
+ 0.000000 287  -0.0002
+ 0.000000 288  -0.0000
+ 0.000000 289   0.0000
+ 0.000000 290   0.0003
+ 0.000000 291   0.0000
+ 0.000000 292   0.0002
+ 0.000000 293  -0.0001
+ 0.000000 294  -0.0030
+ 0.000000 295   0.0048
+ 0.000000 296   0.0060
+ 0.000000 297   0.0113
+ 0.000000 298  -0.0078
+ 0.000000 299   0.0079
+ 0.000000 300  -0.0001
+ 0.000000 301  -0.0002
+ 0.000000 302   0.0002
+ 0.000000 303   0.0006
+ 0.000000 304  -0.0045
+ 0.000000 305   0.0061
+ 0.000000 306   0.0022
+ 0.000000 307  -0.0150
+ 0.000000 308  -0.0067
+ 0.000000 309   0.0277
+ 0.000000 310   0.0061
+ 0.000000 311   0.0226
+ 0.000000 312  -0.0072
+ 0.000000 313   0.0080
+ 0.000000 314   0.0053
+ 0.000000 315  -0.0001
+ 0.000000 316   0.0004
+ 0.000000 317   0.0002
+ 0.000000 318  -0.0002
+ 0.000000 319  -0.0002
+ 0.000000 320   0.0000
+ 0.000000 321  -0.0234
+ 0.000000 322  -0.0020
+ 0.000000 323   0.0061
+ 0.000000 324  -0.0012
+ 0.000000 325  -0.0022
+ 0.000000 326  -0.0000
+ 0.000000 327   0.0007
+ 0.000000 328   0.0005
+ 0.000000 329  -0.0003
+ 0.000000 330  -0.0066
+ 0.000000 331   0.0033
+ 0.000000 332  -0.0013
+ 0.000000 333   0.0001
+ 0.000000 334   0.0003
+ 0.000000 335   0.0000
+ 0.000000 336  -0.0029
+ 0.000000 337   0.0040
+ 0.000000 338  -0.0033
+ 0.000000 339  -0.0066
+ 0.000000 340  -0.0127
+ 0.000000 341   0.0058
+ 0.000000 342   0.0030
+ 0.000000 343   0.0047
+ 0.000000 344   0.0002
+ 0.000000 345   0.0075
+ 0.000000 346   0.0008
+ 0.000000 347   0.0018
+ 0.000000 348   0.0150
+ 0.000000 349  -0.0102
+ 0.000000 350   0.0095
+ 0.000000 351   0.0000
+ 0.000000 352  -0.0003
+ 0.000000 353   0.0005
+ 0.000000 354   0.0068
+ 0.000000 355  -0.0007
+ 0.000000 356  -0.0097
+ 0.000000 357  -0.0122
+ 0.000000 358  -0.0060
+ 0.000000 359   0.0256
+ 0.000000 360  -0.0002
+ 0.000000 361  -0.0002
+ 0.000000 362  -0.0003
+ 0.000000 363  -0.0015
+ 0.000000 364   0.0046
+ 0.000000 365   0.0023
+ 0.000000 366   0.0000
+ 0.000000 367  -0.0000
+ 0.000000 368  -0.0000
+ 0.000000 369   0.0063
+ 0.000000 370   0.0013
+ 0.000000 371   0.0095
+ 0.000000 372  -0.0019
+ 0.000000 373  -0.0001
+ 0.000000 374  -0.0106
+ 0.000000 375  -0.0117
+ 0.000000 376  -0.0073
+ 0.000000 377   0.0053
+ 0.000000 378  -0.0024
+ 0.000000 379  -0.0001
+ 0.000000 380  -0.0005
+ 0.000000 381  -0.0002
+ 0.000000 382   0.0001
+ 0.000000 383  -0.0001
+ 0.000000 384  -0.0017
+ 0.000000 385  -0.0011
+ 0.000000 386  -0.0071
+ 0.000000 387  -0.0053
+ 0.000000 388   0.0011
+ 0.000000 389  -0.0123
+ 0.000000 390   0.0020
+ 0.000000 391  -0.0009
+ 0.000000 392   0.0006
+ 0.000000 393   0.0075
+ 0.000000 394   0.0046
+ 0.000000 395   0.0039
+ 0.000000 396   0.0108
+ 0.000000 397  -0.0059
+ 0.000000 398   0.0081
+ 0.000000 399  -0.0021
+ 0.000000 400  -0.0004
+ 0.000000 401  -0.0004
+ 0.000000 402   0.0054
+ 0.000000 403  -0.0027
+ 0.000000 404   0.0005
+ 0.000000 405   0.0059
+ 0.000000 406   0.0053
+ 0.000000 407  -0.0034
+ 0.000000 408  -0.0024
+ 0.000000 409   0.0009
+ 0.000000 410   0.0003
+ 0.000000 411  -0.0010
+ 0.000000 412  -0.0049
+ 0.000000 413   0.0025
+ 0.000000 414   0.0010
+ 0.000000 415  -0.0052
+ 0.000000 416   0.0062
+ 0.000000 417  -0.0084
+ 0.000000 418   0.0037
+ 0.000000 419   0.0035
+ 0.000000 420   0.0023
+ 0.000000 421   0.0001
+ 0.000000 422   0.0052
+ 0.000000 423   0.0012
+ 0.000000 424   0.0111
+ 0.000000 425   0.0006
+ 0.000000 426   0.0050
+ 0.000000 427  -0.0016
+ 0.000000 428  -0.0008
+ 0.000000 429  -0.0047
+ 0.000000 430   0.0037
+ 0.000000 431   0.0004
+ 0.000000 432  -0.0065
+ 0.000000 433   0.0000
+ 0.000000 434  -0.0060
+ 0.000000 435  -0.0014
+ 0.000000 436  -0.0048
+ 0.000000 437  -0.0010
+ 0.000000 438  -0.0020
+ 0.000000 439  -0.0050
+ 0.000000 440  -0.0004
+ 0.000000 441   0.0036
+ 0.000000 442   0.0069
+ 0.000000 443  -0.0035
+ 0.000000 444  -0.0086
+ 0.000000 445   0.0052
+ 0.000000 446  -0.0016
+ 0.000000 447  -0.0002
+ 0.000000 448   0.0058
+ 0.000000 449  -0.0011
+ 0.000000 450   0.0006
+ 0.000000 451   0.0015
+ 0.000000 452  -0.0064
+ 0.000000 453   0.0039
+ 0.000000 454   0.0065
+ 0.000000 455  -0.0128
+ 0.000000 456   0.0001
+ 0.000000 457   0.0023
+ 0.000000 458  -0.0008
+ 0.000000 459   0.0036
+ 0.000000 460   0.0021
+ 0.000000 461   0.0002
+ 0.000000 462   0.0063
+ 0.000000 463  -0.0021
+ 0.000000 464   0.0005
+ 0.000000 465   0.0048
+ 0.000000 466  -0.0013
+ 0.000000 467   0.0001
+ 0.000000 468   0.0041
+ 0.000000 469  -0.0008
+ 0.000000 470  -0.0061
+ 0.000000 471   0.0046
+ 0.000000 472  -0.0015
+ 0.000000 473   0.0066
+ 0.000000 474   0.0095
+ 0.000000 475  -0.0014
+ 0.000000 476  -0.0008
+ 0.000000 477  -0.0079
+ 0.000000 478  -0.0016
+ 0.000000 479  -0.0057
+ 0.000000 480   0.0023
+ 0.000000 481   0.0030
+ 0.000000 482  -0.0125
+ 0.000000 483   0.0014
+ 0.000000 484   0.0076
+ 0.000000 485  -0.0005
+ 0.000000 486  -0.0090
+ 0.000000 487  -0.0003
+ 0.000000 488  -0.0069
+ 0.000000 489  -0.0041
+ 0.000000 490  -0.0083
+ 0.000000 491   0.0012
+ 0.000000 492  -0.0025
+ 0.000000 493   0.0085
+ 0.000000 494   0.0036
+ 0.000000 495   0.0052
+ 0.000000 496  -0.0105
+ 0.000000 497   0.0021
+ 0.000000 498   0.0005
+ 0.000000 499  -0.0120
+ 0.000000 500  -0.0061
+ 0.000000 501   0.0051
+ 0.000000 502  -0.0043
+ 0.000000 503  -0.0001
+ 0.000000 504  -0.0041
+ 0.000000 505   0.0107
+ 0.000000 506   0.0041
+ 0.000000 507  -0.0021
+ 0.000000 508  -0.0059
+ 0.000000 509   0.0050
+ 0.000000 510   0.0024
+ 0.000000 511   0.0032
+ 0.000000 512  -0.0068
+ 0.000000 513  -0.0140
+ 0.000000 514   0.0019
+ 0.000000 515  -0.0068
+ 0.000000 516   0.0017
+ 0.000000 517   0.0071
+ 0.000000 518   0.0010
+ 0.000000 519   0.0105
+ 0.000000 520   0.0057
+ 0.000000 521   0.0011
+ 0.000000 522  -0.0001
+ 0.000000 523   0.0062
+ 0.000000 524  -0.0000
+ 0.000000 525   0.0021
+ 0.000000 526  -0.0025
+ 0.000000 527  -0.0020
+ 0.000000 528  -0.0047
+ 0.000000 529  -0.0034
+ 0.000000 530  -0.0043
+ 0.000000 531  -0.0005
+ 0.000000 532  -0.0045
+ 0.000000 533  -0.0014
+ 0.000000 534  -0.0084
+ 0.000000 535  -0.0012
+ 0.000000 536  -0.0023
+ 0.000000 537  -0.0022
+ 0.000000 538  -0.0096
+ 0.000000 539  -0.0013
+ 0.000000 540   0.0134
+ 0.000000 541  -0.0018
+ 0.000000 542   0.0017
+ 0.000000 543  -0.0111
+ 0.000000 544   0.0019
+ 0.000000 545  -0.0031
+ 0.000000 546   0.0064
+ 0.000000 547   0.0009
+ 0.000000 548  -0.0135
+ 0.000000 549   0.0007
+ 0.000000 550   0.0006
+ 0.000000 551   0.0105
+ 0.000000 552   0.0005
+ 0.000000 553   0.0014
+ 0.000000 554  -0.0022
+ 0.000000 555  -0.0012
+ 0.000000 556   0.0060
+ 0.000000 557   0.0008
+ 0.000000 558   0.0025
+ 0.000000 559   0.0027
+ 0.000000 560   0.0021
+ 0.000000 561  -0.0055
+ 0.000000 562   0.0032
+ 0.000000 563   0.0013
+ 0.000000 564  -0.0069
+ 0.000000 565  -0.0046
+ 0.000000 566  -0.0031
+ 0.000000 567  -0.0114
+ 0.000000 568   0.0003
+ 0.000000 569   0.0010
+ 0.000000 570  -0.0065
+ 0.000000 571   0.0040
+ 0.000000 572  -0.0078
+ 0.000000 573   0.0011
+ 0.000000 574   0.0004
+ 0.000000 575  -0.0037
+ 0.000000 576  -0.0231
+ 0.000000 577  -0.1953
+ 0.000000 578   0.0762
+ 0.000000 579  -0.1953
+ 0.000000 580   0.0424
+ 0.000000 581  -0.1586
+ 0.000000 582   0.0762
+ 0.000000 583  -0.1586
+ 0.000000 584  -0.0484
diff --git a/regtest/crystallization/rt-q6-subset/plumed.dat b/regtest/crystallization/rt-q6-subset/plumed.dat
new file mode 100644
index 0000000000000000000000000000000000000000..6fcffbed047fb4fd35158108e7886cdae02eadd2
--- /dev/null
+++ b/regtest/crystallization/rt-q6-subset/plumed.dat
@@ -0,0 +1,7 @@
+Q6 SPECIESA=1-5 SPECIESB=1-64 D_0=3.0 R_0=1.5 LABEL=q6a
+Q6 SPECIESA=6-64 SPECIESB=1-64 D_0=3.0 R_0=1.5 LABEL=q6b
+
+LOCAL_Q6 ARG=q6a,q6b SWITCH={RATIONAL D_0=3.0 R_0=1.5} MEAN LOWMEM LABEL=w6
+PRINT ARG=w6.* FILE=colv3
+DUMPDERIVATIVES ARG=w6.* FILE=deriv3 FMT=%8.4f
+
diff --git a/regtest/crystallization/rt-q6/64.xyz b/regtest/crystallization/rt-q6/64.xyz
new file mode 100755
index 0000000000000000000000000000000000000000..90b3ae19c7598dd32c498e7105925df054c3e788
--- /dev/null
+++ b/regtest/crystallization/rt-q6/64.xyz
@@ -0,0 +1,66 @@
+   64
+12.41642 12.41642 12.41642 
+  Ge       1.473000000000      2.211000000000      8.700200000000
+  Ge       4.886500000000      3.830000000000      6.593500000000
+  Ge       3.807000000000      1.978700000000     10.045000000000
+  Ge       5.002000000000      3.883500000000      1.357000000000
+  Ge       9.636000000000      1.604000000000      8.697700000000
+  Ge       6.559800000000     11.084000000000      9.650400000000
+  Ge       0.627000000000      0.390000000000      2.224300000000
+  Ge       3.341900000000      6.765300000000      1.369500000000
+  Ge       5.032000000000      9.650500000000      2.785000000000
+  Ge       1.682700000000     10.392700000000      5.459500000000
+  Ge       3.517300000000     12.039000000000      5.930600000000
+  Ge       1.072000000000      5.374900000000     12.335000000000
+  Ge       0.863390000000     11.308000000000      0.275000000000
+  Ge       5.867800000000      0.672000000000      6.605200000000
+  Ge       3.961000000000      8.414000000000      8.691600000000
+  Ge      11.570960000000     10.444000000000      2.125000000000
+  Ge       1.736000000000      6.845200000000      6.129000000000
+  Ge       7.557300000000      8.842800000000      6.611800000000
+  Ge       2.785800000000      2.591200000000      1.833300000000
+  Ge      11.564000000000     11.555000000000     10.928000000000
+  Ge       3.324000000000     11.334000000000     12.095000000000
+  Ge      10.532000000000      9.377700000000      6.724000000000
+  Ge       7.157000000000     11.468000000000     12.063000000000
+  Ge       0.027000000000      4.622000000000      5.996200000000
+  Ge       4.564000000000      6.513200000000      5.370200000000
+  Ge      12.189770000000      7.981000000000      2.257000000000
+  Ge       8.973100000000      0.437000000000      4.852800000000
+  Ge       9.086200000000      9.857000000000      0.975000000000
+  Ge       6.516500000000     12.170000000000      2.438600000000
+  Ge       8.955900000000      4.612000000000      4.478000000000
+  Ge       7.419000000000      3.301600000000      0.450000000000
+  Ge      10.808000000000      7.170600000000     11.109000000000
+  Te       4.818200000000      9.096200000000      6.189300000000
+  Te      10.663400000000      6.726900000000      5.343000000000
+  Te       7.021700000000      4.814600000000     10.649000000000
+  Te       3.253500000000      5.713300000000      8.267800000000
+  Te      10.322000000000      1.250000000000      2.209500000000
+  Te       0.300000000000      5.033000000000      8.902400000000
+  Te      12.092000000000      0.227000000000      8.527200000000
+  Te       6.329000000000      2.634100000000      8.525500000000
+  Te       8.044800000000     11.712000000000      7.575400000000
+  Te       2.150000000000      8.302000000000      3.591400000000
+  Te      11.581000000000     11.201000000000      4.824700000000
+  Te       3.960900000000      4.755000000000     11.528710000000
+  Te       3.815300000000     12.139000000000      3.263700000000
+  Te       9.419700000000      7.232700000000      1.010000000000
+  Te       1.211700000000      1.726300000000     12.223470000000
+  Te       0.798460000000      8.988100000000      7.517700000000
+  Te      10.078000000000      9.503000000000      9.977500000000
+  Te       9.336700000000      0.894000000000     11.469560000000
+  Te       7.251000000000      5.783400000000      6.399000000000
+  Te       3.740000000000     11.515000000000      9.383700000000
+  Te      10.329000000000      2.726600000000      5.835100000000
+  Te       6.722900000000      8.386100000000      9.226500000000
+  Te       1.247000000000      4.660000000000      2.609100000000
+  Te       5.628500000000      6.170200000000      2.845000000000
+  Te       4.742900000000      9.191800000000      0.212000000000
+  Te       5.134400000000      0.984830000000     12.244000000000
+  Te       8.033800000000     10.061100000000      3.578600000000
+  Te       9.840000000000      4.825000000000      9.743000000000
+  Te       6.760000000000      2.189000000000      4.410700000000
+  Te       2.334000000000      2.201000000000      6.079000000000
+  Te       9.930600000000      3.982900000000      1.562000000000
+  Te       0.806810000000      8.091100000000     12.264000000000
diff --git a/regtest/crystallization/rt-q6/Makefile b/regtest/crystallization/rt-q6/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..3703b27cea227aa053fb6d1d73f861e4384dbcee
--- /dev/null
+++ b/regtest/crystallization/rt-q6/Makefile
@@ -0,0 +1 @@
+include ../../scripts/test.make
diff --git a/regtest/crystallization/rt-q6/colv.reference b/regtest/crystallization/rt-q6/colv.reference
new file mode 100644
index 0000000000000000000000000000000000000000..8d69c80ee2192c76108352c9c7255dee723a579b
--- /dev/null
+++ b/regtest/crystallization/rt-q6/colv.reference
@@ -0,0 +1,2 @@
+#! FIELDS time q6.mean
+ 0.000000 0.245096
diff --git a/regtest/crystallization/rt-q6/colv2.reference b/regtest/crystallization/rt-q6/colv2.reference
new file mode 100644
index 0000000000000000000000000000000000000000..9429375c744b2ffa30efb090c4b3938789f57b75
--- /dev/null
+++ b/regtest/crystallization/rt-q6/colv2.reference
@@ -0,0 +1,2 @@
+#! FIELDS time c.mean
+ 0.000000 13.570253
diff --git a/regtest/crystallization/rt-q6/colv3.reference b/regtest/crystallization/rt-q6/colv3.reference
new file mode 100644
index 0000000000000000000000000000000000000000..511ac4b2209d7e98efef88f378746a702b6b6fa7
--- /dev/null
+++ b/regtest/crystallization/rt-q6/colv3.reference
@@ -0,0 +1,2 @@
+#! FIELDS time w6.mean
+ 0.000000 0.036242
diff --git a/regtest/crystallization/rt-q6/colv4.reference b/regtest/crystallization/rt-q6/colv4.reference
new file mode 100644
index 0000000000000000000000000000000000000000..8bd82ca0535e0cc01c70b169fc340d11c00bb64f
--- /dev/null
+++ b/regtest/crystallization/rt-q6/colv4.reference
@@ -0,0 +1,2 @@
+#! FIELDS time q4.mean
+ 0.000000 0.153825
diff --git a/regtest/crystallization/rt-q6/config b/regtest/crystallization/rt-q6/config
new file mode 100644
index 0000000000000000000000000000000000000000..e07432072a91405171ff68d3c3d22a09fde3346c
--- /dev/null
+++ b/regtest/crystallization/rt-q6/config
@@ -0,0 +1,3 @@
+type=driver
+# this is to test a different name
+arg="--plumed plumed.dat --ixyz 64.xyz"
diff --git a/regtest/crystallization/rt-q6/deriv.reference b/regtest/crystallization/rt-q6/deriv.reference
new file mode 100644
index 0000000000000000000000000000000000000000..a7c522e7376756146f4ece8e74bc7b27bf920713
--- /dev/null
+++ b/regtest/crystallization/rt-q6/deriv.reference
@@ -0,0 +1,202 @@
+#! FIELDS time parameter q6.mean
+ 0.000000 0   0.0012
+ 0.000000 1   0.0016
+ 0.000000 2  -0.0017
+ 0.000000 3  -0.0003
+ 0.000000 4   0.0017
+ 0.000000 5  -0.0031
+ 0.000000 6  -0.0013
+ 0.000000 7  -0.0015
+ 0.000000 8  -0.0023
+ 0.000000 9   0.0000
+ 0.000000 10   0.0022
+ 0.000000 11   0.0030
+ 0.000000 12  -0.0009
+ 0.000000 13  -0.0010
+ 0.000000 14  -0.0002
+ 0.000000 15  -0.0018
+ 0.000000 16  -0.0026
+ 0.000000 17  -0.0006
+ 0.000000 18   0.0009
+ 0.000000 19  -0.0008
+ 0.000000 20   0.0013
+ 0.000000 21  -0.0024
+ 0.000000 22   0.0041
+ 0.000000 23  -0.0008
+ 0.000000 24   0.0026
+ 0.000000 25  -0.0023
+ 0.000000 26  -0.0015
+ 0.000000 27  -0.0021
+ 0.000000 28   0.0029
+ 0.000000 29   0.0037
+ 0.000000 30  -0.0017
+ 0.000000 31  -0.0015
+ 0.000000 32   0.0018
+ 0.000000 33  -0.0027
+ 0.000000 34  -0.0000
+ 0.000000 35   0.0003
+ 0.000000 36   0.0006
+ 0.000000 37  -0.0016
+ 0.000000 38   0.0004
+ 0.000000 39  -0.0020
+ 0.000000 40   0.0019
+ 0.000000 41  -0.0005
+ 0.000000 42   0.0016
+ 0.000000 43  -0.0053
+ 0.000000 44   0.0001
+ 0.000000 45  -0.0031
+ 0.000000 46  -0.0020
+ 0.000000 47  -0.0020
+ 0.000000 48  -0.0014
+ 0.000000 49   0.0010
+ 0.000000 50  -0.0059
+ 0.000000 51   0.0021
+ 0.000000 52  -0.0023
+ 0.000000 53   0.0027
+ 0.000000 54   0.0011
+ 0.000000 55   0.0006
+ 0.000000 56  -0.0010
+ 0.000000 57  -0.0005
+ 0.000000 58  -0.0017
+ 0.000000 59  -0.0010
+ 0.000000 60  -0.0001
+ 0.000000 61   0.0010
+ 0.000000 62   0.0016
+ 0.000000 63   0.0017
+ 0.000000 64   0.0000
+ 0.000000 65  -0.0029
+ 0.000000 66   0.0003
+ 0.000000 67   0.0033
+ 0.000000 68  -0.0041
+ 0.000000 69  -0.0007
+ 0.000000 70   0.0014
+ 0.000000 71  -0.0004
+ 0.000000 72   0.0029
+ 0.000000 73   0.0013
+ 0.000000 74  -0.0008
+ 0.000000 75   0.0017
+ 0.000000 76  -0.0046
+ 0.000000 77  -0.0000
+ 0.000000 78   0.0009
+ 0.000000 79  -0.0008
+ 0.000000 80   0.0009
+ 0.000000 81  -0.0001
+ 0.000000 82  -0.0002
+ 0.000000 83  -0.0006
+ 0.000000 84   0.0009
+ 0.000000 85  -0.0012
+ 0.000000 86   0.0001
+ 0.000000 87   0.0015
+ 0.000000 88   0.0018
+ 0.000000 89  -0.0039
+ 0.000000 90   0.0008
+ 0.000000 91   0.0005
+ 0.000000 92   0.0029
+ 0.000000 93   0.0025
+ 0.000000 94   0.0016
+ 0.000000 95   0.0016
+ 0.000000 96  -0.0017
+ 0.000000 97  -0.0001
+ 0.000000 98   0.0022
+ 0.000000 99  -0.0024
+ 0.000000 100   0.0009
+ 0.000000 101   0.0004
+ 0.000000 102  -0.0017
+ 0.000000 103  -0.0014
+ 0.000000 104   0.0004
+ 0.000000 105   0.0002
+ 0.000000 106  -0.0033
+ 0.000000 107  -0.0020
+ 0.000000 108  -0.0001
+ 0.000000 109   0.0039
+ 0.000000 110   0.0014
+ 0.000000 111  -0.0004
+ 0.000000 112   0.0018
+ 0.000000 113  -0.0021
+ 0.000000 114   0.0037
+ 0.000000 115  -0.0004
+ 0.000000 116   0.0011
+ 0.000000 117   0.0042
+ 0.000000 118  -0.0016
+ 0.000000 119  -0.0004
+ 0.000000 120   0.0011
+ 0.000000 121  -0.0003
+ 0.000000 122   0.0016
+ 0.000000 123   0.0018
+ 0.000000 124   0.0034
+ 0.000000 125   0.0002
+ 0.000000 126   0.0009
+ 0.000000 127   0.0013
+ 0.000000 128   0.0007
+ 0.000000 129   0.0010
+ 0.000000 130  -0.0032
+ 0.000000 131   0.0021
+ 0.000000 132  -0.0027
+ 0.000000 133  -0.0000
+ 0.000000 134   0.0009
+ 0.000000 135  -0.0045
+ 0.000000 136  -0.0014
+ 0.000000 137  -0.0014
+ 0.000000 138   0.0004
+ 0.000000 139  -0.0003
+ 0.000000 140  -0.0025
+ 0.000000 141   0.0032
+ 0.000000 142   0.0037
+ 0.000000 143   0.0005
+ 0.000000 144  -0.0003
+ 0.000000 145   0.0047
+ 0.000000 146  -0.0015
+ 0.000000 147  -0.0011
+ 0.000000 148   0.0004
+ 0.000000 149  -0.0015
+ 0.000000 150  -0.0006
+ 0.000000 151  -0.0028
+ 0.000000 152   0.0036
+ 0.000000 153  -0.0040
+ 0.000000 154  -0.0003
+ 0.000000 155  -0.0031
+ 0.000000 156   0.0021
+ 0.000000 157  -0.0002
+ 0.000000 158   0.0002
+ 0.000000 159   0.0016
+ 0.000000 160   0.0010
+ 0.000000 161   0.0036
+ 0.000000 162  -0.0004
+ 0.000000 163  -0.0028
+ 0.000000 164   0.0055
+ 0.000000 165   0.0014
+ 0.000000 166  -0.0034
+ 0.000000 167   0.0023
+ 0.000000 168  -0.0002
+ 0.000000 169  -0.0002
+ 0.000000 170  -0.0006
+ 0.000000 171  -0.0009
+ 0.000000 172   0.0009
+ 0.000000 173  -0.0003
+ 0.000000 174   0.0032
+ 0.000000 175  -0.0053
+ 0.000000 176   0.0037
+ 0.000000 177  -0.0019
+ 0.000000 178  -0.0020
+ 0.000000 179   0.0011
+ 0.000000 180  -0.0000
+ 0.000000 181   0.0060
+ 0.000000 182  -0.0033
+ 0.000000 183  -0.0027
+ 0.000000 184   0.0016
+ 0.000000 185   0.0005
+ 0.000000 186  -0.0009
+ 0.000000 187  -0.0031
+ 0.000000 188  -0.0009
+ 0.000000 189  -0.0005
+ 0.000000 190   0.0049
+ 0.000000 191   0.0003
+ 0.000000 192  -0.1431
+ 0.000000 193  -0.0326
+ 0.000000 194   0.0101
+ 0.000000 195  -0.0326
+ 0.000000 196  -0.1712
+ 0.000000 197   0.0351
+ 0.000000 198   0.0101
+ 0.000000 199   0.0351
+ 0.000000 200  -0.1192
diff --git a/regtest/crystallization/rt-q6/deriv2.reference b/regtest/crystallization/rt-q6/deriv2.reference
new file mode 100644
index 0000000000000000000000000000000000000000..33b692b27208a3d39b227b155d95dd4b70f562bd
--- /dev/null
+++ b/regtest/crystallization/rt-q6/deriv2.reference
@@ -0,0 +1,202 @@
+#! FIELDS time parameter c.mean
+ 0.000000 0   0.0097
+ 0.000000 1  -0.0011
+ 0.000000 2   0.0021
+ 0.000000 3  -0.0394
+ 0.000000 4   0.0102
+ 0.000000 5   0.0040
+ 0.000000 6   0.0262
+ 0.000000 7   0.0234
+ 0.000000 8  -0.0092
+ 0.000000 9  -0.0410
+ 0.000000 10  -0.0517
+ 0.000000 11   0.0031
+ 0.000000 12  -0.0217
+ 0.000000 13  -0.0134
+ 0.000000 14  -0.0057
+ 0.000000 15  -0.0011
+ 0.000000 16   0.0435
+ 0.000000 17  -0.0060
+ 0.000000 18  -0.0021
+ 0.000000 19  -0.0027
+ 0.000000 20   0.0279
+ 0.000000 21  -0.0030
+ 0.000000 22  -0.0048
+ 0.000000 23   0.0250
+ 0.000000 24   0.0056
+ 0.000000 25   0.0392
+ 0.000000 26   0.0204
+ 0.000000 27   0.0104
+ 0.000000 28   0.0120
+ 0.000000 29  -0.0064
+ 0.000000 30   0.0051
+ 0.000000 31  -0.0027
+ 0.000000 32   0.0143
+ 0.000000 33  -0.0089
+ 0.000000 34  -0.0177
+ 0.000000 35  -0.0153
+ 0.000000 36   0.0081
+ 0.000000 37   0.0058
+ 0.000000 38   0.0060
+ 0.000000 39   0.0140
+ 0.000000 40  -0.0551
+ 0.000000 41  -0.0152
+ 0.000000 42   0.0027
+ 0.000000 43   0.0130
+ 0.000000 44   0.0054
+ 0.000000 45  -0.0078
+ 0.000000 46   0.0027
+ 0.000000 47   0.0034
+ 0.000000 48  -0.0020
+ 0.000000 49  -0.0247
+ 0.000000 50  -0.0523
+ 0.000000 51  -0.0227
+ 0.000000 52   0.0411
+ 0.000000 53  -0.0164
+ 0.000000 54   0.0507
+ 0.000000 55  -0.0270
+ 0.000000 56  -0.0041
+ 0.000000 57   0.0178
+ 0.000000 58  -0.0327
+ 0.000000 59   0.0111
+ 0.000000 60  -0.0226
+ 0.000000 61  -0.0163
+ 0.000000 62   0.0183
+ 0.000000 63   0.0010
+ 0.000000 64   0.0038
+ 0.000000 65  -0.0115
+ 0.000000 66   0.0263
+ 0.000000 67   0.0133
+ 0.000000 68  -0.0225
+ 0.000000 69   0.0137
+ 0.000000 70   0.0298
+ 0.000000 71   0.0288
+ 0.000000 72  -0.0176
+ 0.000000 73   0.0002
+ 0.000000 74  -0.0362
+ 0.000000 75   0.0012
+ 0.000000 76   0.0366
+ 0.000000 77   0.0618
+ 0.000000 78   0.0363
+ 0.000000 79  -0.0291
+ 0.000000 80   0.0062
+ 0.000000 81   0.0065
+ 0.000000 82   0.0436
+ 0.000000 83  -0.0052
+ 0.000000 84  -0.0335
+ 0.000000 85   0.0507
+ 0.000000 86  -0.0176
+ 0.000000 87  -0.0421
+ 0.000000 88  -0.0190
+ 0.000000 89  -0.0439
+ 0.000000 90  -0.0161
+ 0.000000 91  -0.0130
+ 0.000000 92   0.0097
+ 0.000000 93  -0.0292
+ 0.000000 94   0.0403
+ 0.000000 95   0.0037
+ 0.000000 96   0.0280
+ 0.000000 97   0.0328
+ 0.000000 98   0.0060
+ 0.000000 99   0.0391
+ 0.000000 100   0.0353
+ 0.000000 101  -0.0400
+ 0.000000 102   0.0064
+ 0.000000 103  -0.0312
+ 0.000000 104  -0.0096
+ 0.000000 105   0.0576
+ 0.000000 106  -0.0213
+ 0.000000 107   0.0062
+ 0.000000 108  -0.0314
+ 0.000000 109  -0.0415
+ 0.000000 110  -0.0242
+ 0.000000 111   0.0201
+ 0.000000 112  -0.0282
+ 0.000000 113  -0.0207
+ 0.000000 114   0.0460
+ 0.000000 115  -0.0120
+ 0.000000 116  -0.0141
+ 0.000000 117  -0.0271
+ 0.000000 118  -0.0292
+ 0.000000 119   0.0454
+ 0.000000 120   0.0001
+ 0.000000 121   0.0197
+ 0.000000 122  -0.0060
+ 0.000000 123  -0.0321
+ 0.000000 124   0.0626
+ 0.000000 125  -0.0135
+ 0.000000 126   0.0164
+ 0.000000 127  -0.0240
+ 0.000000 128   0.0045
+ 0.000000 129  -0.0391
+ 0.000000 130   0.0116
+ 0.000000 131  -0.0139
+ 0.000000 132   0.0054
+ 0.000000 133  -0.0348
+ 0.000000 134  -0.0281
+ 0.000000 135  -0.0199
+ 0.000000 136  -0.0443
+ 0.000000 137  -0.0068
+ 0.000000 138  -0.0165
+ 0.000000 139   0.0111
+ 0.000000 140  -0.0048
+ 0.000000 141   0.0374
+ 0.000000 142  -0.0216
+ 0.000000 143   0.0240
+ 0.000000 144   0.0112
+ 0.000000 145   0.0245
+ 0.000000 146   0.0321
+ 0.000000 147  -0.0017
+ 0.000000 148  -0.0077
+ 0.000000 149  -0.0134
+ 0.000000 150  -0.0074
+ 0.000000 151  -0.0199
+ 0.000000 152   0.0592
+ 0.000000 153  -0.0233
+ 0.000000 154  -0.0017
+ 0.000000 155  -0.0161
+ 0.000000 156   0.0194
+ 0.000000 157  -0.0028
+ 0.000000 158   0.0438
+ 0.000000 159   0.0039
+ 0.000000 160  -0.0017
+ 0.000000 161   0.0189
+ 0.000000 162   0.0178
+ 0.000000 163  -0.0033
+ 0.000000 164   0.0215
+ 0.000000 165   0.0011
+ 0.000000 166  -0.0257
+ 0.000000 167   0.0101
+ 0.000000 168  -0.0109
+ 0.000000 169   0.0328
+ 0.000000 170   0.0256
+ 0.000000 171   0.0062
+ 0.000000 172  -0.0062
+ 0.000000 173  -0.0137
+ 0.000000 174  -0.0162
+ 0.000000 175   0.0071
+ 0.000000 176   0.0204
+ 0.000000 177  -0.0114
+ 0.000000 178  -0.0090
+ 0.000000 179  -0.0025
+ 0.000000 180  -0.0231
+ 0.000000 181   0.0044
+ 0.000000 182  -0.0187
+ 0.000000 183  -0.0119
+ 0.000000 184   0.0134
+ 0.000000 185  -0.0111
+ 0.000000 186   0.0253
+ 0.000000 187   0.0153
+ 0.000000 188  -0.0110
+ 0.000000 189   0.0067
+ 0.000000 190  -0.0028
+ 0.000000 191  -0.0329
+ 0.000000 192  15.4541
+ 0.000000 193   0.4015
+ 0.000000 194   0.1687
+ 0.000000 195   0.4015
+ 0.000000 196  14.7038
+ 0.000000 197   0.3340
+ 0.000000 198   0.1687
+ 0.000000 199   0.3340
+ 0.000000 200  15.4941
diff --git a/regtest/crystallization/rt-q6/deriv3.reference b/regtest/crystallization/rt-q6/deriv3.reference
new file mode 100644
index 0000000000000000000000000000000000000000..2692feba41081ea512941549a0bebe17769351ab
--- /dev/null
+++ b/regtest/crystallization/rt-q6/deriv3.reference
@@ -0,0 +1,202 @@
+#! FIELDS time parameter w6.mean
+ 0.000000 0   0.0017
+ 0.000000 1   0.0017
+ 0.000000 2   0.0049
+ 0.000000 3  -0.0079
+ 0.000000 4   0.0010
+ 0.000000 5  -0.0191
+ 0.000000 6   0.0042
+ 0.000000 7   0.0026
+ 0.000000 8  -0.0191
+ 0.000000 9  -0.0045
+ 0.000000 10   0.0010
+ 0.000000 11   0.0068
+ 0.000000 12  -0.0001
+ 0.000000 13   0.0001
+ 0.000000 14   0.0001
+ 0.000000 15  -0.0004
+ 0.000000 16  -0.0072
+ 0.000000 17  -0.0002
+ 0.000000 18  -0.0069
+ 0.000000 19  -0.0003
+ 0.000000 20  -0.0000
+ 0.000000 21  -0.0015
+ 0.000000 22  -0.0003
+ 0.000000 23  -0.0023
+ 0.000000 24   0.0072
+ 0.000000 25  -0.0040
+ 0.000000 26  -0.0057
+ 0.000000 27   0.0023
+ 0.000000 28  -0.0078
+ 0.000000 29   0.0012
+ 0.000000 30  -0.0029
+ 0.000000 31   0.0131
+ 0.000000 32   0.0032
+ 0.000000 33   0.0033
+ 0.000000 34  -0.0012
+ 0.000000 35   0.0079
+ 0.000000 36   0.0002
+ 0.000000 37  -0.0002
+ 0.000000 38  -0.0054
+ 0.000000 39   0.0017
+ 0.000000 40   0.0049
+ 0.000000 41   0.0065
+ 0.000000 42  -0.0022
+ 0.000000 43   0.0053
+ 0.000000 44   0.0015
+ 0.000000 45   0.0113
+ 0.000000 46   0.0021
+ 0.000000 47   0.0040
+ 0.000000 48  -0.0040
+ 0.000000 49  -0.0010
+ 0.000000 50  -0.0038
+ 0.000000 51  -0.0027
+ 0.000000 52   0.0047
+ 0.000000 53  -0.0066
+ 0.000000 54   0.0000
+ 0.000000 55   0.0066
+ 0.000000 56   0.0076
+ 0.000000 57  -0.0008
+ 0.000000 58  -0.0033
+ 0.000000 59  -0.0064
+ 0.000000 60  -0.0007
+ 0.000000 61  -0.0101
+ 0.000000 62  -0.0022
+ 0.000000 63  -0.0087
+ 0.000000 64   0.0100
+ 0.000000 65   0.0074
+ 0.000000 66  -0.0004
+ 0.000000 67   0.0031
+ 0.000000 68  -0.0076
+ 0.000000 69   0.0045
+ 0.000000 70  -0.0045
+ 0.000000 71  -0.0019
+ 0.000000 72   0.0048
+ 0.000000 73   0.0098
+ 0.000000 74   0.0093
+ 0.000000 75  -0.0042
+ 0.000000 76  -0.0076
+ 0.000000 77  -0.0009
+ 0.000000 78   0.0060
+ 0.000000 79  -0.0106
+ 0.000000 80  -0.0006
+ 0.000000 81  -0.0031
+ 0.000000 82  -0.0031
+ 0.000000 83   0.0004
+ 0.000000 84   0.0034
+ 0.000000 85   0.0012
+ 0.000000 86  -0.0012
+ 0.000000 87  -0.0002
+ 0.000000 88  -0.0075
+ 0.000000 89   0.0214
+ 0.000000 90   0.0007
+ 0.000000 91   0.0037
+ 0.000000 92   0.0057
+ 0.000000 93   0.0081
+ 0.000000 94   0.0026
+ 0.000000 95  -0.0120
+ 0.000000 96   0.0061
+ 0.000000 97   0.0051
+ 0.000000 98  -0.0013
+ 0.000000 99   0.0005
+ 0.000000 100   0.0022
+ 0.000000 101  -0.0038
+ 0.000000 102  -0.0045
+ 0.000000 103  -0.0058
+ 0.000000 104  -0.0015
+ 0.000000 105   0.0149
+ 0.000000 106  -0.0006
+ 0.000000 107   0.0064
+ 0.000000 108   0.0011
+ 0.000000 109   0.0127
+ 0.000000 110  -0.0015
+ 0.000000 111   0.0012
+ 0.000000 112   0.0023
+ 0.000000 113  -0.0029
+ 0.000000 114   0.0085
+ 0.000000 115  -0.0047
+ 0.000000 116  -0.0120
+ 0.000000 117   0.0090
+ 0.000000 118   0.0005
+ 0.000000 119   0.0119
+ 0.000000 120  -0.0053
+ 0.000000 121  -0.0054
+ 0.000000 122   0.0036
+ 0.000000 123   0.0026
+ 0.000000 124  -0.0051
+ 0.000000 125  -0.0119
+ 0.000000 126  -0.0028
+ 0.000000 127  -0.0041
+ 0.000000 128   0.0008
+ 0.000000 129   0.0006
+ 0.000000 130  -0.0136
+ 0.000000 131  -0.0040
+ 0.000000 132  -0.0037
+ 0.000000 133   0.0007
+ 0.000000 134  -0.0078
+ 0.000000 135   0.0070
+ 0.000000 136  -0.0022
+ 0.000000 137   0.0096
+ 0.000000 138   0.0094
+ 0.000000 139  -0.0005
+ 0.000000 140  -0.0005
+ 0.000000 141  -0.0022
+ 0.000000 142   0.0025
+ 0.000000 143   0.0113
+ 0.000000 144   0.0033
+ 0.000000 145   0.0013
+ 0.000000 146   0.0012
+ 0.000000 147  -0.0076
+ 0.000000 148   0.0015
+ 0.000000 149  -0.0030
+ 0.000000 150  -0.0055
+ 0.000000 151   0.0080
+ 0.000000 152   0.0098
+ 0.000000 153  -0.0048
+ 0.000000 154   0.0001
+ 0.000000 155  -0.0062
+ 0.000000 156   0.0065
+ 0.000000 157  -0.0024
+ 0.000000 158  -0.0151
+ 0.000000 159  -0.0066
+ 0.000000 160  -0.0061
+ 0.000000 161  -0.0043
+ 0.000000 162  -0.0081
+ 0.000000 163  -0.0085
+ 0.000000 164   0.0119
+ 0.000000 165   0.0063
+ 0.000000 166  -0.0047
+ 0.000000 167   0.0134
+ 0.000000 168   0.0060
+ 0.000000 169   0.0087
+ 0.000000 170   0.0066
+ 0.000000 171  -0.0009
+ 0.000000 172   0.0114
+ 0.000000 173   0.0004
+ 0.000000 174  -0.0004
+ 0.000000 175  -0.0097
+ 0.000000 176   0.0144
+ 0.000000 177  -0.0117
+ 0.000000 178   0.0026
+ 0.000000 179   0.0020
+ 0.000000 180  -0.0007
+ 0.000000 181   0.0015
+ 0.000000 182  -0.0189
+ 0.000000 183  -0.0024
+ 0.000000 184  -0.0105
+ 0.000000 185   0.0025
+ 0.000000 186  -0.0088
+ 0.000000 187  -0.0002
+ 0.000000 188   0.0007
+ 0.000000 189  -0.0152
+ 0.000000 190   0.0183
+ 0.000000 191  -0.0046
+ 0.000000 192   0.0519
+ 0.000000 193  -0.0782
+ 0.000000 194  -0.0255
+ 0.000000 195  -0.0782
+ 0.000000 196  -0.1128
+ 0.000000 197   0.0867
+ 0.000000 198  -0.0255
+ 0.000000 199   0.0867
+ 0.000000 200  -0.0399
diff --git a/regtest/crystallization/rt-q6/deriv4.reference b/regtest/crystallization/rt-q6/deriv4.reference
new file mode 100644
index 0000000000000000000000000000000000000000..80babbe054de23b000b132bc080cf2d23e041880
--- /dev/null
+++ b/regtest/crystallization/rt-q6/deriv4.reference
@@ -0,0 +1,202 @@
+#! FIELDS time parameter q4.mean
+ 0.000000 0   0.0019
+ 0.000000 1  -0.0025
+ 0.000000 2  -0.0023
+ 0.000000 3   0.0007
+ 0.000000 4   0.0026
+ 0.000000 5   0.0016
+ 0.000000 6  -0.0005
+ 0.000000 7  -0.0020
+ 0.000000 8   0.0010
+ 0.000000 9   0.0047
+ 0.000000 10   0.0019
+ 0.000000 11   0.0002
+ 0.000000 12   0.0009
+ 0.000000 13   0.0002
+ 0.000000 14  -0.0009
+ 0.000000 15  -0.0009
+ 0.000000 16  -0.0022
+ 0.000000 17   0.0005
+ 0.000000 18  -0.0009
+ 0.000000 19   0.0014
+ 0.000000 20  -0.0026
+ 0.000000 21   0.0003
+ 0.000000 22   0.0002
+ 0.000000 23   0.0001
+ 0.000000 24  -0.0026
+ 0.000000 25  -0.0005
+ 0.000000 26   0.0016
+ 0.000000 27  -0.0007
+ 0.000000 28   0.0001
+ 0.000000 29  -0.0004
+ 0.000000 30   0.0004
+ 0.000000 31   0.0001
+ 0.000000 32  -0.0029
+ 0.000000 33   0.0007
+ 0.000000 34  -0.0014
+ 0.000000 35   0.0006
+ 0.000000 36   0.0029
+ 0.000000 37  -0.0010
+ 0.000000 38  -0.0015
+ 0.000000 39  -0.0003
+ 0.000000 40   0.0023
+ 0.000000 41   0.0012
+ 0.000000 42   0.0000
+ 0.000000 43   0.0003
+ 0.000000 44  -0.0003
+ 0.000000 45   0.0012
+ 0.000000 46   0.0005
+ 0.000000 47   0.0016
+ 0.000000 48  -0.0002
+ 0.000000 49   0.0020
+ 0.000000 50   0.0010
+ 0.000000 51  -0.0018
+ 0.000000 52  -0.0004
+ 0.000000 53   0.0011
+ 0.000000 54  -0.0028
+ 0.000000 55   0.0024
+ 0.000000 56   0.0022
+ 0.000000 57   0.0006
+ 0.000000 58   0.0006
+ 0.000000 59  -0.0019
+ 0.000000 60   0.0033
+ 0.000000 61  -0.0023
+ 0.000000 62  -0.0018
+ 0.000000 63   0.0036
+ 0.000000 64  -0.0012
+ 0.000000 65   0.0005
+ 0.000000 66  -0.0031
+ 0.000000 67  -0.0018
+ 0.000000 68  -0.0007
+ 0.000000 69  -0.0014
+ 0.000000 70  -0.0007
+ 0.000000 71   0.0000
+ 0.000000 72   0.0007
+ 0.000000 73  -0.0003
+ 0.000000 74   0.0007
+ 0.000000 75   0.0029
+ 0.000000 76   0.0044
+ 0.000000 77  -0.0035
+ 0.000000 78  -0.0030
+ 0.000000 79   0.0040
+ 0.000000 80  -0.0001
+ 0.000000 81  -0.0037
+ 0.000000 82  -0.0005
+ 0.000000 83   0.0010
+ 0.000000 84   0.0017
+ 0.000000 85  -0.0008
+ 0.000000 86   0.0016
+ 0.000000 87   0.0023
+ 0.000000 88   0.0012
+ 0.000000 89   0.0048
+ 0.000000 90  -0.0021
+ 0.000000 91   0.0005
+ 0.000000 92  -0.0011
+ 0.000000 93  -0.0017
+ 0.000000 94  -0.0020
+ 0.000000 95  -0.0001
+ 0.000000 96   0.0026
+ 0.000000 97  -0.0016
+ 0.000000 98  -0.0003
+ 0.000000 99  -0.0027
+ 0.000000 100  -0.0015
+ 0.000000 101   0.0047
+ 0.000000 102   0.0028
+ 0.000000 103   0.0039
+ 0.000000 104   0.0004
+ 0.000000 105  -0.0030
+ 0.000000 106   0.0014
+ 0.000000 107   0.0001
+ 0.000000 108   0.0028
+ 0.000000 109   0.0031
+ 0.000000 110  -0.0004
+ 0.000000 111  -0.0002
+ 0.000000 112   0.0024
+ 0.000000 113   0.0005
+ 0.000000 114  -0.0003
+ 0.000000 115   0.0005
+ 0.000000 116   0.0032
+ 0.000000 117  -0.0031
+ 0.000000 118   0.0006
+ 0.000000 119  -0.0039
+ 0.000000 120  -0.0045
+ 0.000000 121   0.0007
+ 0.000000 122   0.0013
+ 0.000000 123  -0.0003
+ 0.000000 124  -0.0036
+ 0.000000 125   0.0021
+ 0.000000 126   0.0043
+ 0.000000 127  -0.0007
+ 0.000000 128  -0.0023
+ 0.000000 129   0.0044
+ 0.000000 130   0.0018
+ 0.000000 131   0.0012
+ 0.000000 132  -0.0005
+ 0.000000 133  -0.0017
+ 0.000000 134  -0.0003
+ 0.000000 135  -0.0025
+ 0.000000 136   0.0026
+ 0.000000 137   0.0005
+ 0.000000 138  -0.0021
+ 0.000000 139  -0.0000
+ 0.000000 140   0.0016
+ 0.000000 141  -0.0032
+ 0.000000 142  -0.0006
+ 0.000000 143  -0.0024
+ 0.000000 144   0.0021
+ 0.000000 145  -0.0033
+ 0.000000 146   0.0005
+ 0.000000 147   0.0008
+ 0.000000 148  -0.0003
+ 0.000000 149  -0.0002
+ 0.000000 150   0.0018
+ 0.000000 151  -0.0005
+ 0.000000 152  -0.0012
+ 0.000000 153  -0.0005
+ 0.000000 154  -0.0004
+ 0.000000 155   0.0007
+ 0.000000 156  -0.0012
+ 0.000000 157  -0.0007
+ 0.000000 158  -0.0054
+ 0.000000 159  -0.0003
+ 0.000000 160   0.0004
+ 0.000000 161   0.0002
+ 0.000000 162   0.0009
+ 0.000000 163  -0.0023
+ 0.000000 164  -0.0023
+ 0.000000 165  -0.0008
+ 0.000000 166   0.0012
+ 0.000000 167  -0.0020
+ 0.000000 168   0.0003
+ 0.000000 169   0.0014
+ 0.000000 170   0.0002
+ 0.000000 171  -0.0010
+ 0.000000 172  -0.0017
+ 0.000000 173  -0.0004
+ 0.000000 174  -0.0005
+ 0.000000 175  -0.0011
+ 0.000000 176  -0.0000
+ 0.000000 177   0.0002
+ 0.000000 178  -0.0005
+ 0.000000 179  -0.0023
+ 0.000000 180   0.0014
+ 0.000000 181  -0.0042
+ 0.000000 182   0.0017
+ 0.000000 183  -0.0024
+ 0.000000 184  -0.0000
+ 0.000000 185   0.0009
+ 0.000000 186   0.0005
+ 0.000000 187  -0.0017
+ 0.000000 188   0.0010
+ 0.000000 189   0.0013
+ 0.000000 190   0.0014
+ 0.000000 191   0.0011
+ 0.000000 192  -0.2881
+ 0.000000 193  -0.0055
+ 0.000000 194  -0.0166
+ 0.000000 195  -0.0055
+ 0.000000 196  -0.2648
+ 0.000000 197  -0.0367
+ 0.000000 198  -0.0166
+ 0.000000 199  -0.0367
+ 0.000000 200  -0.2513
diff --git a/regtest/crystallization/rt-q6/plumed.dat b/regtest/crystallization/rt-q6/plumed.dat
new file mode 100644
index 0000000000000000000000000000000000000000..f027c26db923a0735219637fdca0a0ba145946a2
--- /dev/null
+++ b/regtest/crystallization/rt-q6/plumed.dat
@@ -0,0 +1,19 @@
+COORDINATIONNUMBER SPECIES=1-64 SWITCH={RATIONAL D_0=3.0 R_0=1.5} MEAN LABEL=c
+# COORDINATIONNUMBER SPECIES=1-64 SWITCH={RATIONAL D_0=3.0 R_0=1.5} MEAN NUMERICAL_DERIVATIVES LABEL=cn
+PRINT ARG=c.* FILE=colv2
+DUMPDERIVATIVES ARG=c.* FILE=deriv2 FMT=%8.4f 
+
+Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN LABEL=q6 
+# Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN NUMERICAL_DERIVATIVES LABEL=q6n
+PRINT ARG=q6.* FILE=colv 
+DUMPDERIVATIVES ARG=q6.* FILE=deriv FMT=%8.4f
+
+Q4 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN LABEL=q4
+# Q4 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN NUMERICAL_DERIVATIVES LABEL=q4n
+PRINT ARG=q4.* FILE=colv4
+DUMPDERIVATIVES ARG=q4.* FILE=deriv4 FMT=%8.4f
+
+LOCAL_Q6 ARG=q6 SWITCH={RATIONAL D_0=3.0 R_0=1.5} MEAN LABEL=w6
+# LOCAL_Q6 ARG=q6 SWITCH={RATIONAL D_0=3.0 R_0=1.5} MEAN NUMERICAL_DERIVATIVES LABEL=w6n
+PRINT ARG=w6.* FILE=colv3
+DUMPDERIVATIVES ARG=w6.* FILE=deriv3 FMT=%8.4f
diff --git a/src/.gitignore b/src/.gitignore
index 61e6c24c3cd609be0966eb5836cee7fd3891d369..9dafd67918cb1fc8ceff920aee6a5142289edf64 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -9,6 +9,7 @@
 !/colvar
 !/config
 !/core
+!/crystallization
 !/function
 !/generic
 !/header.sh
diff --git a/src/crystallization/.gitignore b/src/crystallization/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..4888552338441b5d99a97ec7a2cb2ce448e9e4e6
--- /dev/null
+++ b/src/crystallization/.gitignore
@@ -0,0 +1,9 @@
+/*
+# in this directory, only accept source, Makefile and README
+!/.gitignore
+!/*.c
+!/*.cpp
+!/*.h
+!/Makefile
+!/README
+!/module.type
diff --git a/src/crystallization/LocalSteinhardt.h b/src/crystallization/LocalSteinhardt.h
new file mode 100644
index 0000000000000000000000000000000000000000..e82b544b82df8ef98d12eb796041a9b6e8eab165
--- /dev/null
+++ b/src/crystallization/LocalSteinhardt.h
@@ -0,0 +1,44 @@
+/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   Copyright (c) 2012 The plumed team
+   (see the PEOPLE file at the root of the distribution for a list of names)
+
+   See http://www.plumed-code.org for more information.
+
+   This file is part of plumed, version 2.0.
+
+   plumed is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   plumed is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with plumed.  If not, see <http://www.gnu.org/licenses/>.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+#ifndef __PLUMED_crystallization_LocalSteinhardt_h
+#define __PLUMED_crystallization_LocalSteinhardt_h
+#include "OrientationSphere.h"
+
+namespace PLMD {
+namespace crystallization {
+
+template<class T>
+class LocalSteinhardt : public OrientationSphere {
+public:
+  static void registerKeywords( Keywords& keys ){
+    OrientationSphere::registerKeywords(keys);
+  }
+  LocalSteinhardt(const ActionOptions& ao): Action(ao), OrientationSphere(ao)
+  {
+     T* mc=dynamic_cast<T*>( getBaseMultiColvar(0) );
+     if(!mc) error("input action is not calculating the correct vectors");
+  }
+};
+
+}
+}
+#endif
diff --git a/src/crystallization/Makefile b/src/crystallization/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..f68246671ed0ea23ad4d282dde1568ae2024d9e4
--- /dev/null
+++ b/src/crystallization/Makefile
@@ -0,0 +1,4 @@
+USE=core tools vesselbase multicolvar
+
+# generic makefile
+include ../maketools/make.module
diff --git a/src/crystallization/MoleculeOrientation.cpp b/src/crystallization/MoleculeOrientation.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..26e0d985bb341e7b7efe83e735cc207955cc8d47
--- /dev/null
+++ b/src/crystallization/MoleculeOrientation.cpp
@@ -0,0 +1,115 @@
+/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   Copyright (c) 2012 The plumed team
+   (see the PEOPLE file at the root of the distribution for a list of names)
+
+   See http://www.plumed-code.org for more information.
+
+   This file is part of plumed, version 2.0.
+
+   plumed is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   plumed is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with plumed.  If not, see <http://www.gnu.org/licenses/>.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+#include "core/ActionRegister.h"
+#include "VectorMultiColvar.h"
+
+namespace PLMD {
+namespace crystallization {
+
+//+PLUMEDOC MCOLVAR MOLECULES
+/*
+Calculate the vectors connecting a pair of atoms in order to represent the orientation of a molecule.
+
+At its simplest this command can be used to calculate the average length of an internal vector in a 
+collection of different molecules.  When used in conjunction with MutiColvarFunctions in can be used
+to do a variety of more complex tasks.
+
+\par Examples
+
+The following input tells plumed to calculate the distances between two of the atoms in a molecule.
+This is done for the same set of atoms four different molecules and the average separation is then
+calculated.
+
+\verbatim
+MOLECULES MOL1=1,2 MOL2=3,4 MOL3=5,6 MOL4=7,8 MEAN LABEL=mm
+PRINT ARG=mm.mean FILE=colvar
+\endverbatim
+
+
+*/
+//+ENDPLUMEDOC
+
+
+class MoleculeOrientation : public VectorMultiColvar {
+private:
+public:
+  static void registerKeywords( Keywords& keys );
+  MoleculeOrientation( const ActionOptions& ao );
+  void calculateVector();
+  Vector getCentralAtom();
+};
+
+PLUMED_REGISTER_ACTION(MoleculeOrientation,"MOLECULES")
+
+void MoleculeOrientation::registerKeywords( Keywords& keys ){
+  VectorMultiColvar::registerKeywords( keys ); keys.use("MEAN");
+  keys.add("numbered","MOL","The numerical indices of the atoms in the molecule. The orientation of the molecule is equal to " 
+                            "the vector connecting the first two atoms specified.  If a third atom is specified its position "
+                            "is used to specify where the molecule is.  If a third atom is not present the molecule is assumed "
+                            "to be at the center of the vector connecting the first two atoms.");
+  keys.reset_style("MOL","atoms");
+}
+
+MoleculeOrientation::MoleculeOrientation( const ActionOptions& ao ):
+Action(ao),
+VectorMultiColvar(ao)
+{
+  int natoms=-1; 
+  readAtomsLikeKeyword("MOL",natoms); 
+  if( natoms!=2 && natoms!=3 ) error("number of atoms in molecule specification is wrong.  Should be two or three.");
+  setVectorDimensionality( 3, false, natoms );
+}
+
+void MoleculeOrientation::calculateVector(){
+  Vector distance; distance=getSeparation( getPosition(0), getPosition(1) );
+
+  addAtomsDerivative( 0, 0, Vector(-1.0,0,0) ); 
+  addAtomsDerivative( 0, 1, Vector(+1.0,0,0) ); 
+  addBoxDerivatives( 0, Tensor(distance,Vector(-1.0,0,0)) ); 
+  addComponent( 0, distance[0] ); 
+
+  addAtomsDerivative( 1, 0, Vector(0,-1.0,0) ); 
+  addAtomsDerivative( 1, 1, Vector(0,+1.0,0) ); 
+  addBoxDerivatives( 1, Tensor(distance,Vector(0,-1.0,0)) ); 
+  addComponent( 1, distance[1] ); 
+
+  addAtomsDerivative( 2, 0, Vector(0,0,-1.0) ); 
+  addAtomsDerivative( 2, 1, Vector(0,0,+1.0) ); 
+  addBoxDerivatives( 2, Tensor(distance,Vector(0,0,-1.0)) ); 
+  addComponent( 2, distance[2] ); 
+}
+
+Vector MoleculeOrientation::getCentralAtom(){
+  if( getNAtoms()==2 ){
+      Vector com; com.zero();
+      com+=0.5*getPosition(0);
+      com+=0.5*getPosition(1);
+      addCentralAtomDerivatives( 0, 0.5*Tensor::identity() );
+      addCentralAtomDerivatives( 1, 0.5*Tensor::identity() );
+      return com;
+  } 
+  addCentralAtomDerivatives( 2, Tensor::identity() );
+  return getPosition(2);
+}
+
+}
+}
diff --git a/src/crystallization/OrientationSphere.cpp b/src/crystallization/OrientationSphere.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1a2d4043283737d59c6e199eba2850b3e408f7b5
--- /dev/null
+++ b/src/crystallization/OrientationSphere.cpp
@@ -0,0 +1,138 @@
+/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   Copyright (c) 2012 The plumed team
+   (see the PEOPLE file at the root of the distribution for a list of names)
+
+   See http://www.plumed-code.org for more information.
+
+   This file is part of plumed, version 2.0.
+
+   plumed is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   plumed is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with plumed.  If not, see <http://www.gnu.org/licenses/>.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+#include "VectorMultiColvar.h"
+#include "OrientationSphere.h"
+
+using namespace std;
+
+namespace PLMD{
+namespace crystallization {
+
+void OrientationSphere::registerKeywords( Keywords& keys ){
+  multicolvar::MultiColvarFunction::registerKeywords( keys );
+  keys.add("compulsory","NN","6","The n parameter of the switching function ");
+  keys.add("compulsory","MM","12","The m parameter of the switching function ");
+  keys.add("compulsory","D_0","0.0","The d_0 parameter of the switching function");
+  keys.add("compulsory","R_0","The r_0 parameter of the switching function");
+  keys.add("optional","SWITCH","This keyword is used if you want to employ an alternative to the continuous swiching function defined above. "
+                               "The following provides information on the \\ref switchingfunction that are available. "
+                               "When this keyword is present you no longer need the NN, MM, D_0 and R_0 keywords.");
+  // Use actionWithDistributionKeywords
+  keys.use("MEAN"); keys.use("MORE_THAN"); keys.use("LESS_THAN"); 
+  keys.use("MIN"); keys.use("BETWEEN"); keys.use("HISTOGRAM"); keys.use("MOMENTS");
+}
+
+OrientationSphere::OrientationSphere(const ActionOptions&ao):
+Action(ao),
+MultiColvarFunction(ao)
+{
+  // Resize everything that stores a vector now that we know the 
+  // number of components
+  unsigned ncomponents=getBaseMultiColvar(0)->getNumberOfQuantities() - 5;
+  catom_orient.resize( ncomponents ); 
+  catom_der.resize( ncomponents );
+  this_orient.resize( ncomponents ); 
+
+  // Weight of this does not have derivatives
+  weightHasDerivatives=false;
+  // Read in the switching function
+  std::string sw, errors; parse("SWITCH",sw);
+  if(sw.length()>0){
+     switchingFunction.set(sw,errors);
+  } else { 
+     double r_0=-1.0, d_0; int nn, mm;
+     parse("NN",nn); parse("MM",mm);
+     parse("R_0",r_0); parse("D_0",d_0);
+     if( r_0<0.0 ) error("you must set a value for R_0");
+     switchingFunction.set(nn,mm,r_0,d_0);
+  }
+  log.printf("  degree of overlap in orientation between central molecule and those within %s\n",( switchingFunction.description() ).c_str() );
+
+  // Finish the setup of the object
+  buildSymmetryFunctionLists( true );
+
+  // And check everything has been read in correctly
+  checkRead();
+}
+
+void OrientationSphere::calculateWeight(){
+  weightHasDerivatives=true;   // The weight has no derivatives really
+  setElementValue(1,1.0);
+} 
+
+double OrientationSphere::compute(){
+   // Make sure derivatives for central atom are only calculated once
+   VectorMultiColvar* vv = dynamic_cast<VectorMultiColvar*>( getBaseMultiColvar(0) );
+   vv->firstcall=true;
+
+   weightHasDerivatives=true;   // The weight has no derivatives really
+   double sw, value=0, denom=0, dot, f_dot, dot_df, dfunc; Vector distance;
+
+   getValueForBaseTask(0, catom_orient );
+   for(unsigned i=1;i<getNAtoms();++i){
+      distance=getSeparation( getPositionOfCentralAtom(0), getPositionOfCentralAtom(i) );
+      sw = switchingFunction.calculate( distance.modulo(), dfunc );
+      if( sw>=getTolerance() ){    
+         getValueForBaseTask( i, this_orient );
+         // Calculate the dot product wrt to this position 
+         dot=0; for(unsigned k=0;k<catom_orient.size();++k) dot+=catom_orient[k]*this_orient[k];  
+         f_dot = transformDotProduct( dot, dot_df ); 
+         // N.B. We are assuming here that the imaginary part of the dot product is zero
+         for(unsigned k=0;k<catom_orient.size();++k){
+            this_orient[k]*=sw*dot_df; catom_der[k]=sw*dot_df*catom_orient[k];
+         }  
+
+         // Set the derivatives wrt of the numerator
+         addOrientationDerivatives( 0, this_orient ); 
+         addOrientationDerivatives( i, catom_der );  
+         addCentralAtomsDerivatives( 0, 0, f_dot*(-dfunc)*distance );
+         addCentralAtomsDerivatives( i, 0, f_dot*(dfunc)*distance );
+         addBoxDerivatives( f_dot*(-dfunc)*Tensor(distance,distance) );
+         value += sw*f_dot;
+         // Set the derivatives wrt to the numerator
+         addCentralAtomsDerivatives( 0, 1, (-dfunc)*distance );
+         addCentralAtomsDerivatives( i, 1, (dfunc)*distance );
+         addBoxDerivativesOfWeight( (-dfunc)*Tensor(distance,distance) );
+         denom += sw;
+      } else {
+         removeAtomRequest( i, sw );   
+      }
+   }
+   
+   // Now divide everything
+   unsigned nder = getNumberOfDerivatives();
+   for(unsigned i=0;i<nder;++i){
+      setElementDerivative( i, getElementDerivative(i)/denom - (value*getElementDerivative(nder+i))/(denom*denom) );  
+      setElementDerivative( nder + i, 0.0 );
+   }
+   weightHasDerivatives=false;   // Weight has no derivatives we just use the holder for weight to store some stuff
+   return value / denom;
+}
+
+Vector OrientationSphere::getCentralAtom(){
+   addDerivativeOfCentralAtomPos( 0, Tensor::identity() );
+   return getPositionOfCentralAtom(0);
+}
+
+}
+}
+
diff --git a/src/crystallization/OrientationSphere.h b/src/crystallization/OrientationSphere.h
new file mode 100644
index 0000000000000000000000000000000000000000..fc0ade9b8ca666fda64fe4d59947b0e630b9ff29
--- /dev/null
+++ b/src/crystallization/OrientationSphere.h
@@ -0,0 +1,56 @@
+/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   Copyright (c) 2012 The plumed team
+   (see the PEOPLE file at the root of the distribution for a list of names)
+
+   See http://www.plumed-code.org for more information.
+
+   This file is part of plumed, version 2.0.
+
+   plumed is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   plumed is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with plumed.  If not, see <http://www.gnu.org/licenses/>.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+#ifndef __PLUMED_crystallization_OrientationSphere_h
+#define __PLUMED_crystallization_OrientationSphere_h
+
+#include "multicolvar/MultiColvarFunction.h"
+#include "tools/SwitchingFunction.h"
+
+#include <string>
+#include <cmath> 
+
+namespace PLMD {
+namespace crystallization {
+
+class OrientationSphere : public multicolvar::MultiColvarFunction {
+private:
+  std::vector<double> catom_orient, catom_der, this_orient;
+  std::vector<double> catom_iorient, catom_ider, this_iorient;
+  SwitchingFunction switchingFunction;
+public:
+  static void registerKeywords( Keywords& keys );
+  OrientationSphere(const ActionOptions&);
+  double compute();
+  void calculateWeight();
+  virtual double transformDotProduct( const double& dot, double& df );
+  Vector getCentralAtom();  
+  bool isPeriodic(){ return false; }
+};
+
+inline
+double OrientationSphere::transformDotProduct( const double& dot, double& df ){
+  df=1.0; return dot;
+}
+
+}
+}
+#endif
diff --git a/src/crystallization/Q4.cpp b/src/crystallization/Q4.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..17ec0189d011447d9caa930d9be5270b627c39db
--- /dev/null
+++ b/src/crystallization/Q4.cpp
@@ -0,0 +1,82 @@
+/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   Copyright (c) 2012 The plumed team
+   (see the PEOPLE file at the root of the distribution for a list of names)
+
+   See http://www.plumed-code.org for more information.
+
+   This file is part of plumed, version 2.0.
+
+   plumed is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   plumed is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with plumed.  If not, see <http://www.gnu.org/licenses/>.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+#include "Steinhardt.h"
+#include "LocalSteinhardt.h" 
+#include "core/ActionRegister.h"
+
+//+PLUMEDOC MCOLVAR Q4
+/*
+Calculate 4th order Steinhardt parameters.
+
+\par Examples
+
+*/
+//+ENDPLUMEDOC
+
+//+PLUMEDOC MCOLVARF LOCAL_Q4
+/*
+Calculate 4th order Steinhardt parameters.
+
+\par Examples
+
+*/
+//+ENDPLUMEDOC
+
+namespace PLMD {
+namespace crystallization {
+
+class Q4 : public Steinhardt {
+public:
+  static void registerKeywords( Keywords& keys );
+  Q4( const ActionOptions& ao );
+};
+
+PLUMED_REGISTER_ACTION(Q4,"Q4")
+typedef LocalSteinhardt<Q4> LOCAL_Q4;
+PLUMED_REGISTER_ACTION(LOCAL_Q4,"LOCAL_Q4")
+
+void Q4::registerKeywords( Keywords& keys ){
+  Steinhardt::registerKeywords( keys );
+}
+
+Q4::Q4(const ActionOptions& ao ):
+Action(ao),
+Steinhardt(ao)
+{
+  setAngularMomentum(4);
+
+  normaliz.resize( 5 );
+  normaliz[0] = sqrt( ( 9.0*24.0 ) / (4.0*pi*24.0) );
+  normaliz[1] = -sqrt( ( 9.0*6.0 ) / (4.0*pi*120.0) );
+  normaliz[2] = sqrt( ( 9.0*2.0) / (4.0*pi*720.0) );
+  normaliz[3] = -sqrt( ( 9.0*1) / (4.0*pi*5040.0) );
+  normaliz[4] = sqrt( (9.0*1) / (4.0*pi*40320.0) );
+
+  coeff_poly.resize( 5 ); 
+  coeff_poly[0]=0.375; coeff_poly[1]=0.0;
+  coeff_poly[2]=-3.75; coeff_poly[3]=0.0;
+  coeff_poly[4]=4.375; 
+}
+
+}
+}
+
diff --git a/src/crystallization/Q6.cpp b/src/crystallization/Q6.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1ac7d55cd79ef7cb514e272cc62066f6584dfba8
--- /dev/null
+++ b/src/crystallization/Q6.cpp
@@ -0,0 +1,85 @@
+/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   Copyright (c) 2012 The plumed team
+   (see the PEOPLE file at the root of the distribution for a list of names)
+
+   See http://www.plumed-code.org for more information.
+
+   This file is part of plumed, version 2.0.
+
+   plumed is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   plumed is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with plumed.  If not, see <http://www.gnu.org/licenses/>.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+#include "Steinhardt.h"
+#include "LocalSteinhardt.h"
+#include "core/ActionRegister.h"
+
+//+PLUMEDOC MCOLVAR Q6
+/*
+Calculate 6th order Steinhardt parameters.
+
+\par Examples
+
+*/
+//+ENDPLUMEDOC
+
+//+PLUMEDOC MCOLVARF LOCAL_Q6
+/*
+Calculate 4th order Steinhardt parameters.
+
+\par Examples
+
+*/
+//+ENDPLUMEDOC
+
+namespace PLMD {
+namespace crystallization {
+
+class Q6 : public Steinhardt {
+public:
+  static void registerKeywords( Keywords& keys );
+  Q6( const ActionOptions& ao );
+};
+
+PLUMED_REGISTER_ACTION(Q6,"Q6")
+typedef LocalSteinhardt<Q6> LOCAL_Q6;
+PLUMED_REGISTER_ACTION(LOCAL_Q6,"LOCAL_Q6")
+
+void Q6::registerKeywords( Keywords& keys ){
+  Steinhardt::registerKeywords( keys );
+}
+
+Q6::Q6(const ActionOptions& ao ):
+Action(ao),
+Steinhardt(ao)
+{
+  setAngularMomentum(6);
+
+  normaliz.resize( 7 );
+  normaliz[0] = sqrt( ( 13.0*720.0 ) / (4.0*pi*720.0) );
+  normaliz[1] = -sqrt( ( 13.0*120.0 ) / (4.0*pi*5040) );
+  normaliz[2] = sqrt( ( 13.0*24) / (4.0*pi*40320) );
+  normaliz[3] = -sqrt( ( 13.0*6) / (4.0*pi*362880) );
+  normaliz[4] = sqrt( (13.0*2) / (4.0*pi*3628800) );
+  normaliz[5] = -sqrt( (13.0*1) / (4.0*pi*39916800) );
+  normaliz[6] = sqrt( (13.0*1) / (4.0*pi*479001600) );
+
+  coeff_poly.resize( 7 ); 
+  coeff_poly[0]=-0.3125; coeff_poly[1]=0.0;
+  coeff_poly[2]=6.5625; coeff_poly[3]=0.0;
+  coeff_poly[4]=-19.6875; coeff_poly[5]=0.0;
+  coeff_poly[6]=14.4375; 
+}
+
+}
+}
+
diff --git a/src/crystallization/Steinhardt.cpp b/src/crystallization/Steinhardt.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..68412fd04341740764b25549715f17b568fcc71b
--- /dev/null
+++ b/src/crystallization/Steinhardt.cpp
@@ -0,0 +1,186 @@
+/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   Copyright (c) 2012 The plumed team
+   (see the PEOPLE file at the root of the distribution for a list of names)
+
+   See http://www.plumed-code.org for more information.
+
+   This file is part of plumed, version 2.0.
+
+   plumed is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   plumed is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with plumed.  If not, see <http://www.gnu.org/licenses/>.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+#include <complex>
+#include "Steinhardt.h"
+
+namespace PLMD {
+namespace crystallization {
+
+void Steinhardt::registerKeywords( Keywords& keys ){
+  VectorMultiColvar::registerKeywords( keys ); 
+  keys.add("compulsory","NN","12","The n parameter of the switching function ");
+  keys.add("compulsory","MM","24","The m parameter of the switching function ");
+  keys.add("compulsory","D_0","0.0","The d_0 parameter of the switching function");
+  keys.add("compulsory","R_0","The r_0 parameter of the switching function");
+  keys.add("optional","SWITCH","This keyword is used if you want to employ an alternative to the continuous swiching function defined above. "
+                               "The following provides information on the \\ref switchingfunction that are available. "
+                               "When this keyword is present you no longer need the NN, MM, D_0 and R_0 keywords.");
+  keys.use("SPECIES"); keys.use("SPECIESA"); keys.use("SPECIESB");
+  keys.use("MEAN"); keys.use("LESS_THAN"); keys.use("MORE_THAN");
+  keys.use("BETWEEN"); keys.use("HISTOGRAM"); keys.use("MOMENTS"); keys.use("MIN");
+}
+
+Steinhardt::Steinhardt( const ActionOptions& ao ):
+Action(ao),
+VectorMultiColvar(ao)
+{
+  // Read in the switching function
+  std::string sw, errors; parse("SWITCH",sw);
+  if(sw.length()>0){
+     switchingFunction.set(sw,errors);
+  } else {
+     double r_0=-1.0, d_0; int nn, mm;
+     parse("NN",nn); parse("MM",mm);
+     parse("R_0",r_0); parse("D_0",d_0);
+     if( r_0<0.0 ) error("you must set a value for R_0");
+     switchingFunction.set(nn,mm,r_0,d_0);
+  }
+  log.printf("  Steinhardt parameter of central atom and those within %s\n",( switchingFunction.description() ).c_str() );
+}
+
+void Steinhardt::setAngularMomentum( const unsigned& ang ){
+  tmom=ang; setVectorDimensionality( 2*ang + 1, true, 2 );
+} 
+
+void Steinhardt::calculateVector(){
+  double dfunc, dpoly_ass, md, tq6, itq6, real_z, imag_z; 
+  Vector distance, dz, myrealvec, myimagvec, real_dz, imag_dz;
+  // The square root of -1
+  std::complex<double> ii( 0.0, 1.0 ), dp_x, dp_y, dp_z;
+
+  double sw, poly_ass, dlen, nbond=0.0; std::complex<double> powered;
+  for(unsigned i=1;i<getNAtoms();++i){
+     distance=getSeparation( getPosition(0), getPosition(i) );
+     dlen=distance.modulo(); sw = switchingFunction.calculate( dlen, dfunc );
+     if( sw>=getTolerance() ){   
+         nbond += sw;  // Accumulate total number of bonds
+         double dlen3 = dlen*dlen*dlen;
+
+         // Store derivatives of weight
+         MultiColvarBase::addAtomsDerivatives( 0, getAtomIndex(0), (-dfunc)*distance );
+         MultiColvarBase::addAtomsDerivatives( 0, getAtomIndex(i), (+dfunc)*distance );
+         MultiColvarBase::addBoxDerivatives( 0, (-dfunc)*Tensor( distance,distance ) ); 
+
+         // Do stuff for m=0
+         poly_ass=deriv_poly( 0, distance[2]/dlen, dpoly_ass );
+         // Derivatives of z/r wrt x, y, z
+         dz = -( distance[2] / dlen3 )*distance; dz[2] += (1.0 / dlen);
+         // Derivative wrt to the vector connecting the two atoms
+         myrealvec = (+sw)*dpoly_ass*dz + poly_ass*(+dfunc)*distance;
+         // Accumulate the derivatives
+         addAtomsDerivative( tmom, 0, -myrealvec );      
+         addAtomsDerivative( tmom, i, myrealvec ); 
+         addBoxDerivatives( tmom, Tensor( -myrealvec,distance ) );
+         // And store the vector function
+         addComponent( tmom, sw*poly_ass );
+
+         // The complex number of which we have to take powers
+         std::complex<double> com1( distance[0]/dlen ,distance[1]/dlen );
+
+         // Do stuff for all other m values
+         for(unsigned m=1;m<=tmom;++m){
+             // Calculate Legendre Polynomial
+             poly_ass=deriv_poly( m, distance[2]/dlen, dpoly_ass );
+             // Calculate powe of complex number
+             powered=pow(com1,m-1); md=static_cast<double>(m);
+             // Real and imaginary parts of z
+             real_z = real(com1*powered); imag_z = imag(com1*powered );
+ 
+             // Calculate steinhardt parameter
+             tq6=poly_ass*real_z;   // Real part of steinhardt parameter
+             itq6=poly_ass*imag_z;  // Imaginary part of steinhardt parameter
+
+             // Derivatives wrt ( x/r + iy )^m
+             dp_x = md*powered*( (1.0/dlen)-(distance[0]*distance[0])/dlen3-ii*(distance[0]*distance[1])/dlen3 );
+             dp_y = md*powered*( ii*(1.0/dlen)-(distance[0]*distance[1])/dlen3-ii*(distance[1]*distance[1])/dlen3 );
+             dp_z = md*powered*( -(distance[0]*distance[2])/dlen3-ii*(distance[1]*distance[2])/dlen3 );
+
+             // Derivatives of real and imaginary parts of above
+             real_dz[0] = real( dp_x ); real_dz[1] = real( dp_y ); real_dz[2] = real( dp_z );
+             imag_dz[0] = imag( dp_x ); imag_dz[1] = imag( dp_y ); imag_dz[2] = imag( dp_z );  
+
+             // Complete derivative of steinhardt parameter
+             myrealvec = (+sw)*dpoly_ass*real_z*dz + (+dfunc)*distance*tq6 + (+sw)*poly_ass*real_dz; 
+             myimagvec = (+sw)*dpoly_ass*imag_z*dz + (+dfunc)*distance*itq6 + (+sw)*poly_ass*imag_dz;
+
+             // Real part
+             addComponent( tmom+m, sw*tq6 );
+             addAtomsDerivative( tmom+m, 0, -myrealvec );
+             addAtomsDerivative( tmom+m, i, myrealvec );
+             addBoxDerivatives( tmom+m, Tensor( -myrealvec,distance ) );
+             // Imaginary part 
+             addImaginaryComponent( tmom+m, sw*itq6 );
+             addImaginaryAtomsDerivative( tmom+m, 0, -myimagvec );
+             addImaginaryAtomsDerivative( tmom+m, i, myimagvec );
+             addImaginaryBoxDerivatives( tmom+m, Tensor( -myimagvec,distance ) );
+             // Store -m part of vector
+             double pref=pow(-1.0,m); 
+             // -m part of vector is just +m part multiplied by (-1.0)**m and multiplied by complex
+             // conjugate of Legendre polynomial
+             // Real part
+             addComponent( tmom-m, pref*sw*tq6 );
+             addAtomsDerivative( tmom-m, 0, -pref*myrealvec );
+             addAtomsDerivative( tmom-m, i, pref*myrealvec );
+             addBoxDerivatives( tmom-m, pref*Tensor( -myrealvec,distance ) );
+             // Imaginary part
+             addImaginaryComponent( tmom-m, -pref*sw*itq6 );
+             addImaginaryAtomsDerivative( tmom-m, 0, pref*myimagvec );
+             addImaginaryAtomsDerivative( tmom-m, i, -pref*myimagvec );
+             addImaginaryBoxDerivatives( tmom-m, pref*Tensor( myimagvec,distance ) );
+         }
+     } else {
+         removeAtomRequest( i, sw );
+     }
+  } 
+
+  // Normalize 
+  setElementValue(0, nbond ); updateActiveAtoms();
+  for(unsigned i=0;i<2*getNumberOfComponentsInVector();++i) quotientRule( 5+i, 0, 5+i ); 
+  // Clear tempory stuff
+  clearDerivativesAfterTask(0);
+}
+
+double Steinhardt::deriv_poly( const unsigned& m, const double& val, double& df ){
+  double fact=1.0;
+  for(unsigned j=1;j<=m;++j) fact=fact*j;
+  double res=coeff_poly[m]*fact;
+
+  double pow=1.0, xi=val, dxi=1.0; df=0.0;
+  for(int i=m+1;i<=tmom;++i){
+      double fact=1.0;
+      for(unsigned j=i-m+1;j<=i;++j) fact=fact*j;
+      res=res+coeff_poly[i]*fact*xi;
+      df = df + pow*coeff_poly[i]*fact*dxi;
+      xi=xi*val; dxi=dxi*val; pow+=1.0;
+  }
+  df = df*normaliz[m];
+  return normaliz[m]*res;
+}
+
+Vector Steinhardt::getCentralAtom(){
+  addCentralAtomDerivatives( 0, Tensor::identity() );
+  return getPosition(0);
+
+}
+
+}
+}
diff --git a/src/crystallization/Steinhardt.h b/src/crystallization/Steinhardt.h
new file mode 100644
index 0000000000000000000000000000000000000000..b62d90e8ad089b1e60fb18692888049945f06463
--- /dev/null
+++ b/src/crystallization/Steinhardt.h
@@ -0,0 +1,50 @@
+/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   Copyright (c) 2012 The plumed team
+   (see the PEOPLE file at the root of the distribution for a list of names)
+
+   See http://www.plumed-code.org for more information.
+
+   This file is part of plumed, version 2.0.
+
+   plumed is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   plumed is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with plumed.  If not, see <http://www.gnu.org/licenses/>.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+#ifndef __PLUMED_crystallization_Steinhardt_h
+#define __PLUMED_crystallization_Steinhardt_h
+
+#include <complex>
+#include "tools/SwitchingFunction.h"
+#include "VectorMultiColvar.h"
+
+namespace PLMD {
+namespace crystallization {
+
+class Steinhardt : public VectorMultiColvar {
+private:
+  unsigned tmom;
+  SwitchingFunction switchingFunction;
+protected:
+  std::vector<double> coeff_poly;
+  std::vector<double> normaliz;
+  void setAngularMomentum( const unsigned& ang );
+public:
+  static void registerKeywords( Keywords& keys );
+  Steinhardt( const ActionOptions& ao );
+  void calculateVector();
+  Vector getCentralAtom();
+  double deriv_poly( const unsigned&, const double&, double& );
+};
+
+}
+}
+#endif
diff --git a/src/crystallization/StoreVectorsVessel.cpp b/src/crystallization/StoreVectorsVessel.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..64fbff836defa1c65a47171f957a1470dc6d6abe
--- /dev/null
+++ b/src/crystallization/StoreVectorsVessel.cpp
@@ -0,0 +1,149 @@
+/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   Copyright (c) 2012 The plumed team
+   (see the PEOPLE file at the root of the distribution for a list of names)
+
+   See http://www.plumed-code.org for more information.
+
+   This file is part of plumed, version 2.0.
+
+   plumed is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   plumed is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with plumed.  If not, see <http://www.gnu.org/licenses/>.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+#include "vesselbase/VesselRegister.h"
+#include "vesselbase/ActionWithVessel.h"
+#include "multicolvar/MultiColvarFunction.h"
+#include "StoreVectorsVessel.h"
+#include "VectorMultiColvar.h"
+
+namespace PLMD {
+namespace crystallization{
+
+void StoreVectorsVessel::registerKeywords( Keywords& keys ){
+  vesselbase::StoreDataVessel::registerKeywords(keys);
+}
+
+StoreVectorsVessel::StoreVectorsVessel( const vesselbase::VesselOptions& da ):
+StoreDataVessel(da),
+store_director(false)
+{
+  vecs=dynamic_cast<VectorMultiColvar*>( getAction() );
+  plumed_assert( vecs );
+  if( vecs->complexvec ) ncomponents=2*vecs->ncomponents;  
+  else ncomponents = vecs->ncomponents;   
+
+  completeSetup( 5, ncomponents ); myfvec.resize( ncomponents );
+}
+
+void StoreVectorsVessel::usedInFunction( const bool& store ){
+  store_director=store; resize();
+}
+
+void StoreVectorsVessel::recompute( const unsigned& ivec, const unsigned& jstore ){
+  plumed_dbg_assert( usingLowMem() ); 
+  // Set the task we want to reperform
+  setTaskToRecompute( ivec );
+  // Reperform the task
+  vecs->performTask();
+  // Store the derivatives
+  storeDerivativesLowMem( jstore );
+  // Normalize the vector if it is required
+  if( store_director ) normalizeVector( jstore ); 
+  // Clear up afterwards
+  vecs->clearAfterTask();
+
+}
+
+bool StoreVectorsVessel::calculate(){
+  storeValues( vecs->getCurrentPositionInTaskList() );  // Store the values of the components of the vector
+
+  if(!store_director) return true;
+  if( !usingLowMem() ) normalizeVector( vecs->getCurrentPositionInTaskList() );
+  else normalizeVector( -1 );  // Ensures vector components are normalized 
+  return true;
+}
+
+void StoreVectorsVessel::normalizeVector( const int& jstore ){
+  unsigned myelem = vecs->getCurrentPositionInTaskList();
+  bool lowmemory = usingLowMem(); double norm2=0.0, norm;
+  
+  if( (lowmemory && jstore<0) || !lowmemory ){
+     for(unsigned icomp=0;icomp<ncomponents;++icomp) norm2 += getComponent( myelem, icomp ) * getComponent( myelem, icomp );
+     norm=sqrt( norm2 ); 
+     for(unsigned icomp=0;icomp<ncomponents;++icomp){
+        myfvec[icomp]=getComponent( myelem, icomp );      
+        setComponent( myelem, icomp, getComponent( myelem, icomp ) / norm );
+     }
+  } else {
+     for(unsigned icomp=0;icomp<ncomponents;++icomp){
+        myfvec[icomp] = vecs->getElementValue( 5+icomp ); norm2 += myfvec[icomp] * myfvec[icomp];
+     }
+     norm=sqrt( norm2 );
+  }
+  double norm3=norm2*norm, weight = 1.0 / norm, wdf = -1.0 / norm3;
+
+  if( !lowmemory ) {
+      plumed_dbg_assert( jstore<getAction()->getFullNumberOfTasks() );
+      for(unsigned ider=0;ider<getNumberOfDerivatives(myelem);++ider){
+          double comp2=0.0; unsigned ibuf = myelem * ncomponents * getNumberOfDerivativeSpacesPerComponent() + 1 + ider;
+          for(unsigned jcomp=0;jcomp<ncomponents;++jcomp){
+              comp2  += myfvec[jcomp]*getBufferElement(ibuf);
+              ibuf += getNumberOfDerivativeSpacesPerComponent();
+          }
+          ibuf = myelem * ncomponents * getNumberOfDerivativeSpacesPerComponent() + 1 + ider;
+          for(unsigned jcomp=0;jcomp<ncomponents;++jcomp){
+             setBufferElement( ibuf, weight*getBufferElement(ibuf) + wdf*comp2*myfvec[jcomp] );
+             ibuf += getNumberOfDerivativeSpacesPerComponent();
+          }
+      }
+  } else if( jstore>0 ) {
+      unsigned maxder = vecs->getNumberOfDerivatives();
+      for(unsigned ider=0;ider<getNumberOfDerivatives(jstore);++ider){
+          double comp2=0.0; unsigned ibuf = jstore * ncomponents * maxder + ider;
+          for(unsigned jcomp=0;jcomp<ncomponents;++jcomp){
+              comp2 += myfvec[jcomp]*getLocalDerivative( ibuf );    
+              ibuf += maxder;
+          }
+          ibuf = jstore * ncomponents * maxder + ider;
+          for(unsigned jcomp=0;jcomp<ncomponents;++jcomp){
+             setLocalDerivative( ibuf,  weight*getLocalDerivative( ibuf ) + wdf*comp2*myfvec[jcomp] ); 
+             ibuf += maxder;
+          }
+      }
+  }
+}
+
+void StoreVectorsVessel::chainRuleForComponent( const unsigned& icolv, const unsigned& jin, const unsigned& jout, const unsigned& base_cv_no, 
+                                                const double& weight, multicolvar::MultiColvarFunction* funcout ){
+  if( usingLowMem() ){
+     unsigned ibuf = ( icolv*ncomponents + jin ) * getAction()->getNumberOfDerivatives();
+     for(unsigned ider=0;ider<getNumberOfDerivatives(icolv);++ider){
+         funcout->addStoredDerivative( jout, base_cv_no, getStoredIndex( icolv, ider ), weight*getLocalDerivative(ibuf+ider) );
+     }                                         
+  } else {
+     unsigned ibuf = (icolv*ncomponents + jin ) * getNumberOfDerivativeSpacesPerComponent() + 1;
+     for(unsigned ider=0;ider<getNumberOfDerivatives(icolv);++ider){
+         funcout->addStoredDerivative( jout, base_cv_no, getStoredIndex( icolv, ider ), weight*getBufferElement(ibuf+ider) );
+     }   
+  }  
+}
+
+void StoreVectorsVessel::chainRuleForVector( const unsigned& icolv, const unsigned& jout, const unsigned& base_cv_no, 
+                                             const std::vector<double>& df, multicolvar::MultiColvarFunction* funcout ){ 
+   chainRule( icolv, df );
+   for(unsigned ider=0;ider<getNumberOfDerivatives(icolv);++ider){
+       funcout->addStoredDerivative( jout, base_cv_no, getStoredIndex( icolv, ider ), getFinalDerivative(ider) );
+   }
+}
+
+}
+}
diff --git a/src/crystallization/StoreVectorsVessel.h b/src/crystallization/StoreVectorsVessel.h
new file mode 100644
index 0000000000000000000000000000000000000000..ba523fbbcc8b2f31fe97ab91acc1af907532f5f0
--- /dev/null
+++ b/src/crystallization/StoreVectorsVessel.h
@@ -0,0 +1,76 @@
+/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   Copyright (c) 2012 The plumed team
+   (see the PEOPLE file at the root of the distribution for a list of names)
+
+   See http://www.plumed-code.org for more information.
+
+   This file is part of plumed, version 2.0.
+
+   plumed is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   plumed is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with plumed.  If not, see <http://www.gnu.org/licenses/>.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+#ifndef __PLUMED_crystallization_StoreVectorsVessel_h
+#define __PLUMED_crystallization_StoreVectorsVessel_h
+
+#include "tools/DynamicList.h"
+#include "vesselbase/StoreDataVessel.h" 
+
+namespace PLMD {
+
+class multicolvar::MultiColvarFunction;
+
+namespace crystallization {
+
+class VectorMultiColvar;
+
+class StoreVectorsVessel : public vesselbase::StoreDataVessel {
+friend class VectorMultiColvar;
+private:
+/// We want to store the director rather than the value
+  bool store_director; 
+  unsigned ncomponents;
+  std::vector<double> myfvec;
+  VectorMultiColvar* vecs;
+  void normalizeVector( const int& );
+public:
+  static void registerKeywords( Keywords& keys );
+/// Constructor
+  StoreVectorsVessel( const vesselbase::VesselOptions& );
+/// This turns on the full use of this action for storage
+  void usedInFunction( const bool& );
+/// This makes sure vectors are normalized (they are already stored)
+  bool calculate();
+/// This reperforms a calculation
+  void recompute( const unsigned& , const unsigned& );
+/// This does nothing
+  std::string description(){ return ""; }
+/// Get the orientation of the ith vector
+  void getVector( const unsigned& , std::vector<double>& );
+/// Chain rule for component
+  void chainRuleForComponent( const unsigned& , const unsigned& , const unsigned& jout, const unsigned& , const double& , multicolvar::MultiColvarFunction* );
+/// Chain rule for whole vector
+  void chainRuleForVector( const unsigned& , const unsigned& , const unsigned& , const std::vector<double>& , multicolvar::MultiColvarFunction* );
+};
+
+inline
+void StoreVectorsVessel::getVector( const unsigned& imol, std::vector<double>& vec ){
+  plumed_dbg_assert( vec.size()==getNumberOfComponents() );
+  for(unsigned i=0;i<getNumberOfComponents();++i) vec[i]=getComponent( imol, i );
+}
+
+
+
+}
+}
+#endif
+
diff --git a/src/crystallization/VectorAverage.cpp b/src/crystallization/VectorAverage.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d1cf4007256a6e543915f12fd677e47627968e78
--- /dev/null
+++ b/src/crystallization/VectorAverage.cpp
@@ -0,0 +1,162 @@
+/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   Copyright (c) 2012 The plumed team
+   (see the PEOPLE file at the root of the distribution for a list of names)
+
+   See http://www.plumed-code.org for more information.
+
+   This file is part of plumed, version 2.0.
+
+   plumed is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   plumed is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with plumed.  If not, see <http://www.gnu.org/licenses/>.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+#include "core/ActionWithValue.h"
+#include "core/ActionRegister.h"
+#include "core/PlumedMain.h"
+#include "core/ActionSet.h"
+#include "vesselbase/BridgeVessel.h"
+#include "vesselbase/ActionWithVessel.h"
+#include "VectorMultiColvar.h"
+
+//+PLUMEDOC MCOLVARF AVERAGE_VECTOR
+/*
+Calculate an average vector
+
+\par Examples
+
+*/
+//+ENDPLUMEDOC
+
+namespace PLMD {
+namespace crystallization {
+
+class VectorAverage : 
+  public PLMD::ActionWithValue,
+  public vesselbase::ActionWithVessel
+{
+private:
+  vesselbase::BridgeVessel* myBridgeVessel;
+  VectorMultiColvar* mycolv;
+  std::vector<double> values, derivatives;
+public:
+  static void registerKeywords( Keywords& keys );
+  VectorAverage(const ActionOptions&ao);
+/// Don't actually clear the derivatives when this is called from plumed main.  
+/// They are calculated inside another action and clearing them would be bad  
+  void clearDerivatives(){}
+  void doJobsRequiredBeforeTaskList();
+  unsigned getNumberOfDerivatives();
+  void performTask();
+  void finishComputations();
+  void calculate(){}
+  void apply();
+  void calculateNumericalDerivatives( ActionWithValue* a=NULL );
+  bool isPeriodic();
+  void deactivate_task();
+};
+
+PLUMED_REGISTER_ACTION(VectorAverage,"AVERAGE_VECTOR")
+
+void VectorAverage::registerKeywords( Keywords& keys ){
+  Action::registerKeywords( keys );
+  ActionWithValue::registerKeywords( keys );
+  ActionWithVessel::registerKeywords( keys );
+  keys.add("compulsory","ARG","the label of the action that calculates the vectors we are interested in averaging");
+}
+
+VectorAverage::VectorAverage(const ActionOptions&ao):
+Action(ao),
+ActionWithValue(ao),
+ActionWithVessel(ao)
+{
+  std::string mlab; parse("ARG",mlab);
+  mycolv = plumed.getActionSet().selectWithLabel<crystallization::VectorMultiColvar*>(mlab);
+  if(!mycolv) error("action labeled " + mlab + " does not exist or is not a multicolvar");
+  std::string functype=mycolv->getName();
+  log.printf("  calculating average %s vector\n",functype.c_str() );
+
+  if( checkNumericalDerivatives() ){
+      // If we use numerical derivatives we have to force the base
+      // multicolvar to also use numerical derivatives
+      ActionWithValue* vv=dynamic_cast<ActionWithValue*>( mycolv );
+      plumed_assert( vv ); vv->useNumericalDerivatives();
+  }
+
+  // Now set up the bridging vessel (has to be done this way for internal arrays to be resized properly)
+  addDependency(mycolv); myBridgeVessel = mycolv->addBridgingVessel( this );
+  // And create value
+  addValueWithDerivatives(); setNotPeriodic(); 
+  // Resize everything
+  unsigned nder = mycolv->getNumberOfDerivatives();
+  unsigned ncomp = mycolv->getNumberOfQuantities() - 5;
+  values.resize( ncomp ); derivatives.resize( ncomp*nder );
+  getPntrToComponent(0)->resizeDerivatives( nder );
+}
+
+void VectorAverage::doJobsRequiredBeforeTaskList(){
+  ActionWithValue::clearDerivatives(); 
+  values.assign( values.size(), 0.0 );
+  derivatives.assign( derivatives.size(), 0.0 );
+}
+
+unsigned VectorAverage::getNumberOfDerivatives(){
+  return mycolv->getNumberOfDerivatives();
+}
+
+void VectorAverage::performTask(){
+  unsigned nder=mycolv->getNumberOfDerivatives();
+  for(unsigned i=5;i<mycolv->getNumberOfQuantities();++i){
+     values[i-5] += mycolv->getElementValue( i ); 
+     unsigned nl=(i-5)*nder, nj=i*nder;
+     for(unsigned j=0;j<mycolv->getNumberOfDerivatives();++j){
+         derivatives[nl+j] += mycolv->getElementDerivative( nj + j );
+     }
+  }
+}
+
+void VectorAverage::finishComputations(){
+  comm.Sum( values ); comm.Sum( derivatives ); 
+  double norm = static_cast<double>( mycolv->getFullNumberOfTasks() );
+  double sum=0; unsigned nder = mycolv->getNumberOfDerivatives();
+  for(unsigned i=0;i<values.size();++i){ values[i]/=norm; sum+=values[i]*values[i]; }
+
+  double inorm = 1.0 / ( norm*sqrt(sum) );
+  Value* val=getPntrToComponent(0); val->set( sqrt(sum) ); 
+  for(unsigned icomp=0;icomp<values.size();++icomp){
+     for(unsigned jder=0;jder<mycolv->getNumberOfDerivatives();++jder){
+        val->addDerivative( jder, inorm*values[icomp]*derivatives[nder*icomp+jder] );
+     }
+  }
+}
+
+void VectorAverage::apply(){
+  Value* val=getPntrToComponent(0); 
+  std::vector<double> tforces( mycolv->getNumberOfDerivatives(), 0 );
+  if( val->applyForce( tforces ) ) mycolv->addForcesOnAtoms( tforces );
+}
+
+void VectorAverage::calculateNumericalDerivatives( ActionWithValue* a ){
+  myBridgeVessel->completeNumericalDerivatives();
+}
+
+bool VectorAverage::isPeriodic(){
+  plumed_merror("This should never be called");
+  return mycolv->isPeriodic();
+}
+
+void VectorAverage::deactivate_task(){
+  plumed_merror("This should never be called");
+}
+
+
+}
+}
diff --git a/src/crystallization/VectorMultiColvar.cpp b/src/crystallization/VectorMultiColvar.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..07fe7758241817fecc13c553e4ab5eab2d481d11
--- /dev/null
+++ b/src/crystallization/VectorMultiColvar.cpp
@@ -0,0 +1,193 @@
+/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   Copyright (c) 2012 The plumed team
+   (see the PEOPLE file at the root of the distribution for a list of names)
+
+   See http://www.plumed-code.org for more information.
+
+   This file is part of plumed, version 2.0.
+
+   plumed is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   plumed is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with plumed.  If not, see <http://www.gnu.org/licenses/>.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+#include "multicolvar/MultiColvarFunction.h"
+#include "VectorMultiColvar.h"
+
+namespace PLMD {
+namespace crystallization {
+
+void VectorMultiColvar::registerKeywords( Keywords& keys ){
+  MultiColvar::registerKeywords( keys );
+}
+
+VectorMultiColvar::VectorMultiColvar(const ActionOptions& ao):
+PLUMED_MULTICOLVAR_INIT(ao),
+firstcall(false),
+vecs(NULL)
+{
+  setLowMemOption(true);
+}
+
+void VectorMultiColvar::setVectorDimensionality( const unsigned& ncomp, const bool& comp, const int& nat ){
+  // Store number of derivatives and if vectors are complex
+  ncomponents = ncomp; complexvec=comp; 
+  if(complexvec) dervec.resize( 2*ncomponents );
+  else dervec.resize( ncomponents );
+  // Read in the atoms if we are using multicolvar reading
+  int natoms=nat; readAtoms( natoms );
+  // Create the store vector object
+  std::string param; vesselbase::VesselOptions da("","",0,param,this);
+  Keywords keys; StoreVectorsVessel::registerKeywords( keys );
+  vesselbase::VesselOptions da2(da,keys);
+  vecs = new StoreVectorsVessel(da2);
+  // Add the vessel to the base
+  addVessel(vecs);
+  // Read in any vessels
+  readVesselKeywords();
+  // Resize a holder for the derivatives of the norm of the vector
+}
+
+double VectorMultiColvar::doCalculation(){
+  // Now calculate the vector
+  calculateVector();
+  // Sort out the active derivatives
+  updateActiveAtoms();
+
+  // Now calculate the norm of the vector (this is what we return here)
+  double norm=0, inorm;
+  if(complexvec){
+     for(unsigned i=0;i<ncomponents;++i) norm += getComponent(i)*getComponent(i) + getImaginaryComponent(i)*getImaginaryComponent(i); 
+     norm=sqrt(norm); inorm = 1.0 / norm;
+     for(unsigned i=0;i<ncomponents;++i){ dervec[i] = inorm*getComponent(i); dervec[ncomponents+i] = inorm*getImaginaryComponent(i); } 
+  } else {
+     for(unsigned i=0;i<ncomponents;++i) norm += getComponent(i)*getComponent(i);
+     norm=sqrt(norm); inorm = 1.0 / norm;
+     for(unsigned i=0;i<ncomponents;++i) dervec[i] = inorm*getComponent(i); 
+  }
+
+  if( usingLowMem() ){
+     vecs->storeDerivativesLowMem( 0 );
+     vecs->chainRule( 0, dervec );
+  } else {
+     vecs->storeDerivativesHighMem( getCurrentPositionInTaskList() );
+     vecs->chainRule( getCurrentPositionInTaskList(), dervec );
+  }
+
+  // Add derivatives to base multicolvars
+  Vector tmpd;
+  for(unsigned i=0;i<atoms_with_derivatives.getNumberActive();++i){
+       unsigned k=atoms_with_derivatives[i];
+       tmpd[0]=vecs->getFinalDerivative(3*i+0); 
+       tmpd[1]=vecs->getFinalDerivative(3*i+1); 
+       tmpd[2]=vecs->getFinalDerivative(3*i+2); 
+       MultiColvarBase::addAtomsDerivatives( 0, k, tmpd );
+  }   
+  unsigned vvbase=3*atoms_with_derivatives.getNumberActive(); Tensor tmpv;
+  for(unsigned i=0;i<3;++i){
+      for(unsigned j=0;j<3;++j){
+          tmpv(i,j) = vecs->getFinalDerivative( vvbase+3*i+j ); 
+      }   
+  }   
+  MultiColvarBase::addBoxDerivatives( 0, tmpv );
+
+  
+  return norm;
+}
+
+void VectorMultiColvar::useInMultiColvarFunction( const bool store_director ){
+  if( setupCentralAtomVessel() ) return;
+  vecs->usedInFunction( store_director );
+}
+
+void VectorMultiColvar::getValueForTask( const unsigned& iatom, std::vector<double>& vals ) const {
+  vecs->getVector( iatom, vals );
+}
+
+void VectorMultiColvar::addWeightedValueDerivatives( const unsigned& iatom, const unsigned& base_cv_no, const double& weight, multicolvar::MultiColvarFunction* func ){
+  if( usingLowMem() ){
+     vecs->recompute( iatom, 1 ); 
+     for(unsigned j=0;j<getNumberOfQuantities()-5;++j) vecs->chainRuleForComponent( 1, j, 5+j, base_cv_no, weight, func );
+  } else {
+     for(unsigned j=0;j<getNumberOfQuantities()-5;++j) vecs->chainRuleForComponent( iatom, j, 5+j, base_cv_no, weight, func );
+  }
+}
+
+void VectorMultiColvar::finishWeightedAverageCalculation( multicolvar::MultiColvarFunction* func ){
+  // And calculate the norm of the vector
+  double norm=0, inorm; std::vector<unsigned> tmpindices( 1 + func->getNumberOfDerivatives() );
+  if(complexvec){
+     for(unsigned i=0;i<ncomponents;++i){
+        // Calculate average vector
+        func->quotientRule(5+i, 1, 5+i); func->quotientRule(5+ncomponents+i, 1, 5+ncomponents+i);
+        // Calculate length of vector
+        norm += func->getElementValue(5+i)*func->getElementValue(5+i) + func->getElementValue(5+ncomponents+i)*func->getElementValue(5+ncomponents+i);
+     }
+     norm=sqrt(norm); inorm = 1.0 / norm;
+     for(unsigned i=0;i<ncomponents;++i){ 
+        dervec[i] = inorm*func->getElementValue(5+i); dervec[ncomponents+i] = inorm*func->getElementValue(5+ncomponents+i); 
+     }
+     func->getIndexList( 1, 0, func->getNumberOfDerivatives(), tmpindices );
+     unsigned nder = func->getNumberOfDerivatives();
+     for(unsigned i=0;i<tmpindices[0];++i){
+         unsigned ind = tmpindices[1+i];
+         for(unsigned j=0;j<ncomponents;++j){
+             func->addElementDerivative( ind, dervec[j]*func->getElementDerivative(nder*(5+j) + ind) );
+             func->addElementDerivative( ind, dervec[ncomponents+j]*func->getElementDerivative(nder*(5+ncomponents+j) + ind) );
+         }
+     }
+  } else {
+     for(unsigned i=0;i<ncomponents;++i){
+         // Calculate average vector
+         func->quotientRule(5+i, 1, 5+i);
+         // Calculate length of vector
+         norm += func->getElementValue(5+i)*func->getElementValue(5+i);
+     }
+     norm=sqrt(norm); inorm = 1.0 / norm;
+     for(unsigned i=0;i<ncomponents;++i) dervec[i] = inorm*func->getElementValue(5+i); 
+     func->getIndexList( 1, 0, func->getNumberOfDerivatives(), tmpindices );
+     // And set derivatives given magnitude of the vector
+     unsigned nder = func->getNumberOfDerivatives();
+     for(unsigned i=0;i<tmpindices[0];++i){
+         unsigned ind = tmpindices[1+i];
+         for(unsigned j=0;j<ncomponents;++j){
+             func->addElementDerivative( ind, dervec[j]*func->getElementDerivative(nder*(5+j) + ind) );
+         }
+     }
+  }
+  func->setElementValue( 0, norm );
+}
+
+void VectorMultiColvar::addOrientationDerivativesToBase( const unsigned& iatom, const unsigned& jstore, const unsigned& base_cv_no, 
+                                                         const std::vector<double>& der, multicolvar::MultiColvarFunction* func ){
+  if( usingLowMem() ){
+      if(jstore==1){
+         if(firstcall){ vecs->recompute( iatom, jstore ); firstcall=false; }
+         vecs->chainRuleForVector( jstore, 0, base_cv_no, der, func );
+      } else {
+         vecs->recompute( iatom, jstore );
+         vecs->chainRuleForVector( jstore, 0, base_cv_no, der, func );
+      }
+  } else {
+      vecs->chainRuleForVector( iatom, 0, base_cv_no, der, func );
+  }
+}
+
+void VectorMultiColvar::addForcesOnAtoms( const std::vector<double>& inforces ){
+  plumed_dbg_assert( inforces.size()==getNumberOfDerivatives() );
+  std::vector<double> oldforces( getNumberOfDerivatives() ); 
+  getForcesFromVessels( oldforces ); 
+  for(unsigned i=0;i<getNumberOfDerivatives();++i) oldforces[i]+=inforces[i];
+  setForcesOnAtoms( oldforces );
+}
+
+}
+}
diff --git a/src/crystallization/VectorMultiColvar.h b/src/crystallization/VectorMultiColvar.h
new file mode 100644
index 0000000000000000000000000000000000000000..def504e4c07eb794e46a1e1180c7f6cbb74c3fd1
--- /dev/null
+++ b/src/crystallization/VectorMultiColvar.h
@@ -0,0 +1,189 @@
+/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   Copyright (c) 2012 The plumed team
+   (see the PEOPLE file at the root of the distribution for a list of names)
+
+   See http://www.plumed-code.org for more information.
+
+   This file is part of plumed, version 2.0.
+
+   plumed is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   plumed is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with plumed.  If not, see <http://www.gnu.org/licenses/>.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+#ifndef __PLUMED_crystallization_VectorMultiColvar_h
+#define __PLUMED_crystallization_VectorMultiColvar_h
+
+#include "tools/Matrix.h"
+#include "multicolvar/MultiColvar.h"
+#include "StoreVectorsVessel.h"
+
+namespace PLMD {
+namespace crystallization {
+
+class VectorMultiColvar : public multicolvar::MultiColvar {
+friend class StoreVectorsVessel;
+friend class OrientationSphere;
+friend class VectorAverage;
+private:
+/// Are the vectors complex
+  bool complexvec;
+/// Used to make sure central atom position is only calculated
+/// once when using orientation sphere
+  bool firstcall;
+/// How many components does the vector have
+  unsigned ncomponents;
+/// This object stores the vectors
+  StoreVectorsVessel* vecs;
+/// This is a tempory vector that is used to store derivatives
+  std::vector<double> dervec;
+protected:
+/// Set the dimensionality of the vector
+  void setVectorDimensionality( const unsigned&, const bool&, const int& );
+/// Add some value to the ith component of the vector
+  void addComponent( const unsigned&, const double& );
+/// Get the ith component
+  double getComponent( const unsigned& ) const ;
+/// Set the ith component
+  void setComponent( const unsigned&, const double& );
+/// Add derivatives of ith component of vector with repect to jth atom
+  void addAtomsDerivative( const unsigned&, const unsigned&, const Vector& );
+/// Add atomic derivatives to all components of matrix (note iatom is treated literally here - cf above)
+  void addAtomDerivativeToAllRealComponents( const unsigned& iatom, const std::vector<double>& vec, const Vector& avec );
+/// Add derivatives of ith component of vector with respect to the box 
+  void addBoxDerivatives( const unsigned&, const Tensor& );
+/// Add box derivatives to all components of matrix
+  void addBoxDerivativesToAllRealComponents( const std::vector<double>& vec, const Tensor& avec );
+/// Add some value to the imaginary part of the ith component of the vector
+  void addImaginaryComponent( const unsigned&, const double& );
+/// Get the ith component
+  double getImaginaryComponent( const unsigned& ) const ;
+/// Set the ith component
+  void setImaginaryComponent( const unsigned&, const double& );
+/// Add derivatives of the imaginary part of the ith component of vector with repect to jth atom
+  void addImaginaryAtomsDerivative( const unsigned&, const unsigned&, const Vector& );
+/// Add atomic derivatives to all components of matrix (note iatom is treated literally here - cf above)
+  void addAtomDerivativeToAllImagComponents( const unsigned& iatom, const std::vector<double>& vec, const Vector& avec );
+/// Add derivatives of the imaginary part of the ith component of vector with respect to the box 
+  void addImaginaryBoxDerivatives( const unsigned&, const Tensor& );
+/// Add box derivatives to all components of matrix
+  void addBoxDerivativesToAllImagComponents( const std::vector<double>& vec, const Tensor& avec );
+/// This can be used to accumulate derivative from a store of vectors
+  void accumulateDerivativesFromVector( const unsigned& ivec, const unsigned& base_cv_no, const double& weight, StoreVectorsVessel* vectors );
+/// Used in vector average to add forces from vector the the forces from here
+  void addForcesOnAtoms( const std::vector<double>& inforces );
+public:
+  static void registerKeywords( Keywords& keys );
+  VectorMultiColvar(const ActionOptions&);
+  ~VectorMultiColvar(){}
+/// The norm of a vector is not periodic
+  virtual bool isPeriodic(){ return false; }
+/// Calculate the multicolvar
+  double doCalculation();
+/// This shouldn't do anything
+  double compute(){ plumed_error(); }
+/// Calculate the vector
+  virtual void calculateVector()=0;
+/// Get the number of components in the vector
+  unsigned getNumberOfComponentsInVector() const ;
+/// Get the number of quantities we are calculating per step
+  unsigned getNumberOfQuantities();
+/// Store bits and bobs so they can be used in a function
+  void useInMultiColvarFunction( const bool store_director );
+/// Get the vector
+  void getValueForTask( const unsigned& iatom, std::vector<double>& vals ) const ;
+/// Used to accumulate values
+  void addWeightedValueDerivatives( const unsigned& iatom, const unsigned& base_cv_no, const double& weight, multicolvar::MultiColvarFunction* func );
+/// Used for calculating weighted averages
+  void finishWeightedAverageCalculation( multicolvar::MultiColvarFunction* func );
+/// Used in functions to add derivatives to the orientation vector
+  void addOrientationDerivativesToBase( const unsigned& iatom, const unsigned& jstore, const unsigned& base_cv_no, 
+                                        const std::vector<double>& der, multicolvar::MultiColvarFunction* func );
+/// Can we differentiate the orientation - yes we can the multicolvar is a vector
+  bool hasDifferentiableOrientation() const { return true; }
+};
+
+inline
+unsigned VectorMultiColvar::getNumberOfComponentsInVector() const {
+  return ncomponents; 
+}
+
+inline
+void VectorMultiColvar::addComponent( const unsigned& icomp, const double& val ){
+  plumed_dbg_assert( icomp<ncomponents );
+  addElementValue( 5 + icomp, val );
+}
+
+inline
+void VectorMultiColvar::setComponent( const unsigned& icomp, const double& val ){
+  plumed_dbg_assert( icomp<ncomponents );
+  setElementValue( 5 + icomp, val );
+} 
+  
+inline
+double VectorMultiColvar::getComponent( const unsigned& icomp ) const {
+  plumed_dbg_assert( icomp<ncomponents );
+  return getElementValue( 5 + icomp );
+} 
+
+
+inline
+void VectorMultiColvar::addAtomsDerivative( const unsigned& icomp, const unsigned& jatom, const Vector& der ){
+  plumed_dbg_assert( icomp<ncomponents && jatom<getNAtoms() );
+  MultiColvarBase::addAtomsDerivatives( 5 + icomp, getAtomIndex(jatom), der );
+}
+
+inline
+void VectorMultiColvar::addBoxDerivatives( const unsigned& icomp, const Tensor& vir ){
+  plumed_dbg_assert( icomp<ncomponents );
+  MultiColvarBase::addBoxDerivatives( 5 + icomp, vir );
+}
+
+inline
+void VectorMultiColvar::addImaginaryComponent( const unsigned& icomp, const double& val ){
+  plumed_dbg_assert( icomp<ncomponents && complexvec );
+  addElementValue( 5 + ncomponents + icomp, val );
+}
+
+inline
+void VectorMultiColvar::setImaginaryComponent( const unsigned& icomp, const double& val ){
+  plumed_dbg_assert( icomp<ncomponents && complexvec );
+  setElementValue( 5 + ncomponents + icomp, val );
+}
+
+inline 
+double VectorMultiColvar::getImaginaryComponent( const unsigned& icomp ) const {
+  plumed_dbg_assert( icomp<ncomponents && complexvec );
+  return getElementValue( 5 + ncomponents + icomp );
+} 
+
+inline
+void VectorMultiColvar::addImaginaryAtomsDerivative( const unsigned& icomp, const unsigned& jatom, const Vector& der){
+  plumed_dbg_assert( icomp<ncomponents && complexvec && jatom<getNAtoms() );
+  MultiColvarBase::addAtomsDerivatives( 5 + ncomponents + icomp, getAtomIndex(jatom), der );
+}
+
+inline
+void VectorMultiColvar::addImaginaryBoxDerivatives( const unsigned& icomp, const Tensor& vir ){
+  plumed_dbg_assert( icomp<ncomponents && complexvec );
+  MultiColvarBase::addBoxDerivatives( 5 + ncomponents + icomp, vir ); 
+}
+
+inline
+unsigned VectorMultiColvar::getNumberOfQuantities(){
+  if( complexvec ) return 5 + 2*ncomponents;
+  return 5 + ncomponents;
+}
+
+}
+}
+#endif
+
diff --git a/src/crystallization/module.type b/src/crystallization/module.type
new file mode 100644
index 0000000000000000000000000000000000000000..de832730330473a1870bd368868640da677460ae
--- /dev/null
+++ b/src/crystallization/module.type
@@ -0,0 +1 @@
+default-off