Skip to content

Commit

Permalink
fixing bugs with counts -> counts()
Browse files Browse the repository at this point in the history
  • Loading branch information
weinbe58 committed Nov 28, 2023
1 parent d6ffdfc commit 8f14577
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def rydberg_state_probabilities(shot_counts):

emu_batch = load(emu_filename)
emu_report = emu_batch.report()
emu_counts = emu_report.counts
emu_counts = emu_report.counts()

hardware_batch = load(filename)
# hardware_batch.fetch() # uncomment to fetch results from Braket
Expand All @@ -150,8 +150,8 @@ def rydberg_state_probabilities(shot_counts):
hardware_report = hardware_batch.report()


emu_rydberg_state_probabilities = rydberg_state_probabilities(emu_report.counts)
hw_rydberg_state_probabilities = rydberg_state_probabilities(hardware_report.counts)
emu_rydberg_state_probabilities = rydberg_state_probabilities(emu_report.counts())
hw_rydberg_state_probabilities = rydberg_state_probabilities(hardware_report.counts())

# %% [markdown]
# plot 0, 1, and 2 Rydberg state probabilities but in separate plots
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/example-2-two-qubit-adiabatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ def rydberg_state_probabilities(emu_counts):
emu_report = emu_batch.report()
hardware_report = hardware_batch.report()

emu_rydberg_state_probabilities = rydberg_state_probabilities(emu_report.counts)
hw_rydberg_state_probabilities = rydberg_state_probabilities(hardware_report.counts)
emu_rydberg_state_probabilities = rydberg_state_probabilities(emu_report.counts())
hw_rydberg_state_probabilities = rydberg_state_probabilities(hardware_report.counts())

emu_distances = emu_report.list_param("atom_distance")
hw_distances = hardware_report.list_param("atom_distance")
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/example-3-time-sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
def get_z2_probabilities(report):
z2_probabilities = []

for count in report.counts:
for count in report.counts():
z2_probability = count["01010101010"] / sum(list(count.values()))
z2_probabilities.append(z2_probability)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/example-4-quantum-scar-dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
def get_z2_probabilities(report):
z2_probabilities = []

for count in report.counts:
for count in report.counts():
z2_probability = count.get("01010101010", 0) / sum(list(count.values()))
z2_probabilities.append(z2_probability)

Expand Down

0 comments on commit 8f14577

Please sign in to comment.