@@ -534,13 +534,14 @@ def mopac_compute_adi(q, params, full_id):
534534 coords = q .col (itraj )
535535
536536 critical_params = ["labels" , "timestep" ]
537- default_params = {"mopac_exe" : "mopac" , "is_first_time" : True , "orbital_space" : None , "active_space" : None ,
537+ default_params = {"mopac_exe" : "mopac" , "is_first_time" : True , "orbital_space" : None ,
538538 "nstates" :2 ,
539539 "mopac_run_params" : "INDO C.I.=(6,3) CHARGE=0 RELSCF=0.000001 ALLVEC WRTCONF=0.00 WRTCI=2" ,
540540 "mopac_working_directory" : "mopac_wd" ,
541541 "mopac_input_prefix" : "input_" , "mopac_output_prefix" : "output_" ,
542542 "dt" : 1.0 * units .fs2au , "do_Lowdin" : 0 ,
543- "CAS" :[ [1 ,2 ], 2 ], "mult_S" :0 , "mult_Ms" :0 , "is_singlet_excitation" :0
543+ "CAS" :[ [1 ,2 ], 2 ], "mult_S" :0 , "mult_Ms" :0 , "is_singlet_excitation" :0 ,
544+ "nelec_act_space" :None
544545 }
545546 comn .check_input (params [itraj ], default_params , critical_params )
546547
@@ -554,14 +555,14 @@ def mopac_compute_adi(q, params, full_id):
554555 mopac_input_prefix = params [itraj ]["mopac_input_prefix" ]
555556 mopac_output_prefix = params [itraj ]["mopac_output_prefix" ]
556557 orbital_space = params [itraj ]["orbital_space" ]
557- active_space = params [itraj ]["active_space" ]
558558 nstates = params [itraj ]["nstates" ]
559559 dt = params [itraj ]["dt" ]
560560 do_Lowdin = params [itraj ]["do_Lowdin" ]
561561 CAS = params [itraj ]["CAS" ]
562562 mult_S = params [itraj ]["mult_S" ]
563563 mult_Ms = params [itraj ]["mult_Ms" ]
564564 is_singlet_excitation = params [itraj ]["is_singlet_excitation" ]
565+ nelec_act_space = params [itraj ]["nelec_act_space" ]
565566 natoms = len (labels )
566567 ndof = 3 * natoms
567568
@@ -575,6 +576,17 @@ def mopac_compute_adi(q, params, full_id):
575576 read_params = {"nstates" :nstates , "filename" :filename , "orbital_space" :None }
576577 info , MO_curr , data_curr = read_mopac_orbital_info (read_params )
577578
579+ #================= Construct active space ==================
580+ active_space = None
581+ if nelec_act_space is None :
582+ active_space = info ["actual_orbital_space" ]
583+ else :
584+ min_indx = info ["nocc" ] - nelec_act_space // 2 + 1
585+ if min_indx > info ["min_occ" ]:
586+ min_elec = ((info ["nocc" ] - info ["min_occ" ]) + 1 )* 2
587+ raise ValueError (f"The `nelec_act_space` should be at least { min_elec } " )
588+ active_space = list (range (min_indx , info ["nmo" ]+ 1 ))
589+
578590 # Get the properties at the previous time-steps
579591 MO_prev , data_prev = None , None
580592 if is_first_time :
@@ -602,7 +614,7 @@ def mopac_compute_adi(q, params, full_id):
602614 # Make it doubled - block-matrix
603615 st_mo = np .kron (np .eye (2 ), st_mo_orb )
604616
605- #================= Compute CI time-overlaps =============
617+ #================= Compute CI time-overlaps =============
606618 ovlp_params = {"homo_indx" :info ["nocc" ],
607619 "nocc" :info ["nocc" ] - 1 ,
608620 "nvirt" :info ["nmo" ] - info ["nocc" ],
0 commit comments