Utils Module

The Utils module includes utility functions that assist with data processing, normalization, and parameter handling.

Main.SchrödingerSolver.Utils.get_parametersMethod
get_parameters(choice::String)

Retrieves parameters based on the user's selection.

Arguments

  • choice: User selection for the potential type.

Returns

  • (N, v, s, potential_gaussian_integral, potential_params, potential_name, num_levels): Parameters for solving the Schrödinger equation.
source
Main.SchrödingerSolver.Utils.get_potential_functionMethod
get_potential_function(choice::String)

Selects the potential function based on user's choice.

Arguments

  • choice: User selection for the potential type.

Returns

  • [(potential_gaussian_integral, potential_name, potential_params)]: Potential function and parameters.
source
Main.SchrödingerSolver.Utils.normalize_wavefunctionMethod
normalize_wavefunction(x_vals::AbstractVector{Float64}, ψ::AbstractVector{Float64})::Vector{Float64}

Normalizes the wave function ψ based on the integration over x_vals.

Arguments

  • x_vals: Vector of x values.
  • ψ: Wave function to normalize.

Returns

  • Normalized wave function.
source
Main.SchrödingerSolver.Utils.read_intMethod
read_int(prompt::String, default::Int)

Reads an integer from the user with a prompt. If the user presses enter without input, returns the default value.

Arguments

  • prompt: The prompt message to display.
  • default: The default value to return if no input is provided.

Returns

  • The user-entered integer or the default value.
source
Main.SchrödingerSolver.Utils.read_numberMethod
read_number(prompt::String, default::Float64)

Reads a floating-point number from the user with a prompt. If the user presses enter without input, returns the default value.

Arguments

  • prompt: The prompt message to display.
  • default: The default value to return if no input is provided.

Returns

  • The user-entered number or the default value.
source