# Layer Morphology¶

Compositions are used to include multiple materials in a single layer. This allows for the generation of host-guest systems or molecular mixtures. Composites can also be used to model the microscopic roughness of layer interfaces.

Bumblebee provides both Basic and Advanced compositions.

## Basic Composition¶

In the previous tutorials, Basic compositions were generated. These compositions assume that the materials are randomly distributed within a layer. These distributions are generated at the start of the simulation. When multiple disorder instances are used, each instance will have its own unique distribution.

The resulting layers have a homogeneous material distribution. The Advanced composition allows for the definition of gradients to specify more complex layer morphologies.

## Layer Gradients¶

When creating a new composition, select the Advanced composition type.

In the advanced composition editor, we start by adding materials to the layer. For this example, we will create a CBP-Ir(ppy)3 host-guest system using the materials from a previous tutorial.

The first fraction that is added to the layer will be labeled as the background. The background material is used to close the material balance at each gridpoint, assuring that the fractions sum to 1. If no morphology is specified, the background material will make up the entire layer.

Morphology generators are provided to add gradients to the layer composition.

### Linear¶

We will use CBP as the background material. You can select the pencil icon to adjust the background material if necessary.

Selecting the linear gradient generator, we can add the Ir(ppy)3 dye to the layer. The material fraction is specified at the layer edges. A linear interpolation is used to determine the fractions at the interior gridpoints.

For this example, we use fractions of 0.4 and 0.8. Selecting Add Morphology will save the gradient as part of the current composition. Multiple gradients can also be combined to create more complex morphologies.

### Trapezoid¶

To compare the different generators, we will now create a new composition.

The trapezoid generator can be used to combine multiple linear interpolations. In order to create a trapezoidal gradient, the material fraction can be specified at various locations inside the layer. Linear interpolation is used to determine the fractions at the remaining gridpoints.

We specify the locations as a fraction of the layer width. This allows the morphology to be used with different stacks. At each location, we specify the fraction of Ir(ppy)3. The background material (CBP) is used to close the balance.

Clicking the check mark allows additional points to be added to the trapezoidal gradient. We will use a simple 3-point trapezoid for this example.

If the list of locations does not include the edges of the layer (\(x=0,\,x=1\)), all fractions outside the trapezoid range will be set to 0.

### Custom¶

We will create a new composition to illustrate the use of custom gradients.

The custom gradient option allows user-defined mathematical functions to be used for determining the material fraction.

We start by defining the start and end points of the generator. Locations outside of this range will have a fraction of 0. For locations inside the range, a function is specified to convert the position \(x\) into a fraction.

The supported mathematical operations are:

Basic arithmetic operations: +, -, *, \

Exponentiation and modulation: **, %

Absolute values: \(\textrm{abs}()\)

Basic mathematical functions: \(\textrm{sqrt}(),\,\exp(),\,\log(),\,\textrm{log10}()\)

Basic trigonometric functions: \(\sin(),\,\cos(),\,\tan()\)

Hyperbolic functions: \(\sinh(),\,\cosh(),\,\tanh()\)

Inverse trigonometric functions: \(\textrm{asin}(),\,\textrm{acos}(),\,\textrm{atan}()\)

Inverse hyperbolic functions: \(\textrm{arcsinh}(),\,\textrm{arccosh}(),\,\textrm{arctanh}()\)

Warning

If the custom function returns a fraction that is less than 0 or larger than 1, the morphology generator will return an error and your simulation will not succeed.

For this example, we will use an exponential function \(x^x\) in the range of [0.2, 0.8].

### Multiple Gradients¶

We will create a new composition to illustrate the use of multiple gradients.

The various generators can be combined in order to create more complex morphologies. When doing this, you have to be careful that the sum of the fractions does not exceed 1.

For this example, we will consider a host-guest system containing 2 dyes: Ir(ppy)3 and Ir(dmp)3.

CBP is used as the host material and is therefore set as the background material. We will use a linear generator to create a static Ir(dmp)3 fraction of 0.1. The trapezoid is used to add an Ir(ppy)3 gradient to the edges. The custom generator is used to add Ir(ppy)3 to the center of the layer.

## Visualizing Gradients¶

At the end of these steps, you should now have 4 advanced compositions.

You can use these compositions to set up new simulations. The generated morphologies will then be shown in the Morphology section of the Box Report.

## Layer Contacts¶

In order to model the microscopic roughness of layer interfaces, a composite layer can be added to the stack in order to describe the nanoscale spatial mixing of the layer components.

Using the materials defined in an earlier tutorial, we create a basic composition of 0.5 TAPC and 0.5 CBP.

We create a new stack containing 3 layers:

A 20 nm TAPC layer

A 1 nm layer containing the TAPC/CBP mixture

A 20 nm layer containing a CBP/Ir(ppy)3 host-guest system with 10% Ir(ppy)3

The resulting morphology localizes the disorder in the interfacial layer.