parameters: (name, **kwargs)
return_statement: return ref_wfn
docstring: Function encoding sequence of PSI module calls for
      an SCF hessian calculation.
docstring_summary: Function encoding sequence of PSI module calls for
      an SCF hessian calculation.
docstring_tokens: Function encoding sequence of PSI module calls for an SCF hessian calculation .
function: def run_scf_hessian(name, **kwargs):
      """Function encoding sequence of PSI module calls for
      an SCF hessian calculation.
  
      """
      optstash = proc_util.scf_set_reference_local(name)
  
      # Bypass the scf call if a reference wavefunction is given
      ref_wfn = kwargs.get('ref_wfn', None)
      if ref_wfn is None:
          ref_wfn = run_scf(name, **kwargs)
  
      badref = core.get_option('SCF', 'REFERENCE') in ['ROHF', 'CUHF', 'UKS']
      badint = core.get_global_option('SCF_TYPE') in [ 'CD', 'OUT_OF_CORE']
      if badref or badint:
          raise ValidationError("Only RHF/UHF Hessians are currently implemented. SCF_TYPE either CD or OUT_OF_CORE not supported")
  
      if hasattr(ref_wfn, "_disp_functor"):
          disp_hess = ref_wfn._disp_functor.compute_hessian(ref_wfn.molecule(), ref_wfn)
          ref_wfn.set_variable("-D Hessian", disp_hess)
  
      H = core.scfhess(ref_wfn)
      ref_wfn.set_hessian(H)
  
      # Clearly, add some logic when the reach of this fn expands
      ref_wfn.set_variable("HF TOTAL HESSIAN", H)  # P::e SCF
      ref_wfn.set_variable("SCF TOTAL HESSIAN", H)  # P::e SCF
      core.set_variable("SCF TOTAL HESSIAN", H)  # P::e SCF
  
      # Shove variables into global space
      for k, v in ref_wfn.variables().items():
          core.set_variable(k, v)
  
      optstash.restore()
      return ref_wfn
function_tokens: def run_scf_hessian ( name , * * kwargs ) : optstash = proc_util . scf_set_reference_local ( name ) # Bypass the scf call if a reference wavefunction is given ref_wfn = kwargs . get ( 'ref_wfn' , None ) if ref_wfn is None : ref_wfn = run_scf ( name , * * kwargs ) badref = core . get_option ( 'SCF' , 'REFERENCE' ) in [ 'ROHF' , 'CUHF' , 'UKS' ] badint = core . get_global_option ( 'SCF_TYPE' ) in [ 'CD' , 'OUT_OF_CORE' ] if badref or badint : raise ValidationError ( "Only RHF/UHF Hessians are currently implemented. SCF_TYPE either CD or OUT_OF_CORE not supported" ) if hasattr ( ref_wfn , "_disp_functor" ) : disp_hess = ref_wfn . _disp_functor . compute_hessian ( ref_wfn . molecule ( ) , ref_wfn ) ref_wfn . set_variable ( "-D Hessian" , disp_hess ) H = core . scfhess ( ref_wfn ) ref_wfn . set_hessian ( H ) # Clearly, add some logic when the reach of this fn expands ref_wfn . set_variable ( "HF TOTAL HESSIAN" , H ) # P::e SCF ref_wfn . set_variable ( "SCF TOTAL HESSIAN" , H ) # P::e SCF core . set_variable ( "SCF TOTAL HESSIAN" , H ) # P::e SCF # Shove variables into global space for k , v in ref_wfn . variables ( ) . items ( ) : core . set_variable ( k , v ) optstash . restore ( ) return ref_wfn