principia_materia.phonon_id.dynamic_tensors module
- class principia_materia.phonon_id.dynamic_tensors.DynamicTensors(structure, supa, order, pg='C1', tol=1e-06)
Bases:
object
Dynamic tensors of a reciprocal mesh at arbitrary order.
As a fundation to many other tools, this class accommodatas dynamic tensors, can rotate them from irreducible Q-points to full BZ. For second order, it can also accounts for dipole-dipole interaction.
Instead of a dictionary, the dynamic tensors of different Q-points are stored as an array of tensors in the same order of the Q-points designated by principia_materia.translation_group.QpointsN class. In a sense, we created a custom hash table.
- Parameters:
structure (CrystalFTG object or a structure file of CrystalFTG) – The crystal structure.
supa (array of int, shape(dim, dim)) – The supercell matrix.
order (int) – Order of the dynamic tensor.
pg (str or PointGroup object) – The point group.
tol (float, optional, default to 1.0E-6) – Error tolerence.
- copy()
Make a copy
- Returns:
new – A copy of the object.
- Return type:
- get_D_at_Q(Q)
Get dynamic tensor at a given Q-point
If the stored dynamic tensors are from irreducible Q-points and Q is not in the irreducible Q-points, rotate the dynamic tensor from the corresponding irreducible Q-point to Q.
- Parameters:
Q (array of Fraction, shape(order, dim)) – A Q-point.
- Returns:
dynamic_tensor – Dynamic tensor at Q-point.
- Return type:
array of complex, shape(ndof, …, ndof) or shape(ndof, …, ndof, m)
- get_full_D()
Get dynamic tensors of full BZ.
- Returns:
dynamic_tensors – Dynamic tensors of full BZ.
- Return type:
array of complex, shape(N, ndof, …, ndof) or shape(N, ndof, …, ndof, m)
- prepend_hiden_q(Qpoints)
Prepend the hidden q-point to Q-points
For Q-points that didn’t keep the hidden q-point, this method can prepend the q-point back. (Due to the conservation of momentum, all q-points in a Q-point need to add up equivalent to Gamma point, thus there are only order-1 linearly independent q-points in a given Q-point, and the dependent one can be omitted. The convention here is to omit the first q-point, and referred to as the hidden q-point.)
- Parameters:
Qpoints (array of Fraction, shape(N, order - 1, dim)) – Q-points without the hidden q-point.
- set_D(Qpoints, D)
Set dynamic tensors.
- Parameters:
Qpoints (array of Fraction, shape(N, order - 1, dim) or shape(N, order, dim)) – Q-points either of the irreducible zone or the full BZ. Can be the full Q-points or the Q-points without the hidden q-point.
D (array of complex, shape(N, ndof, ..., ndof), shape(N, ndof, ..., ndof, m)) – Dynamic tensors in the same order as the Qpoints. Can be dynamic tensors of irreducible Q-points, or of full BZ. Can be trivial dynamic tensors or vectorized tensors with the last axis being the vector axis.
- set_dipoledipole(zeu=None, epsilon=None, dataset=None, G_ran=5, Lambda=0.2, factor=1.0)
For the case of second order, initialize dipole dipole contribution data.
- Parameters:
zeu (array of float, shape(natoms, dim, dim)) – Born effective charge tensor.
epsilon (array of float, shape(dim, dim)) – Dielectric constant tensor.
dataset (str) – Path to a file that contains all the necessary data. (In the case when zeu and epsilon are absent, this dataset file is required, otherwise it is ignored. If any of optional parameters (i.e. G_ran, Lamda, factor and tol) is missing, the default value will be used.)
G_ran (int, optional, default to 5) – Range of G vectors.
Lambda (float, optional, default to 0.20) – Lamda value in the equation.
factor (float, optional, default to 1.0) – Overall unit conversion factor for the output matrix.
- set_dipoledipole_contribution()
For 2nd order, subtract the dipole-dipole contribution from the dynamic matrices.
This step is only supported when the stored dynamic matrices are of full BZ.
- set_irreducible_D(D)
Set irreducible dynamic tensors.
- Parameters:
D (array of complex, shape(N, ndof, ..., ndof), shape(N, ndof, ..., ndof, m)) – Dynamic tensors of irreducible Q-points. Can be trivial dynamic tensors or vectorized tensors with the last axis being the vector axis.
- principia_materia.phonon_id.dynamic_tensors.get_DynamicTensors_from_hdf5(h5file, tol=1e-06)
Load DynamicTensors from HDF5 file.
- Parameters:
h5file (str or h5py.File/h5py.Group obejct) – Path to a HDF5 file or a h5py.File/h5py.Group object.
tol (float, optional, default to 1.0E-6) – Error tolerance to use when constructing the LittleGroupADT object.
- principia_materia.phonon_id.dynamic_tensors.get_DynamicTensors_hdf5_wrapper()
HDF5 data wrapper for DynamicTensors class.
- principia_materia.phonon_id.dynamic_tensors.save_DynamicTensors_to_hdf5(obj, h5file='dynamic_tensors.hdf5', overwrite=False)
Save DynamicTensors data into HDF5 file.
- Parameters:
obj (DynamicTensors) – A DynamicTensors object.
h5file (str or h5py.File/h5py.Group obejct, optional, default to "dynamic_tensors.hdf5") – Path to a HDF5 file or a h5py.File/h5py.Group object.
overwrite (bool, optional, default to False) – When the file exists, whether to replace the content of the file with the content to be saved.