Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Pengfei Chen committed Nov 29, 2023
1 parent 32b893c commit e7274bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 4 additions & 3 deletions unitary/alpha/quantum_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,10 @@ def get_correlated_histogram(
count: Number of measurements
Returns:
A dictionary, with the keys being each possible state of the whole quantum
world (or `objects` if specified) in terms of tuple, and the values being
the count of that state.
A dictionary, with the keys being tuples representing each possible state of
the whole quantum world (or, if `objects` is specified, the key is a tuple of
the results of each object in `objects` and in the order of `objects`), and
the values being the count of that state.
"""
if not objects:
objects = self.public_objects
Expand Down
4 changes: 1 addition & 3 deletions unitary/alpha/quantum_world_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,5 @@ def test_get_correlated_histogram_with_entangled_qobjects(simulator, compile_to_
alpha.Split()(light1, light2, light3)
alpha.quantum_if(light2).equals(1).apply(alpha.Move())(light4, light5)

# histogram = world.get_histogram()
# assert histogram == [{0: 0, 1: 100}, {0: 0, 1: 100, 2: 0}]
histogram = world.get_correlated_histogram()
assert histogram.keys() == [(0, 0, 1, 1, 0), (0, 1, 0, 0, 1)]
assert histogram.keys() == {(0, 0, 1, 1, 0), (0, 1, 0, 0, 1)}

0 comments on commit e7274bd

Please sign in to comment.