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}

Note that SpinQit uses little-endian ordering; that is, the first bit in the result binary string corresponds to the first qubit in the quantum circuit.

Second, counts for each possible binary reading can be found in the result. The total number of shots is configurable; if it is not specified, the default is 1024.

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 get_random_reading().

print(result.get_random_reading())
11

Fourth, the two simulator backends can provide the state vector of all the qubits when the circuit contains no measurement 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.

Result

Basic Simulator

Torch Simulator

Local Quantum Computer

Cloud

QASM Backend

Probabilities

Y

Y

Y

Y

Y

Counts

Y

Y

Y

Y

Y

States

Y

Y

N

N

Y

Random Reading

Y

Y

N

N

Y