Пример #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))
Пример #2
0
 def func(server, curramp):
     alg = gc.Algorithm(devs)
     q0 = alg.q0
     alg[LZ_gate([q0], amp=curramp)]
     alg[gates.Wait([q0], 0 * ns)]
     alg[gates.PiPulse([q0])]
     alg[gates.Readout([q0])]
     alg.compile()
     data = yield runQubits(server, alg.agents, stats, dataFormat='iqRaw')
     if dataFormat == 'Amp':
         mag, ang = readout.iqToPolar(readout.parseDataFormat(data, 'iq'))
     else:
         data = readout.parseDataFormat(data, 'iq')
         mag, ang = data[0], data[1]
     returnValue([mag, ang])
Пример #3
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])
Пример #4
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])