Ejemplo n.º 1
0
 def func(server, currk, currphase):
     alg = gc.Algorithm(devs)
     q0 = alg.q0
     k0 = np.sqrt(delta**2 / (1 + np.tan(currphase)**2))
     alg[gates.MoveToState([q0], 0, state - 1)]
     alg[gates.Wait([q0], waitTime=tBuf)]
     alg[LZ_gate([q0], k0=k0, k1=k0 * np.tan(currphase), k2=currk)]
     alg[gates.Wait([q0], waitTime=tBuf)]
     alg[gates.Measure([q0])]
     alg.compile()
     data = yield runQubits(server, alg.agents, stats, dataFormat='iqRaw')
     probs = readout.iqToProbs(data, alg.qubits, states=range(1 + state))
     returnValue(np.squeeze(probs))
Ejemplo n.º 2
0
 def func(server, currdelay):
     alg = gc.Algorithm(devs)
     q0 = alg.q0
     taup = q0['lztaup']
     currtau1 = (currdelay - taup) / 2
     alg[LZ_gate([q0], tau1=currtau1)]
     alg[gates.Measure([q0])]
     alg.compile()
     data = yield runQubits(server, alg.agents, stats, dataFormat='iqRaw')
     if prob:
         probs = readout.iqToProbs(data, alg.qubits)
         probs = np.squeeze(probs)
         returnValue(probs)
     else:
         data = readout.parseDataFormat(data, 'iq')
         mag, phase = readout.iqToPolar(data)
         returnValue([mag, phase])
Ejemplo n.º 3
0
 def func(server, currphase):
     alg = gc.Algorithm(devs)
     q0 = alg.q0
     k0 = np.sqrt(delta**2 / (1 + np.tan(currphase)**2))
     #alg[gates.MoveToState([q0], 0, state-1)]
     alg[LZ_gate([q0], k0=k0, k1=k0 * np.tan(currphase))]
     #alg[gates.MoveToState([q0], state-1, 0)]
     alg[gates.Measure([q0])]
     alg.compile()
     data = yield runQubits(server, alg.agents, stats, dataFormat='iqRaw')
     if prob:
         probs = readout.iqToProbs(data, alg.qubits)
         probs = np.squeeze(probs)
         returnValue(probs)
     else:
         data = readout.parseDataFormat(data, 'iq')
         mag, phase = readout.iqToPolar(data)
         returnValue([mag, phase])