QuTech-Delft / qx-simulator

QX Simulator
Other
16 stars 12 forks source link

Measurement outcome of multiple execution #68

Closed prince-ph0en1x closed 2 years ago

prince-ph0en1x commented 5 years ago

The res variable is boolean type even if 100 tests are run. How do I access the average value from the test code?

import qxelarator

qx = qxelarator.QX()
qx.set('rand.qasm')

NTests = 100
qx.execute(NTests)
res = qx.get_measurement_outcome(0)

The code above is the test_rand.py test case of Qxelerator

pablolh commented 2 years ago

get_measurement_outcome indeed shows the final value of the measurement register for that qubit. You can easily compute an average per-qubit using the new output format (stdout or json)