def __init__(self, init_member, ranges_dict, data_dict, pipi_FSR=False, folder="", method="differential_evolution", population=100, N_generation=20, mutation_s=0.1, crossing_p=0.9, normalized_data=True, **trash): ## Initialize self.init_member = deepcopy(init_member) self.member = deepcopy(init_member) self.ranges_dict = ranges_dict self.data_dict = data_dict self.folder = folder self.normalized_data = normalized_data self.pipi_FSR = pipi_FSR self.pars = Parameters() for param_name, param_range in self.ranges_dict.items(): if param_name in self.init_member.keys(): self.pars.add(param_name, value=self.init_member[param_name], min=param_range[0], max=param_range[-1]) elif param_name in self.init_member["band_params"].keys(): self.pars.add( param_name, value=self.init_member["band_params"][param_name], min=param_range[0], max=param_range[-1]) self.method = method # "shgo", "differential_evolution", "leastsq" ## Differential evolution self.population = population self.N_generation = N_generation self.mutation_s = mutation_s self.crossing_p = crossing_p ## Objects if pipi_FSR == False: self.bandObject = BandStructure(**self.member) else: self.bandObject = Pocket(**self.member) self.condObject = None self.admrObject = None ## Empty spaces self.nb_calls = 0 self.json_name = None self.rhozz_data_matrix = None self.rzz_data_matrix = None self.Bphi_array = None self.Btheta_array = None self.Btheta_data_dict = {} self.rhozz_data_dict = {} self.rzz_data_dict = {}
def __init__(self, init_member, ranges_dict, data_dict, pipi_FSR=False, folder="", method="differential_evolution", population=100, N_generation=20, mutation_s=0.1, crossing_p=0.9, normalized_data=True, **trash): ## Initialize self.init_member = deepcopy(init_member) self.ranges_dict = deepcopy(ranges_dict) self.data_dict = deepcopy(data_dict) self.data_T_list = init_member["data_T"] self.folder = folder self.normalized_data = normalized_data self.pipi_FSR = pipi_FSR self.weight_rhozz = 0 self.pars = Parameters() for param_name, param_range in self.ranges_dict.items(): if param_name in self.init_member.keys() and type(self.init_member[param_name])==dict: for T in self.data_T_list: self.pars.add(param_name + "_" + str(T), value = self.init_member[param_name][T], min = param_range[T][0], max = param_range[T][-1]) elif param_name in self.init_member.keys() and type(self.init_member[param_name])!=dict: self.pars.add(param_name, value = self.init_member[param_name], min = param_range[0], max = param_range[-1]) elif param_name in self.init_member["band_params"].keys(): self.pars.add(param_name, value = self.init_member["band_params"][param_name], min = param_range[0], max = param_range[-1]) self.method = method # "shgo", "differential_evolution", "leastsq" ## Create a dictionnary member that contains dictionnaries for each temperatures self.member_dict = {} for T in self.data_T_list: # first create that list self.member_dict[T] = deepcopy(init_member) self.member_dict[T]["data_T"] = T for param_name, param_value in init_member.items(): # then break the dictionaries of temperatures in member if type(param_value)==dict and param_name!="band_params": for T in self.data_T_list: self.member_dict[T][param_name] = init_member[param_name][T] ## Objects if pipi_FSR==False: self.bandObject = BandStructure(**self.member_dict[self.data_T_list[0]]) else: self.bandObject = Pocket(**self.member_dict[self.data_T_list[0]]) self.condObject_dict = {} self.admrObject_dict = {} ## Empty spaces self.nb_calls = 0 self.json_name = None self.rhozz_data_i_dict = {} # keys=(T), dictionaries of interpolated values for fit self.rzz_data_i_dict = {} # keys=(T) dictionaries of interpolated values for fit self.rhozz_0_data_dict = {} # keys=(T, phi), dictionaries of rhozz(theta=0) data self.rhozz_data_dict = {} # keys=(T, phi) dictionaries of the raw data self.rzz_data_dict = {} # keys=(T, phi) dictionaries of the raw data self.Btheta_data_dict = {} # keys=(T, phi) dictionaries of the raw data self.Bphi_dict = {} self.Btheta_dict = {} self.rhozz_data_i_dict = {} self.rzz_data_i_dict = {}
def test_conductivity_T_0(self): """T = 0""" bandObject = BandStructure(**TestTransport.params) ## Discretize bandObject.doping() bandObject.discretize_FS() bandObject.dos_k_func() ## Conductivity condObject = Conductivity(bandObject, **TestTransport.params) condObject.runTransport() condObject.chambersFunc(i=2, j=2) self.assertEqual(np.round(condObject.sigma[2, 2], 3), 18103.539)
def test_conductivity_T(self): """T > 0""" params = deepcopy(TestTransport.params) params["T"] = 25 # in K bandObject = BandStructure(**params) ## Discretize bandObject.doping() bandObject.discretize_FS() bandObject.dos_k_func() ## Conductivity condObject = Conductivity(bandObject, **params) condObject.runTransport() condObject.chambersFunc(i=2, j=2, coeff_name="sigma") self.assertEqual(np.round(condObject.sigma[2, 2], 3), 17946.592)
## Graph values T = 25 # in Kelvin Bamp = 45 # in Telsa Btheta_array = np.arange(0, 95, 5) ## Fit >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>># ## Initialize the BandStructure Object bandObject = BandStructure(bandname="hPocket", a=3.74767, b=3.74767, c=13.2, t=190, tp=-0.14, tpp=0.07, tz=0.07, tz2=0.00, mu=mu_ini, numberOfKz=7, mesh_ds=1 / 20) ## Interpolate data over theta of simulation data = np.loadtxt( "data_NdLSCO_0p21/NdLSCO_0p21_1808A_c_AS_T_25_H_45_phi_0.dat", dtype="float", comments="#") x = data[:, 0] y = data[:, 2] rzz_0 = np.interp(Btheta_array, x, y) data = np.loadtxt(
"Bphi_array": [0, 20, 28, 36, 44], "gamma_0": 3.77, "gamma_k": 0, "power": 6, "data_T": 4.2, "data_p": 0.30, "epsilon_z":"-2 * cos(c*kz/2)*(" +\ "+0.50 * tz * cos(kx * a / 2) * cos(ky * b / 2)" +\ "-0.25 * tz2 * (cos(3 * kx * a / 2) * cos(ky * b / 2) + cos(kx * a / 2) * cos(3 * ky * b / 2))" +\ "-0.50 * tz3 * cos(3 * kx * a / 2) * cos(3 * ky * b / 2)" +\ "+0.25 * tz4 * (cos(5 * kx * a / 2) * cos(ky * b / 2) + cos(kx * a / 2) * cos(5 * ky * b / 2))" +\ ")", } ## ONE BAND Horio et al. ///////////////////////////////////////////////////////// bandObject = BandStructure(**params) ## Discretize bandObject.setMuToDoping(0.30) bandObject.runBandStructure(printDoping=True) # bandObject.mc_func() # print("mc = " + "{:.3f}".format(bandObject.mc)) # bandObject.figDiscretizeFS2D() # bandObject.figMultipleFS2D() ## Conductivity condObject = Conductivity(bandObject, **params) # condObject.figdfdE() # condObject.runTransport() # condObject.omegac_tau_func()
# 0.0, # 15, # 30, # 45.0 # ], # "gamma_0": 15, # "gamma_k": 0, # "gamma_dos_max": 0, # "power": 12, # "factor_arcs": 10, # "data_T": 25, # "data_p": 0.21 # } ## Create Bandstructure object bandObject = BandStructure(**params) ## Discretize Fermi surface # bandObject.setMuToDoping(0.15) # print(bandObject["mu"]) bandObject.runBandStructure(printDoping=True) # bandObject.mc_func() # print("mc = " + "{:.3f}".format(bandObject.mc)) # bandObject.figMultipleFS2D() # # bandObject.figDiscretizeFS2D() # ## Compute conductivity condObject = Conductivity(bandObject, **params) # condObject.runTransport() # condObject.figScatteringColor()
Output: - gamma will be in mJ/K^2/mol """ gamma = (np.pi**2 / 3) * Boltzmann**2 * (dos / meVolt) * V_molar * 1e3 return gamma ## Array of parameters tz_array = np.array([0.06512192]) # in units of t # mu_array = np.linspace(-0.75, -0.88, 20) # in units of t mu_array = np.array([-0.82439881]) ## Bandstructure bandObject = BandStructure(**params) ## Empty matrix p_matrix = np.empty((len(tz_array), len(mu_array))) dos_epsilon_matrix = np.empty((len(tz_array), len(mu_array))) gamma_matrix = np.empty((len(tz_array), len(mu_array))) mc_matrix = np.empty((len(tz_array), len(mu_array))) for i, tz in enumerate(tqdm(tz_array, ncols=80, unit="tz", desc="total tz")): bandObject["tz"] = tz if tz == 0: bandObject.res_z = 1 else: bandObject.res_z = params["res_z"] for j, mu in enumerate(
import time import plotly import plotly.graph_objs as go import plotly.figure_factory as ff import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State from skimage import measure from textwrap import dedent as d from cuprates_transport.bandstructure import BandStructure, Pocket from cuprates_transport.conductivity import Conductivity startTime = time.time() print('discretizing fermi surface') band = BandStructure(mu = -0.83) # band.setMuToDoping(0.30) band.discretize_FS() band.dos_k_func() band.doping() print("discretizing time : %.6s s\n" % (time.time() - startTime)) # band.figDiscretizeFS3D() # exit(0) def computeAMROpoints(B_amp,B_phi_a,B_theta_a): amroListForPhi = [] for i in range(B_phi_a.shape[0]): amroListForTheta = []
def test_doping(self): bandObject = BandStructure(**TestTransport.params) bandObject.doping() self.assertEqual(np.round(bandObject.p, 3), 0.239)
- V_molar must in Angstrom^3.mol^-1 Output: - gamma will be in mJ/K^2/mol """ gamma = (np.pi**2/3) * Boltzmann**2 * (dos / meVolt) * V_molar * 1e3 return gamma ## Array of parameters tz_array = np.array([0, 0.015]) # in units of t mu_array = np.linspace(-2.4, -1.1, 2000) # in units of t ## Bandstructure bandObject = BandStructure(**params) ## Empty matrix p_matrix = np.empty((len(tz_array), len(mu_array))) dos_epsilon_matrix = np.empty((len(tz_array), len(mu_array))) gamma_matrix = np.empty((len(tz_array), len(mu_array))) mc_matrix = np.empty((len(tz_array), len(mu_array))) for i, tz in enumerate(tqdm(tz_array, ncols=80, unit="tz", desc="total tz")): bandObject.tz = tz if tz == 0: bandObject.numberOfKz = 1 else: bandObject.numberOfKz = params["numberOfKz"] for j, mu in enumerate(tqdm(mu_array, ncols=80, unit="mu", desc="tz = " + str(tz), leave=False)):
"tp": -0.136, "tpp": 0.068, "tz": 0.07 }, "res_xy": 20, "res_z": 7, "T": 0, "gamma_0": 3.6, "gamma_k": 0, "gamma_dos_max": 0, "power": 12, "factor_arcs": 1, } ## BandObject ------------------------ bandObject = BandStructure(**params) bandObject.runBandStructure() ## Conductivity Object --------------- condObject = Conductivity(bandObject, Bamp=Bmin, **params) # T = 20K, p = 0.24 from fit ADMR condObject.Ntime = 1000 # better for high magnetic field values # condObject.epsilon_N = 10 ## Transport coeffcients ------------- ## Empty arrays rhoxx_array = np.empty_like(B_array, dtype=np.float64) rhoxy_array = np.empty_like(B_array, dtype=np.float64) rhozz_array = np.empty_like(B_array, dtype=np.float64) RHa_array = np.empty_like(B_array, dtype=np.float64)