def create_laser(s_name, l): if s_name != 'PCS': s = lasers[s_name](l, n_max) else: s = laser.PCS(l, n_max, rs=(0.4, 0.4)) # s = laser.PCS(l, n_max, rs=(0.2, 0.9)) return s
def __create_laser(self, name, l, rs=False): """ Setup the entangled laser source for detection """ laser = None if name == 'TMSS': laser = l2m.TMSS(l, self.n_max) elif name == 'PS': laser = l2m.PS(l, self.n_max) elif name == 'PA': laser = l2m.PA(l, self.n_max) elif name == 'PSA': laser = l2m.PSA(l, self.n_max) elif name == 'PAS': laser = l2m.PAS(l, self.n_max) elif name == "PCS": laser = l2m.PCS(l, self.n_max, rs) return laser
def create_laser(s_name, l): if s_name != 'PCS': s = lasers[s_name](l, n_max) else: res = minimize(etgl_asym, np.array([0.2, 0.85]), args=(l, n_max), method='L-BFGS-B', bounds=[(0, 1), (0, 1)]) res2 = minimize(etgl_asym, np.array([0.3, 0.3]), args=(l, n_max), method='L-BFGS-B', bounds=[(0, 1), (0, 1)]) if res2.fun < res.fun: res = res2 ra, rb = res.x[0], res.x[1] if (-1e-6 < ra < 1e-6) and (-1e-6 < rb < 1e-6): ra, rb = 1, 1 s = laser.PCS(l, n_max, rs=(ra, rb)) return s
def etgl_asym(r, l, n_max): state = laser.PCS(l, n_max, (r[0], r[1])) return -state.entanglement
def etgl_sym(r, l, n_max): # print(r) state = laser.PCS(l, n_max, (r[0], r[0])) return -state.entanglement
def create_laser(l, rs): s = laser.PCS(l, n_max, rs=rs) # s = laser.PCS(l, n_max, rs=(0.2, 0.9)) return s