Only the bound states in the quantum wells are included in the Fermi level and gain calculation. For physically meaningful results all other states should be filtered out. This filtering is controlled by setting the boundary conditions.

Modifying the boundary conditions is an advanced feature. The boundary conditions used in the Application Gallery examples should be suitable for most simulations. For laser simulation see the Multi-quantum well (MQW) edge emitting laser example, and for electro-absorption modulator simulations see the GaAs-AlGaAs electro absorption modulator example.

## Types of Boundary Conditions

The MQW solver has two types of boundary conditions: hard wall and perfectly matched layer (PML) boundaries. The hard wall boundary forces the wave function to drop to zero at the boundaries, while the PML boundaries place absorbing layers at either side of the stack to minimize back reflections.

For hard wall boundaries, the selection of confined states is governed by a threshold on the magnitude of the derivative of the wave function at the boundaries. For PML boundaries, a threshold on the fraction of the total probability density inside the PML is used to reject unconfined states. The cut-off should be much less than 1, typically 10^{-2} − 10^{-5} for both types of boundary conditions. If the exciton model is enabled, a higher value can be used and other filtering will be used to determine the correct subbands to use.

For both types of boundary conditions it is best to extend the simulation region by a thick enough buffer layer on both sides to ensure that the wave function decays sufficiently towards the boundaries (10 nm or more depending on the barrier height) regardless of the thickness of the inner barriers.

## When to Modify the Boundary Conditions

In general, the boundary conditions used in the MQW solver Application Gallery examples should be suitable for most simulations. However, sometimes it may be necessary to adjust these parameters from these default values to ensure that only confined states or enough confined states are selected. Whether a state is confined can be confirmed visually by inspecting the probability density near the boundaries. If it is confined it should go to zero near the boundaries.

## Setting the Boundary Conditions

The boundary condition properties can be found in the **Advanced** tab of the **Edit MQW Gain Solver** window.

### Hard Wall Boundaries

To set up hard wall boundaries:

- Set
**boundary condition**to**hard wall**. - Set the
**cutoff**value for the conduction band (under**cb**) and the valence band (under**vb**). For hard wall boundaries, the eigenstates are rejected based on the derivative of the wavefunction at the boundary. The derivative is given in units of A^{-3/2}, where A is angstroms.

### PML Boundaries

To set up PML boundaries:

- Set
**boundary condition**to**pml**. - Set the
**cutoff**value for the conduction band (under**cb**) and the valence band (under**vb**). For PML boundaries the eigenstates are rejected based on the ratio between the probability density inside the PMLs and the probability density inside the MQW stack. - Set the
**pml length**for the**left**(first layer) and**right**(last layer) sides of the MQW stack. - Fill out the
**pml coeff table**. The two table cells in the top row are for the left and right PMLs for the conduction band. The table cells in the bottom row are for the valence band.

Next: Running the MQW Solver

Previous: Setting the Simulation Parameters of the MQW Solver