parameters: (name, **kwargs)
return_statement: return ref_wfn
docstring: Function encoding sequence of PSI module calls for
      an F/ISAPT0 computation
docstring_summary: Function encoding sequence of PSI module calls for
      an F/ISAPT0 computation
docstring_tokens: Function encoding sequence of PSI module calls for an F / ISAPT0 computation
function: def run_fisapt(name, **kwargs):
      """Function encoding sequence of PSI module calls for
      an F/ISAPT0 computation
  
      """
      optstash = p4util.OptionsState(['SCF_TYPE'])
  
      # Alter default algorithm
      if not core.has_global_option_changed('SCF_TYPE'):
          core.set_global_option('SCF_TYPE', 'DF')
  
      # Get the molecule of interest
      ref_wfn = kwargs.get('ref_wfn', None)
      if ref_wfn is None:
          sapt_dimer = kwargs.pop('molecule', core.get_active_molecule())
      else:
          core.print_out('Warning! FISAPT argument "ref_wfn" is only able to use molecule information.')
          sapt_dimer = ref_wfn.molecule()
      sapt_dimer.update_geometry()  # make sure since mol from wfn, kwarg, or P::e
  
      # Shifting to C1 so we need to copy the active molecule
      if sapt_dimer.schoenflies_symbol() != 'c1':
          core.print_out('  FISAPT does not make use of molecular symmetry, further calculations in C1 point group.\n')
          sapt_dimer = sapt_dimer.clone()
          sapt_dimer.reset_point_group('c1')
          sapt_dimer.fix_orientation(True)
          sapt_dimer.fix_com(True)
          sapt_dimer.update_geometry()
  
      if core.get_option('SCF', 'REFERENCE') != 'RHF':
          raise ValidationError('FISAPT requires requires \"reference rhf\".')
  
      if ref_wfn is None:
          core.timer_on("FISAPT: Dimer SCF")
          ref_wfn = scf_helper('RHF', molecule=sapt_dimer, **kwargs)
          core.timer_off("FISAPT: Dimer SCF")
  
      core.print_out("  Constructing Basis Sets for FISAPT...\n\n")
      scf_aux_basis = core.BasisSet.build(ref_wfn.molecule(),
                                          "DF_BASIS_SCF",
                                          core.get_option("SCF", "DF_BASIS_SCF"),
                                          "JKFIT",
                                          core.get_global_option('BASIS'),
                                          puream=ref_wfn.basisset().has_puream())
      ref_wfn.set_basisset("DF_BASIS_SCF", scf_aux_basis)
  
      sapt_basis = core.BasisSet.build(ref_wfn.molecule(), "DF_BASIS_SAPT", core.get_global_option("DF_BASIS_SAPT"),
                                       "RIFIT", core.get_global_option("BASIS"),
                                       ref_wfn.basisset().has_puream())
      ref_wfn.set_basisset("DF_BASIS_SAPT", sapt_basis)
  
      minao = core.BasisSet.build(ref_wfn.molecule(), "BASIS", core.get_global_option("MINAO_BASIS"))
      ref_wfn.set_basisset("MINAO", minao)
  
      # Turn of dispersion for -d
      if "-d" in name.lower():
          core.set_local_option("FISAPT", "FISAPT_DO_FSAPT_DISP", False)
  
      fisapt_wfn = core.FISAPT(ref_wfn)
      from .sapt import fisapt_proc
      fisapt_wfn.compute_energy(external_potentials=kwargs.get("external_potentials", None))
  
      # Compute -D dispersion
      if "-d" in name.lower():
          proc_util.sapt_empirical_dispersion(name, ref_wfn)
  
      optstash.restore()
      return ref_wfn
function_tokens: def run_fisapt ( name , * * kwargs ) : optstash = p4util . OptionsState ( [ 'SCF_TYPE' ] ) # Alter default algorithm if not core . has_global_option_changed ( 'SCF_TYPE' ) : core . set_global_option ( 'SCF_TYPE' , 'DF' ) # Get the molecule of interest ref_wfn = kwargs . get ( 'ref_wfn' , None ) if ref_wfn is None : sapt_dimer = kwargs . pop ( 'molecule' , core . get_active_molecule ( ) ) else : core . print_out ( 'Warning! FISAPT argument "ref_wfn" is only able to use molecule information.' ) sapt_dimer = ref_wfn . molecule ( ) sapt_dimer . update_geometry ( ) # make sure since mol from wfn, kwarg, or P::e # Shifting to C1 so we need to copy the active molecule if sapt_dimer . schoenflies_symbol ( ) != 'c1' : core . print_out ( '  FISAPT does not make use of molecular symmetry, further calculations in C1 point group.\n' ) sapt_dimer = sapt_dimer . clone ( ) sapt_dimer . reset_point_group ( 'c1' ) sapt_dimer . fix_orientation ( True ) sapt_dimer . fix_com ( True ) sapt_dimer . update_geometry ( ) if core . get_option ( 'SCF' , 'REFERENCE' ) != 'RHF' : raise ValidationError ( 'FISAPT requires requires \"reference rhf\".' ) if ref_wfn is None : core . timer_on ( "FISAPT: Dimer SCF" ) ref_wfn = scf_helper ( 'RHF' , molecule = sapt_dimer , * * kwargs ) core . timer_off ( "FISAPT: Dimer SCF" ) core . print_out ( "  Constructing Basis Sets for FISAPT...\n\n" ) scf_aux_basis = core . BasisSet . build ( ref_wfn . molecule ( ) , "DF_BASIS_SCF" , core . get_option ( "SCF" , "DF_BASIS_SCF" ) , "JKFIT" , core . get_global_option ( 'BASIS' ) , puream = ref_wfn . basisset ( ) . has_puream ( ) ) ref_wfn . set_basisset ( "DF_BASIS_SCF" , scf_aux_basis ) sapt_basis = core . BasisSet . build ( ref_wfn . molecule ( ) , "DF_BASIS_SAPT" , core . get_global_option ( "DF_BASIS_SAPT" ) , "RIFIT" , core . get_global_option ( "BASIS" ) , ref_wfn . basisset ( ) . has_puream ( ) ) ref_wfn . set_basisset ( "DF_BASIS_SAPT" , sapt_basis ) minao = core . BasisSet . build ( ref_wfn . molecule ( ) , "BASIS" , core . get_global_option ( "MINAO_BASIS" ) ) ref_wfn . set_basisset ( "MINAO" , minao ) # Turn of dispersion for -d if "-d" in name . lower ( ) : core . set_local_option ( "FISAPT" , "FISAPT_DO_FSAPT_DISP" , False ) fisapt_wfn = core . FISAPT ( ref_wfn ) from . sapt import fisapt_proc fisapt_wfn . compute_energy ( external_potentials = kwargs . get ( "external_potentials" , None ) ) # Compute -D dispersion if "-d" in name . lower ( ) : proc_util . sapt_empirical_dispersion ( name , ref_wfn ) optstash . restore ( ) return ref_wfn