What sort of SCF calculations are supported with external fields?

Which types of SCF are supported with the $multipole_field section? I am particularly interested in ROKS calculations. A simple test:

$comment
  Ground state calculation.
$end

$molecule
  0   1
  O   0.0000000  0.0000000  0.1173000
  H   0.0000000  0.7572000 -0.4692000
  H   0.0000000 -0.7572000 -0.4692000
$end

$rem
  METHOD          PBE
  BASIS           pcseg-1
  MEM_TOTAL       8000
  MEM_STATIC      100
  SCF_CONVERGENCE 8
  SYMMETRY        FALSE
  SYM_IGNORE      TRUE
  THRESH          14
$end

@@@

$comment
  ROKS calculation on water - without field
$end

$molecule
  read
$end

$rem
  ROKS            TRUE
  METHOD          PBE
  BASIS           pcseg-1
  MEM_TOTAL       8000
  MEM_STATIC      100
  SCF_CONVERGENCE 8
  SCF_GUESS       READ
  SYMMETRY        FALSE
  SYM_IGNORE      TRUE
  THRESH          14
$end

@@@

$comment
  ROKS calculation on water - with field
$end

$molecule
  read
$end

$rem
  ROKS            TRUE
  METHOD          PBE
  BASIS           pcseg-1
  MEM_TOTAL       8000
  MEM_STATIC      100
  SCF_CONVERGENCE 8
  SCF_GUESS       READ
  SYMMETRY        FALSE
  SYM_IGNORE      TRUE
  THRESH          14
$end

$multipole_field
  z 0.0001
$end

runs and indeed produces a Stark shift in the excited state energy. I ran a more complex example:

$comment
  Ground state calculation on water.
$end

$molecule
  0   1
  O   0.0000000  0.0000000  0.1173000
  H   0.0000000  0.7572000 -0.4692000
  H   0.0000000 -0.7572000 -0.4692000
$end

$rem
  METHOD          SCAN
  BASIS           GEN
  PURECART        11
  MEM_TOTAL       8000
  MEM_STATIC      100
  SCF_CONVERGENCE 8
  SYMMETRY        FALSE
  SYM_IGNORE      TRUE
  THRESH          14
$end

$basis
H     0
aug-pcseg-2
****
O     0
aug-pcx-2
****
$end

@@@ 

$comment
  ROKS calculation on 1s -> 3s excited state of water - no field
$end

$molecule
  read
$end

$rem
  DELTA_SCF       TRUE  
  METHOD          SCAN
  BASIS           GEN
  PURECART        11
  MEM_TOTAL       8000
  MEM_STATIC      100
  SCF_CONVERGENCE 8
  SCF_GUESS       READ
  SYMMETRY        FALSE
  SYM_IGNORE      TRUE
  THRESH          14
$end

$delta_scf
  SOMO_1 1
  singlet restricted
  singlet_SCF_algorithm SGM
  singlet_SOMO_print    alpha
$end

$plots
  grid_spacing 0.35
  grid_range   5.0
$end

$basis
H     0
aug-pcseg-2
****
O     0
aug-pcx-2
****
$end

@@@ 

$comment
  ROKS calculation on 1s -> 3s excited state of water - with field (6e-2)
$end

$molecule
  read
$end

$rem
  DELTA_SCF       TRUE  
  METHOD          SCAN
  BASIS           GEN
  PURECART        11
  MEM_TOTAL       8000
  MEM_STATIC      100
  SCF_CONVERGENCE 8
  SCF_GUESS       READ
  SYMMETRY        FALSE
  SYM_IGNORE      TRUE
  THRESH          14
$end

$delta_scf
  SOMO_1 1
  singlet_SCF_algorithm SGM
  singlet restricted
$end

$basis
H     0
aug-pcseg-2
****
O     0
aug-pcx-2
****
$end

$multipole_field
  z 0.06
$end

@@@ 

$comment
  ROKS calculation on 1s -> 3s excited state of water - with field (-6e-2)
$end

$molecule
  read
$end

$rem
  DELTA_SCF       TRUE  
  METHOD          SCAN
  BASIS           GEN
  PURECART        11
  MEM_TOTAL       8000
  MEM_STATIC      100
  SCF_CONVERGENCE 8
  SCF_GUESS       READ
  SYMMETRY        FALSE
  SYM_IGNORE      TRUE
  THRESH          14
$end

$delta_scf
  SOMO_1 1
  singlet_SCF_algorithm SGM
  singlet restricted
$end

$basis
H     0
aug-pcseg-2
****
O     0
aug-pcx-2
****
$end

$multipole_field
  z -0.06
$end

and the results seem to agree well with Fig 4. of https://doi.org/10.1021/acs.jpca.2c08311, so I am tempted to conclude that the calculation works. However, wanted to verify with you to be certain, as there is no information in the manual about this.

It is mildly documented, in Appendix B of the PDF manual (search for “multipole_field”), which is slightly hard to find in the HTML manual but it’s here:
https://manual.q-chem.com/latest/A2.S1.SS2.html
Works at the SCF level just by adding a term proportional to the requested Cartesian field component(s), e.g., F += -0.06*z in your example input.

Is it certain that it works for all types of SCF (including RO and C)? I vaguely remember reading somewhere that it didnt for ROHF but I may be making up that memory as I cant find that reference now.

Don’t know, especially about complex SCF. For other flavors you could try GEN_SCFMAN = TRUE/FALSE, make sure you get the same answer. The formalism is quite simple and in the old SCF code, I believe it’s hard-coded when the multipole field is turned on. Therefore, the question is just to make certain in the new code (where each flavor of SCF is its own class) that the extra terms are added to the Fock matrix in each case.

I’m having some issues running CHF on gen_scfman that I’ll post in the developer forum and I dont think CHF is supported in the old SCF code. The naive attempt for gen_scfman:

$comment
  Ground state calculation.
$end

$molecule
  0   1
  O   0.0000000  0.0000000  0.1173000
  H   0.0000000  0.7572000 -0.4692000
  H   0.0000000 -0.7572000 -0.4692000
$end

$rem
  METHOD          HF
  BASIS           pcseg-1
  MEM_TOTAL       8000
  MEM_STATIC      100
  SCF_CONVERGENCE 8
  SYMMETRY        FALSE
  SYM_IGNORE      TRUE
  THRESH          14
$end

@@@

$comment
  CHF calculation
$end

$molecule
  0   1
  O   0.0000000  0.0000000  0.1173000
  H   0.0000000  0.7572000 -0.4692000
  H   0.0000000 -0.7572000 -0.4692000
$end

$rem
  COMPLEX         True
  METHOD          HF
  BASIS           pcseg-1
  MEM_TOTAL       8000
  MEM_STATIC      100
  SCF_GUESS       READ_REAL
  SCF_CONVERGENCE 8
  SYMMETRY        FALSE
  SYM_IGNORE      TRUE
  THRESH          14
$end

$multipole_field
  z 0.0100
$end

produces

 -----------------------------------------------------------------------
  General SCF calculation program by
  Eric Jon Sundstrom, Paul Horn, Yuezhi Mao, Dmitri Zuev, Alec White,
  David Stuck, Shaama M.S., Shane Yost, Joonho Lee, David Small,
  Daniel Levine, Susi Lehtola, Hugh Burton, Evgeny Epifanovsky,
  Bang C. Huynh
 -----------------------------------------------------------------------
 Hartree-Fock
 The following algorithms are not available for inc_jk, because: 
  Algorithm libfock::24@0x139960ac0 for inc_jk is not capable because of input use_libqints = false

  Algorithm libfock::24@0x139960b10 for inc_jk is not capable because of input use_libqints = false

gen_scfman_exception: hamiltonian: algorithm selector failure

 Q-Chem fatal error occurred in module libgscf/gen_scfman/gen_scfman_main.C, line 279:

 Error in gen_scfman


 Please submit a crash report at q-chem.com/reporter 

on the second job. However, for RO, it does seems that gen_scfman produces the same energies as the old SCF code when using the $multipole_field.

Complex is definitely NOT supported in the old code (that was one major motivation for writing a new code…), so that’s harder to test but my suggestion was exactly what you’ve done - test ROHF using old and new code. I would guess that if both agree for RO, which is often the corner case, then they agree for restricted and unrestricted also (but those can also be tested explicitly).