Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
prog.insert(pq.H(qlist[2])).insert(pq.meas_all(qlist,clist))
data = {'shots':1000}
result=machine.run_with_configuration(prog,clist,data)
print("result11111",result)
pq.destroy_quantum_machine(machine)
machine2=pq.init_quantum_machine(pq.QMachineType.CPU)
qlist2=machine2.qAlloc_many(3)
prog2=pq.QProg()
prog2.insert(pq.H(qlist2[0])).insert(pq.CNOT(qlist2[0],qlist2[1]))
result2=machine2.prob_run_dict(prog2,qlist2,-1)
pq.destroy_quantum_machine(machine2)
pq.init(pq.QMachineType.CPU)
qlist3=pq.qAlloc_many(5)
clist3=pq.cAlloc_many(5)
prog3=pq.QProg()
prog3.insert(pq.H(qlist3[0])).insert(pq.CNOT(qlist3[0],qlist3[1]))\
.insert(pq.CNOT(qlist3[1],qlist3[2])).insert(pq.CNOT(qlist3[2],qlist3[3]))\
.insert(pq.meas_all(qlist3,clist3))
result3=pq.run_with_configuration(prog3,clist3,100)
pq.finalize()
return result,result2,result3
if __name__=="__main__":