QuTech-Delft / quantuminspire

Quantum Inspire SDK
Apache License 2.0
65 stars 27 forks source link

Generating count histogram from the raw data #28

Closed QFer closed 5 years ago

QFer commented 5 years ago

With this issue, the raw data that is returned from the backend is taken as the source to calculate the count histogram (instead of the probabilities histogram). Also the memory data field is filled with the raw data values. A special case is when number_of_shots = 1. In this case the backend doesn't return raw_data. With number_of_shots = 1, there must be one value in the counts histogram (with count = 1), and the same single value in memory data. To determine this value a random float is generated in the range [0, 1). With this random number the value from the probabilities histogram is taken where the added probabilities is greater this random number.

Also the unit tests are adjusted because the single shot unit test now delivers valid data.

Some minor docstring adjustments for the other part of the file.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 8747b12ffdd02a95ebb91e28f2de3749dec6345c on bug/DEM-766/histogram_counts into 2bf7c882bdca69918a3dd87ca3b722947a0a5cb9 on dev.

QFer commented 5 years ago

The OrderedDict of project parameter I'll have to do another time when type hinting it together with Api