Beispiel #1
0
 def test_database(self):
     from abipy.core.symmetries import bilbao_ptgroup, sch_symbols
     for sch_symbol in sch_symbols:
         print(sch_symbol)
         ptg = bilbao_ptgroup(sch_symbol)
         print(ptg)
         ptg.show_character_table()
         #for irrep_name in ptg.irrep_names: ptg.show_irrep(irrep_name)
         self.assertTrue(ptg.auto_test() == 0)
 def test_database(self):
     from abipy.core.symmetries import bilbao_ptgroup, sch_symbols
     for sch_symbol in sch_symbols:
         print(sch_symbol)
         ptg = bilbao_ptgroup(sch_symbol)
         print(ptg)
         ptg.show_character_table()
         #for irrep_name in ptg.irrep_names: ptg.show_irrep(irrep_name)
         self.assertTrue(ptg.auto_test() == 0)
Beispiel #3
0
 def test_database(self):
     """Testing BilbaoPointGroup database."""
     from abipy.core.symmetries import bilbao_ptgroup, sch_symbols
     for sch_symbol in sch_symbols:
         #print(sch_symbol)
         ptg = bilbao_ptgroup(sch_symbol)
         repr(ptg); str(ptg)
         assert len(ptg.to_string())
         #for irrep_name in ptg.irrep_names: ptg.show_irrep(irrep_name)
         assert ptg.auto_test() == 0
Beispiel #4
0
 def test_database(self):
     """Testing BilbaoPointGroup database."""
     from abipy.core.symmetries import bilbao_ptgroup, sch_symbols
     for sch_symbol in sch_symbols:
         print(sch_symbol)
         ptg = bilbao_ptgroup(sch_symbol)
         repr(ptg); str(ptg)
         assert len(ptg.to_string())
         #for irrep_name in ptg.irrep_names: ptg.show_irrep(irrep_name)
         assert ptg.auto_test() == 0
Beispiel #5
0
    def __init__(self, ltk, deg_ewaves):
        """
        Compute the D(R) matrices for each degenerate subset.
        """
        kgroup = ltk.kgroup
        #print("g0vecs", ltk.g0vecs)

        #The main problem here is represented by the fact 
        #that the classes in ltk might not have the 
        #same order as the classes reported in the Bilbao database.
        #Hence we have to shuffle the last dimension of my_character
        #so that we can compare the two array correctly
        #The most robust approach consists in matching class invariants 
        #such as the trace, the determinant of the rotation matrices.
        #as well as the order of the rotation and inv_root!
        #Perhaps I can make LatticeRotation hashable with
        #__hash__ = return det + 10 * trace + 100 * order + 1000 * inv_root
        #The pseudo code below computes the table to_bilbao_classes:

        # Get the Bilbao entry for this point group
        from abipy.core.symmetries import bilbao_ptgroup
        try:
            self.bilbao_ptg = bilbao_ptgroup(kgroup.sch_symbol)
            #to_bilbao_classes = self.bilbao_ptg.map_rotclasses(kgroup.rotclasses)
        except:
            raise self.Error(straceback())

        # Number of degeneracies, 
        # number of spatial rotation in the group of k, number of classes in kgroup.
        self.num_degs = num_degs = len(deg_ewaves)
        num_rotk, num_classes = len(kgroup), kgroup.num_classes

        # Allocate D(R) for each set of degenerated bands.
        # Init them with np.inf. If everything goes well 
        # only the diagonal element for the first operation 
        # in each class has to be computed.
        dmats = self.num_degs * [None]
        for idg, (e, waves) in enumerate(deg_ewaves):
            nb = len(waves)
            dr_bbp = np.empty((num_rotk, nb, nb), dtype=np.complex)
            dr_bbp[:,:,:] = np.inf
            dmats[idg] = dr_bbp

        # FIXME
        # Here there's a problem since I have to exclude time_rev and afm.
        #ltk_symmops = ltk.symmops[:48]
        ltk_symmops = ltk.symmops[:8]

        for idg, (e, waves) in enumerate(deg_ewaves):
            nb = len(waves)
            for isym, symmop in enumerate(ltk_symmops):
                for (ii, wave) in enumerate(waves):
                    rot_wave = wave.rotate(symmop)
                    prod = wave.braket(rot_wave)
                    # Update the entry
                    dmats[idg][isym,ii,ii] = prod
            print("idg", idg, "shape", dmats[idg].shape)

        self.dmats = dmats

        for idg in range(num_degs):
            if idg != 2: continue
            print(self.all_traces(idg))
Beispiel #6
0
    def __init__(self, ltk, deg_ewaves):
        """
        Compute the D(R) matrices for each degenerate subset.
        """
        kgroup = ltk.kgroup
        #print("g0vecs", ltk.g0vecs)

        #The main problem here is represented by the fact
        #that the classes in ltk might not have the
        #same order as the classes reported in the Bilbao database.
        #Hence we have to shuffle the last dimension of my_character
        #so that we can compare the two array correctly
        #The most robust approach consists in matching class invariants
        #such as the trace, the determinant of the rotation matrices.
        #as well as the order of the rotation and inv_root!
        #Perhaps I can make LatticeRotation hashable with
        #__hash__ = return det + 10 * trace + 100 * order + 1000 * inv_root
        #The pseudo code below computes the table to_bilbao_classes:

        # Get the Bilbao entry for this point group
        from abipy.core.symmetries import bilbao_ptgroup
        try:
            self.bilbao_ptg = bilbao_ptgroup(kgroup.sch_symbol)
            #to_bilbao_classes = self.bilbao_ptg.map_rotclasses(kgroup.rotclasses)
        except:
            raise self.Error(straceback())

        # Number of degeneracies,
        # number of spatial rotation in the group of k, number of classes in kgroup.
        self.num_degs = num_degs = len(deg_ewaves)
        num_rotk, num_classes = len(kgroup), kgroup.num_classes

        # Allocate D(R) for each set of degenerated bands.
        # Init them with np.inf. If everything goes well
        # only the diagonal element for the first operation
        # in each class has to be computed.
        dmats = self.num_degs * [None]
        for idg, (e, waves) in enumerate(deg_ewaves):
            nb = len(waves)
            dr_bbp = np.empty((num_rotk, nb, nb), dtype=np.complex)
            dr_bbp[:, :, :] = np.inf
            dmats[idg] = dr_bbp

        # FIXME
        # Here there's a problem since I have to exclude time_rev and afm.
        #ltk_symmops = ltk.symmops[:48]
        ltk_symmops = ltk.symmops[:8]

        for idg, (e, waves) in enumerate(deg_ewaves):
            nb = len(waves)
            for isym, symmop in enumerate(ltk_symmops):
                for (ii, wave) in enumerate(waves):
                    rot_wave = wave.rotate(symmop)
                    prod = wave.braket(rot_wave)
                    # Update the entry
                    dmats[idg][isym, ii, ii] = prod
            print("idg", idg, "shape", dmats[idg].shape)

        self.dmats = dmats

        for idg in range(num_degs):
            if idg != 2: continue
            print(self.all_traces(idg))