+++
title = "Multilayer"
weight = 35
+++

## Top level sample model

A sample is always represented by an instance of class `Sample`.

##### Create an instance and add layers

The sample is created by the constructor call
```python
sample = ba.Sample()
```

Layers can be added individually with
```python
sample.addLayer(layer)
```
or within periodic layer stacks:
```python
sample.addStack(stack)
```

For the arguments, see sections [Layer](layer) and [LayerStack](stack).

The layer added first is the top layer (typically vacuum).
The layer added last is the bottom layer (typically substrate).

Layers are either _finite_ (with a specified thickness) or _semi-infinite_
(extending to infinity in one direction). There are no _infinite_ layers
(extending to infinity in both directions). As a consequence, a sample must
contain at least two layers: a semi-infinite top layer and a semi-infinite
bottom layer.

The top and bottom layers must be of simple [Layer](layer) type,
and have infinite thickness.

All other layers have finite thickness, and may also be of type [LayerStack](stack).
