mqc_basis_reader Module

Gaussian basis set parser and molecular basis construction

Provides utilities for parsing Gaussian-type orbital basis sets from text files and building molecular basis sets for quantum calculations. Determine basis file line type Parse basis for single element Build complete molecular basis Convert angular momentum character to integer Convert angular momentum integer to character


Uses

  • module~~mqc_basis_reader~~UsesGraph module~mqc_basis_reader mqc_basis_reader module~mqc_basis_file_reader mqc_basis_file_reader module~mqc_basis_reader->module~mqc_basis_file_reader module~mqc_cgto mqc_cgto module~mqc_basis_reader->module~mqc_cgto module~mqc_error mqc_error module~mqc_basis_reader->module~mqc_error pic_types pic_types module~mqc_basis_reader->pic_types module~mqc_basis_file_reader->module~mqc_error module~mqc_basis_file_reader->pic_types module~mqc_cgto->pic_types

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: LINE_ATOM = 1

Element specification line

integer, public, parameter :: LINE_FUNCTION = 3

Basis function coefficient line

integer, public, parameter :: LINE_SHELL = 2

Shell definition line

integer, public, parameter :: LINE_UNKNOWN = 0

Unrecognized line type


Functions

public pure function ang_mom_char_to_int(ang_mom_char) result(ang_mom)

Convert angular momentum character to integer

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=1), intent(in) :: ang_mom_char

Angular momentum symbol

Return Value integer

Corresponding integer value

public pure function ang_mom_int_to_char(ang_mom) result(ang_mom_char)

Convert angular momentum integer to character

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ang_mom

Angular momentum quantum number

Return Value character(len=1)

Corresponding symbol character

public pure function classify_line(line) result(line_type)

Classify a line from a gamess formatted basis set file

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: line

Return Value integer

private pure function is_blank_or_control(line) result(res)

Check if a line is blank or a control line (starts with ‘$’)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: line

Return Value logical

private pure function is_function_line(line) result(res)

Check if a line is a function coefficient line (starts with a number)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: line

Return Value logical

private pure function is_shell_header(line) result(res)

Check if a line is a shell header line (starts with S, P, D, F, G, H, I, or L)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: line

Return Value logical


Subroutines

public subroutine build_molecular_basis(basis_string, element_names, mol_basis, error)

Build molecular basis from geometry and basis file Only parses unique elements, then copies basis data to atoms

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: basis_string
character(len=*), intent(in) :: element_names(:)

Element for each atom in geometry order

type(molecular_basis_type), intent(out) :: mol_basis
type(error_t), intent(out) :: error

public pure subroutine parse_element_basis(basis_string, element_name, atom_basis, error)

Parse basis set for a specific element from a GAMESS formatted basis string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: basis_string
character(len=*), intent(in) :: element_name
type(atomic_basis_type), intent(out) :: atom_basis
type(error_t), intent(out) :: error

private pure subroutine copy_atomic_basis(source, dest)

Deep copy of atomic basis data from source to dest

Arguments

Type IntentOptional Attributes Name
type(atomic_basis_type), intent(in) :: source
type(atomic_basis_type), intent(out) :: dest

private pure subroutine count_shells_for_element(basis_string, element_name, nshells, error)

Count the number of shells for a specific element in a GAMESS formatted basis string,

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: basis_string
character(len=*), intent(in) :: element_name
integer, intent(out) :: nshells
type(error_t), intent(out) :: error

private pure subroutine fill_element_basis(basis_string, element_name, atom_basis, error)

Fill in the shell data for a specific element from a GAMESS formatted basis string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: basis_string
character(len=*), intent(in) :: element_name
type(atomic_basis_type), intent(inout) :: atom_basis
type(error_t), intent(out) :: error

private pure subroutine find_unique_strings(input_array, unique_array, nunique)

Find unique strings in an array Returns array of unique strings and count

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: input_array(:)
character(len=:), intent(out), allocatable :: unique_array(:)
integer, intent(out) :: nunique

private pure subroutine get_next_line(string, line_start, line, line_end)

Extract the next line from a string starting at line_start

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
integer, intent(in) :: line_start
character(len=*), intent(out) :: line
integer, intent(out) :: line_end

private pure subroutine parse_function_line(line, func_num, exponent, coeff_s, coeff_p, has_p, stat)

Parse function line (e.g., “1 1.0 2.0” or “1 1.0 2.0 3.0” for L shells)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: line
integer, intent(out) :: func_num
real(kind=dp), intent(out) :: exponent
real(kind=dp), intent(out) :: coeff_s
real(kind=dp), intent(out), optional :: coeff_p
logical, intent(out) :: has_p
integer, intent(out) :: stat

private pure subroutine parse_shell_header(line, ang_mom, nfunc, stat)

Parse shell header line (e.g., “S 2” or “L 3”)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: line
character(len=1), intent(out) :: ang_mom
integer, intent(out) :: nfunc
integer, intent(out) :: stat