예제 #1
0
 def collect_sublatt_data(i_layer, sublatt):
     idx_range = self._layer_inds_sublatt()[i_layer][sublatt]
     sites = self.coords[idx_range[0]:idx_range[1]+1]
     bins = divide_sites_2D(sites, bin_box=[[max_dist,0],[0,max_dist]], idx_from=idx_range[0])
     v1, v2 = self.layer_latt_vecs[i_layer]
     vec_to_NN = (v1+v2)/3 if sublatt==0 else -(v1+v2)/3
     return sites, bins, vec_to_NN
예제 #2
0
 def collect_layer_data(lay_id):
     id_range = layer_inds[lay_id]
     sites = self.coords[id_range[0]:id_range[1] + 1]
     bins = divide_sites_2D(sites,
                            bin_box=[[max_dist, 0], [0, max_dist]],
                            idx_from=id_range[0])
     return sites, bins
예제 #3
0
 def collect_sublatt_data(lay_id, sublatt):
     id_range = layer_inds_sublatt[lay_id][sublatt]
     sites = self.coords[id_range[0]:id_range[1] + 1]
     bins = divide_sites_2D(sites,
                            bin_box=[[max_dist, 0], [0, max_dist]],
                            idx_from=id_range[0])
     vec_to_NN = self.vecs_to_NN[self.layer_types[lay_id]][sublatt][0]
     return sites, bins, vec_to_NN
예제 #4
0
    def add_hopping_pz(self, split=False, max_dist=5.0, g0=3.12, a0=1.42, g1=0.48, h0=3.349, \
                                     rc=6.14, lc=0.265, q_dist_scale=2.218, nr_processes=1):
        from tBG.hopping import hop_func_pz 
        hop_func = hop_func_pz(g0=g0, a0=a0, g1=g1, h0=h0, rc=rc, lc=lc, q_dist_scale=q_dist_scale)

        if split:
            nlayer = len(self.layer_nsites)
            layid_sorted = np.argsort(self.layer_zcoords)
            layer_inds = self._layer_inds()

            def collect_layer_data(lay_id):
                id_range = layer_inds[lay_id]
                sites = self.coords[id_range[0]:id_range[1]+1]
                bins = divide_sites_2D(sites, bin_box=[[max_dist,0],[0,max_dist]], idx_from=id_range[0])
                return sites, bins

            ## intralayer hopping
            for i in range(nlayer):
                lay_id = layid_sorted[i]
                sites, bins = collect_layer_data(lay_id)
                key, value = calc_hoppings(sites, bins, hop_func=hop_func, max_dist=max_dist, nr_processes=nr_processes)
                try:
                    keys = np.concatenate([keys, key], axis=0)
                    values = np.concatenate([values, value], axis=0)
                except:
                    keys = key
                    values = value

            ## interlayer hopping
            for i in range(nlayer-1):
                lay0_id = layid_sorted[i]
                site0s, bin0s = collect_layer_data(lay0_id)

                lay1_id = layid_sorted[i+1]
                site1s, bin1s = collect_layer_data(lay1_id)

                key, value = calc_hoppings(site0s, bin0s, site1s, bin1s, hop_func=hop_func, max_dist=max_dist, nr_processes=nr_processes)

                keys = np.concatenate([keys, key], axis=0)
                values = np.concatenate([values, value], axis=0)
        else:
            sites = self.coords
            bins = divide_sites_2D(sites, bin_box=[[max_dist,0],[0,max_dist]], idx_from=0)
            keys, values = calc_hoppings(sites, bins, hop_func=hop_func, max_dist=max_dist, nr_processes=nr_processes)
        self.hopping = keys, values