当前位置: 首页>>代码示例>>Python>>正文


Python Symmetry.get_international_table方法代码示例

本文整理汇总了Python中phonopy.structure.symmetry.Symmetry.get_international_table方法的典型用法代码示例。如果您正苦于以下问题:Python Symmetry.get_international_table方法的具体用法?Python Symmetry.get_international_table怎么用?Python Symmetry.get_international_table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在phonopy.structure.symmetry.Symmetry的用法示例。


在下文中一共展示了Symmetry.get_international_table方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: read_crystal

# 需要导入模块: from phonopy.structure.symmetry import Symmetry [as 别名]
# 或者: from phonopy.structure.symmetry.Symmetry import get_international_table [as 别名]
def read_crystal(filename):
    f_crystal = open(filename)
    crystal_in = CrystalIn(f_crystal.readlines())
    f_crystal.close()
    tags = crystal_in.get_tags()
     
     
    cell = Atoms(cell=tags['lattice_vectors'], 
                 symbols=tags['atomic_species'],
                 scaled_positions=tags['coordinates'])
    
    magmoms = tags['magnetic_moments']
    if magmoms is not None:
        # Print out symmetry information for magnetic cases
        # Original code from structure/symmetry.py
        symmetry = Symmetry(cell, symprec=1e-5)
        print("CRYSTAL-interface: Magnetic structure, number of operations without spin: %d" %
              len(symmetry.get_symmetry_operations()['rotations']))
        print("CRYSTAL-interface: Spacegroup without spin: %s" % symmetry.get_international_table())

        cell.set_magnetic_moments(magmoms)
        symmetry = Symmetry(cell, symprec=1e-5)
        print("CRYSTAL-interface: Magnetic structure, number of operations with spin: %d" %
              len(symmetry.get_symmetry_operations()['rotations']))
        print("")
    
    return cell, tags['conv_numbers']
开发者ID:gcgs1,项目名称:phonopy,代码行数:29,代码来源:crystal.py

示例2: gencastep

# 需要导入模块: from phonopy.structure.symmetry import Symmetry [as 别名]
# 或者: from phonopy.structure.symmetry.Symmetry import get_international_table [as 别名]
def gencastep(fn,modenum,basis,natom,typatsym,symprec,atpos):
    from phonopy import Phonopy
    import phonopy.structure.spglib as spg
    from phonopy.structure.atoms import PhonopyAtoms as Atoms
    from phonopy.structure.symmetry import Symmetry, find_primitive, get_pointgroup

    fh=open(fn,'w')
    unitcell = Atoms(symbols=typatsym, cell=basis, positions=atpos)
    pbasis=np.eye(3)
    for i in range(len(basis)):
        pbasis[i]=basis[i]/np.linalg.norm(basis[i])
    symmetry = Symmetry(unitcell, symprec)
    rotations = symmetry.get_symmetry_operations()['rotations']
    translations = symmetry.get_symmetry_operations()['translations']
    print('Space group International symbol: %s' % symmetry.get_international_table())

    fh.write('%BLOCK LATTICE_CART\n')
    for bl in basis:
        fh.write('%s\n' % ''.join(' %12.8f' % b for b in bl))
    fh.write('%ENDBLOCK LATTICE_CART\n\n')
    fh.write('%BLOCK POSITIONS_ABS\n')
    for i in range(len(typatsym)):
        fh.write("  %3s   " % typatsym[i])
        fh.write('%s\n' % ''.join(' %12.8f' % p for p in atpos[i].tolist()))
    fh.write('%ENDBLOCK POSITIONS_ABS\n\n')

    fh.write('SYMMETRY_TOL : %f ang\n' % symprec)
    fh.write('SYMMETRY_GENERATE \n')
    fh.write('#KPOINT_MP_GRID : 4 4 4\n#KPOINT_MP_OFFSET : 0.5 0.5 0.5\n')
开发者ID:ladyteam,项目名称:LADYtools,代码行数:31,代码来源:scan_alnog_mode_castep.py

示例3: test_parse_wien2k_struct

# 需要导入模块: from phonopy.structure.symmetry import Symmetry [as 别名]
# 或者: from phonopy.structure.symmetry.Symmetry import get_international_table [as 别名]
 def test_parse_wien2k_struct(self):
     cell, npts, r0s, rmts = parse_wien2k_struct("BaGa2.struct")
     lattice = cell.get_cell().T
     displacements, supercell = parse_disp_yaml("disp_BaGa2.yaml",
                                                return_cell=True)
     symmetry = Symmetry(cell)
     print(PhonopyAtoms(atoms=cell))
     sym_op = symmetry.get_symmetry_operations()
     print(symmetry.get_international_table())
     for i, (r, t) in enumerate(
             zip(sym_op['rotations'], sym_op['translations'])):
         print("--- %d ---" % (i + 1))
         print(r)
         print(t)
开发者ID:Johnson-Wang,项目名称:phonopy,代码行数:16,代码来源:test_wien2k.py

示例4: _set_x_tags

# 需要导入模块: from phonopy.structure.symmetry import Symmetry [as 别名]
# 或者: from phonopy.structure.symmetry.Symmetry import get_international_table [as 别名]
        self._set_x_tags('xred')

    def _set_x_tags(self, tagname):
        xtag = []
        natom = self._tags['natom']
        for val in self._values:
            xtag += self._get_numerical_values(val)
            if len(xtag) >= natom * 3:
                break

        self._tags[tagname] = np.reshape(xtag[:natom * 3], (-1, 3))

    def _set_znucl(self):
        znucl = []
        ntypat = self._tags['ntypat']
        for val in self._values:
            znucl += self._get_numerical_values(val, num_type='int')
            if len(znucl) >= ntypat:
                break

        self._tags['znucl'] = znucl[:ntypat]

if __name__ == '__main__':
    import sys
    from phonopy.structure.symmetry import Symmetry
    abinit = AbinitIn(open(sys.argv[1]).readlines())
    cell = read_abinit(sys.argv[1])
    symmetry = Symmetry(cell)
    print("# %s" % symmetry.get_international_table())
    print(get_abinit_structure(cell))
开发者ID:gcgs1,项目名称:phonopy,代码行数:32,代码来源:abinit.py

示例5: _set_alat

# 需要导入模块: from phonopy.structure.symmetry import Symmetry [as 别名]
# 或者: from phonopy.structure.symmetry.Symmetry import get_international_table [as 别名]
        self._tags['plat'] = plat

    def _set_alat(self, header):
        hlist = header.split()
        for j in hlist:
            if j.startswith('alat'):
                alat = float(j.split('=')[1])
                break
        self._tags['alat'] = alat    

    def _check_ord(self, header):
        if not 'xpos' in header.split():
            print('EXIT(1): LMTO Interface requires site', end=' ')
            print('files to be in fractional co-ordinates')
            sys.exit(1)
            
    def get_variables(self, header, sites):
        self._check_ord(header)
        self._set_atoms(sites)
        self._set_plat(header)
        self._set_alat(header)
        return self._tags

if __name__ == '__main__':
    import sys
    from phonopy.structure.symmetry import Symmetry
    cell = read_lmto(sys.argv[1])
    symmetry = Symmetry(cell)
    print('# %s' % symmetry.get_international_table())
    print(get_lmto_structure(cell))
开发者ID:gcgs1,项目名称:phonopy,代码行数:32,代码来源:lmto.py

示例6: int

# 需要导入模块: from phonopy.structure.symmetry import Symmetry [as 别名]
# 或者: from phonopy.structure.symmetry.Symmetry import get_international_table [as 别名]
            elif tag == "atomiccoordinatesandatomicspecies":
                lines = block.split('\n')[:-1]
                self._tags["atomiccoordinates"] = [ [float(x)  for x in atom.split()[:3]] for atom in lines ]
                self._tags["atomicspecies"] = [ int(atom.split()[3]) for atom in lines]
       
        #check if the block are present
        self.check_present("atomicspecies")
        self.check_present("atomiccoordinates")
        self.check_present("latticevectors")
        self.check_present("chemicalspecieslabel")
            
        #translate the atomicspecies to atomic numbers
        self._tags["atomicnumbers"] = [self._tags["atomicnumbers"][atype] for atype in self._tags["atomicspecies"]]
    
    def check_present(self,tag):
        if not self._tags[tag]:
            print "%s not present"%tag
            exit()
 
    def __str__():
        return self._tags

        
if __name__ == '__main__':
    import sys
    from phonopy.structure.symmetry import Symmetry
    cell,atypes = read_siesta(sys.argv[1])
    symmetry = Symmetry(cell)
    print "#", symmetry.get_international_table()
    print get_siesta_structure(cell,atypes)
开发者ID:nfh,项目名称:phonopy,代码行数:32,代码来源:siesta.py

示例7: read_vasp

# 需要导入模块: from phonopy.structure.symmetry import Symmetry [as 别名]
# 或者: from phonopy.structure.symmetry.Symmetry import get_international_table [as 别名]
from anharmonic.phonon3.triplets import get_triplets_at_q
from phonopy.interface.vasp import read_vasp 
from phonopy.structure.symmetry import Symmetry
import numpy as np

cell = read_vasp("POSCAR-unitcell")
symmetry = Symmetry(cell, 1e-2)
print symmetry.get_international_table()
reciprocal_lattice = np.linalg.inv(cell.get_cell())
mesh = [7, 7, 7]

print reciprocal_lattice

(triplets_at_q,
 weights_at_q,
 grid_address,
 bz_map,
 triplets_map_at_q,
 ir_map_at_q)= get_triplets_at_q(74,
                                 mesh,
                                 symmetry.get_pointgroup_operations(),
                                 reciprocal_lattice,
                                 stores_triplets_map=True)

for triplet in triplets_at_q:
    sum_q = (grid_address[triplet]).sum(axis=0)
    if (sum_q % mesh != 0).any():
        print "============= Warning =================="
        print triplet
        for tp in triplet:
            print grid_address[tp], np.linalg.norm(np.dot(reciprocal_lattice, grid_address[tp] / mesh))
开发者ID:Johnson-Wang,项目名称:phonopy,代码行数:33,代码来源:triplets_search.py


注:本文中的phonopy.structure.symmetry.Symmetry.get_international_table方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。