Ejemplo n.º 1
0
 def rectangle(self, w, h, twist_angle, overlap='side_center', rm_single_bond=True, new_cut_style=False):
     if overlap not in ['side_center', 'hole']:
         raise ValueError("Overlap can only be 'side_center' or 'hole' to keep the symmetry")
     self.orient = 'armchair'
     self.nfold = 2
     R = np.sqrt(w**2/4+h**2/4)
     self._initial_round_disk(R+2, twist_angle, overlap=overlap)
     self.rotate_struct_axis0_to_x_axis()
     ## get vertices of rectangle
     vert0 = self.a*np.array([ w/2,  h/2])
     vert1 = self.a*np.array([-w/2,  h/2])
     vert2 = self.a*np.array([-w/2, -h/2])
     vert3 = self.a*np.array([ w/2, -h/2])
     vertices = np.array([vert0, vert1, vert2, vert3])
     if new_cut_style:
         vertices = rotate_on_vec(-twist_angle/2, vertices) # cut with reference of bottom layer
     ## get all sides
     sides = get_sides_from_vertices(vertices)
     # get atoms inside polygon 
     self.coords = filter_sites_inside_polygon(self.coords, sides)
     if new_cut_style:
         coords_bottom =  self.coords[np.where(self.coords[:,-1]==0.0)[0]] ## left only bottom 
         coords_top = rotate_on_vec(twist_angle, coords_bottom)
         coords_top[:,-1] = self.h
         self.coords = np.concatenate([coords_bottom, coords_top]) 
     
     self.layer_nsites = self.get_layer_nsites()
     if rm_single_bond:
         self._remove_single_bonds()
     self.point_group = self.get_point_group()
     self.layer_nsites = self.get_layer_nsites()
     self.layer_nsites_sublatt = self.get_layer_nsites_sublatt()
Ejemplo n.º 2
0
 def rotate_struct_axis0_to_x_axis(self):
     angle_axis0_x = self._angle_C2_axis0_x()
     self.coords = rotate_on_vec(-angle_axis0_x, self.coords)
     layer_latt_vecs = []
     for i in range(len(self.layer_latt_vecs)):
         latt_vec_new = rotate_on_vec(-angle_axis0_x, self.layer_latt_vecs[i])
         layer_latt_vecs.append(latt_vec_new)
     self.layer_latt_vecs = layer_latt_vecs
Ejemplo n.º 3
0
    def regular_polygon(self, n, R, twist_angle, overlap='hole', rm_single_bond=True, \
                         orient='armchair', new_cut_style=False):
        """
        n: the regular polygon with n sides (n=3, 6, 12)
        R: the distance from center to vertex (in units of a: the lattice constant of graphene)
        twist_angle: the twist angle between two layers
        rm_single_bond: whether the atom with only one negibors are removed
        orient: zigzag or armchair along x-axis
        new_cut_style: False: rotate and cut, True: cut and rotate
        """
        ######################## check inputs ################################################
        if overlap not in ['atom', 'hole', 'atom1']:
            raise ValueError('Overlap %s is not recogenized!' % overlap)

        if orient not in ['armchair', 'zigzag']:
            raise ValueError('Oriention %s is not recogenized!' % orient)
        
        ## Four following lines make sure the highest symmetry
        if n==3 and orient=='zigzag' and overlap!='hole':
            raise ValueError('For Triangle and zigzag orientation, overlap can only be hole!')

        if n in [6,12] and overlap!='hole':
            raise ValueError('For Hexgon or Decagon, overlap can only be hole!')
        ######################### check inputs done ###########################################

        self.orient = orient
        self.nfold = n

        ######################## informations of regular polygon ###############################
        vertices = get_vertices_regular_polygon(self.nfold, self.a*(R+1.e-4))
        if new_cut_style:
            vertices = rotate_on_vec(-twist_angle/2, vertices) # cut with reference of bottom layer
        sides = get_sides_from_vertices(vertices)
        # get atoms inside polygon 
        self._initial_round_disk(R+2, twist_angle, overlap=overlap)
        self.rotate_struct_axis0_to_x_axis()
        self.coords = filter_sites_inside_polygon(self.coords, sides)
        if new_cut_style:
            coords_bottom =  self.coords[np.where(self.coords[:,-1]==0.0)[0]] ## left only bottom 
            coords_top = rotate_on_vec(twist_angle, coords_bottom)
            coords_top[:,-1] = self.h
            self.coords = np.concatenate([coords_bottom, coords_top]) 
            
        ########################################################################################

        if rm_single_bond:
            self._remove_single_bonds()
        self.layer_nsites = self.get_layer_nsites()
        self.layer_nsites_sublatt  = self.get_layer_nsites_sublatt()
        self.point_group = self.get_point_group()
Ejemplo n.º 4
0
 def regular_polygon(self, n, R, OV_orientation=0, overlap='hole', rm_single_bond=True):
     """
     n: the fold number
     R: the distance from origin to any vertex in units of a
     OV_orient: the angle of origin-vertex relative x axis in units of degree
     overlap: the rotation axis
     rm_single_bond: whether the dangling bonds are removed
     """
     self.nfold = n
     self._initial_round_disk(R+2, 30., overlap=overlap)
     ######################## informations of regular polygon ###############################
     vertices = get_vertices_regular_polygon(n, self.a*(R+1.e-4))
     if OV_orientation:
         vertices = rotate_on_vec(OV_orientation, vertices)
     sides = get_sides_from_vertices(vertices)
     # get atoms inside polygon 
     self.coords = filter_sites_inside_polygon(self.coords, sides)
     ########################################################################################
     if rm_single_bond:
         self._remove_single_bonds()
     self.layer_nsites = self.get_layer_nsites()
     self.layer_nsites_sublatt = self.get_layer_nsites_sublatt()
     if n in [3, 6]:
         self.point_group = 'C%iv' % n
     if n == 12:
         self.nfold = 6
         self.point_group = 'D6d'
Ejemplo n.º 5
0
 def all_C2_axes_QC():
     axes = []
     for i in range(n):
         theta = 180/(2*n)*(2*i+1)
         axis = rotate_on_vec(theta,[1,0])
         axes.append(axis)
     return axes 
Ejemplo n.º 6
0
    def __init__(self, a=2.47):
        """
        structure descriptiong:
        armchair and zigzag are along y- and x-axis, respectively.
        atom order: C0, C1, F0, F1, where F0 and F1 are attached to C0 and C1, respectively.
                    F0 and C0 bend towards z axis, F1 and V1 bend towards -z axis.

        vector delta_1 is C0(0,0) -> C1( 0,  0)  (0,0) stands for the unit cell
        vector delta_2 is C0(0,0) -> C1(-1,  0)
        vector delta_3 is C0(0,0) -> C1( 0, -1)
        vector delta_F is C0->F0 or C1->F1 
        
        orbitals include C: s, px, py, pz
                         F: px, py, pz   
        """
        self.a = a
        self.latt_vec = a * np.array([[1 / 2, np.sqrt(3) / 2, 0],
                                      [-1 / 2, np.sqrt(3) / 2, 0],
                                      [0, 0, 100 / a]])
        delta = np.array([0, self.a / np.sqrt(3)])
        self.deltas = np.array(
            [rotate_on_vec(120 * i, delta) for i in range(3)])
        self.lmn = {'delta_1':[0, 1, 0], 'delta_2':[-np.sqrt(3)/2, -1/2, 0],\
                    'delta_3':[np.sqrt(3)/2, -1/2, 0]}
        self.hopping_params = {'C-C':{'V_sssigma':-5.34, 'V_spsigma':6.4, \
                                      'V_pxypxypi':-2.8,'V_pxypxysigma':7.65,\
                                      'V_pzpzpi':-2.8, 'V_pzpzsigma':0,\
                                      'V_pxypzpi':0, 'V_pxypzsigma':0}}
        self.E_onsite_params = {'C': {'s': -2.85, 'pxy': 3.2, 'pz': 0.0}}
Ejemplo n.º 7
0
def all_C2_axes(n):
    """
    orient_1st: the orient of the 1st 2-fold axis 'armchair or zigzag'
    """
    axis0 = np.array([1,0])
    axes = []
    for i in range(n):
        axis_i = rotate_on_vec(180/n*i, axis0)
        axes.append(axis_i)
    return np.array(axes)
Ejemplo n.º 8
0
def get_vertices_regular_polygon(n, R):
    """
    get coordinates of all vertices of regular polygon with n sides
    n: the number of sides of regular polygon
    R: the distance from center to one vertics
    Note: one vertex is on x axis with coordinate [R, 0]
    """
    vert0 = R*np.array([1,0])
    vertices = []
    for i in range(n):
        theta_i = 360/n*i
        vertices.append(rotate_on_vec(theta_i, vert0))
    return vertices
Ejemplo n.º 9
0
 def Cns(self, coords=None):
     """
     Description: all rotations related to n-fold principal axis
     operators are Cn_i with i=1,...,n-1
     """
     n = self.nfold
     coords_0 = self._coords(coords)
     coords_end = []
     for i in range(1, n):
         theta = 360/n*i
         coords_1 = rotate_on_vec(theta, coords_0)
         coords_end.append(coords_1)
     return np.array(coords_end)
Ejemplo n.º 10
0
 def S2n_odds(self, coords=None):
     """
     These operations are symmetry operations for D3d D6d point group
     These include S2n_2i+1 with 2i+1<2n
     """
     n = self.nfold
     coords_0 = self._coords(coords)
     #### C2n_odds first ####
     coords_end = []
     for i in range(0, n):
         theta = 180/n*(2*i+1)
         coords_1 = rotate_on_vec(theta, coords_0)
         coords_end.append(coords_1)
     coords_C2n_odds = np.array(coords_end)
     ###############################################
     coords_Cns_sigma_h = [self.sigma_h(coords)[0] for coords in coords_C2n_odds]
     return np.array(coords_Cns_sigma_h)
Ejemplo n.º 11
0
def diag_k_path_rotate(struct,
                       k_path=['G', 'M', 'K', 'G'],
                       dk=0.01,
                       elec_field=0.0,
                       fname='EIGEN_val_path',
                       rotate=30):
    """
    This function is used to calculate band structure along rotated k_path
    """
    from tBG.utils import rotate_on_vec
    bz = BZHexagonal(struct.latt_vec)
    kpts, inds = bz.kpoints_line_mode(k_path, dk)
    kpts = rotate_on_vec(rotate, kpts)
    vals, vecs, pmks = struct.diag_kpts(kpts,
                                        vec=0,
                                        pmk=0,
                                        elec_field=elec_field)
    k_info = {'labels': k_path, 'inds': inds}
    np.savez_compressed(fname, kpoints=kpts, vals=vals, k_info=[k_info])