def continuousTeleportationSimulation(psi, c_ops=[]): N = 8 psi0 = tensor([basis(2, 0), psi] + [basis(2, 0) for i in range(N - 2)]) schedule = [] # encoding, Hadamards stage 1, 2 schedule.append((constructHadamardH(N, range(N)), constructHadamardCorr(N, range(N)), np.pi)) # encoding, CZs, stage 3 schedule.append((constructCZH(N, [0, 2, 4], [1, 3, 5]), None, np.pi)) # encoding, Hadamards, stage 4, 5 schedule.append((constructHadamardH(N, [1, 3, 5]), constructHadamardCorr(N, [1, 3, 5]), np.pi)) # teleportation, stage 6 schedule.append((osum([Sy(N, i) for i in [1, 2, 3, 4]]), None, np.pi / 2.)) # teleportation, stage 7 schedule.append( (osum([Sz(N, i) for i in [1, 2, 3, 4]]), None, -np.pi / 2.)) # teleportation, stage 8 schedule.append((constructCZH(N, [1, 3], [2, 4]), None, np.pi)) # teleportation, stage 9 schedule.append( (osum([Sy(N, i) for i in [1, 2, 3, 4]]), None, -np.pi / 2.)) # decoding, stage 10, 11 schedule.append( (constructHadamardH(N, [1, 3]), constructHadamardCorr(N, [1, 3]), np.pi)) # decoding, stage 12 schedule.append((constructCZH(N, [0, 2], [1, 3]), None, np.pi)) # decoding, stage 13, 14 schedule.append((constructHadamardH(N, [0, 1, 2, 3]), constructHadamardCorr(N, [0, 1, 2, 3]), np.pi)) # perform time evolution and return the final state return scheduledTimeEvolution(psi0, schedule, c_ops=c_ops)
def continuousZBraidingCorrectionSimulation(psi0, c_ops=[]): N = 8 schedule = [] for i in range(2): # XX braiding, stage 1 schedule.append((osum([Sx(N, i) for i in [4, 5]]), None, np.pi / 2.)) # XX braiding, stage 2 schedule.append((osum([Sz(N, i) for i in [4, 5]]), None, -np.pi / 2.)) # XX braiding, stage 3 schedule.append((constructCZH(N, [4], [5]), None, np.pi)) # XX braiding, stage 4 schedule.append((osum([Sx(N, i) for i in [4, 5]]), None, -np.pi / 2.)) return scheduledTimeEvolution(psi0, schedule, c_ops=c_ops)
def test_noisy_time_teleportation_rand(self): N = 8 gamma = 0.05 c_ops = [np.sqrt(gamma)*Sz(N, i) for i in range(N)] psi = rand_ket(2) fidelity0000, fidelity = simulateTeleportation( psi, continuousTeleportationSimulation, continuousXXBraidingCorrectionSimulation, continuousZBraidingCorrectionSimulation, continuousDecodingSimulation, c_ops=c_ops) assert fidelity0000 > fidelity
'xp': xp, 'xm': xm, 'yp': yp, 'ym': ym, 'rnd': rand_ket(2) } N = 8 nb = args.res gmax = args.gamma gs = np.linspace(0., gmax, nb) psi = inp[args.psi] results = np.zeros((3, nb)) results[0, :] = gs for i, gamma in enumerate(tqdm(gs)): c_ops = [np.sqrt(gamma) * Sz(N, j) for j in range(N)] f0000, fall = simulateTeleportation( psi, continuousTeleportationSimulation, continuousXXBraidingCorrectionSimulation, continuousZBraidingCorrectionSimulation, continuousDecodingSimulation, c_ops=c_ops) results[1, i] = f0000 results[2, i] = fall np.save(args.output, np.array(results))
# inner inter-wire braid Hamiltonian operator H = 0.25 * 1j * gr(Ltot, L - 1, Opers=Opers) * gl(Ltot, L, Opers=Opers) # produce a measurement operators that measure the two nanowire system in the logical Z-basis lSz = psi0L * psi0L.dag() - psi1L * psi1L.dag() lSz1 = tensor([lSz] + [qeye(2) for i in range(L)]) lSz2 = tensor([qeye(2) for i in range(L)] + [lSz]) # here perform the time evolution and get the expectation values wires = mesolve(H, psi01L, times, e_ops=[lSz1, lSz2]).expect # as for the qubit system, we make similar time evolution just to be able to compare them psi01 = tensor(basis(2, 0), basis(2, 1)) # qubit Hamiltonian H = 0.25 * Sx(2, 0) * Sx(2, 1) # simulate qubits qubits = mesolve(H, psi01, times, e_ops=[Sz(2, 0), Sz(2, 1)]).expect # plot the results plotExpectations( times, list(qubits) + list(wires), ['$<\sigma^z_1>$', '$<\sigma^z_2>$', '$<S^z_1>$', '$<S^z_2>$'], ['tab:blue', 'tab:orange', 'black', 'white'], ['-', '-', '--', '--'], [3., 3., 1., 1.], r'Comparing 1DTS $i\frac{1}{4}\gamma_{(L,r)}\gamma_{(L+1,l)}$ to qubits $\sqrt{X_1 X_2}$', 'plots/majorana-qubits/result.png', axvlines=[np.pi])
def constructHadamardH(N, targets): return osum([(Sx(N, i) + Sz(N, i)) / np.sqrt(2.) for i in targets])