Skip to content

Read a result and its report

Run the first experiment before this lesson. Keep the terminal output, the HTML report and its neighboring JSON file open. They describe the same run but serve different purposes: the terminal gives a short summary, the report helps you explore it, and the JSON preserves the underlying result.

Check these fields first

Field Question it answers
counts How many sampled outcomes had each bitstring?
probabilities What distribution did this simulator calculate, when requested?
bit_order Which qubit corresponds to each position?
diagnostic_codes Did the run record a warning or other diagnostic?
theta_rad, shots, seed, sdk_version Which experiment and environment produced these numbers?

First add the counts. Then divide the 1 count by shots and compare it with the probability of 1. This difference is sampling fluctuation for this ideal circuit; it is not evidence of hardware noise. An empty diagnostics list does not prove that an experiment answers the research question you intended.

The report is a view derived from ResultIR. Changing a chart does not rerun the circuit or modify the original counts. Inspect the source record with python -m json.tool artifacts/first-experiment.json.

Do not expect every backend to populate the same optional fields. For example, a result may contain samples without a returned state vector. Consult the result and diagnostics guide when a field is absent.

Diagnose before retrying

If a program fails validation, read the error code, affected object path and suggested correction. Re-running an unchanged invalid program will not fix its input. Separate an input problem from a resource limit or an unsupported operation using troubleshooting.

Practice: a report shows a frequency of 0.28 for 1, while the probability is 0.25. Does that alone mean the simulator is wrong? What additional information would you record?

A useful answer

Record shots, the seed, the circuit, the SDK version and the exact counts. At 128 shots, a binomial proportion near 0.25 has standard error about 0.038. A difference of 0.03 in one run is not by itself surprising. That calculation assumes independent samples from the stated distribution; it does not test the correctness of the circuit or noise model.

Next, choose a learning route and keep an experiment record.

中文版

SDK 1.0.8a · `8b227bff`