Commit 2fdb981 1 parent c423769 commit 2fdb981 Copy full SHA for 2fdb981
File tree 3 files changed +49
-7
lines changed
3 files changed +49
-7
lines changed Original file line number Diff line number Diff line change @@ -170,13 +170,19 @@ def handle_command(self):
170
170
171
171
electrons -= self .calc .charge
172
172
173
- if self .calc .multiplicity != 1 :
174
- raise InvalidParameter ("Unimplemented multiplicity" )
173
+ if self .calc .multiplicity == 1 :
174
+ n_HOMO = (electrons // 2 ) - 1
175
+ n_LUMO = electrons // 2
176
+ n_LUMO1 = (electrons // 2 ) + 1
177
+ n_LUMO2 = (electrons // 2 ) + 2
178
+ elif self .calc .multiplicity == 2 :
179
+ n_HOMO = ((electrons + 1 ) // 2 ) - 1
180
+ n_LUMO = (electrons + 1 ) // 2
181
+ n_LUMO1 = ((electrons + 1 ) // 2 ) + 1
182
+ n_LUMO2 = ((electrons + 1 ) // 2 ) + 2
175
183
176
- n_HOMO = int (electrons / 2 ) - 1
177
- n_LUMO = int (electrons / 2 )
178
- n_LUMO1 = int (electrons / 2 ) + 1
179
- n_LUMO2 = int (electrons / 2 ) + 2
184
+ else :
185
+ raise InvalidParameter ("Unimplemented multiplicity" )
180
186
181
187
mo_block = f"""%plots
182
188
dim1 45
Original file line number Diff line number Diff line change @@ -227,6 +227,10 @@ def handle_specifications(self):
227
227
self .cmd_arguments += "--squick "
228
228
elif ss [0 ] == "mquick" :
229
229
self .cmd_arguments += "--mquick "
230
+ elif ss [0 ] == "molden" :
231
+ self .cmd_arguments += "--molden "
232
+ elif ss [0 ] == "json" :
233
+ self .cmd_arguments += "--json "
230
234
elif ss [0 ] == "concerted" :
231
235
if self .calc .type not in [
232
236
CalcType .CONSTR_OPT ,
@@ -237,7 +241,7 @@ def handle_specifications(self):
237
241
self .concerted_scan = True
238
242
239
243
else :
240
- raise InvalidParameter ("Invalid specification" )
244
+ raise InvalidParameter ("Invalid specification: {ss} " )
241
245
elif len (ss ) == 2 :
242
246
if ss [0 ] == "o" or ss [0 ] == "opt" :
243
247
if ss [1 ] not in [
Original file line number Diff line number Diff line change @@ -847,3 +847,35 @@ def test_unavailable_calc_type(self):
847
847
848
848
with self .assertRaises (ImpossibleCalculation ):
849
849
xtb = self .generate_calculation (** params )
850
+
851
+ def test_molden_output (self ):
852
+ params = {
853
+ "type" : "Geometrical Optimisation" ,
854
+ "file" : "Cl.xyz" ,
855
+ "software" : "xtb" ,
856
+ "charge" : "-1" ,
857
+ "specifications" : "--molden" ,
858
+ }
859
+
860
+ xtb = self .generate_calculation (** params )
861
+
862
+ REF = "xtb Cl.xyz --opt tight --chrg -1 --molden"
863
+
864
+ self .assertTrue (self .is_equivalent (REF , xtb .command ))
865
+ self .assertTrue (self .is_equivalent ("" , xtb .input_file ))
866
+
867
+ def test_json_output (self ):
868
+ params = {
869
+ "type" : "Geometrical Optimisation" ,
870
+ "file" : "Cl.xyz" ,
871
+ "software" : "xtb" ,
872
+ "charge" : "-1" ,
873
+ "specifications" : "--JSon" ,
874
+ }
875
+
876
+ xtb = self .generate_calculation (** params )
877
+
878
+ REF = "xtb Cl.xyz --opt tight --chrg -1 --json"
879
+
880
+ self .assertTrue (self .is_equivalent (REF , xtb .command ))
881
+ self .assertTrue (self .is_equivalent ("" , xtb .input_file ))
You can’t perform that action at this time.
0 commit comments