feat: derived observable array mode works now, test added

This commit is contained in:
Fabian Joswig 2021-12-06 21:59:41 +00:00
parent 52867fb033
commit 02d8f469eb
2 changed files with 19 additions and 18 deletions

View file

@ -1157,7 +1157,7 @@ def derived_observable(func, data, array_mode=False, **kwargs):
for name in new_cov_names:
g_extracted[name] = []
for i_dat, dat in enumerate(data):
g_extracted[name].append(np.array([obs.covobs[name]]).reshape(dat.shape + (1, )))
g_extracted[name].append(np.array([o.covobs[name].grad for o in dat.reshape(np.prod(dat.shape))]).reshape(dat.shape + (1, )))
for i_val, new_val in np.ndenumerate(new_values):
new_deltas = {}