本文整理汇总了Python中pymatgen.symmetry.analyzer.SpacegroupAnalyzer.is_laue方法的典型用法代码示例。如果您正苦于以下问题:Python SpacegroupAnalyzer.is_laue方法的具体用法?Python SpacegroupAnalyzer.is_laue怎么用?Python SpacegroupAnalyzer.is_laue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.symmetry.analyzer.SpacegroupAnalyzer
的用法示例。
在下文中一共展示了SpacegroupAnalyzer.is_laue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_adsorb_both_surfaces
# 需要导入模块: from pymatgen.symmetry.analyzer import SpacegroupAnalyzer [as 别名]
# 或者: from pymatgen.symmetry.analyzer.SpacegroupAnalyzer import is_laue [as 别名]
def test_adsorb_both_surfaces(self):
# Test out for monatomic adsorption
o = Molecule("O", [[0, 0, 0]])
adslabs = self.asf_100.adsorb_both_surfaces(o)
adslabs_one = self.asf_100.generate_adsorption_structures(o)
self.assertEqual(len(adslabs), len(adslabs_one))
for adslab in adslabs:
sg = SpacegroupAnalyzer(adslab)
sites = sorted(adslab, key=lambda site: site.frac_coords[2])
self.assertTrue(sites[0].species_string == "O")
self.assertTrue(sites[-1].species_string == "O")
self.assertTrue(sg.is_laue())
# Test out for molecular adsorption
oh = Molecule(["O", "H"], [[0, 0, 0], [0, 0, 1]])
adslabs = self.asf_100.adsorb_both_surfaces(oh)
adslabs_one = self.asf_100.generate_adsorption_structures(oh)
self.assertEqual(len(adslabs), len(adslabs_one))
for adslab in adslabs:
sg = SpacegroupAnalyzer(adslab)
sites = sorted(adslab, key=lambda site: site.frac_coords[2])
self.assertTrue(sites[0].species_string in ["O", "H"])
self.assertTrue(sites[-1].species_string in ["O", "H"])
self.assertTrue(sg.is_laue())
示例2: test_symmetrization
# 需要导入模块: from pymatgen.symmetry.analyzer import SpacegroupAnalyzer [as 别名]
# 或者: from pymatgen.symmetry.analyzer.SpacegroupAnalyzer import is_laue [as 别名]
def test_symmetrization(self):
# Restricted to primitive_elemental materials due to the risk of
# broken stoichiometry. For compound materials, use is_polar()
# Get all slabs for P6/mmm Ti and Fm-3m Ag up to index of 2
all_Ti_slabs = generate_all_slabs(self.ti, 2, 10, 10, bonds=None,
tol=1e-3, max_broken_bonds=0,
lll_reduce=False, center_slab=False,
primitive=True, max_normal_search=2,
symmetrize=True)
all_Ag_fcc_slabs = generate_all_slabs(self.agfcc, 2, 10, 10, bonds=None,
tol=1e-3, max_broken_bonds=0,
lll_reduce=False,
center_slab=False,
primitive=True,
max_normal_search=2,
symmetrize=True)
all_slabs = [all_Ti_slabs, all_Ag_fcc_slabs]
for i, slabs in enumerate(all_slabs):
assymetric_count = 0
symmetric_count = 0
for i, slab in enumerate(slabs):
sg = SpacegroupAnalyzer(slab)
# Check if a slab is symmetric
if not sg.is_laue():
assymetric_count += 1
else:
symmetric_count += 1
# Check if slabs are all symmetric
self.assertEqual(assymetric_count, 0)
self.assertEqual(symmetric_count, len(slabs))
示例3: test_get_symmetric_sites
# 需要导入模块: from pymatgen.symmetry.analyzer import SpacegroupAnalyzer [as 别名]
# 或者: from pymatgen.symmetry.analyzer.SpacegroupAnalyzer import is_laue [as 别名]
def test_get_symmetric_sites(self):
# Check to see if we get an equivalent site on one
# surface if we add a new site to the other surface
all_Ti_slabs = generate_all_slabs(self.ti, 2, 10, 10, bonds=None,
tol=1e-3, max_broken_bonds=0,
lll_reduce=False, center_slab=False,
primitive=True, max_normal_search=2,
symmetrize=True)
for slab in all_Ti_slabs:
sorted_sites = sorted(slab, key=lambda site: site.frac_coords[2])
site = sorted_sites[-1]
point = np.array(site.frac_coords)
point[2] = point[2] + 0.1
point2 = slab.get_symmetric_site(point)
slab.append("O", point)
slab.append("O", point2)
# Check if slab is all symmetric
sg = SpacegroupAnalyzer(slab)
self.assertTrue(sg.is_laue())
示例4: test_is_laue
# 需要导入模块: from pymatgen.symmetry.analyzer import SpacegroupAnalyzer [as 别名]
# 或者: from pymatgen.symmetry.analyzer.SpacegroupAnalyzer import is_laue [as 别名]
def test_is_laue(self):
s = Structure.from_spacegroup("Fm-3m", np.eye(3) * 3, ["Cu"],
[[0, 0, 0]])
a = SpacegroupAnalyzer(s)
self.assertTrue(a.is_laue())