operator.f90¶
The operator.f90 program is a supporting utility used during operator file generation. While the Bash script (operator-make.sh) is responsible for assembling the complete operator file, this Fortran program converts the fitted vibronic coupling parameters into the parameter definitions required by the MCTDH operator format.
The program is executed automatically by the Bash script once for every selected vibrational mode. Users normally do not need to run it manually.
Why is a Separate Fortran Program Required?¶
The fitted coupling files obtained from the nonlinear fitting procedure contain only numerical values. These values cannot be inserted directly into an MCTDH operator file because MCTDH expects every coupling parameter to be written using a specific syntax.
For example, instead of simply writing a numerical value, MCTDH requires parameter names such as
where
krepresents the linear vibronic coupling,grepresents the quadratic vibronic coupling,- the subscripts denote the interacting electronic states, and
- the final number identifies the vibrational mode.
Generating hundreds of such parameter definitions manually is both tedious and error-prone. The operator.f90 program automates this process.
Input¶
For each selected vibrational mode, the program reads a fitted coupling file generated during the nonlinear fitting stage.
Each file contains
- linear coupling constants,
- quadratic coupling constants,
- interstate coupling parameters,
for a single vibrational mode.
The filename and the number of electronic states are supplied automatically by the Bash script before compilation.
Processing¶
For every electronic-state pair, the program
- Reads the fitted parameters.
- Identifies linear coupling constants.
- Identifies quadratic coupling constants.
- Assigns the appropriate MCTDH parameter names.
- Formats the values according to the operator-file syntax.
This procedure is repeated independently for every selected vibrational mode.
Output¶
The program writes a temporary file
containing the formatted coupling definitions.
A typical output consists of parameter definitions such as
These entries are not the complete operator file. Instead, they represent only the coupling parameters associated with a single vibrational mode.
The Bash script appends these definitions to the Parameter Section of the final MCTDH operator file.
Interaction with the Bash Script¶
The relationship between the Bash script and the Fortran program is illustrated below.
Selected Mode
│
▼
Mode Coupling File
│
▼
operator-make.sh
│
▼
Compile operator.f90
│
▼
Execute operator.exe
│
▼
operator-elements.out
│
▼
Append to Operator File
This sequence is repeated for every selected vibrational mode until all coupling parameters have been written.
Automation¶
The Bash script automatically modifies the source code before compilation by inserting
- the current coupling filename,
- the number of electronic states,
- and the corresponding vibrational mode index.
The program is then compiled using
and executed immediately.
After the coupling definitions have been written to the operator file, the temporary executable and intermediate files are removed automatically.
Advantages¶
Using a separate Fortran program provides several advantages.
- Eliminates manual formatting of coupling parameters.
- Reduces the possibility of transcription errors.
- Automatically generates parameter names compatible with MCTDH.
- Easily adapts to different numbers of electronic states.
- Scales efficiently for systems containing many vibrational modes.
Summary¶
The operator.f90 program is responsible for converting fitted vibronic coupling parameters into the syntax required by the MCTDH operator format. It operates as a helper program called automatically by operator-make.sh, producing formatted coupling definitions for each selected vibrational mode. Together, these two programs automate the generation of a complete operator file, eliminating the need to manually write hundreds of Hamiltonian parameters.