Skip to content

Commit

Permalink
Adding documentation about big endian values (#3146)
Browse files Browse the repository at this point in the history
- Adjusting documentation about big endian representations
for TrialResult and Sampler.
- Solves #2972
  • Loading branch information
dstrain115 committed Jul 21, 2020
1 parent d1b374c commit ea20a18
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cirq/study/trial_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class TrialResult:
attribute. The repetition number is the row index and measurement keys
are the columns of the DataFrame. Each element is a big endian integer
representation of measurement outcomes for the measurement key in that
repitition.
repetition. See `cirq.big_endian_int_to_bits` and similar functions
for how to convert this integer into bits.
Attributes:
params: A ParamResolver of settings used when sampling result.
Expand Down
10 changes: 7 additions & 3 deletions cirq/work/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ def sample(
Returns:
A `pandas.DataFrame` with a row for each sample, and a column for
each measurement result as well as a column for each symbolic
parameter. There is an also index column containing the repetition
number, for each parameter assignment.
each measurement key as well as a column for each symbolic
parameter. Measurement results are stored as a big endian integer
representation with one bit for each measured qubit in the key.
See `cirq.big_endian_int_to_bits` and similar functions for how
to convert this integer into bits.
There is an also index column containing the repetition number,
for each parameter assignment.
Examples:
>>> a, b, c = cirq.LineQubit.range(3)
Expand Down

0 comments on commit ea20a18

Please sign in to comment.