Exemple #1
0
option = 'rsc'

te = 0.1

# Operations options
k_sc = 0.001

print("N:", N)
print("mu:", mu)
print("k:", k_sc)

r = np.arcsinh(np.sqrt(mu))
r_eve = np.arcsinh(np.sqrt(mpne))

## Initialize state
sys = cv.System(N, Nmodes=2, cm=False)
sys.apply_TMS(r, [0, 1])

# Evesdropper collective attack
sys.add_TMSV(r_eve)

state0 = sys.state

sys.set_quadratures_basis()
tes = np.logspace(-2, 0, base=10, num=20)
#tes = np.linspace(.9, 1, 10)
#tes = [1.]

theta = np.arccos(np.sqrt(te))
sys.apply_BS(theta, [1, 2])
Exemple #2
0
Created on Fri Mar  8 10:58:55 2019

@author: Eduardo Villasenor
"""
import sys
sys.path.append("..") 

import src.cv_system as cv
import numpy as np

N =10
k = .05
g = np.sqrt((1 - k)/k)
print('g:', g)



sys = cv.System(N, Nmodes=1, cm=False)
sys.apply_SMD(1)
print(sys.state)

sys.apply_scissors(k)
print(sys.state)


sys2 = cv.System(N, Nmodes=1, cm=False)
sys2.apply_SMD(1)


print(sys.state.dag() * sys2.state)
def r_nkT(n, k, t):
    return np.sqrt(comb(n, k) * t**(n - k) * (1 - t)**k)


psi_theory = qt.tensor(qt.basis(N), qt.basis(N)) * 0

for i in range(N):
    #    psi_theory += alpha_n(i) * r_nkT(i, 1, T) * qt.tensor(qt.basis(N, i), qt.basis(N, i))
    psi_theory += alpha_n(r, i) * qt.tensor(qt.basis(N, i), qt.basis(N, i))
    print(i, alpha_n(r, i))

norm = psi_theory.norm()
psi_theory = psi_theory / norm
print('Norm:', norm)

sys = cv.System(N, Nmodes=2)
sys.apply_TMS(mean_photon_number, [0, 1])

psi_simulation = sys.state

a = qt.tensor(qt.destroy(N), qt.qeye(N))
b = qt.tensor(qt.qeye(N), qt.destroy(N))

n_op = a.dag() * a

print("Mean photon number theory:", qt.expect(n_op, psi_theory))
print("Mean photon number simulation:", qt.expect(n_op, psi_simulation))

fig, axes = plt.subplots(1, 2, figsize=(12, 3))
qt.plot_fock_distribution(psi_theory,
                          fig=fig,
# -*- coding: utf-8 -*-
"""
Dummy file to test stuff

@author: Eduardo Villasenor
"""

import src.cv_system as cv
import qutip as qt
import numpy as np

N = 30
mu = 2

sys = cv.System(N, 2)

r = .5
sys.apply_TMS(r)
#sys.apply_SMS(r, 1)

#state = qt.basis(N, 1)
#sys.add_state(state)

for i in range(20):
    sys.apply_photon_subtraction(0.99, 1)

#sys.apply_scissors_exact(0.05, 0)
#sys.apply_photon_catalysis(4, 0.9, 0)
#sys.apply_photon_catalysis(3, 0.9, 0)
#sys.apply_photon_catalysis(2, 0.9, 0)
#sys.apply_photon_catalysis(1, 0.9, 0)
Exemple #5
0
# -*- coding: utf-8 -*-
"""
File to test distillation of CAT_quasi_Bell states

Created on Wed Aug 21 14:13:06 2019

@author: Eduardo Villasenor
"""

import src.cv_system as cv
import numpy as np
import qutip as qt
import src.wigner_plots as wplt
N = 40
sys = cv.System(N, 0)
sys.add_CAT(3)

#sys.add_CAT_Bell(3, state='00')

qt.fock_distribution(qt.coherent(40, 3))

#wplt.plot(sys.state, [-7, 7], 200)