2.6.6. prismatique.sample.generate_potential_slices
- generate_potential_slices(sample_model_params, output_dirname='potential_slice_generator_output', max_data_size=2000000000, worker_params=None, skip_validation_and_conversion=False)[source]
Generate the potential slices for a given sample model.
For each frozen phonon configuration subset, this Python function generates the corresponding potential slices and saves them to a set of files. See the documentation for the classes
prismatique.discretization.Paramsandprismatique.thermal.Paramsfor discussions on potential slices and frozen phonon configuration subsets respectively.For each frozen phonon configuration subset, the corresponding potential slice data is written to a file with the basename
"potential_slices_of_subset_"+str(i)+".h5", withibeing the subset index.In addition to the potential slice files, two other files are generated as well: The first is a JSON file with the basename
"sample_model_params.json"which contains, in a serialized format, the simulation parameters related to the modelling of the sample; the second file is a JSON file with the basename"worker_params.json"which contains, in a serialized format, the simulation parameters related to GPU and CPU workers.- Parameters:
- sample_model_params
prismatique.sample.ModelParams The simulation parameters related to the modelling of the sample.
- output_dirnamestr, optional
The relative or absolute path to the directory in which all output files are to be saved. If the directory doesn’t exist upon saving the output files, it will be created if possible.
- max_data_sizeint, optional
The data size limit, in bytes, of the potential slices to be generated. If the potential slices to be generated would require a data size larger than the aforementioned limit, then an exception is raised and the potential slices are not generated. Note that data size due to HDF5 file overhead and metadata are not taken into account.
- worker_params
prismatique.worker.Params| None, optional The simulation parameters related to GPU and CPU workers. See the documentation for the class
prismatique.worker.Paramsfor a discussion on said parameters. Ifworker_paramsis set to None [i.e. the default value], then the aforementioned simulation parameters are set to default values.- skip_validation_and_conversionbool, optional
If
skip_validation_and_conversionis set toFalse, then validations and conversions are performed on the above parameters.Otherwise, if
skip_validation_and_conversionis set toTrue, no validations and conversions are performed on the above parameters. This option is desired primarily when the user wants to avoid potentially expensive validation and/or conversion operations.
- sample_model_params
- Returns: