principia_materia.phonon_id.lid_mesh module

class principia_materia.phonon_id.lid_mesh.LIDMesh(structure, supa, order, pg='C1', full_symmetry=False, hidden_order=1, fdtype='c', tol=1e-06)

Bases: object

Compute phonons and their interactions with LID approach on a given mesh.

Parameters:
  • structure (CrystalFTG object or a structure file of CrystalFTG) – The crystal structure.

  • supa (array of int, shape(dim, dim)) – The supercell matrix (a.k.a the mesh) to compute phonons and their interactions in.

  • order (int) – The order of the phonon interactions.

  • pg (str or PointGroup object, optional, default to "C1") – The point group.

  • full_symmetry (bool, optional, default to False) – If True, use full group analysis (not implemented yet). If False, use little group analysis.

  • hidden_order (int, optional, default to 1) – The order of derivatives from first principles.

  • fdtype (str, choice of ["c", "f", "b"]) – Type of finite displacement.

  • tol (float, optional, default to 1.0E-6) – Error tolerence.

create_jobs(job_handler, deltas, Q_dir_format='Qpoint_{:>03d}', delta_format=<function format_delta_dirname>, measurement_label=<function format_measurement_label>, jobname_prefix='', config_file='finite_displacements.yml', fdseries_filename='fdseries.hdf5', lid_filename='loneqID_fp.hdf5', append=False, dry_run=False)

Create jobs for LID calculations for the irreducible Q-points.

Parameters:
  • job_handler (ComputeJobSeries or JobsDB) – Either a ComputeJobSeries or a JobsDB object as the interface to the jobs.

  • deltas (list of numbers, list of arrays, 1-d or 2-d array) –

    Displacement amplitude. Can take following types:

    1. a number, will be broadcast into a shape(n_measurements, 1) array.

    2. an 1-d array of length N, will be broadcast into a shape(n_measurements, N) array.

    3. a 2-d array of shape(n_measurements, N).

  • Q_dir_format (str, optional, default to "Qpoint_{:>03d}") – The format of directory name representing a Q-point.

  • delta_format (callable, optional, default to function: format_delta_dirname.) – A function that format a delta into a string for directory name. Must be in form of def function(delta, ...): ....

  • measurement_label (callable, optioal, default to function: format_measurement_label.) – A function the format a measurement index into a measurement label string.

  • jobname_prefix (str) – Prefix for jobnames.

  • config_file (str, optional, default to "finite_displacements.yml") – The name of the finite displacements configuration file.

  • fdseries_filename (str, optional, default to "fdseries.hdf5") – The name of the FDSeries data file to store finite displacement information.

  • lid_filename (str, optional, default to "loneqID_fp.hdf5") – The name of HDF5 file to save LID data into.

  • dry_run (bool, optional, default to False) – If True, don’t actually create the job.

get_dynamic_tensors()

Compute irreducible derivatives and construct dynamic tensors of irreducible Q-points.

Returns:

dynamic_tensors – The dynamic tensors of irreducible Q-points.

Return type:

array of complex, shape(N irreducible Q-points, norbitals, …)

get_fourier_interpolation()

Construct the FourierInterpolation object from dynamic tensors of irreducible Q-points.

Returns:

fourier_interpolation – A FourierInterpolation object.

Return type:

FourierInterpolation

get_irreducible_derivative_names()
get_irreducible_derivatives()
property irreducible_derivatives
load_lid(root_directory, lid_filename='loneqID_fp.hdf5', fdseries_filename='fdseries.hdf5')

Load LID objects from HDF5 files.

Parameters:
  • root_directory (str) – The root directory of the LIDMesh jobs.

  • lid_filename (str, optional, default to "loneqID_fp.hdf5") – The name of HDF5 file to save LID data into.

  • fdseries_filename (str, optional, default to "fdseries.hdf5") – The name of the FDSeries data file to store finite displacement information.

set_errortail_results(pick_min=3, pick_max=None, consecutive=False, penalty=<function penalty_linear_mse>, separate_complex=True, output=None, overwrite=True)

Compute error tail for the FrozenPhonons result.

Parameters:
  • pick_min (int, optional, default to 3) – The minimum number of picks for delta selection.

  • pick_max (int, optional, default to None) – The maximum number of picks for delta selection. If None, the pick n scheme is used with n=pick_min. If not None, the pick N schcme is used with N=[pick_min, pick_max].

  • consecutive (bool, optional, default to False) – Whether to pick consecutive deltas in the picking process.

  • penalty (callable, optional, default to penalty_linear_mse) – The penalty function to determine the best fit.

  • separate_complex (bool, optional, default to False) – Whether to fit real and imaginary part of the complex data points separetely.

  • output (str, optional, default to None) – Path of the output file. If not None, save the output of errortail fit to the file.

set_lid()

Construct LID objects for irreducible Q-points.

set_results(job_handler, data_type, fill=0.0, config_file='finite_displacements.yml')

Get finite displacements results from calculations.

Parameters:
  • job_handler (ComputeJobSeries or JobsDB) – Either a ComputeJobSeries or a JobsDB object as the interface to the jobs.

  • data_type (str, choices of "forces" and "energy") – Type of data to read from compute jobs.

  • config_file (str, optional, default to "finite_displacements.yml") – The name of the finite displacements configuration file.

principia_materia.phonon_id.lid_mesh.get_LIDMesh_config_wrapper(title='LID Mesh Configuration')

YAML data wrapper for LIDMesh configurations.

principia_materia.phonon_id.lid_mesh.get_LIDMesh_from_hdf5(h5file, tol=1e-06)
principia_materia.phonon_id.lid_mesh.get_LIDMesh_from_yaml(filename, tol=1e-06)
principia_materia.phonon_id.lid_mesh.get_LIDMesh_hdf5_wrapper()

HDF5 data wrapper for LIDMesh configurations.

principia_materia.phonon_id.lid_mesh.save_LIDMesh_to_hdf5(obj, h5file='lid_mesh.hdf5', overwrite=False)
principia_materia.phonon_id.lid_mesh.save_LIDMesh_to_yaml(obj, filename='lid_mesh.yml', overwrite=False)