ResultΒΆ

SpinQit provides four types of results. First, all the backends can provide the probabilities of binary readings as follows:

print(result.probabilities)
{'10': 0.4999999999809753, '11': 0.4999999999809753}

Please notice that SpinQit uses the little endian, i.e., the first bit in the result binary string corresponds to the first qubit in the quantum circuit.

Second, the count of each possible binary reading can be found in the result except when the cloud backend is used. The total number of shots is configured otherwise 1024 will be used by default.

print(result.counts)
{'10': 512, '11': 512}

Third, with the simulators, a random binary reading can be obtained from the result according to the probabilities via a get_random_reading method.

print(result.get_random_reading())
11

Fourth, the two simulator backends can provide the state vector of all the qubits when there is no measure gate or conditional gate based on the value of a classical register.

print(result.states)
[(1.37812710729329e-10+0j), (1.37812710729329e-10+0j), -0.7071067811865476j, -0.7071067811865476j]

The following table shows the result formats supported by each backend.

Basic Simulator

Torch Simulator

Local Quantum Computer

Cloud

QASM Backend

Probabilities

Y

Y

Y

Y

Y

Counts

Y

Y

Y

N

Y

States

Y

Y

N

N

Y

Random Reading

Y

Y

N

N

Y