Skip to content

Commit

Permalink
[DEM-933] result wasn't aligned
Browse files Browse the repository at this point in the history
  • Loading branch information
QFer committed May 8, 2019
1 parent 1f9df86 commit e0b699b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/example_qiskit_entangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ def get_authentication():
qi_result = qi_job.result()
histogram = qi_result.get_counts(circuit)
print('\nState\tCounts')
[print('{0}\t{1}'.format(state, counts)) for state, counts in histogram.items()]
[print('{0}\t\t{1}'.format(state, counts)) for state, counts in histogram.items()]
# Print the full state probabilities histogram
probabilities_histogram = Obj.to_dict(qi_result.data(circuit)['probabilities'])
print('\nState\tProbabilities')
# Format the hexadecimal key to a zero-padded binary string with length of the number of classical bits
[print('{0}\t{1}'.format(format(int(str(bin(int(key, 16)))[2:], 2), '0{}b'.format(b.size)),
[print('{0}\t\t{1}'.format(format(int(str(bin(int(key, 16)))[2:], 2), '0{}b'.format(b.size)),
val)) for key, val in probabilities_histogram.items()]

0 comments on commit e0b699b

Please sign in to comment.