本文整理汇总了Python中pyscf.symm.geom.detect_symm函数的典型用法代码示例。如果您正苦于以下问题:Python detect_symm函数的具体用法?Python detect_symm怎么用?Python detect_symm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了detect_symm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_d5h
def test_d5h(self):
atoms = ringhat(5, u)
atoms = atoms[5:]
gpname, orig, axes = geom.detect_symm(atoms)
self.assertEqual(gpname, 'D5h')
gpname, axes = geom.subgroup(gpname, axes)
atoms = geom.shift_atom(atoms, orig, axes)
self.assertEqual(gpname, 'C2v')
self.assertTrue(geom.check_given_symm('C2v', atoms))
self.assertEqual(geom.symm_identical_atoms(gpname, atoms),
[[0], [1, 4], [2, 3], [5, 6]])
atoms = ringhat(5, u)
atoms = atoms[5:]
atoms[1][0] = 'C1'
gpname, orig, axes = geom.detect_symm(atoms, {'C':'ccpvdz','C1':'sto3g','N':'631g'})
self.assertEqual(gpname, 'C2v')
gpname, axes = geom.subgroup(gpname, axes)
atoms = geom.shift_atom(atoms, orig, axes)
self.assertEqual(gpname, 'C2v')
self.assertTrue(geom.check_given_symm('C2v', atoms))
self.assertEqual(geom.symm_identical_atoms(gpname, atoms),
[[0,2],[1],[3,4],[5,6]])
示例2: test_ghost
def test_ghost(self):
atoms = [
['Fe' , ( 0.0, 0.0, 0.0)],
['O' , (-1.3, 0.0, 0.0)],
['GHOST-O' , ( 1.3, 0.0, 0.0)],
['GHOST-O' , ( 0.0, -1.3, 0.0)],
['O' , ( 0.0, 1.3, 0.0)],]
l, orig, axes = geom.detect_symm(atoms)
self.assertEqual(l, 'C2v')
self.assertAlmostEqual(axes[2,0]*axes[2,1], -.5)
atoms = [
['Fe' , ( 0.0, 0.0, 0.0)],
['O' , (-1.3, 0.0, 0.0)],
['XO' , ( 1.3, 0.0, 0.0)],
['GHOSTO' , ( 0.0, -1.3, 0.0)],
['O' , ( 0.0, 1.3, 0.0)],]
l, orig, axes = geom.detect_symm(atoms)
self.assertEqual(l, 'C2v')
self.assertAlmostEqual(axes[2,0]*axes[2,1], -.5)
atoms = [
['Fe' , ( 0.0, 0.0, 0.0)],
['O' , (-1.3, 0.0, 0.0)],
['X' , ( 1.3, 0.0, 0.0)],
['X' , ( 0.0, -1.3, 0.0)],
['O' , ( 0.0, 1.3, 0.0)],]
l, orig, axes = geom.detect_symm(atoms)
self.assertEqual(l, 'C2v')
self.assertAlmostEqual(axes[2,0]*axes[2,1], -.5)
示例3: test_detect_symm_c2h
def test_detect_symm_c2h(self):
atoms = [['H' , (1., 0., 2.)],
['He', (0., 1., 0.)],
['H' , (1., 0., 0.)],
['H' , (-1.,0., 0.)],
['H' , (-1.,0.,-2.)],
['He', (0.,-1., 0.)]]
l, orig, axes = geom.detect_symm(atoms)
atoms = geom.shift_atom(atoms, orig, axes)
self.assertEqual(l, 'C2h')
self.assertEqual(geom.symm_identical_atoms(l,atoms), [[0,4],[1,5],[2,3]])
self.assertTrue(geom.check_given_symm('C2h', atoms))
atoms = [['H' , (1., 0., 1.)],
['H' , (1., 0.,-1.)],
['He', (0., 0., 2.)],
['He', (2., 0.,-2.)],
['Li', (1., 1., 0.)],
['Li', (1.,-1., 0.)]]
l, orig, axes = geom.detect_symm(atoms)
atoms = geom.shift_atom(atoms, orig, axes)
self.assertEqual(l, 'C2h')
self.assertEqual(geom.symm_identical_atoms(l,atoms),
[[0, 1], [2, 3], [4, 5]])
self.assertTrue(geom.check_given_symm('C2h', atoms))
示例4: test_quasi_c2v
def test_quasi_c2v(self):
atoms = [
['Fe', ( 0.0000000000, 0.0055197721, 0.0055197721)],
['O' , (-1.3265475500, 0.0000000000, -0.9445024777)],
['O' , ( 1.3265475500, 0.0000000000, -0.9445024777)],
['O' , ( 0.0000000000, -1.3265374484, 0.9444796669)],
['O' , ( 0.0000000000, 1.3265374484, 0.9444796669)],]
l, orig, axes = geom.detect_symm(atoms)
self.assertEqual(l, 'Cs')
tolbak, geom.TOLERANCE = geom.TOLERANCE, 1e-2
l, orig, axes = geom.detect_symm(atoms)
self.assertEqual(l, 'C2v')
geom.TOLERANCE = tolbak
示例5: test_c3v_1
def test_c3v_1(self):
mol = gto.M(atom='''
C 0.948065 -0.081406 -0.007893
C 0.462608 -0.144439 1.364854
N 0.077738 -0.194439 2.453356
H 0.591046 0.830035 -0.495369
H 0.591062 -0.944369 -0.576807
H 2.041481 -0.080642 -0.024174''')
gpname, orig, axes = geom.detect_symm(mol._atom)
self.assertEqual(gpname, 'C1')
with lib.temporary_env(geom, TOLERANCE=1e-3):
gpname, orig, axes = geom.detect_symm(mol._atom)
self.assertEqual(gpname, 'C3v')
示例6: test_t
def test_t(self):
atoms = [['C', ( 1.0 ,-1.0 , 1.0 )],
['O', ( 1.0-.1,-1.0+.2, 1.0 )],
['O', ( 1.0 ,-1.0+.1, 1.0-.2)],
['O', ( 1.0-.2,-1.0 , 1.0-.1)],
['C', (-1.0 , 1.0 , 1.0 )],
['O', (-1.0+.1, 1.0-.2, 1.0 )],
['O', (-1.0 , 1.0-.1, 1.0-.2)],
['O', (-1.0+.2, 1.0 , 1.0-.1)],
['C', ( 1.0 , 1.0 ,-1.0 )],
['O', ( 1.0-.2, 1.0 ,-1.0+.1)],
['O', ( 1.0 , 1.0-.1,-1.0+.2)],
['O', ( 1.0-.1, 1.0-.2,-1.0 )],
['C', (-1.0 ,-1.0 ,-1.0 )],
['O', (-1.0 ,-1.0+.1,-1.0+.2)],
['O', (-1.0+.2,-1.0 ,-1.0+.1)],
['O', (-1.0+.1,-1.0+.2,-1.0 )]]
gpname, orig, axes = geom.detect_symm(atoms)
self.assertEqual(gpname, 'T')
gpname, axes = geom.subgroup(gpname, axes)
atoms = geom.shift_atom(atoms, orig, axes)
self.assertEqual(gpname, 'D2')
self.assertTrue(geom.check_given_symm('D2', atoms))
self.assertEqual(geom.symm_identical_atoms(gpname, atoms),
[[0, 4, 8, 12], [1, 5, 11, 15],
[2, 6, 10, 13], [3, 7, 9, 14]])
示例7: test_quasi_c2v
def test_quasi_c2v(self):
atoms = [
['Fe', ( 0.0000000000, 0.0055197721, 0.0055197721)],
['O' , (-1.3265475500, 0.0000000000, -0.9445024777)],
['O' , ( 1.3265475500, 0.0000000000, -0.9445024777)],
['O' , ( 0.0000000000, -1.3265374484, 0.9444796669)],
['O' , ( 0.0000000000, 1.3265374484, 0.9444796669)],]
l, orig, axes = geom.detect_symm(atoms)
self.assertEqual(l, 'Cs')
with lib.temporary_env(geom, TOLERANCE=1e-2):
l, orig, axes = geom.detect_symm(atoms)
self.assertEqual(l, 'C2v')
with lib.temporary_env(geom, TOLERANCE=1e-1):
l, orig, axes = geom.detect_symm(atoms)
self.assertEqual(l, 'Td')
示例8: test_c2
def test_c2(self):
coords1 = numpy.dot(make4(2.5), 1)
coords2 = make12(1.2)
axes = geom._make_axes(coords2[1]-coords2[0], coords2[2])
coords2 = numpy.dot(coords2, axes.T)
atoms = [['C', c] for c in numpy.vstack((coords1,coords2))]
gpname, orig, axes = geom.detect_symm(atoms)
self.assertEqual(gpname, 'C2')
示例9: test_s10
def test_s10(self):
numpy.random.seed(19)
rotz = numpy.eye(3)
rotz[:2,:2] = numpy.linalg.svd(numpy.random.random((2,2)))[0]
coords1 = numpy.dot(make60(1.5, 3.0), u)
coords2 = reduce(numpy.dot, (make20(1.1), rotz, u))
atoms = [['C', c] for c in coords1] + [['C', c] for c in coords2]
gpname, orig, axes = geom.detect_symm(atoms)
self.assertEqual(gpname, 'S10')
示例10: test_cs
def test_cs(self):
coords1 = make4(2.5)
axes = geom._make_axes(coords1[1]-coords1[0], coords1[2])
coords1 = numpy.dot(coords1, axes.T)
coords2 = make12(1.2)
axes = geom._make_axes(coords2[1]-coords2[0], coords2[2])
coords2 = numpy.dot(coords2, axes.T)
atoms = [['C', c] for c in numpy.vstack((coords1,coords2))]
gpname, orig, axes = geom.detect_symm(atoms)
self.assertEqual(gpname, 'Cs')
numpy.random.seed(1)
c0 = numpy.random.random((4,3))
c0[:,1] *= .5
c1 = c0.copy()
c1[:,1] *= -1
atoms = [['C', c] for c in numpy.vstack((c0,c1))]
gpname, orig, axes = geom.detect_symm(atoms)
self.assertEqual(gpname, 'Cs')
示例11: test_ih4
def test_ih4(self):
coords1 = make12(1.5)
atoms = [['C', c] for c in coords1]
gpname, orig, axes = geom.detect_symm(atoms)
self.assertEqual(gpname, 'Ih')
gpname, axes = geom.subgroup(gpname, axes)
atoms = geom.shift_atom(atoms, orig, axes)
self.assertEqual(gpname, 'Ci')
self.assertTrue(geom.check_given_symm('Ci', atoms))
示例12: test_d6h
def test_d6h(self):
atoms = ringhat(6, u)
atoms = atoms[6:]
gpname, orig, axes = geom.detect_symm(atoms)
self.assertEqual(gpname, 'D6h')
gpname, axes = geom.subgroup(gpname, axes)
atoms = geom.shift_atom(atoms, orig, axes)
self.assertEqual(geom.symm_identical_atoms(gpname, atoms),
[[0,3],[1,2,4,5],[6,7]])
self.assertTrue(geom.check_given_symm('D2h', atoms))
示例13: test_detect_symm_d2h_b
def test_detect_symm_d2h_b(self):
atoms = [['H' , (1., 0., 2.)],
['He', (0., 1., 0.)],
['H' , (-1.,0.,-2.)],
['He', (0.,-1., 0.)]]
l, orig, axes = geom.detect_symm(atoms)
self.assertEqual(l, 'D2h')
atoms = geom.shift_atom(atoms, orig, axes)
self.assertTrue(geom.check_given_symm('D2h', atoms))
self.assertEqual(geom.symm_identical_atoms(l,atoms), [[0,2],[1,3]])
示例14: test_oh2
def test_oh2(self):
coords1 = numpy.dot(make8(1.5), u)
atoms = [['C', c] for c in coords1]
gpname, orig, axes = geom.detect_symm(atoms)
self.assertEqual(gpname, 'Oh')
gpname, axes = geom.subgroup(gpname, axes)
atoms = geom.shift_atom(atoms, orig, axes)
self.assertEqual(gpname, 'D2h')
self.assertTrue(geom.check_given_symm('D2h', atoms))
示例15: test_c5v
def test_c5v(self):
atoms = ringhat(5, u)[5:-1]
gpname, orig, axes = geom.detect_symm(atoms)
self.assertEqual(gpname, 'C5v')
gpname, axes = geom.subgroup(gpname, axes)
atoms = geom.shift_atom(atoms, orig, axes)
self.assertEqual(gpname, 'Cs')
self.assertTrue(geom.check_given_symm('Cs', atoms))
self.assertEqual(geom.symm_identical_atoms(gpname, atoms),
[[0, 1], [2, 4], [3], [5]])