from os import sys, path sys.path.append(path.dirname(path.dirname(path.dirname(path.abspath(__file__))))) from simulationManager.papyllon_simulation import PapyllonSimulation from scipy.optimize import fsolve import numpy as np s = PapyllonSimulation(__file__,['wc','g','delta','k','xi','wd']) def parfunc(p): s.set_parameters(p) xi = s.k /1.42 * 10 ** s.xi def equation(A): return A**2 - s.wc**2*xi**2 / ((s.wd**2-(s.wc+s.g**2/np.sqrt(2*s.g**2*(A**2-1)+s.delta**2))**2)**2+s.k**2*s.wd**2) return fsolve(equation, xi)/xi if __name__ == "__main__": s.run(parfunc)
from os import sys, path sys.path.append(path.dirname(path.dirname(path.dirname(path.abspath(__file__))))) from simulationManager.papyllon_simulation import PapyllonSimulation from scipy.optimize import fsolve import numpy as np from CPB_cav import JC from qutip import * s = PapyllonSimulation(__file__,["N_photons","wc","kappa","gamma","xi","wd","g0", "Ec", "Ej", "d", "N_cpb","flux","wc2"]) ############## # compute coupling and qubit frequency for all different fluxes ############## jc = JC(s.g0, s.wc, 8, s.Ec, s.Ej, s.d, s.N_cpb,fc2 = s.wc2,flux = -1.32523) if s.X_name == "flux": flux_list = np.linspace(s.X_start,s.X_end,s.X_points) elif s.Y_name == "flux": flux_list = np.linspace(s.Y_start,s.Y_end,s.Y_points) elif s.Z_name == "flux": flux_list = np.linspace(s.Z_start,s.Z_end,s.Z_points) else: flux_list = [s.flux] jc = JC(s.g0, s.wc, 8, s.Ec, s.Ej, s.d, s.N_cpb,fc2 = s.wc2) jc_parameters = {} for f in flux_list: jc.cpb.set_flux(f) jc_parameters[str(f)] = {"g":jc.g(0,1),