pibronic.data package

Scripts that handle data

Submodules

pibronic.data.file_name module

Bookkeeping provided by file_name module

Store all naming conventions in one place Keeps file naming consistent over the many modules if changes need to be made

pibronic.data.file_name.analytic_results = 'analytic_results.json'

contains any parameters which can be obtained through analytical methods which describe the system’s Hamiltonian before we did a unitary transformation

pibronic.data.file_name.coupled_model = 'coupled_model.json'

contains the original parameters (diagonal) which describe the system’s Hamiltonian before we did a unitary transformation

pibronic.data.file_name.execution_output(D='{D:d}', R='{R:d}', P='{P:d}', T='{T:.2f}', J='{J:d}')[source]

wrapper function to allow parameterized search for files can pass in any regular expression most commonly will just pass in “*” to search for all files of a given argument

pibronic.data.file_name.harmonic_model = 'harmonic_model.json'

contains the parameters which describe a sampling model this can be anything which is diagonal in the electronic states

pibronic.data.file_name.iterative_matrix = 'iterative_matrix.txt'

contains any parameters which can be obtained through analytical methods this commonly stores properties of the sampling model at different temperatures

pibronic.data.file_name.iterative_model = 'iterative_model.json'

contains the transformation matrix which was used in our iterative decomposition method to generate the iterative model

pibronic.data.file_name.jackknife(P='{P:d}', T='{T:.2f}', X='{X:d}')[source]

wrapper function to allow parameterized search for files can pass in any regular expression most commonly will just pass in “*” to search for all files of a given argument

pibronic.data.file_name.original_analytic_results = 'original_analytic_results.json'

contains the orthonormal matrix which was used to preform the unitary transformation on the original_coupled_model.json to get the coupled_model.json

pibronic.data.file_name.original_model = 'original_coupled_model.json'

contains the parameters which describe the harmonic operator this is all the Kinetic terms + any diagonal terms that can be described by a Harmonic oscillator this can be used as a simplistic sampling distribution rho_0

pibronic.data.file_name.pimc(P='{P:d}', T='{T:.2f}', J='{J:d}')[source]

wrapper function to allow parameterized search for files can pass in any regular expression most commonly will just pass in “*” to search for all files of a given argument

pibronic.data.file_name.sampling_model = 'sampling_model.json'

contains the parameters which describe the sampling model which has been generated using our iterative decomposition method whose weights have been corrected using single-point energy calculations

pibronic.data.file_name.sos(B='{B:d}')[source]

wrapper function to allow parameterized search for files can pass in any regular expression most commonly will just pass in “*” to search for all files of a given argument

pibronic.data.file_name.training_data_g_output(P='{P:d}', T='{T:.2f}', J='{J:d}')[source]

wrapper function to allow parameterized search for files can pass in any regular expression most commonly will just pass in “*” to search for all files of a given argument

pibronic.data.file_name.training_data_input(P='{P:d}', T='{T:.2f}', J='{J:d}')[source]

wrapper function to allow parameterized search for files can pass in any regular expression most commonly will just pass in “*” to search for all files of a given argument

pibronic.data.file_name.training_data_rho_output(P='{P:d}', T='{T:.2f}', J='{J:d}')[source]

wrapper function to allow parameterized search for files can pass in any regular expression most commonly will just pass in “*” to search for all files of a given argument

pibronic.data.file_name.trotter(P='{P:d}', B='{B:d}')[source]

wrapper function to allow parameterized search for files can pass in any regular expression most commonly will just pass in “*” to search for all files of a given argument

pibronic.data.file_structure module

Bookkeeping provided by FileStucture class

keeps directory structure consistant over the many modules if changes need to be made

class pibronic.data.file_structure.FileStructure(path_root, id_data, id_rho=0, no_makedir=False)[source]

Bases: object

handles creation and verification of default file structure storing data from/to jobs

change_rho(id_rho)[source]

modifies all the FileStructure’s paths to point to the new rho id calls make_rho_directories() to ensure the directories exist

dir_list = None

TODO - possibly rename the sampling and coupled paths? they are paths but shouldn’t be in the dir_list

directories_exist()[source]

x

classmethod from_boxdata(path_root, data)[source]

constructor wrapper that takes a data object from minimal.py

generate_model_hashes(force_flag=False)[source]

create two new data attributes (if they don’t already exist) which store the hash values (hash_vib, hash_rho) created by the functions vIO.create_model_hash() and vIO.create_sampling_hash()

make_directories()[source]

x

make_rho_directories(id_rho)[source]

creates (if they don’t already exist) the necessary directories for storing the data of an additional sampling distribution (choice of rho)

template_rho = 'data_set_{:d}/rho_{:d}/'
template_rho_output = 'data_set_{:d}/rho_{:d}/execution_output/'
template_rho_params = 'data_set_{:d}/rho_{:d}/parameters/'
template_rho_plots = 'data_set_{:d}/rho_{:d}/plots/'

template_pimc_suffix = “D{D:d}_R{R:d}_P{P:d}_T{T:.2f}_J*_data_points.npz” template_jackknife_suffix = “D{D:d}_R{R:d}_P{P:d}_T{T:.2f}_X{X:d}_thermo” template_sos_suffix = “sos_B{B:d}.json”

template_rho_results = 'data_set_{:d}/rho_{:d}/results/'
template_vib = 'data_set_{:d}/'
template_vib_output = 'data_set_{:d}/execution_output/'
template_vib_params = 'data_set_{:d}/parameters/'
template_vib_plots = 'data_set_{:d}/plots/'
template_vib_results = 'data_set_{:d}/results/'
valid_rho_hash(model_dict)[source]

takes a dictionary and returns bool if value of ‘hash_rho’ key is same as hash_rho attribute of self

valid_vib_and_rho_hashes(path)[source]
valid_vib_hash(model_dict)[source]

takes a dictionary and returns bool if value of ‘hash_vib’ key is same as hash_vib attribute of self

verify_directories_exists(id_data, path_root=None)[source]

if directory structure exists does nothing, creates the file structure otherwise

pibronic.data.postprocessing module

Handles all file processing after calculations are run

Provides functions for collating files for statistical analaysis (such as jackknife) and plotting

pibronic.data.postprocessing.extract_basis_value_from_sos_file_path(file_path)[source]

does what it says, returns an int

pibronic.data.postprocessing.extract_bead_paramater_list(list_pimc)[source]

takes a list of file-paths to results from pimc calculations and return a list of all the unique bead values

pibronic.data.postprocessing.extract_bead_value_from_pimc_file_path(file_path)[source]

does what it says, returns an int

pibronic.data.postprocessing.extract_bead_value_from_thermo_file_path(file_path)[source]

does what it says, returns an int

pibronic.data.postprocessing.extract_bead_value_from_trotter_file_path(file_path)[source]

does what it says, returns an int

pibronic.data.postprocessing.extract_jackknife_parameters(list_pimc, list_coupled, list_sampling)[source]

make a list of all parameters whose dependencies are satisfied note that this function is tightly tied to the file name

pibronic.data.postprocessing.extract_job_value_from_pimc_file_path(file_path)[source]

does what it says, returns an int

pibronic.data.postprocessing.extract_parameter_lists(list_pimc, list_vib, list_rho)[source]

just assume that we directly use the extract_trotter_paramater_list() function for now

pibronic.data.postprocessing.extract_pimc_parameters(list_pimc, list_coupled, list_sampling)[source]

make a list of all parameters whose dependencies are satisfied note that this function is tightly tied to the file name

pibronic.data.postprocessing.extract_sample_value_from_thermo_file_path(file_path)[source]

does what it says, returns an int

pibronic.data.postprocessing.extract_sos_basis_paramater_list(list_vib, list_rho)[source]

takes a list of file-paths to results from sos calculations (both coupled and rho) and return a list of all the unique

pibronic.data.postprocessing.extract_temperature_paramater_list(list_pimc)[source]

takes a list of file-paths to results from pimc calculations and return a list of all the unique temperature values (as floats)

pibronic.data.postprocessing.extract_temperature_value_from_pimc_file_path(file_path)[source]

does what it says, returns a float

pibronic.data.postprocessing.extract_temperature_value_from_thermo_file_path(file_path)[source]

does what it says, returns a float

pibronic.data.postprocessing.extract_trotter_paramater_list(list_trotter)[source]

takes a list of file-paths to results from trotter calculations and return a dictionary with integer keys representing possible basis sizes, whose corresponding values are lists of all possible bead values for that given basis size.

pibronic.data.postprocessing.load_analytic_data(FS, T, analytic)[source]

load data from analytic_results.txt with same T into the dictionary analytic

pibronic.data.postprocessing.load_pimc_data(FS, P, T, pimc_results)[source]

load data from all files with same P and T

pibronic.data.postprocessing.load_rho_sos_data(FS, P, B, T, rho_args)[source]

load data from all files with same P and T into the dictionary rho_args

pibronic.data.postprocessing.prune_results_using_hashes(FS, list_pimc)[source]

takes a list of file paths (strings) to different results and a FileStructure object returns a subset of the input list where each returned file path exists and has a ‘valid’ hash, i.e. the same as in the FileStructure object

pibronic.data.postprocessing.retrive_all_file_paths(FS)[source]

return three lists of the full paths to each data file that might be used

pibronic.data.postprocessing.retrive_file_paths_for_jackknife(FS)[source]

return three lists of the full paths to each data file that might be used

pibronic.data.postprocessing.retrive_jackknife_file_list(FS)[source]

return a list of the full path to each jackknife file that might be used

pibronic.data.postprocessing.retrive_pimc_file_list(FS)[source]

return a list of the full path to each pimc file that might be used

pibronic.data.postprocessing.retrive_sos_coupled_file_list(FS, B='*')[source]

return a list of the full path to each sos(coupled) file that might be used

pibronic.data.postprocessing.retrive_sos_sampling_file_list(FS, B='*')[source]

return a list of the full path to each sos(sampling) file that might be used