Skip to content

Commit

Permalink
rename to ret'
Browse files Browse the repository at this point in the history
  • Loading branch information
apchytr committed Sep 13, 2024
1 parent 3b991c1 commit 685c5a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mrmustard/lab_dev/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ def sample(self, state: State, n_samples: int = 1000) -> np.ndarray:
return initial_samples

unique_samples, counts = np.unique(initial_samples, return_counts=True)
temp = []
ret = []
for unique_sample, counts in zip(unique_samples, counts):
meas_op = self.meas_ops[self.meas_outcomes.index(unique_sample)].on([initial_mode])
reduced_state = (state >> meas_op.dual).normalize()
samples = self.sample(reduced_state, counts)
for sample in samples:
temp.append(np.append([unique_sample], sample))
return np.array(temp)
ret.append(np.append([unique_sample], sample))
return np.array(ret)

def sample_prob_dist(self, state: State, n_samples: int = 1000) -> np.ndarray:
r"""
Expand Down

0 comments on commit 685c5a9

Please sign in to comment.