def test_time_teleportation(self): states = [z0, z1, xp, xm, yp, ym, rand_ket(2)] for psi in states: fidelity0000, fidelity = simulateTeleportation( psi, continuousTeleportationSimulation, continuousXXBraidingCorrectionSimulation, continuousZBraidingCorrectionSimulation, continuousDecodingSimulation) assert are_close(fidelity0000, 1.) assert fidelity < fidelity0000
def test_unitary_teleportation(self): states = [z0, z1, xp, xm, yp, ym, rand_ket(2)] for psi in states: fidelity0000, fidelity = simulateTeleportation( psi, circuitTeleportationSimulation, circuitXXBraidingCorrectionSimulation, circuitZBraidingCorrectionSimulation, circuitDecodingSimulation) assert are_close(fidelity0000, 1.) assert are_close(fidelity, 1.)
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))