Skip to content

Commit 789b389

Browse files
committed
Tests: Molpro MRCI implementation
1 parent 1547348 commit 789b389

1 file changed

Lines changed: 65 additions & 6 deletions

File tree

arc/job/adapters/molpro_test.py

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ def setUpClass(cls):
4343
species=[ARCSpecies(label='spc1', xyz=['O 0 0 1'])],
4444
testing=True,
4545
)
46+
cls.job_3 = MolproAdapter(execution_type='queue',
47+
job_type='sp',
48+
level=Level(method='MRCI', basis='aug-cc-pvtz-f12'),
49+
project='test',
50+
project_directory=os.path.join(ARC_PATH, 'arc', 'testing', 'test_MolproAdapter_3'),
51+
species=[ARCSpecies(label='HNO_t', xyz=["""N -0.08142 0.37454 0.00000
52+
O 1.01258 -0.17285 0.00000
53+
H -0.93116 -0.20169 0.00000"""])],
54+
testing=True,
55+
)
4656

4757
def test_set_cpu_and_mem(self):
4858
"""Test assigning number of cpu's and memory"""
@@ -57,26 +67,26 @@ def test_set_input_file_memory(self):
5767
self.job_1.input_file_memory = None
5868
self.job_1.cpu_cores = 48
5969
self.job_1.set_input_file_memory()
60-
self.assertEqual(self.job_1.input_file_memory, 40)
70+
self.assertEqual(self.job_1.input_file_memory, 1880)
6171

6272
self.job_1.cpu_cores = 8
6373
self.job_1.set_input_file_memory()
64-
self.assertEqual(self.job_1.input_file_memory, 235)
74+
self.assertEqual(self.job_1.input_file_memory, 1880)
6575

6676
self.job_1.input_file_memory = None
6777
self.job_1.cpu_cores = 1
6878
self.job_1.set_input_file_memory()
6979
self.assertEqual(self.job_1.input_file_memory, 1880)
7080

7181
def test_write_input_file(self):
72-
"""Test writing Gaussian input files"""
82+
"""Test writing Molpro input files"""
7383
self.job_1.cpu_cores = 48
7484
self.job_1.set_input_file_memory()
7585
self.job_1.write_input_file()
7686
with open(os.path.join(self.job_1.local_path, input_filenames[self.job_1.job_adapter]), 'r') as f:
7787
content_1 = f.read()
7888
job_1_expected_input_file = """***,spc1
79-
memory,40,m;
89+
memory,Total=1880,m;
8090
8191
geometry={angstrom;
8292
O 0.00000000 0.00000000 1.00000000}
@@ -105,7 +115,7 @@ def test_write_input_file(self):
105115
with open(os.path.join(self.job_2.local_path, input_filenames[self.job_2.job_adapter]), 'r') as f:
106116
content_2 = f.read()
107117
job_2_expected_input_file = """***,spc1
108-
memory,40,m;
118+
memory,Total=1880,m;
109119
110120
geometry={angstrom;
111121
O 0.00000000 0.00000000 1.00000000}
@@ -128,6 +138,55 @@ def test_write_input_file(self):
128138
"""
129139
self.assertEqual(content_2, job_2_expected_input_file)
130140

141+
def test_write_mrci_input_file(self):
142+
"""Test writing MRCI Molpro input files"""
143+
self.job_3.cpu_cores = 48
144+
self.job_3.set_input_file_memory()
145+
self.job_3.write_input_file()
146+
with open(os.path.join(self.job_3.local_path, input_filenames[self.job_3.job_adapter]), 'r') as f:
147+
content_3 = f.read()
148+
job_3_expected_input_file = """***,HNO_t
149+
memory,Total=1880,m;
150+
151+
geometry={angstrom;
152+
N -0.08142000 0.37454000 0.00000000
153+
O 1.01258000 -0.17285000 0.00000000
154+
H -0.93116000 -0.20169000 0.00000000}
155+
156+
gprint,orbitals;
157+
158+
basis=aug-cc-pvtz-f12
159+
160+
161+
162+
int;
163+
{hf;
164+
maxit,1000;
165+
wf,spin=0,charge=0;}
166+
167+
{mp2;
168+
wf,spin=0,charge=0;}
169+
170+
{casscf;
171+
maxit,999;
172+
wf,spin=0,charge=0;}
173+
174+
{mrci-f12;
175+
maxit,999;
176+
wf,spin=0,charge=0;};
177+
178+
179+
180+
181+
E_mrci=energy;
182+
E_mrci_Davidson=energd;
183+
184+
table,E_mrci,E_mrci_Davidson;
185+
---;
186+
187+
"""
188+
self.assertEqual(content_3, job_3_expected_input_file)
189+
131190
def test_set_files(self):
132191
"""Test setting files"""
133192
job_1_files_to_upload = [{'file_name': 'submit.sub',
@@ -155,7 +214,7 @@ def tearDownClass(cls):
155214
A function that is run ONCE after all unit tests in this class.
156215
Delete all project directories created during these unit tests
157216
"""
158-
for folder in ['test_MolproAdapter_1', 'test_MolproAdapter_2']:
217+
for folder in ['test_MolproAdapter_1', 'test_MolproAdapter_2', 'test_MolproAdapter_3']:
159218
shutil.rmtree(os.path.join(ARC_PATH, 'arc', 'testing', folder), ignore_errors=True)
160219

161220

0 commit comments

Comments
 (0)