morsefit.residue module¶
Defines the residue and Jacobian function generators
- morsefit.residue.gen_rj_func(confs, morse)[source]¶
Generate the residue and Jacobian function for a list of configurations
It returns two functions that is able to return the residue and the Jacobian respectively when called with the grand vector of Morse parameters of the protocol as defined in the function get_mp_base_idx(). For a \(N\) parameter and \(M\) configuration problem, the residue function is going to return a 1-D array of length M for the residues. For the Jacobian, the return value is going to be an \(N\times{}M\) matrix.
Parameters: - confs – The list of configurations.
- morse – The list of initial guesses for the Morse potential.
- morsefit.residue.get_mp_base_idx(morse, elem_pair)[source]¶
Gets the base index for the Morse parameters for a given element pair
Since the Morse parameters for all the element pairs are stored in a big vector, we need to compute the base index for the Morse parameters for a given element pair. The protocol is fairly simple, just the \(D_e\), \(a\), and \(r_0\) parameters of each pair in the Morse potential list are stored consecutively in the same order as the list for the initial guess.
Parameters: - morse – The list of initial guesses for the Morse potential, as returned from the read_morse_inp() function.
- elem_pair – A pair of element symbols.