@@ -16,14 +16,8 @@ class TestMicrosoftElementsDftJob(QuantumTestBase):
1616 @pytest .mark .microsoft_elements_dft
1717 def test_dft_success (self ):
1818 dft_input_params = {
19- "tasks" : [
20- {
21- "taskType" : "spe" ,
22- "basisSet" : { "name" : "def2-svp" , "cartesian" : False },
23- "xcFunctional" : { "name" : "m06-2x" , "gridLevel" : 4 },
24- "scf" : { "method" : "rks" , "maxSteps" : 100 , "convergeThreshold" : 1e-8 }
25- }
26- ]
19+ "driver" : "energy" ,
20+ "model" : {"method" : "m06-2x" , "basis" : "def2-svp" },
2721 }
2822
2923 job = self ._run_job (dft_input_params )
@@ -37,14 +31,8 @@ def test_dft_success(self):
3731 @pytest .mark .microsoft_elements_dft
3832 def test_dft_failure_invalid_input (self ):
3933 dft_input_params = {
40- "tasks" : [
41- {
42- "taskType" : "invlidTask" ,
43- "basisSet" : { "name" : "def2-svp" , "cartesian" : False },
44- "xcFunctional" : { "name" : "m06-2x" , "gridLevel" : 4 },
45- "scf" : { "method" : "rks" , "maxSteps" : 100 , "convergeThreshold" : 1e-8 }
46- }
47- ]
34+ "driver" : "energy" ,
35+ "model" : {"method" : "m06-2x" , "basis" : "invalidBasis" },
4836 }
4937
5038 job = self ._run_job (dft_input_params )
@@ -58,14 +46,8 @@ def test_dft_failure_invalid_input(self):
5846 @pytest .mark .microsoft_elements_dft
5947 def test_dft_failure_algorithm_produces_output (self ):
6048 dft_input_params = {
61- "tasks" : [
62- {
63- "taskType" : "spe" ,
64- "basisSet" : { "name" : "def2-svp" , "cartesian" : False },
65- "xcFunctional" : { "name" : "m06-2x" , "gridLevel" : 4 },
66- "scf" : { "method" : "rks" , "maxSteps" : 1 , "convergeThreshold" : 1e-8 }
67- }
68- ]
49+ "driver" : "energy" ,
50+ "model" : {"method" : "m06-2x" , "basis" : "invalidBasis" },
6951 }
7052
7153 job = self ._run_job (dft_input_params )
@@ -82,12 +64,11 @@ def _run_job(self, input_params) -> Job:
8264 target = workspace .get_targets ("microsoft.dft" )
8365 dir_path = os .path .dirname (os .path .realpath (__file__ ))
8466
85- with open (f"{ dir_path } /molecule.xyz" , "r" ) as file :
86- job = target .submit (input_data = file .read (), input_params = input_params )
87- job .wait_until_completed (timeout_secs = DEFAULT_TIMEOUT_SECS )
88- job .refresh ()
67+ job = target .submit (input_data = [f"{ dir_path } /molecule.xyz" ], input_params = input_params )
68+ job .wait_until_completed (timeout_secs = DEFAULT_TIMEOUT_SECS )
69+ job .refresh ()
8970
90- return job
71+ return job
9172
9273test_xyz_file = Path (__file__ ).parent / "molecule.xyz"
9374
0 commit comments