Displaying and downloading your results

Introduction

When you execute a quantum algorithm and examine the results (which are shown in a histogram) it is important to understand a few basic things:

Selecting a result

In the editor, click on the 'Results' tab at the top. It will show a list of all executions of your algorithm. Of course, if you have never executed the algorithm, the list will be empty.

You can click on any of the rows that shows 'Done' (as opposed to 'Scheduled' or 'Running') to view the results. s Note: The status of the execution is not automatically pushed to the web browser when the algorithm is ready. On most browsers clicking F5 will refresh your browser

Understanding the histogram

In addition to showing your algorithm code and visualisation, the result page shows a histogram.

In essence, what the histogram shows is the probability of the outcome of a state measurement at the end of the algorithm. To interpret this histogram you should be aware of two things:

  • The labels on the x-axis show the value of the binary register, and the bits are ordered such that the most-significant bit is the leftmost bit and the least significant bit is the rightmost bit; so the measurement for qubit 0 is the rightmost bit, the measurement for qubit 3 is the 3th bit from the right;
  • There are three different modes in which simulations can run; each mode implements a different way of obtaining the data that generates the histogram.

The different modes are explained in detail below.

Deterministic algorithms using a single shot (N=1)

If the algorithm is deterministic, it can be executed with simulation optimization.

When this mode is running with a single shot (number of shots is 1), the histogram data will contain the probability amplitude values of the final state in the computational z-basis. The histogram will be determined directly from the final state probability amplitudes. In this case the raw data file will only contain one entry, which is the same as the histogram data.

Deterministic algorithms with multiple shots (N>1)

When executing with simulation optimization and more than one shot, the histogram will be determined using a Monte Carlo simulation, based on the probability amplitudes of the final state. More information on the exact steps is given in the page on simulation optimization.

Non-deterministic algorithms

When running a non-deterministic algorithm on the simulator, or when running an algorithm on actual hardware, the result is obtained by executing the algorithm multiple times (the number of shots) and reading out the binary measurement register. The histogram reflects the observed frequency of distinct measurement register values. Note that the binary register is always initialized to zeroes, so when a qubit is not measured at all, the corresponding bit in the binary register (and thus in the histogram) will be zero, but that value has no relationship with the actual qubit state.

Downloading results files

The result page offers links that download the histogram data and other data as a csv (comma-separated values) file for importing the data into a spreadsheet or as a json file for structured processing by other software.

The download links available are for:

  • histogram data; a list of the bins in the histogram and their probabilities;
  • raw data; a list of all observed measurement outcomes or states (empty when simulation optimization with 1 shot is executed);
  • observed state; currently empty, in future versions will contain quantum state output from all display statements in the algorithm for debugging purposes;
  • measurement register; only valid when running without simulation optimization; contains the measurement register values for all display and display_binary statements.

Histogram data syntac

The histogram data is given as a table of decimal values for the measurement register and the normalized frequency of observing that value over all shots (non-observed values are omitted from the table). Example:

        
          {"6":0.939453125,"2":0.0078125,"1":0.0078125,"7":0.0078125,"4":0.01171875,"3":0.0078125,"0":0.009765625,"5":0.0078125}
        
      
0.010
000
0.008
001
0.008
010
0.008
011
0.012
100
0.008
101
0.939
110
0.008
111
1.0
0.8
0.6
0.4
0.2
0.0

Raw data syntax

The raw data is a list of integers, each integer being the decimal representation of the value of the measurement register at the end of each shot. Example:

        
          [6,6,6,6,6,1,6,3,6,6,6,6,6,4,6,6,6,6,6,6,6,6,6,6,6,6, ... ]