Skip to main content
← OpenMECP Documentation

build_program_header_with_chk

Function build_program_header_with_chk 

Source
pub fn build_program_header_with_chk(
    config: &Config,
    charge: i32,
    mult: usize,
    td_or_tail: &str,
    state: usize,
    chk_file: Option<&str>,
    input_basename: Option<&str>,
) -> String
Expand description

Builds a program-specific input file header with custom checkpoint/GBW file support.

This function generates headers for any supported QM program, allowing precise control over the checkpoint or wavefunction file usage. This is critical for:

  • Gaussian: Specifying the %chk file path.
  • ORCA: Specifying the %moinp file path for chain-linked restarts.

It automatically applies run-mode specific modifications (like force, guess=read, or !moread) to the method string.

§Arguments

  • config - The global configuration.
  • charge - Molecular charge.
  • mult - Spin multiplicity.
  • td_or_tail - TD-DFT keywords (Gaussian) or tail content (ORCA).
  • state - Electronic state index (for BAGEL).
  • chk_file - Optional custom checkpoint/GBW file path.
    • For Gaussian: Sets %chk={chk_file}.
    • For ORCA: Sets %moinp "{chk_file}" if !moread is active.
  • input_basename - Optional basename for default naming fallback (required for ORCA if chk_file is None).

§Returns

Returns the formatted input header string.