Exemplo n.º 1
0
    def setUp(self):
        self.places = 6
        self.e_places = 6
        self.f_places = 6
        self.v_places = 6

        system_1 = dpdata.LabeledSystem('gaussian/methane.gaussianlog',
                                        fmt='gaussian/log')
        system_2 = dpdata.LabeledSystem(
            'gaussian/methane_reordered.gaussianlog', fmt='gaussian/log')
        system_3 = dpdata.LabeledSystem('gaussian/methane_sub.gaussianlog',
                                        fmt='gaussian/log')
        system_4 = dpdata.LabeledSystem('gaussian/noncoveraged.gaussianlog',
                                        fmt='gaussian/log')

        systems = dpdata.MultiSystems(system_1, system_2, system_3, system_4)
        path = "tmp.deepmd.multi"
        systems.to_deepmd_raw(path)
        self.system_1 = dpdata.LabeledSystem(os.path.join(path, 'C1H3'),
                                             fmt='deepmd/raw',
                                             type_map=['C', 'H'])
        self.system_2 = system_3
Exemplo n.º 2
0
    def setUp(self):
        self.places = 6
        self.e_places = 6
        self.f_places = 6
        self.v_places = 6

        system_1 = dpdata.LabeledSystem('gaussian/methane.gaussianlog',
                                        fmt='gaussian/log')
        system_2 = dpdata.LabeledSystem(
            'gaussian/methane_reordered.gaussianlog', fmt='gaussian/log')
        system_3 = dpdata.LabeledSystem('gaussian/methane_sub.gaussianlog',
                                        fmt='gaussian/log')
        system_4 = dpdata.LabeledSystem('gaussian/noncoveraged.gaussianlog',
                                        fmt='gaussian/log')

        self.systems = dpdata.MultiSystems(system_1, system_3, system_4)
        self.systems.append(system_2)
        self.system_1 = self.systems['C1H3']
        self.system_2 = system_3

        self.system_names = ['C1H4', 'C1H3']
        self.system_sizes = {'C1H4': 2, 'C1H3': 1}
        self.atom_names = ['C', 'H']
Exemplo n.º 3
0
 def test_npy_type_map(self):
     system_1 = dpdata.LabeledSystem('poscars/OUTCAR.h2o.md',
                                     fmt='vasp/outcar')
     system_1.to_deepmd_npy('tmp.deepmd')
     with open(os.path.join('tmp.deepmd', 'type_map.raw')) as fp:
         tm = fp.read().split()
     self.assertEqual(tm, ['O', 'H'])
     self.assertEqual(system_1['atom_names'], ['O', 'H'])
     self.assertEqual(system_1['atom_types'][0], 0)
     self.assertEqual(system_1['atom_types'][1], 0)
     self.assertEqual(system_1['atom_types'][2], 1)
     self.assertEqual(system_1['atom_types'][3], 1)
     self.assertEqual(system_1['atom_types'][4], 1)
     self.assertEqual(system_1['atom_types'][5], 1)
Exemplo n.º 4
0
    def setUp(self):
        self.places = 6
        self.e_places = 6
        self.f_places = 6
        self.v_places = 6

        system_1 = dpdata.LabeledSystem('gaussian/methane.gaussianlog', fmt='gaussian/log')
        system_2 = dpdata.LabeledSystem('gaussian/methane_reordered.gaussianlog', fmt='gaussian/log')
        system_3 = dpdata.LabeledSystem('gaussian/methane_sub.gaussianlog', fmt='gaussian/log')
        system_4 = dpdata.LabeledSystem('gaussian/noncoveraged.gaussianlog', fmt='gaussian/log')

        self.systems = dpdata.MultiSystems(system_1)
        self.systems += system_2
        self.systems += system_3
        self.systems += system_4
        for s in self.systems:
            if s.formula == 'C1H3':
                self.system_1 = s
        self.system_2 = system_3
    
        self.system_names = ['C1H4', 'C1H3']
        self.system_sizes = {'C1H4':2, 'C1H3':1}
        self.atom_names = ['C', 'H']
Exemplo n.º 5
0
 def test_data_empty(self):
     data = {
         'atom_names': ['A', 'B'],
         'atom_numbs': [0, 0],
         'atom_types': np.array([], dtype=int),
         'orig': np.array([0, 0, 0]),
         'cells': np.array([]),
         'coords': np.array([]),
     }
     sys1 = dpdata.System(data=data)
     data = {
         'atom_names': ['A', 'B'],
         'atom_numbs': [0, 0],
         'atom_types': np.array([], dtype=int),
         'orig': np.array([0, 0, 0]),
         'cells': np.array([]),
         'coords': np.array([]),
         'forces': np.array([]),
         'energies': np.array([]),
         'virials': np.array([]),
     }
     sys2 = dpdata.LabeledSystem(data=data)
Exemplo n.º 6
0
 def setUp(self):
     self.system_al = dpdata.LabeledSystem(['qe.scf/Al.in', 'qe.scf/Al.out'], fmt='qe/pw/scf')
Exemplo n.º 7
0
 def setUp(self):
     self.system_ch4 = dpdata.LabeledSystem('pwscf.scf/01.out',
                                            fmt='pwscf/scf')
     self.system_h2o = dpdata.LabeledSystem('pwscf.scf/02.out',
                                            fmt='pwscf/scf')
Exemplo n.º 8
0
 def setUp (self) :
     self.system = dpdata.LabeledSystem('gaussian/noncoveraged.gaussianlog',
                                        fmt = 'gaussian/log')
     self.atom_names = []
     self.atom_numbs = []
     self.nframes = 0
Exemplo n.º 9
0
 def setUp(self):
     self.system_ch4 = dpdata.LabeledSystem(['qe.scf/01.in', 'qe.scf/01.out'], fmt='qe/pw/scf')
     self.system_h2o = dpdata.LabeledSystem(['qe.scf/02.in', 'qe.scf/02.out'], fmt='qe/pw/scf')
Exemplo n.º 10
0
 def setUp(self):
     self.system = dpdata.LabeledSystem('pwscf.traj/oh-md',
                                        fmt='pwscf/traj')
Exemplo n.º 11
0
 def setUp(self):
     self.system_water = dpdata.LabeledSystem('abacus.md',fmt='abacus/md')
Exemplo n.º 12
0
 def setUp(self):
     self.system = dpdata.LabeledSystem('fhi_aims/out_scf',
                                        fmt='fhi_aims/scf')
Exemplo n.º 13
0
 def setUp (self) :
     self.system_1 = dpdata.LabeledSystem('gaussian/methane.gaussianlog', fmt='gaussian/log')
     self.system_2 = dpdata.LabeledSystem('gaussian/methane_reordered.gaussianlog', fmt='gaussian/log')
     self.system_3 = dpdata.LabeledSystem('gaussian/methane_sub.gaussianlog', fmt='gaussian/log')
     self.system_4 = dpdata.LabeledSystem('gaussian/noncoveraged.gaussianlog', fmt='gaussian/log')
Exemplo n.º 14
0
 def setUp(self):
     self.system = dpdata.LabeledSystem('gaussian/noncoveraged.gaussianlog',
                                        fmt='gaussian/log')
Exemplo n.º 15
0
 def setUp(self):
     self.system = dpdata.LabeledSystem('cp2k/cp2k_output',
                                        fmt='cp2k/output')
Exemplo n.º 16
0
 def setUp(self):
     self.system = dpdata.LabeledSystem('gaussian/methane.gaussianlog',
                                        fmt='gaussian/log')
 def setUp(self):
     self.system = dpdata.LabeledSystem('fhi_aims/output_multi_elements',
                                        fmt='fhi_aims/md')
Exemplo n.º 18
0
 def setUp(self):
     self.system = dpdata.LabeledSystem('siesta/aimd/output',
                                        fmt='siesta/aiMD_output')
Exemplo n.º 19
0
    def setUp(self):
        self.LabeledSystem1 = dpdata.LabeledSystem(os.path.join('poscars', 'OUTCAR.ch4.unconverged'),\
        fmt='outcar' )

        self.LabeledSystem2 = dpdata.LabeledSystem(os.path.join('poscars', 'OUTCAR.ch4.1step'),\
        fmt='outcar' )
Exemplo n.º 20
0
 def test_empty(self):
     sys1 = dpdata.System(type_map=['A', 'H', 'B', 'O', 'D'])
     sys2 = dpdata.LabeledSystem(type_map=['A', 'H', 'B', 'O', 'D'])
Exemplo n.º 21
0
 def setUp(self): 
     self.system = dpdata.LabeledSystem('qe.traj/oh-md', fmt = 'qe/cp/traj')
Exemplo n.º 22
0
 def test(self):
     system = dpdata.LabeledSystem('poscars/6362_OUTCAR', fmt='vasp/outcar')
     expected_types = [0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1]
     self.assertEqual(list(system['atom_types']), expected_types)
     self.assertEqual(system['atom_names'], ['B', 'O'])
     self.assertEqual(system['atom_numbs'], [8, 6])
Exemplo n.º 23
0
 def setUp (self) :
     self.system_1 = dpdata.LabeledSystem('poscars/vasprun.h2o.md.10.xml')
     self.system_types = np.array([0,0,1,1,1,1]) 
     self.system_2 = self.system_1.set_atom_types(["H","C","O"])
     self.system_3 = self.system_1.set_atom_types({"H":2,"C":1,"O":3})
Exemplo n.º 24
0
 def restart_error(self):
     with self.assertRaises(AssertionError):
         dpdata.LabeledSystem('cp2k/restart_aimd',
                              fmt='cp2k/aimd_output',
                              restart=False)
Exemplo n.º 25
0
 def setUp(self):
     self.system = dpdata.LabeledSystem('siesta/scf/siesta_output',
                                        fmt='siesta/output')
Exemplo n.º 26
0
 def setUp(self):
     self.system_ch4 = dpdata.LabeledSystem('abacus.scf', fmt='abacus/scf')