@@ -129,9 +129,11 @@ def save(self, h5group):
129
129
subGroup [name ] = correlator
130
130
131
131
@classmethod
132
- def computeDerivedCorrelators (cls , measurements ):
132
+ def computeDerivedCorrelators (cls , measurements , commonTransform ):
133
133
r"""!
134
134
\param measurements a dictionary of measurements that has measurements of `"np"` and `"nh"`
135
+ \param commonTransform A spatial matrix used to transform *all* correlators passed in through `measurements`,
136
+ i.e. the `transform` attribute of measurement objects.
135
137
136
138
Measurements of one-point functions \f$\rho_x\f$, \f$n_x\f$,
137
139
and \f$S^3_x\f$ are built from measurements of \f$n^p_x\f$ and \f$n^h_x\f$
@@ -142,16 +144,20 @@ def computeDerivedCorrelators(cls, measurements):
142
144
```python
143
145
# meas is an instance of OnePointFunctions
144
146
derived = isle.meas.OnePointFunctions.computeDerivedCorrelators(
145
- {name: np.asarray(corr) for name, corr in meas.correlators.items()})
147
+ {name: np.asarray(corr) for name, corr in meas.correlators.items()},
148
+ meas.transform)
146
149
```
147
150
148
151
\returns `dict` with additional one-point functions, built from those already computed.
149
152
"""
150
153
154
+ nx = next (iter (measurements .values ())).shape [1 ]
155
+ U = commonTransform if commonTransform is not None else np .eye ((nx , nx ))
156
+
151
157
derived = dict ()
152
158
153
159
derived ["rho" ] = measurements ["np" ] - measurements ["nh" ]
154
160
derived ["n" ] = measurements ["np" ] + measurements ["nh" ]
155
- derived ["S3" ] = 0.5 * (1 - derived ["n" ])
161
+ derived ["S3" ] = 0.5 * (np . expand_dims ( np . sum ( U , axis = 1 ), axis = 0 ) - derived ["n" ])
156
162
157
163
return derived
0 commit comments