-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Now we use quokka-sharp as
import quokka-sharp as qk
# the input circuit should be in QASM format
# compute probability of measurement outcome 0 on the first qubit
res = qk.Measure("circ1.qasm", "firstzero")
print(res.prob)
# compute probability of measurement outcome 0 on the all qubits
res = qk.Measure("circ1.qasm", "allzero")
print(res.prob)
To avoid encoding the circuits twice, we can rewrite the function as
import quokka-sharp as qk
# the input circuit should be in QASM format
# compute probability of measurement outcome 0 on the first qubit
cnf1 = qc2cnf1("circ1.qasm")
res = qk.Measure(cnf1, "firstzero")
# compute probability of measurement outcome 0 on the all qubits
res = qk.Measure(cnf1, "allzero")