Skip to content

Commit

Permalink
Update experiment.Random
Browse files Browse the repository at this point in the history
  • Loading branch information
phantomlsh committed Dec 16, 2024
1 parent 46fcfeb commit abe4872
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion quick/constants/experiment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ T2Echo: |
t: {r_relax}
Random: |
rep: 500
rep: 100
p0_freq: {r_freq}
p0_length: {r_length}
p0_power: {r_power}
Expand Down
11 changes: 7 additions & 4 deletions quick/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,12 @@ def run(self, silent=False):
return self.conclude(silent)
def random(self, silent=True):
self.run(silent)
c = 0
res = 0
for i in range(len(self.data)):
if i > 64:
continue
res += self.data[i] * 2 ** (-i - 1)
for i in range(64):
if c >= len(self.data):
self.run(silent)
c = 0
res += self.data[c] * 2 ** (-i - 1)
c += 1
return res

0 comments on commit abe4872

Please sign in to comment.