Tips for using the (n,k) material model in FDTD
This page describes how to define a material based on a single complex refractive index value (e.g., n + ik = 2 + 0.05i) for single frequency simulation. This example shows images from FDTD but the same information is applicable to (n,k) material models in CHARGE, HEAT, DGTD and FEEM.
For broadband simulations, n,k material is cannot be used as discussed below.
Note: For materials with \( n \in \mathbf{R} \), the situation is simplified as you can simply use a 'Dielectric' material model to avoid the following complications. 
Narrowband simulations
In some cases, it may be convenient to define the refractive index of a material based on a single n,k value (e.g. n + ik = 2 + 0.05i). If you are using a single frequency source (i.e. the source 'Start' and 'Stop' wavelengths are equal), the best solution is likely to add an (n,k) Material to the database, as shown in the above screenshot. The n,k material allows you to enter the desired n,k values.
It is important to remember that the (n,k) Material model should ONLY be used for single frequency sources. The implementation of the (n,k) Material model is such that it only gives the desired refractive index values at the center frequency of the source. Obviously, if the source is single frequency, this is not a problem. However, for a broadband source, the resulting refractive index near the start and stop wavelengths can differ substantially from the desired values. The following figures show the desired (Blue) and actual (Green) refractive index values that will occur for source bandwidth set to 500nm and 400700nm. The two lines will always agree at the center frequency, but not necessary at other frequencies.
Example
Source wavelength limits: 500500nm (n,k) Material values: 2, 0.05 

Source wavelength limits: 400700nm (n,k) Material values: 2, 0.05
Notice the substantial variation, especially in the imaginary part, near 400 and 700nm. 
Broadband simulations
In some cases, you may hope to define the broadband refractive index of a material as a constant value of n,k (e.g n + ik = 2 + 0.05i). Unfortunately, this is a challenging problem. The root of the problem comes from the fact that FDTD is a time domain technique, while the refractive index is known in the frequency domain. We are restricted to describing the refractive index with a particular class of functions that are compatible with a time domain solver. Unfortunately, a constant n,k as a function of frequency is not something that can be described perfectly with this restriction. While we can often still get very good fits, they will never be perfect.
Option 1  Sampled data
The best option for adding such a material to the database is with the Sampled data material, where you import a list of n,k data as a function of wavelength, as described on the Creating sampled data materials page. The resulting material is shown in the above screenshot. The imported data would look something like this, with a constant value of n,k
wavelength n k
390 2 0.05
400 2 0.05
410 2 0.05
420 2 0.05
430 2 0.05
440 2 0.05
...
The next step is to adjust the fit with the Material Explorer, as shown below. By adjusting the fitting parameters, it is often possible to get a good (but not perfect) fit to the material data. In the screenshot below, we can see that the desired n,k value is 2 + 0.05i. The actual fit varies from n = 1.992  2.007 and k = 0.0497  0.0506. While not perfect, the fit is quite good, especially when you consider that the experimental errors in refractive index measurements are often quite large.
Option 2  (n,k) Material (Not recommended)
This option is not recommended. It is only included here to describe the short comings of this method.
A common error is to use the (n,k) Material model when trying to create these types of materials. Unfortunately, this model is only designed for narrowband simulations. This model will give the desired n,k values at the center frequency of the source, but not at other wavelengths. These differences can be seen with the Material Explorer, and will lead to errors in your simulation. Rather than using the (n,k) Material model, it is better to use the Sampled data model described above, which allows you to adjust the fitting parameters to get a better fit.