structures.layers

Classes:

Layer(id, name, **kwargs)

Base class of real physical layers, such as amorphous layers and unit cells.

AmorphousLayer(id, name, thickness, density, …)

Representation of amorphous layers containing an Atom or AtomMixed.

UnitCell(id, name, c_axis, **kwargs)

Representation of unit cells made of one or multiple Atom or AtomMixed instances at defined positions.

class udkm1Dsim.structures.layers.Layer(id, name, **kwargs)

Bases: object

Base class of real physical layers, such as amorphous layers and unit cells.

It holds different structural, thermal, and elastic properties that are relevant for simulations.

Parameters
  • id (str) – id of the layer.

  • name (str) – name of the layer.

Keyword Arguments
  • roughness (float) – gaussian width of the top roughness of a layer.

  • deb_wal_fac (float) – Debye Waller factor.

  • sound_vel (float) – sound velocity.

  • phonon_damping (float) – phonon damping.

  • opt_pen_depth (float) – optical penetration depth.

  • opt_ref_index (float) – refractive index.

  • opt_ref_index_per_strain (float) – change of refractive index per strain.

  • heat_capacity (float) – heat capacity.

  • therm_cond (float) – thermal conductivity.

  • lin_therm_exp (float) – linear thermal expansion.

  • sub_system_coupling (float) – sub-system coupling.

Attributes
  • id (str) – id of the layer.

  • name (str) – name of the layer.

  • thickness (float) – thickness of the layer [m].

  • mass (float) – mass of the layer [kg].

  • mass_unit_area (float) – mass of layer normalized to unit area of 1 Ų [kg].

  • density (float) – density of the layer [kg/m³].

  • area (float) – area of layer [m²].

  • volume (float) – volume of layer [m³].

  • roughness (float) – gaussian width of the top roughness of a layer [m].

  • deb_wal_fac (float) – Debye-Waller factor [m²].

  • sound_vel (float) – longitudinal sound velocity in the layer [m/s].

  • spring_const (ndarray[float]) – spring constant of the layer [kg/s²] and higher orders.

  • phonon_damping (float) – damping constant of phonon propagation [kg/s].

  • opt_pen_depth (float) – optical penetration depth of the layer [m].

  • opt_ref_index (ndarray[float]) – optical refractive index - real and imagenary part \(n + i\kappa\).

  • opt_ref_index_per_strain (ndarray[float]) – optical refractive index change per strain - real and imagenary part \(\frac{d n}{d \eta} + i\frac{d \kappa}{d \eta}\).

  • therm_cond (list[@lambda]) – list of HANDLES T-dependent thermal conductivity [W/(m K)].

  • lin_therm_exp (list[@lambda]) – list of T-dependent linear thermal expansion coefficient (relative).

  • int_lin_therm_exp (list[@lambda]) – list of T-dependent integrated linear thermal expansion coefficient.

  • heat_capacity (list[@lambda]) – list of T-dependent heat capacity function [J/(kg K)].

  • int_heat_capacity (list[@lambda]) – list of T-dependent integrated heat capacity function.

  • sub_system_coupling (list[@lambda]) – list of of coupling functions of different subsystems [W/m³].

  • num_sub_systems (int) – number of subsystems for heat and phonons (electrons, lattice, spins, …).

Methods:

check_input(inputs)

Checks the input and create a list of function handle strings with T as argument.

get_property_dict(**kwargs)

Returns a dictionary with all parameters.

get_acoustic_impedance()

Calculates the acoustic impedance.

set_ho_spring_constants(HO)

Set the higher orders of the spring constant for anharmonic phonon simulations.

set_opt_pen_depth_from_ref_index(wavelength)

Set the optical penetration depth from the optical referactive index for a given wavelength.

calc_spring_const()

Calculates the spring constant of the layer from the mass per unit area, sound velocity and thickness

check_input(inputs)

Checks the input and create a list of function handle strings with T as argument. Inputs can be strings, floats, ints, or pint quantaties.

Parameters

inputs (list[str, int, float, Quantity]) – list of strings, int, floats, or Pint quantities.

Returns

(tuple)

  • output (list[@lambda]) - list of lambda functions.

  • output_strs (list[str]) - list of string-representations.

get_property_dict(**kwargs)

Returns a dictionary with all parameters. objects or dicts and objects are converted to strings. if a type is given, only these properties are returned.

Parameters

**kwargs (list[str]) – types of requested properties.

Returns

R (dict) – dictionary with requested properties.

get_acoustic_impedance()

Calculates the acoustic impedance.

Returns

Z (float) – acoustic impedance.

set_ho_spring_constants(HO)

Set the higher orders of the spring constant for anharmonic phonon simulations.

Parameters

HO (ndarray[float]) – higher order spring constants.

set_opt_pen_depth_from_ref_index(wavelength)

Set the optical penetration depth from the optical referactive index for a given wavelength.

Parameters

wavelength (Quantity) – wavelength as Pint Quantitiy.

calc_spring_const()

Calculates the spring constant of the layer from the mass per unit area, sound velocity and thickness

\[k = m \, \left(\frac{v}{c}\right)^2\]
class udkm1Dsim.structures.layers.AmorphousLayer(id, name, thickness, density, **kwargs)

Bases: udkm1Dsim.structures.layers.Layer

Representation of amorphous layers containing an Atom or AtomMixed.

Parameters
  • id (str) – id of the layer.

  • name (str) – name of layer.

  • thickness (float) – thickness of the layer.

  • density (float) – density of the layer.

Keyword Arguments
  • atom (object) – Atom or AtomMixed in the layer.

  • roughness (float) – gaussian width of the top roughness of a layer.

  • deb_wal_fac (float) – Debye Waller factor.

  • sound_vel (float) – sound velocity.

  • phonon_damping (float) – phonon damping.

  • roughness – gaussian width of the top roughness of a layer.

  • opt_pen_depth (float) – optical penetration depth.

  • opt_ref_index (float) – refractive index.

  • opt_ref_index_per_strain (float) – change of refractive index per strain.

  • heat_capacity (float) – heat capacity.

  • therm_cond (float) – thermal conductivity.

  • lin_therm_exp (float) – linear thermal expansion.

  • sub_system_coupling (float) – sub-system coupling.

Attributes
  • id (str) – id of the layer.

  • name (str) – name of the layer.

  • thickness (float) – thickness of the layer [m].

  • mass (float) – mass of the layer [kg].

  • mass_unit_area (float) – mass of layer normalized to unit area of 1 Ų [kg].

  • density (float) – density of the layer [kg/m³].

  • area (float) – area of layer [m²].

  • volume (float) – volume of layer [m³].

  • roughness (float) – gaussian width of the top roughness of a layer [m].

  • deb_wal_fac (float) – Debye-Waller factor [m²].

  • sound_vel (float) – longitudinal sound velocity in the layer [m/s].

  • spring_const (ndarray[float]) – spring constant of the layer [kg/s²] and higher orders.

  • phonon_damping (float) – damping constant of phonon propagation [kg/s].

  • opt_pen_depth (float) – optical penetration depth of the layer [m].

  • opt_ref_index (ndarray[float]) – optical refractive index - real and imagenary part \(n + i\kappa\).

  • opt_ref_index_per_strain (ndarray[float]) – optical refractive index change per strain - real and imagenary part \(\frac{d n}{d \eta} + i\frac{d \kappa}{d \eta}\).

  • therm_cond (list[@lambda]) – list of HANDLES T-dependent thermal conductivity [W/(m K)].

  • lin_therm_exp (list[@lambda]) – list of T-dependent linear thermal expansion coefficient (relative).

  • int_lin_therm_exp (list[@lambda]) – list of T-dependent integrated linear thermal expansion coefficient.

  • heat_capacity (list[@lambda]) – list of T-dependent heat capacity function [J/(kg K)].

  • int_heat_capacity (list[@lambda]) – list of T-dependent integrated heat capacity function.

  • sub_system_coupling (list[@lambda]) – list of of coupling functions of different subsystems [W/m³].

  • num_sub_systems (int) – number of subsystems for heat and phonons (electrons, lattice, spins, …).

  • magnetization (dict[float]) – magnetization amplitude, phi and gamma angle inherited from the atom.

  • atom (object) – Atom or AtomMixed in the layer.

Methods:

calc_spring_const()

Calculates the spring constant of the layer from the mass per unit area, sound velocity and thickness

check_input(inputs)

Checks the input and create a list of function handle strings with T as argument.

get_acoustic_impedance()

Calculates the acoustic impedance.

get_property_dict(**kwargs)

Returns a dictionary with all parameters.

set_ho_spring_constants(HO)

Set the higher orders of the spring constant for anharmonic phonon simulations.

set_opt_pen_depth_from_ref_index(wavelength)

Set the optical penetration depth from the optical referactive index for a given wavelength.

calc_spring_const()

Calculates the spring constant of the layer from the mass per unit area, sound velocity and thickness

\[k = m \, \left(\frac{v}{c}\right)^2\]
check_input(inputs)

Checks the input and create a list of function handle strings with T as argument. Inputs can be strings, floats, ints, or pint quantaties.

Parameters

inputs (list[str, int, float, Quantity]) – list of strings, int, floats, or Pint quantities.

Returns

(tuple)

  • output (list[@lambda]) - list of lambda functions.

  • output_strs (list[str]) - list of string-representations.

get_acoustic_impedance()

Calculates the acoustic impedance.

Returns

Z (float) – acoustic impedance.

get_property_dict(**kwargs)

Returns a dictionary with all parameters. objects or dicts and objects are converted to strings. if a type is given, only these properties are returned.

Parameters

**kwargs (list[str]) – types of requested properties.

Returns

R (dict) – dictionary with requested properties.

set_ho_spring_constants(HO)

Set the higher orders of the spring constant for anharmonic phonon simulations.

Parameters

HO (ndarray[float]) – higher order spring constants.

set_opt_pen_depth_from_ref_index(wavelength)

Set the optical penetration depth from the optical referactive index for a given wavelength.

Parameters

wavelength (Quantity) – wavelength as Pint Quantitiy.

class udkm1Dsim.structures.layers.UnitCell(id, name, c_axis, **kwargs)

Bases: udkm1Dsim.structures.layers.Layer

Representation of unit cells made of one or multiple Atom or AtomMixed instances at defined positions.

Parameters
  • id (str) – id of the UnitCell.

  • name (str) – name of the UnitCell.

  • c_axis (float) – c-axis of the UnitCell.

Keyword Arguments
  • a_axis (float) – a-axis of the UnitCell.

  • b_axis (float) – b-axis of the UnitCell.

  • deb_wal_fac (float) – Debye Waller factor.

  • sound_vel (float) – sound velocity.

  • phonon_damping (float) – phonon damping.

  • roughness (float) – gaussian width of the top roughness of a layer.

  • opt_pen_depth (float) – optical penetration depth.

  • opt_ref_index (float) – refractive index.

  • opt_ref_index_per_strain (float) – change of refractive index per strain.

  • heat_capacity (float) – heat capacity.

  • therm_cond (float) – thermal conductivity.

  • lin_therm_exp (float) – linear thermal expansion.

  • sub_system_coupling (float) – sub-system coupling.

Attributes
  • id (str) – id of the layer.

  • name (str) – name of the layer.

  • c_axis (float) – out-of-plane c-axis [m].

  • a_axis (float) – in-plane a-axis [m].

  • b_axis (float) – in-plane b-axis [m].

  • thickness (float) – thickness of the layer [m].

  • mass (float) – mass of the layer [kg].

  • mass_unit_area (float) – mass of layer normalized to unit area of 1 Ų [kg].

  • density (float) – density of the layer [kg/m³].

  • area (float) – area of layer [m²].

  • volume (float) – volume of layer [m³].

  • roughness (float) – gaussian width of the top roughness of a layer [m].

  • deb_wal_fac (float) – Debye-Waller factor [m²].

  • sound_vel (float) – longitudinal sound velocity in the layer [m/s].

  • spring_const (ndarray[float]) – spring constant of the layer [kg/s²] and higher orders.

  • phonon_damping (float) – damping constant of phonon propagation [kg/s].

  • opt_pen_depth (float) – optical penetration depth of the layer [m].

  • opt_ref_index (ndarray[float]) – optical refractive index - real and imagenary part \(n + i\kappa\).

  • opt_ref_index_per_strain (ndarray[float]) – optical refractive index change per strain - real and imagenary part \(\frac{d n}{d \eta} + i\frac{d \kappa}{d \eta}\).

  • therm_cond (list[@lambda]) – list of HANDLES T-dependent thermal conductivity [W/(m K)].

  • lin_therm_exp (list[@lambda]) – list of T-dependent linear thermal expansion coefficient (relative).

  • int_lin_therm_exp (list[@lambda]) – list of T-dependent integrated linear thermal expansion coefficient.

  • heat_capacity (list[@lambda]) – list of T-dependent heat capacity function [J/(kg K)].

  • int_heat_capacity (list[@lambda]) – list of T-dependent integrated heat capacity function.

  • sub_system_coupling (list[@lambda]) – list of of coupling functions of different subsystems [W/m³].

  • num_sub_systems (int) – number of subsystems for heat and phonons (electrons, lattice, spins, …).

  • atoms (list[atom, @lambda]) – list of atoms and function handle for strain dependent displacement.

  • num_atoms (int) – number of atoms in unit cell.

  • magnetization (list[float]) – magnetization amplitutes, phi, and gamma angle of each atom in the unit cell.

Methods:

calc_spring_const()

Calculates the spring constant of the layer from the mass per unit area, sound velocity and thickness

check_input(inputs)

Checks the input and create a list of function handle strings with T as argument.

get_acoustic_impedance()

Calculates the acoustic impedance.

get_property_dict(**kwargs)

Returns a dictionary with all parameters.

set_ho_spring_constants(HO)

Set the higher orders of the spring constant for anharmonic phonon simulations.

set_opt_pen_depth_from_ref_index(wavelength)

Set the optical penetration depth from the optical referactive index for a given wavelength.

visualize(**kwargs)

Allows for 3D presentation of unit cell by allow for a & b coordinate of atoms.

add_atom(atom, position)

Adds an AtomBase/AtomMixed at a relative position of the unit cell.

add_multiple_atoms(atom, position, Nb)

Adds multiple AtomBase/AtomMixed at a relative position of the unit cell.

get_atom_ids()

Provides a list of atom ids within the unit cell.

get_atom_positions(*args)

Calculates the relative positions of the atoms in the unit cell

calc_spring_const()

Calculates the spring constant of the layer from the mass per unit area, sound velocity and thickness

\[k = m \, \left(\frac{v}{c}\right)^2\]
check_input(inputs)

Checks the input and create a list of function handle strings with T as argument. Inputs can be strings, floats, ints, or pint quantaties.

Parameters

inputs (list[str, int, float, Quantity]) – list of strings, int, floats, or Pint quantities.

Returns

(tuple)

  • output (list[@lambda]) - list of lambda functions.

  • output_strs (list[str]) - list of string-representations.

get_acoustic_impedance()

Calculates the acoustic impedance.

Returns

Z (float) – acoustic impedance.

get_property_dict(**kwargs)

Returns a dictionary with all parameters. objects or dicts and objects are converted to strings. if a type is given, only these properties are returned.

Parameters

**kwargs (list[str]) – types of requested properties.

Returns

R (dict) – dictionary with requested properties.

set_ho_spring_constants(HO)

Set the higher orders of the spring constant for anharmonic phonon simulations.

Parameters

HO (ndarray[float]) – higher order spring constants.

set_opt_pen_depth_from_ref_index(wavelength)

Set the optical penetration depth from the optical referactive index for a given wavelength.

Parameters

wavelength (Quantity) – wavelength as Pint Quantitiy.

visualize(**kwargs)

Allows for 3D presentation of unit cell by allow for a & b coordinate of atoms. Also add magnetization per atom.

Todo

use the avogadro project as plugin

Todo

create unit cell from CIF file e.g. by xrayutilities plugin.

Parameters

**kwargs (str) – strain or magnetization for manipulating unit cell visualization.

add_atom(atom, position)

Adds an AtomBase/AtomMixed at a relative position of the unit cell.

Sort the list of atoms by the position at zero strain.

Update the mass, density and spring constant of the unit cell automatically:

\[\kappa = m \cdot (v_s / c)^2\]
Parameters
  • atom (Atom, AtomMixed) – Atom or AtomMixed added to unit cell.

  • position (float) – relative position within unit cel [0 .. 1].

add_multiple_atoms(atom, position, Nb)

Adds multiple AtomBase/AtomMixed at a relative position of the unit cell.

Parameters
  • atom (Atom, AtomMixed) – Atom or AtomMixed added to unit cell.

  • position (float) – relative position within unit cel [0 .. 1].

  • Nb (int) – repetition of atoms.

get_atom_ids()

Provides a list of atom ids within the unit cell.

Returns

ids (list[str]) – list of atom ids within unit cell

get_atom_positions(*args)

Calculates the relative positions of the atoms in the unit cell

Returns

res (ndarray[float]) – relative postion of the atoms within the unit cell.