pibronic.vibronic package¶
Scripts that handle data¶
-
pibronic.vibronic.
VMK
¶ alias of
pibronic.vibronic.vibronic_model_keys.VibronicModelKeys
Subpackages¶
Submodules¶
pibronic.vibronic.electronic_structure module¶
-
class
pibronic.vibronic.electronic_structure.
State
[source]¶ Bases:
enum.Enum
An enumeration.
-
FINISHED
= 7¶
-
IPEOMCC
= 4¶
-
NIP
= 2¶
-
OPT
= 1¶
-
PREPVIB
= 5¶
-
VIB
= 3¶
-
VIBRON
= 6¶
-
-
class
pibronic.vibronic.electronic_structure.
VibronExecutionClass
(name, root, state=None)[source]¶ Bases:
object
handles all details related to the execution
-
file_in
= {}¶
-
file_out
= {}¶
-
name
= None¶
-
parameter_dictionary
= {'DROPMO': '', 'NIP': None, 'basis': None, 'calculation': None, 'ccConv': 10, 'estateTol': 10, 'gridVibron': 3, 'scfConv': 10, 'theory': None}¶
-
path_root
= None¶
-
singles_cutoff
= 85.0¶
-
state
= None¶
-
triples_cutoff
= 92.0¶
-
zmat
= None¶
-
-
class
pibronic.vibronic.electronic_structure.
ZmatClass
(file_path)[source]¶ Bases:
object
handles all details related to zmat file which represents the geometry of the molecule can hold internal or cartesian coordinates
-
kind
= 'cartesian'¶
-
-
pibronic.vibronic.electronic_structure.
calculate_vibronic_model_wrapper_one
(data_set_num, molecule_name='ch2o', inital_job_state=0)[source]¶ executes jobs using exists data_set_# file structure
-
pibronic.vibronic.electronic_structure.
calculations_list
= ['IP']¶ get the functions name
-
pibronic.vibronic.electronic_structure.
find_string_in_file
(memmap_file, file_path, target_string)[source]¶ wrapper that raises error if no substr can be found finds the first occurrence of a substring in memory mapped file
-
pibronic.vibronic.electronic_structure.
geometry_optimization
(path_root, name, zmat, parameter_dictionary)[source]¶ creates and populates the input file and submission file for the job
-
pibronic.vibronic.electronic_structure.
get_integer_from_user
(message)[source]¶ return the integer value of the users response to a input prompt
-
pibronic.vibronic.electronic_structure.
get_yes_no_from_user
(message)[source]¶ return the Boolean value of the users response the a yes/no question
-
pibronic.vibronic.electronic_structure.
hartree_fock_calculation
(path_root, name, zmat, parameter_dictionary, hf_type)[source]¶ creates and populates the input file and submission file for the job
-
pibronic.vibronic.electronic_structure.
ip_calculation
(path_root, name, zmat, parameter_dictionary)[source]¶ creates and populates the input file and submission file for the job
-
pibronic.vibronic.electronic_structure.
pairwise
(iterable)[source]¶ returns an iterator over pairs of elements in the iterable
-
pibronic.vibronic.electronic_structure.
parse_hartree_fock_output
(vibron, execution_state)[source]¶ extracts relevant data from output of job
-
pibronic.vibronic.electronic_structure.
parse_ip_output
(vibron)[source]¶ extracts relevant data from output of job
-
pibronic.vibronic.electronic_structure.
parse_opt_output
(vibron)[source]¶ extract substrings describing the optimized geometry from the output file generated by a geometry optimization calculation
-
pibronic.vibronic.electronic_structure.
parse_prepVibron_output
(vibron)[source]¶ extracts relevant data from output of job
-
pibronic.vibronic.electronic_structure.
parse_vibron_output
(vibron)[source]¶ extracts relevant data from output of job
-
pibronic.vibronic.electronic_structure.
prepVibron_calculation
(path_root, name, zmat, parameter_dictionary)[source]¶ creates and populates the input file and submission file for the job
-
pibronic.vibronic.electronic_structure.
pretty_print_job_status
(path=None)[source]¶ quick hack for scripting, path should look something like /**/data_set_{:d}/electronic_structure/execution_state.txt
-
pibronic.vibronic.electronic_structure.
rfind_string_in_file
(memmap_file, file_path, target_string)[source]¶ wrapper that raises error if no substr can be found finds the last occurrence of a substring in memory mapped file
-
pibronic.vibronic.electronic_structure.
skip_back_n_lines
(memmap_file, n, start_index)[source]¶ gives the byte location n lines before the given byte location start_index
-
pibronic.vibronic.electronic_structure.
skip_forward_n_lines
(memmap_file, n, start_index)[source]¶ gives the byte location n lines after the given byte location start_index
-
pibronic.vibronic.electronic_structure.
submit_job
(parameter_dictionary)[source]¶ wrapper for job_boss job submission
-
pibronic.vibronic.electronic_structure.
test_one
(molecule_name='ch2o', inital_job_state=0)[source]¶ runs the job in the current directory stores results in folder named by the molecule
-
pibronic.vibronic.electronic_structure.
verify_aces2_completed
(path_root, file_path, job_id)[source]¶ verifies that the aces2 output file has completed successfully
-
pibronic.vibronic.electronic_structure.
verify_file_exists
(file_path)[source]¶ raises FileNotFoundError exception if input is not a file, or does not exist
-
pibronic.vibronic.electronic_structure.
verify_ip_states
(job)[source]¶ run calculations to verify the range of states selected
-
pibronic.vibronic.electronic_structure.
vibrational_frequency
(path_root, name, zmat, parameter_dictionary)[source]¶ creates and populates the input file and submission file for the job
pibronic.vibronic.model_auto module¶
module that handles parsing model.auto files
-
pibronic.vibronic.model_auto.
confirm_symmetry_in_modes
(mode_range, quadratic_couplings)[source]¶ check for symmetry in modes
-
pibronic.vibronic.model_auto.
confirm_symmetry_in_surfaces
(el_range, linear_couplings, quadratic_couplings)[source]¶ check for symmetry in surfaces
-
pibronic.vibronic.model_auto.
fill_in_diagonal_quadratic_couplings
(f_iter, el_range, mode_range, quadratic_couplings)[source]¶ does what it says
-
pibronic.vibronic.model_auto.
fill_in_excitation_energies
(f_iter, el_range, excitation_energies)[source]¶ does what it says
-
pibronic.vibronic.model_auto.
fill_in_linear_couplings
(f_iter, el_range, mode_range, linear_couplings)[source]¶ does what it says
-
pibronic.vibronic.model_auto.
fill_in_offdiagonal_quadratic_couplings
(f_iter, el_range, mode_range, quadratic_couplings)[source]¶ does what it says
-
pibronic.vibronic.model_auto.
read_model_auto_file
(filename)[source]¶ if the shift to MCTDH file structure is permanent this function will no longer be needed
Read Vibronic Model file (cp.auto) which contains all information on the approximate Born-Oppenheimer Ground State PES.
Returns: number of electronic states number of normal modes
Excitation energies: (nel, nel) frequencies (nmode) linear couplings: (nmode, nel, nel) quadratic couplings: (nmode, nmode, nel, nel)
pibronic.vibronic.model_h module¶
module that handles parsing model.h files
-
pibronic.vibronic.model_h.
extract_cubic_couplings
(path, memmap, coupling_terms, frequencies)[source]¶ not implemented at this time
-
pibronic.vibronic.model_h.
extract_energies
(path, memmap, energies)[source]¶ fill the array energies with appropriate values from the memmap’ed file
-
pibronic.vibronic.model_h.
extract_linear_couplings
(path, memmap, coupling_terms, frequencies)[source]¶ fill the array coupling_terms with appropriate values from the memmap’ed file the frequencies need to be provided in wavenumbers
-
pibronic.vibronic.model_h.
extract_normal_mode_frequencies
(path, file, frequency_array, symmetric_modes)[source]¶ fill the array frequency_array with appropriate values from the memmap’ed file
-
pibronic.vibronic.model_h.
extract_offdiag_quadratic_couplings
(path, memmap, coupling_terms, frequencies)[source]¶ fill the array coupling_terms with appropriate values from the memmap’ed file the frequencies need to be provided in wavenumbers
-
pibronic.vibronic.model_h.
extract_quadratic_couplings
(path, memmap, coupling_terms, frequencies)[source]¶ fill the array coupling_terms with appropriate values from the memmap’ed file the frequencies need to be provided in wavenumbers
-
pibronic.vibronic.model_h.
extract_quartic_couplings
(path, memmap, coupling_terms, frequencies)[source]¶ not implemented at this time
-
pibronic.vibronic.model_h.
get_number_of_electronic_states
(path, file)[source]¶ return the number of electronic states (int) taken from file
pibronic.vibronic.model_op module¶
module that handles parsing model.op files
pibronic.vibronic.vibronic_model_io module¶
vibronic_model_io.py should handle the majority of file I/O
-
pibronic.vibronic.vibronic_model_io.
create_basic_diagonal_model
(FS)[source]¶ wrapper function to make the simplest diagonal(sampling) model
-
pibronic.vibronic.vibronic_model_io.
create_coupling_from_h_file
(FS, path_file_h)[source]¶ assumes that the path_file_h is in electronic_structure
-
pibronic.vibronic.vibronic_model_io.
create_coupling_from_op_file
(FS, path_file_op)[source]¶ assumes that the path_file_op is in electronic_structure
-
pibronic.vibronic.vibronic_model_io.
create_coupling_from_op_hyperlink
(FS, url)[source]¶ assumes that the path_file_op is in electronic_structure
-
pibronic.vibronic.vibronic_model_io.
create_diagonal_model_hash
(FS=None, path=None)[source]¶ create a hash of the sampling_model.json file’s contents this is used to confirm that result files were generated for the current model and not an older one uses a FileStructure or an absolute path to the file
-
pibronic.vibronic.vibronic_model_io.
create_fake_coupled_model
(FS, tuning_parameter=0.01, transformation_matrix=None)[source]¶ take the diagonal coupled model and preform a unitary transformation on it to get a dense matrix
for a tuning_parameter of 0 the transformation matrix (U) is identity the larger the value of tuning_parameter the “farther” away from identity U becomes
if a numpy array of dim AxA is provided in the transformation_matrix then we won’t create a new matrix and instead use the provided one note: if transformation_matrix is provided then the tuning_parameter is ignored
-
pibronic.vibronic.vibronic_model_io.
create_harmonic_model
(FS)[source]¶ wrapper function to refresh harmonic model
-
pibronic.vibronic.vibronic_model_io.
create_model_hash
(FS=None, path=None)[source]¶ create a hash of the coupled_model.json file’s contents this is used to confirm that result files were generated for the current model and not an older one uses a FileStructure or an absolute path to the file
-
pibronic.vibronic.vibronic_model_io.
create_orthonormal_matrix_lambda_close_to_identity
(order, tuning_parameter)[source]¶ a wrapper for the function defined in pibronic.vibronic.orthonormal
-
pibronic.vibronic.vibronic_model_io.
create_random_diagonal_model
()[source]¶ returns a dictionary that is a valid diagonal model
-
pibronic.vibronic.vibronic_model_io.
create_random_model
()[source]¶ returns a dictionary that is a valid model
-
pibronic.vibronic.vibronic_model_io.
create_random_orthonormal_matrix
(A)[source]¶ returns a orthonormal matrix, just a wrapper for scipy.stats.ortho_group.rvs()
-
pibronic.vibronic.vibronic_model_io.
diagonal_model_shape_dict
(A, N)[source]¶ returns a dictionary with the same keys as the .json file whose values are tuples representing the dimensionality of the associated value in the .json file Takes A - number of surfaces and N - number of modes
-
pibronic.vibronic.vibronic_model_io.
diagonal_model_zeros_template_json_dict
(A, N)[source]¶ returns a dictionary that is a valid diagonal model, where all values (other than states and modes) are set to 0
-
pibronic.vibronic.vibronic_model_io.
extract_dimensions_of_diagonal_model
(FS=None, path=None)[source]¶ returns A, N in that order A is the number_of_surfaces and N is the number_of_modes for sampling_model.json files by using a FileStructure or an absolute path to the file
-
pibronic.vibronic.vibronic_model_io.
extract_dimensions_of_model
(FS=None, path=None)[source]¶ returns A, N in that order A is the number_of_surfaces and N is the number_of_modes for coupling_model.json files by using a FileStructure or an absolute path to the file
-
pibronic.vibronic.vibronic_model_io.
fill_offdiagonal_of_model_with_zeros
(model)[source]¶ takes a dictionary who must have values of dimensionality (…, A, A) and set the off-diagonal (surface) elements to zero
-
pibronic.vibronic.vibronic_model_io.
generate_vibronic_model_data
(input_parameters=None)[source]¶ redo this one but otherwise its fine returns e,w,l,q filled with appropriate values
-
pibronic.vibronic.vibronic_model_io.
load_diagonal_model_from_JSON
(path, dictionary=None)[source]¶ if kwargs is not provided then returns a dictionary filled with the values stored in the .json file located at path
if kwargs is provided then all values are overwritten (in place) with the values stored in the .json file located at path
-
pibronic.vibronic.vibronic_model_io.
load_model_from_JSON
(path, dictionary=None)[source]¶ if kwargs is not provided then returns a dictionary filled with the values stored in the .json file located at path
if kwargs is provided then all values are overwritten (in place) with the values stored in the .json file located at path
-
pibronic.vibronic.vibronic_model_io.
model_parameters_are_symmetric_in_modes
(kwargs)[source]¶ Boolean function that returns true if the provided model’s quadratic and quartic arrays are symmetric in their mode dimensions this is a bit trickier than the surface dimension this function assumes that the arrays is properly formatted
-
pibronic.vibronic.vibronic_model_io.
model_parameters_are_symmetric_in_surfaces
(kwargs)[source]¶ Boolean function that returns true if the provided model’s arrays are all symmetric in the surface dimension where the surface dimensions (A) are by convention the last two dimensions this function assumes that the arrays is properly formatted
-
pibronic.vibronic.vibronic_model_io.
model_shape_dict
(A, N)[source]¶ returns a dictionary with the same keys as the .json file whose values are tuples representing the dimensionality of the associated value in the .json file Takes A - number of surfaces and N - number of modes
-
pibronic.vibronic.vibronic_model_io.
model_zeros_template_json_dict
(A, N)[source]¶ returns a dictionary that is a valid model, where all values (other than states and modes) are set to 0
-
pibronic.vibronic.vibronic_model_io.
read_model_auto_file
(path_file_auto)[source]¶ wrapper function to maintain functionality - possible remove in the future
-
pibronic.vibronic.vibronic_model_io.
read_model_h_file
(path_file_h)[source]¶ wrapper function to maintain functionality - possible remove in the future
-
pibronic.vibronic.vibronic_model_io.
read_model_op_file
(path_file_op)[source]¶ wrapper function to maintain functionality - possible remove in the future
-
pibronic.vibronic.vibronic_model_io.
recalculate_energy_values_of_diagonal_model
(FS, path)[source]¶ x
-
pibronic.vibronic.vibronic_model_io.
remove_coupling_from_model
(path_source, path_destination)[source]¶ reads in a model from path_source whose values can have dimensionality (…, A, A) creates a new model whose values have dimensionality (…, A) from the diagonal of the A dimension of the input model saves the new model to the provided path_destination
-
pibronic.vibronic.vibronic_model_io.
save_diagonal_model_to_JSON
(path, dictionary)[source]¶ wrapper for _save_to_JSON calls verify_sample_parameters() before calling _save_to_JSON()
-
pibronic.vibronic.vibronic_model_io.
save_model_to_JSON
(path, dictionary)[source]¶ wrapper for _save_to_JSON calls verify_model_parameters() before calling _save_to_JSON()
-
pibronic.vibronic.vibronic_model_io.
simple_single_point_energy_calculation
(FS, path)[source]¶ generate new energy values for the diagonal model stored at the arg ‘path’ this is intended to be used for re-weighting the oscillators created using the iterative method
returns a list of energy values in eV which
pibronic.vibronic.vibronic_model_keys module¶
contains the VibronicModelKeys
-
class
pibronic.vibronic.vibronic_model_keys.
VibronicModelKeys
[source]¶ Bases:
enum.Enum
The VibronicModelKeys, which are the keys (strings) used in the .json files to identify the corresponding values
-
A
= 'number of surfaces'¶
-
E
= 'energies'¶
-
G1
= 'linear couplings'¶
-
G2
= 'quadratic couplings'¶
-
G3
= 'cubic couplings'¶
-
G4
= 'quartic couplings'¶
-
N
= 'number of modes'¶
-
cubic_couplings
= 'cubic couplings'¶
-
energies
= 'energies'¶
-
frequencies
= 'frequencies'¶
-
linear_couplings
= 'linear couplings'¶
-
number_of_modes
= 'number of modes'¶
-
number_of_surfaces
= 'number of surfaces'¶
-
quadratic_couplings
= 'quadratic couplings'¶
-
quartic_couplings
= 'quartic couplings'¶
-
w
= 'frequencies'¶
-