Exemplo n.º 1
0
 def CheckSymmetries(self, TSrun=False):
     print('\nPerforming symmetry analysis')
     # Check if a smaller basis is present:
     Sym = Symmetry.Symmetry()
     # Find lattice symmetries
     Sym.setupGeom(self.geom.pbc,
                   self.geom.snr,
                   self.geom.anr,
                   self.geom.xyz,
                   onlyLatticeSym=True)
     if not TSrun:
         Sym.pointGroup(
         )  # Actually this call is only needed if phonons are computed
         #Sym.findIrreducible()
         self.SetDynamicAtoms(list(range(1, Sym.basis.NN + 1)))
     Sym.what()
     # Calculate lattice vectors for phase factors
     # The closest cell might be different depending on which atom is moved
     sxyz = Sym.xyz.copy()
     latticevectors = N.zeros((Sym.NN, Sym.NN, 3), N.float)
     for ii in range(Sym.NN):
         micxyz = Symmetry.moveIntoClosest(sxyz - sxyz[ii], Sym.pbc[0],
                                           Sym.pbc[1], Sym.pbc[2])
         for jj in range(Sym.NN):
             latticevectors[ii, jj] = micxyz[jj] + sxyz[
                 Sym.basisatom[ii]] - sxyz[Sym.basisatom[jj]]
     self.latticevectors = latticevectors
     self.supercell = True
     self.Sym = Sym
Exemplo n.º 2
0
def readxv():
    global geom
    # Read geometry from first .XV file found in dir
    fns = glob.glob('*.XV')

    if len(fns) > 1:
        print "ERROR: BandStruct: More than one .XV file ... which geometry to choose???"
        sys.exit(1)
    elif len(fns) < 1:
        print "ERROR: BandStruct: Error ... No .XV file found!"
        sys.exit(1)

    print('Reading geometry from "%s" file' % fns[0])
    geom = MG.Geom(fns[0])
    geom.sym = SYM.Symmetry(fns[0], onlyLatticeSym=True)
    if geom.sym.NNbasis != geom.natoms:
        print "ERROR: Siesta cell does not contain one unit cell"
        sys.exit(1)