예제 #1
0
 def test_parse_orb(self):
     sym = Orb(resource('mol-c2h6-sym.scforb'))
     nym = Orb(resource('mol-c2h6-nosym.scforb'))
     sym.parse_momatrix()
     nym.parse_momatrix()
     self.assertTrue(sym.momatrix.shape[0] == 274)
     self.assertTrue(nym.momatrix.shape[0] == 900)
예제 #2
0
 def test_parse_orb(self):
     sym = Orb(resource('mol-c2h6-sym.scforb'))
     nym = Orb(resource('mol-c2h6-nosym.scforb'))
     sym.parse_momatrix()
     nym.parse_momatrix()
     self.assertTrue(sym.momatrix.shape[0] == 274)
     self.assertTrue(nym.momatrix.shape[0] == 900)
예제 #3
0
 def setUp(self):
     tar = open(resource('va-vroa-h2o2.tar.bz'), mode='r')
     tar.extractall()
     tar.close()
     tar = open(resource('va-vroa-methyloxirane.tar.bz'), mode='r')
     tar.extractall()
     tar.close()
예제 #4
0
 def test_compare_fields(self):
     chk = Universe.load(resource('adf-lu-valid.hdf5'))
     uni = Universe.load(resource('adf-lu.hdf5'))
     uni.add_molecular_orbitals(vector=range(8, 60), verbose=False,
                                field_params=chk.field.loc[0])
     res = compare_fields(chk, uni, signed=False, verbose=False)
     self.assertTrue(np.isclose(len(res), sum(res), rtol=5e-4))
예제 #5
0
 def setUp(self):
     # TODO : add some cartesian basis set files
     #        a geometry optimization and
     #        maybe properties? like the frequency
     #        and tddft calcs
     self.uo2 = Output(resource('g09-uo2.out'))
     self.mam3 = Output(resource('g09-ch3nh2-631g.out'))
     self.mam4 = Output(resource('g09-ch3nh2-augccpvdz.out'))
예제 #6
0
 def setUp(self):
     self.h2o = XYZ(resource('H2O.xyz'))
     self.h2o.parse_atom()
     self.h2 = XYZ(resource('H2.xyz'))
     self.h2.parse_atom()
     self.znpor = XYZ(resource('ZnPorphyrin.xyz'))
     self.znpor.parse_atom()
     self.cols = ['x', 'y', 'z']
예제 #7
0
 def test_compare_fields(self):
     nw = nwchem.Output(resource('nw-ch3nh2-631g.out')).to_universe()
     mo = molcas.Output(resource('mol-ch3nh2-631g.out'))
     mo.add_orb(resource('mol-ch3nh2-631g.scforb'))
     mo = mo.to_universe()
     nw.add_molecular_orbitals(vector=range(3, 10), verbose=False)
     mo.add_molecular_orbitals(vector=range(3, 10), verbose=False)
     res = compare_fields(nw, mo, signed=False, rtol=5e-3)
     self.assertTrue(np.isclose(sum(res), len(res), rtol=5e-3))
예제 #8
0
 def setUp(self):
     self.h2o2_freq = Fchk(resource('g16-h2o2-def2tzvp-freq.fchk'))
     self.methyloxirane_freq = Fchk(resource('g16-methyloxirane-def2tzvp-freq.fchk'))
     tar = open(resource('va-vroa-h2o2.tar.bz'), mode='r')
     tar.extractall()
     tar.close()
     tar = open(resource('va-vroa-methyloxirane.tar.bz'), mode='r')
     tar.extractall()
     tar.close()
예제 #9
0
 def setUp(self):
     self.chk = Universe.load(resource('mol-carbon-dz-valid.hdf5'))
     kws = {'field_params': self.chk.field.loc[0], 'verbose': False}
     uni = Universe.load(resource('mol-carbon-dz.hdf5'))
     add_molecular_orbitals(uni, vector=range(5), **kws)
     add_density(uni, mocoefs='coef', **kws)
     add_orb_ang_mom(uni, rcoefs='lreal', icoefs='limag', **kws)
     add_density(uni, mocoefs='sx', **kws)
     add_density(uni, mocoefs='sy', **kws)
     add_density(uni, mocoefs='sz', **kws)
     self.uni = uni
예제 #10
0
 def setUp(self):
     # TODO : add some cartesian basis set files
     self.uo2 = Output(resource('g09-uo2.out'))
     self.mam3 = Output(resource('g09-ch3nh2-631g.out'))
     self.mam4 = Output(resource('g09-ch3nh2-augccpvdz.out'))
     # need two because of the current limitations in the parse_frequency code
     self.meth_opt = Output(resource('g16-methyloxirane-def2tzvp-opt.out'))
     self.meth_freq = Output(resource('g16-methyloxirane-def2tzvp-freq.out'))
     self.nap_tddft = Output(resource('g16-naproxen-def2tzvp-tddft.out'))
     self.h2o2_tddft = Output(resource('g16-h2o2-def2tzvp-tddft.out'))
     self.nap_opt = Output(resource('g16-naproxen-def2tzvp-opt.out'))
     self.nitro_nmr = Output(resource('g16-nitromalonamide-6-31++g-nmr.out'))
     # to test having both a geometry optimization and frequencies calculation
     self.meth_opt_freq_hp = Output(resource('g16-methyloxirane-def2tzvp-opt-freq.out'))
예제 #11
0
 def test_parse_momatrix(self):
     """Test the momatrix table parser."""
     uo2sp = Orb(resource('mol-uo2-anomb.scforb'))
     uo2sp.parse_momatrix()
     self.assertEqual(uo2sp.momatrix.shape[0], 4761)
     self.assertTrue(np.all(pd.notnull(pd.DataFrame(uo2sp.momatrix))))
     self.assertTrue(np.all(pd.notnull(pd.DataFrame(uo2sp.orbital))))
     mamcart = Orb(resource('mol-ch3nh2-631g.scforb'))
     mamcart.parse_momatrix()
     self.assertEqual(mamcart.momatrix.shape[0], 784)
     self.assertTrue(np.all(pd.notnull(pd.DataFrame(mamcart.momatrix))))
     self.assertTrue(np.all(pd.notnull(pd.DataFrame(mamcart.orbital))))
     mamsphr = Orb(resource('mol-ch3nh2-anovdzp.scforb'))
     mamsphr.parse_momatrix()
     self.assertEqual(mamsphr.momatrix.shape[0], 2809)
     self.assertTrue(np.all(pd.notnull(pd.DataFrame(mamsphr.momatrix))))
     self.assertTrue(np.all(pd.notnull(pd.DataFrame(mamsphr.orbital))))
예제 #12
0
 def test_parse_momatrix(self):
     """Test the momatrix table parser."""
     uo2sp = Orb(resource('mol-uo2-anomb.scforb'))
     uo2sp.parse_momatrix()
     self.assertEqual(uo2sp.momatrix.shape[0], 4761)
     self.assertTrue(np.all(pd.notnull(uo2sp.momatrix)))
     self.assertTrue(np.all(pd.notnull(uo2sp.orbital)))
     mamcart = Orb(resource('mol-ch3nh2-631g.scforb'))
     mamcart.parse_momatrix()
     self.assertEqual(mamcart.momatrix.shape[0], 784)
     self.assertTrue(np.all(pd.notnull(mamcart.momatrix)))
     self.assertTrue(np.all(pd.notnull(mamcart.orbital)))
     mamsphr = Orb(resource('mol-ch3nh2-anovdzp.scforb'))
     mamsphr.parse_momatrix()
     self.assertEqual(mamsphr.momatrix.shape[0], 2809)
     self.assertTrue(np.all(pd.notnull(mamsphr.momatrix)))
     self.assertTrue(np.all(pd.notnull(mamsphr.orbital)))
예제 #13
0
 def test_add_orb(self):
     """Test adding orbital file functionality."""
     self.mamcart.add_orb(resource('mol-ch3nh2-631g.scforb'))
     self.assertTrue(hasattr(self.mamcart, 'momatrix'))
     self.assertTrue(hasattr(self.mamcart, 'orbital'))
     with self.assertRaises(ValueError):
         self.mamcart.add_orb(resource('mol-ch3nh2-631g.scforb'))
     self.mamcart.add_orb(resource('mol-ch3nh2-631g.scforb'),
                          mocoefs='same')
     self.assertTrue('same' in self.mamcart.momatrix.columns)
     self.assertTrue('same' in self.mamcart.orbital.columns)
     self.mamcart.add_orb(resource('mol-ch3nh2-631g.scforb'),
                          mocoefs='diff', orbocc='diffocc')
     self.assertTrue('diff' in self.mamcart.momatrix.columns)
     self.assertTrue('diffocc' in self.mamcart.orbital.columns)
     uni = self.mamcart.to_universe()
     self.assertTrue(hasattr(uni, 'momatrix'))
     self.assertTrue(hasattr(uni, 'orbital'))
예제 #14
0
 def setUp(self):
     self.lu = Output(resource('adf-lu.out'))
     # TODO :: File with excitation
     self.pf3 = Output(resource('adf-pf3-nmr.out'))
     self.c2h2 = Output(resource('adf-c2h2-cpl.out'))
     self.ch4 = Output(resource('adf-ch4-opt-freq.out'))
     self.c2h2_nofrag = Output(resource('adf-c2h2-cpl-nofrag.out'))
     self.c2h3i = Output(resource('adf-c2h3i-opt.out'))
     self.nico4 = Output(resource('adf-nico4.out'))
예제 #15
0
    def setUp(self):
        dz = MolOutput(resource('mol-carbon-dz.out'))
        dz.add_overlap(resource('mol-carbon-dz.overlap'))

        li = MolOutput(resource('mol-li-ano.out'))
        li.add_overlap(resource('mol-li-ano.overlap'))

        zno2 = MolOutput(resource('mol-zno2-dz.out'))
        zno2.add_overlap(resource('mol-zno2-dz.overlap'))

        npo2 = MolOutput(resource('mol-npo2-ano.out'))
        npo2.add_overlap(resource('mol-npo2-ano.overlap'))

        self.unis = [dz.to_universe(), li.to_universe(),
                     zno2.to_universe(), npo2.to_universe()]
예제 #16
0
    def setUp(self):
        dz = MolOutput(resource('mol-carbon-dz.out'))
        dz.add_overlap(resource('mol-carbon-dz.overlap'))

        li = MolOutput(resource('mol-li-ano.out'))
        li.add_overlap(resource('mol-li-ano.overlap'))

        zno2 = MolOutput(resource('mol-zno2-dz.out'))
        zno2.add_overlap(resource('mol-zno2-dz.overlap'))

        npo2 = MolOutput(resource('mol-npo2-ano.out'))
        npo2.add_overlap(resource('mol-npo2-ano.overlap'))

        self.unis = [
            dz.to_universe(),
            li.to_universe(),
            zno2.to_universe(),
            npo2.to_universe()
        ]
예제 #17
0
 def test_add_overlap(self):
     """Test adding an overlap matrix."""
     self.cdz.add_overlap(resource('mol-carbon-dz.overlap'))
     self.assertTrue(hasattr(self.cdz, 'overlap'))
     uni = self.cdz.to_universe()
     self.assertTrue(hasattr(uni, 'overlap'))
예제 #18
0
 def setUp(self):
     self.mam1 = Fchk(resource('g09-ch3nh2-631g.fchk'))
     self.mam2 = Fchk(resource('g09-ch3nh2-augccpvdz.fchk'))
예제 #19
0
 def setUp(self):
     self.nw = nwchem.Output(resource('nw-ch3nh2-631g.out')).to_universe()
     mo = molcas.Output(resource('mol-ch3nh2-631g.out'))
     mo.add_orb(resource('mol-ch3nh2-631g.scforb'))
     self.mo = mo.to_universe()
예제 #20
0
 def setUp(self):
     self.lg = Cube(resource('mol-carbon-dz-1.cube'))
     self.sm1 = Cube(resource('adf-lu-35.cube'))
     self.sm2 = Cube(resource('adf-lu-36.cube'))
     self.uni = uni_from_cubes(staticdir() + '/cube/', ext='*lu*cube')
예제 #21
0
 def test_add_overlap(self):
     """Test adding an overlap matrix."""
     self.cdz.add_overlap(resource('mol-carbon-dz.overlap'))
     self.assertTrue(hasattr(self.cdz, 'overlap'))
     uni = self.cdz.to_universe()
     self.assertTrue(hasattr(uni, 'overlap'))
예제 #22
0
 def test_sizes(self):
     for name, size in check.items():
         xyz = XYZ(resource(name))
         xyz.parse_atom()
         self.assertEqual(xyz.atom.shape[0], size)
예제 #23
0
 def setUp(self):
     self.mam1 = Output(resource('nw-ch3nh2-631g.out'))
     self.mam2 = Output(resource('nw-ch3nh2-augccpvdz.out'))
예제 #24
0
 def setUp(self):
     self.h2o2 = Fchk(resource('g16-h2o2-def2tzvp-freq.fchk'))
     self.ch4 = Output(resource('adf-ch4-opt-freq.out'))
예제 #25
0
 def setUp(self):
     self.h2o2 = Fchk(resource('g16-h2o2-def2tzvp-freq.fchk'))
예제 #26
0
 def setUp(self):
     self.mam1 = Output(resource('nw-ch3nh2-631g.out'))
     self.mam2 = Output(resource('nw-ch3nh2-augccpvdz.out'))
예제 #27
0
 def setUp(self):
     self.lg = Cube(resource('mol-carbon-dz-1.cube'))
     self.sm1 = Cube(resource('adf-lu-35.cube'))
     self.sm2 = Cube(resource('adf-lu-36.cube'))
     self.uni = uni_from_cubes(staticdir() + '/cube/', ext='*lu*cube')
예제 #28
0
 def setUp(self):
     self.cdz = Output(resource('mol-carbon-dz.out'))
     self.uo2sp = Output(resource('mol-uo2-anomb.out'))
     self.mamcart = Output(resource('mol-ch3nh2-631g.out'))
     self.mamsphr = Output(resource('mol-ch3nh2-anovdzp.out'))
     self.c2h6 = Output(resource('mol-c2h6-basis.out'))
예제 #29
0
 def test_sizes(self):
     for name, size in check.items():
         xyz = XYZ(resource(name))
         xyz.parse_atom()
         self.assertEqual(xyz.atom.shape[0], size)
예제 #30
0
파일: test_atom.py 프로젝트: wgong/exatomic
 def setUp(self):
     self.h2o = XYZ(resource('H2O.xyz'))
     self.h2o.parse_atom()
     self.cols = ['x', 'y', 'z']
예제 #31
0
 def setUp(self):
     self.nym = HDF(resource('mol-c2h6-nosym-scf.hdf5'))
     self.sym = HDF(resource('mol-c2h6-sym-scf.hdf5'))
예제 #32
0
 def setUp(self):
     self.mam1 = Fchk(resource('g09-ch3nh2-631g.fchk'))
     self.mam2 = Fchk(resource('g09-ch3nh2-augccpvdz.fchk'))
     self.mam3 = Fchk(resource('g16-methyloxirane-def2tzvp-freq.fchk'))
     self.mam4 = Fchk(resource('g16-h2o2-def2tzvp-freq.fchk'))
     self.nitro_nmr = Fchk(resource('g16-nitromalonamide-6-31++g-nmr.fchk'))
예제 #33
0
 def setUp(self):
     self.nitro_freq = gOutput(
         resource('g09-nitromalonamide-6-31++g-freq.out'))
     tar = open(resource('va-zpvc-nitro_nmr.tar.bz'), mode='r')
     tar.extractall()
     tar.close()
예제 #34
0
 def setUp(self):
     self.lu = Output(resource('adf-lu.out'))
예제 #35
0
 def setUp(self):
     self.cdz = Output(resource('mol-carbon-dz.out'))
     self.uo2sp = Output(resource('mol-uo2-anomb.out'))
     self.mamcart = Output(resource('mol-ch3nh2-631g.out'))
     self.mamsphr = Output(resource('mol-ch3nh2-anovdzp.out'))
     self.c2h6 = Output(resource('mol-c2h6-basis.out'))
예제 #36
0
 def setUp(self):
     self.nw = nwchem.Output(resource('nw-ch3nh2-631g.out')).to_universe()
     mo = molcas.Output(resource('mol-ch3nh2-631g.out'))
     mo.add_orb(resource('mol-ch3nh2-631g.scforb'))
     self.mo = mo.to_universe()
예제 #37
0
# Copyright (c) 2015-2022, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
import numpy as np
from unittest import TestCase
from os import sep, remove, rmdir
from tempfile import mkdtemp
import tarfile
from glob import glob
from exatomic.base import resource
from exatomic.va import VA, get_data, gen_delta
from exatomic.gaussian import Fchk, Output as gOutput
from exatomic.nwchem import Output


TMPDIR = mkdtemp()
h2o2_freq = Fchk(resource('g16-h2o2-def2tzvp-freq.fchk'))
methyloxirane_freq = Fchk(resource('g16-methyloxirane-def2tzvp-freq.fchk'))
tar = tarfile.open(resource('va-vroa-h2o2.tar.bz'), mode='r')
tar.extractall(TMPDIR)
tar.close()
tar = tarfile.open(resource('va-vroa-methyloxirane.tar.bz'), mode='r')
tar.extractall(TMPDIR)
tar.close()
nitro_freq = gOutput(resource('g09-nitromalonamide-6-31++g-freq.out'))
tar = tarfile.open(resource('va-zpvc-nitro_nmr.tar.bz'), mode='r')
tar.extractall(TMPDIR)
tar.close()


class TestGetData(TestCase):
    def test_getter_small(self):
예제 #38
0
 def setUp(self):
     self.lu = Output(resource('adf-lu.out'))
예제 #39
0
 def setUp(self):
     self.mam1 = Output(resource('nw-ch3nh2-631g.out'))
     self.mam2 = Output(resource('nw-ch3nh2-augccpvdz.out'))
     self.nap_roa = Output(resource('nw-naproxen-def2tzvp-roa.out'))
     self.meth_roa = Output(resource('nw-methyloxirane-def2tzvp-roa.out'))
예제 #40
0
 def setUp(self):
     self.nym = HDF(resource('mol-c2h6-nosym-scf.hdf5'))
     self.sym = HDF(resource('mol-c2h6-sym-scf.hdf5'))