Multilayers

This module provides methods for creating multilayer_obj and layer_obj instances. These classes are used for describing layered thin film samples with several or multiple layers.

The instances of multilayer_obj are used for the calculation of High Resolution X-ray Diffraction, Neutron and X-ray Specular Reflectivity, and Polarized Neutron Reflectivity.

escape.scattering.layer.layer(name: str, material: MaterialLike, thkn: ParameterLike = 10, rough: ParameterLike = 1, bydensity: bool = False, mdb: mdb_obj = <escape.scattering.mdb.mdb_obj object>, **param_kwargs) layer_obj

Returns a layer object.

Parameters:
name: string

Layer name

material: material_obj or string

Material object or material name from the material database

thkn: parameter_obj or value

Layer thickness

rough: roughness_obj or value

RMS roughness

bydensity: bool

If True, the material is specified by density, otherwise by SLD.

mdb: mdb_obj

The material database mdb object.

**param_kwargs: dict

Additional arguments for the parameters. Each key should have a prefix with the parameter name. For example ‘thkn_userlim’ for thickness user boundaries, ‘density_fixed’ for density fixed flag, etc.

Returns:

object of type ‘layer_obj’

escape.scattering.layer.magnetic_layer(name: str, material: MaterialLike, b_phi: ParameterLike, b_theta: ParameterLike, thkn: ParameterLike, rough: ParameterLike, bydensity: bool = False, mdb: mdb_obj = <escape.scattering.mdb.mdb_obj object>, **param_kwargs) layer_obj

Returns magnetic layer object. The magnetization angles \(\phi\) and \(\theta\) define the magnetization components in the sample coordinate system as following

\[ \begin{align}\begin{aligned}M_x = cos(\phi) sin(\theta)\\ M_y = sin(\phi)\\ M_z = cos(\phi) cos(\theta)\end{aligned}\end{align} \]

The sample coordinate system is right-handed with X-axis directed towards the detector and Z-axis being normal to the sample plane. The magnetization angles \(\phi\) and \(\theta\) are chosen for the samples installed vertically, i.e. when the external magnetic field is directed along the sample Y-axis.

Parameters:
name: string

Layer name

material: material_obj

Material instance.

b_phi: parameter_obj or value

\(\phi\) angle in degrees between layer magnetization and XZ plane

b_theta: parameter_obj or value

\(\theta\) angle in degrees between projection of layer magnetization on XZ plane and Z-axis

thkn: parameter_obj or value

Layer thickness

rough: roughness_obj or value

RMS roughness

bydensity: bool

If True, the material is specified by density, otherwise by SLD.

mdb: mdb_obj

The material database mdb object.

**param_kwargs: dict

Additional arguments for the parameters. Each key should have a prefix with the parameter name. For example ‘thkn_userlim’ for thickness user boundaries, ‘density_fixed’ for density fixed flag, etc.

Returns:

object of type ‘layer_obj’

escape.scattering.layer.substrate(name: str, material: MaterialLike, rough: ParameterLike, bydensity: bool = False, mdb: mdb_obj = <escape.scattering.mdb.mdb_obj object>, **param_kwargs) layer_obj

Returns a substrate instance.

Parameters:
name: string

Layer name

material: material_obj

Material description

rough: roughness_obj or value

RMS roughness

bydensity: bool

If True, the material is specified by density, otherwise by SLD.

mdb: mdb_obj

The material database mdb object.

**param_kwargs: dict

Additional arguments for the parameters. Each key should have a prefix with the parameter name. For example ‘thkn_userlim’ for thickness user boundaries, ‘density_fixed’ for density fixed flag, etc.

Returns:

object of type layer_obj

escape.scattering.layer.magnetic_substrate(name: str, material: MaterialLike, b_phi: ParameterLike, b_theta: ParameterLike, rough: ParameterLike, bydensity: bool = False, mdb: mdb_obj = <escape.scattering.mdb.mdb_obj object>, **param_kwargs) layer_obj

Returns a magnetic substrate object. The magnetization angles \(\phi\) and \(\theta\) define the magnetization components in the sample coordinate system as following

\[ \begin{align}\begin{aligned}M_x = cos(\phi) sin(\theta)\\ M_y = sin(\phi)\\ M_z = cos(\phi) cos(\theta)\end{aligned}\end{align} \]

The sample coordinate system is right-handed with X-axis directed towards the detector and Z-axis being normal to the sample plane. The magnetization angles \(\phi\) and \(\theta\) are chosen for the samples installed vertically, i.e. when the external magnetic field is directed along the sample Y-axis.

Parameters:
name: string

Layer name

material: material_obj

Material description

b_phi: parameter_obj or value

\(\phi\) angle in degrees between layer magnetization and XZ plane

b_theta: parameter_obj or value

\(\theta\) angle in degrees between projection of layer magnetization on XZ plane and Z-axis

rough: roughness_obj or value

RMS roughness

bydensity: bool

If True, the material is specified by density, otherwise by SLD.

mdb: mdb_obj

The material database mdb object.

**param_kwargs: dict

Additional arguments for the parameters. Each key should have a prefix with the parameter name. For example ‘thkn_userlim’ for thickness user boundaries, ‘density_fixed’ for density fixed flag, etc.

Returns:

object of type layer_obj

escape.scattering.layer.env(name: str, material: MaterialLike, bydensity: bool = False, mdb: mdb_obj = <escape.scattering.mdb.mdb_obj object>, **param_kwargs) layer_obj

Returns a foreground, i.e. environment.

Parameters:
name: string

Layer name

material: material_obj

Material description

bydensity: bool

If True, the material is specified by density, otherwise by SLD.

mdb: mdb_obj

The material database mdb object.

**param_kwargs: dict

Additional arguments for the parameters. Each key should have a prefix with the parameter name. For example ‘thkn_userlim’ for thickness user boundaries, ‘density_fixed’ for density fixed flag, etc.

Returns:

object of type ‘layer_obj’

escape.scattering.layer.air(name: str = 'Air') layer_obj

Returns an air foreground.

Returns:

object of type ‘layer_obj’

escape.scattering.layer.layer_stack(name: str, formula: str = '', repeat: IntSettingLike = 1, bydensity: bool = False, mdb: mdb_obj = <escape.scattering.mdb.mdb_obj object>, globals: dict = {}, **param_kwargs) layerstack_obj

Creates layerstack instance.

Parameters:
name: string

Layerstack name

formula: string

Layerstack formula

repeat: integer

repetition of layers in the stack

bydensity: bool

If True, the material is specified by density, otherwise by SLD.

mdb: mdb_obj

The material database mdb object.

Returns:

object of type ‘layerstack_obj’

escape.scattering.layer.multilayer(name: str, formula: str = '', frgr: Optional[layer_obj] = None, bkgr: Optional[layer_obj] = None, bydensity: bool = False, mdb: mdb_obj = <escape.scattering.mdb.mdb_obj object>, globals: dict = {}, **param_kwargs) multilayer_obj

Creates multilayer instance.

Parameters:
name: string

Multilayer name

formula: string

Multilayer formula

frgr: layer_obj

foreground, i.e. environment

bkgr: layer_obj

background, i.e. substrate

bydensity: bool

If True, the material is specified by density, otherwise by SLD.

mdb: mdb_obj

The material database mdb object.

Returns:

instance of ‘multilayer_obj’

escape.scattering.layer.roughness(name: str, rough: ParameterLike, lateral: Optional[ParameterLike] = None, hurst: Optional[ParameterLike] = None, **param_kwargs) roughness_obj

Returns instance of ‘roughness_obj’.

Parameters:
rough: parameter_obj or value

root-mean-square roughness

lateral: parameter_obj or value

lateral correlation length of roughness

hurst: parameter_obj or value

Hurst parameter

Returns:

object of type ‘roughness_obj’

class escape.scattering.layer.roughness_obj

roughness_obj is a container for surface roughness parameters.

constrain(val: bool_parameter_obj)

Add constraint to functor.

constraints
Returns:

List of constraints

static convert(obj: object, name: str, **param_kwargs) roughness_obj

Converts the input object to a roughness object.

Parameters:
obj: roughness_obj or value

Roughness object or value

name: string

Roughness name

Returns:

roughness_obj: Roughness object instance.

hurst
Returns:

Hurst parameter value.

is_feasible
Returns:

True if functor is feasible, False otherwise.

lateral
Returns:

Correlation length of lateral roughness.

name
Returns:

Object name.

parameters
Returns:

List of parameters

rms
Returns:

Root-mean-square roughness parameter value.

unconstrain(val: bool_parameter_obj)

Remove constraint from functor.

unconstrain_all()

Remove all constraints from functor.

class escape.scattering.layer.layer_obj

‘layer_obj’ is a wrapper class for layers. It contains relevant parameters and material description for layer.

constrain(val: bool_parameter_obj)

Add constraint to functor.

constraints
Returns:

List of constraints

static convert(inp: object, name: str, bydensity: bool, mdb: mdb_obj, **param_kwargs) layer_obj

Converts the input object or string to a layer object using the given material database mdb object.

Parameters:

inp (object, layer_obj or string): The input object or string with material name to be converted. name (str): The name of the layer object to be created. bydensity (bool): If True, the material is specified by density, otherwise by SLD. mdb (mdb_obj): The material database mdb object. param_kwargs (dict): Additional arguments for the parameters.

Each key should have a prefix with the parameter name. For example ‘thkn_userlim’ for thickness user boundaries, ‘density_fixed’ for density fixed flag, etc.

Returns:

layer_obj: Layer object instance.

is_feasible
Returns:

True if functor is feasible, False otherwise.

material

Returns material instance.

Returns:

material_obj instance

name

Returns object name.

Returns:

string value

parameters
Returns:

List of parameters

roughness

Returns roughness instance. :return:

roughness_obj instance

thickness

Returns thickness value.

Returns:

double value

thkn

Returns thickness value.

Returns:

double value

unconstrain(val: bool_parameter_obj)

Remove constraint from functor.

unconstrain_all()

Remove all constraints from functor.

class escape.scattering.layer.layerstack_obj

layerstack_obj is a wrapper class for layer stacks.

add(lay: layer_obj)

Appends layer to stack.

Parameters:
lay: layer_obj

layer object

constrain(val: bool_parameter_obj)

Add constraint to functor.

constraints
Returns:

List of constraints

static convert(inp: object, name: str, bydensity: bool, mdb: mdb_obj, globals: dict, **param_kwargs) layerstack_obj

Converts the input object or string to a layerstack object using the given material database mdb object.

Parameters:

inp (object, layerstack_obj or string): The input object or string with layerstack to be converted. name (str): The name of the layerstack object to be created. bydensity (bool): If True, the material is specified by density, otherwise by SLD. mdb (mdb_obj): The material database mdb object. globals (dict): Global variables dictionary. param_kwargs (dict): Additional arguments for the parameters.

Each key should have a prefix with the parameter name. For example ‘thkn_userlim’ for thickness user boundaries, ‘density_fixed’ for density fixed flag, etc.

Returns:

layerstack_obj: Layerstack object instance.

erase(idx: size_t)

Erases layer with index ‘idx’ from stack.

erase_all()

Erases all layers from stack.

insert(idx: size_t, lay: layer_obj)

Inserts layer to stack.

Parameters:
idx: size_t

layer index to replace

lay: layer_obj

new layer object

is_feasible
Returns:

True if functor is feasible, False otherwise.

min_thickness
Returns:

Minimal thickness of stack.

name

Returns object name.

Returns:

string value

parameters
Returns:

List of parameters

set(idx: size_t, lay: layer_obj)

Replaces layer in stack.

Parameters:
idx: size_t

layer index to replace

lay: layer_obj

new layer object

total_thickness

Returns total thickness of stack.

Returns:

double value

unconstrain(val: bool_parameter_obj)

Remove constraint from functor.

unconstrain_all()

Remove all constraints from functor.

class escape.scattering.layer.multilayer_obj

This class is used to describe layered samples. Layered samples can consist of layers or layer stacks. The topmost and bottommost layers are called the foreground (environment) and background (substrate), respectively, and are considered to have infinite thickness. Normally, the foreground layer has a zero scattering length density. If not, the wave-vector components of the incident wave will be corrected according to Snell’s law.

add(obj: object)

Appends layer or layerstack

Parameters:
obj: layer_obj or layerstack_obj

layer or layerstack object

constrain(val: bool_parameter_obj)

Add constraint to functor.

constraints
Returns:

List of constraints

static convert(inp: object, name: str, bydensity: bool, mdb: mdb_obj, globals: dict, **param_kwargs) multilayer_obj

Converts the input object or string to a multilayer object using the given material database mdb object. If layer has been created earlier, it can be used in the formula. In this case globals dictionary is required to be passed to the function.

Parameters:

inp (object, multilayer_obj or string): The input object or string with multilayer forumula. name (str): The name of the multilayer object to be created. bydensity (bool): If True, the material is specified by density, otherwise by SLD. mdb (mdb_obj): The material database mdb object. globals (dict): Global variables dictionary. param_kwargs (dict): Additional arguments for the parameters.

Each key should have a prefix with the parameter name. For example ‘thkn_userlim’ for thickness user boundaries, ‘density_fixed’ for density fixed flag, etc.

Returns:

multilayer_obj: Multilayer object instance.

erase(idx: size_t)

Erases layer or layerstack

Parameters:
idx: size_t

layer index to replace

erase_all()

Erases all layers

Parameters:
idx: size_t

layer index to replace

insert(idx: size_t, obj: object)

Inserts layer or layerstack

Parameters:
idx: size_t

layer index to replace

obj: layer_obj or layerstack_obj

layer or layerstack object

is_feasible
Returns:

True if functor is feasible, False otherwise.

min_thickness

Return minimal thickness of multilayer

Returns:

double value

move_down(idx: size_t)

Moves layer or layerstack down

Parameters:
idx: size_t

layer index to replace

move_up(idx: size_t)

Moves layer or layerstack up

Parameters:
idx: size_t

layer index to replace

name

Returns object name.

Returns:

string value

parameters
Returns:

List of parameters

set(idx: size_t, obj: object)

Replaces layer or layerstack

Parameters:
idx: size_t

layer index to replace

obj: layer_obj or layerstack_obj

layer or layerstack object

show(profile: str = '', source: Optional[source_obj] = None, config: Optional[Any] = None, **kwargs) ProfileLayout

Show profile of the layer.

Parameters:
profile: str

Profile type

source: source_obj

Source object

config: ProfileConfig

total_thickness

Return total thickness of multilayer

Returns:

double value

unconstrain(val: bool_parameter_obj)

Remove constraint from functor.

unconstrain_all()

Remove all constraints from functor.