Materials in rcwa — Rigorous Coupled Wave Analysis 1.0 documentation

# Materials in rcwa

class rcwa.Material(name=None, er=1, ur=1, n=None, database_path=None, filename=None, source=None)

  Material class for defining materials permittivity / permeability / refractive index as a function of wavelength / angle.

  Parameters

    - name – Material name to be looked up in database (i.e. Si)

    - er – Complex-valued numerical permittivity value or function of wavelength

    - ur – Complex-valued numerical permeability value or function of wavelength

    - n – Complex-valued refractive index of material. Overrides er / ur

    - source – Excitation source to link to material (mandatory for dispersive materials)

    - filename – File containing n/k data for the material in question

    - database_path – Raw file path within database

The Material class handles materials whose material properties (permittivity, permeability, or refractive index) change as a function of wavelength. There are three primary ways to describe materials:

1. Constant numerical value

> This is the simplest model for a material - a constant permittivity / permeability or refractive index, passed in with the er, ur and n arguments.

2. Custom function of wavelength

> In addition to being constants, er, ur, and n may be user-specified single-argument functions, which take wavelength as an argument. Units of wavelength in this case do not matter and returns a (potentially complex) scalar.

3. Tabulated data

> If a value is passed to the `filename` argument, then the `Material` will load in that file. Csv formats are supported by default, with the first axis being wavelength and the second axis being the complex-valued refractive index. You may instead choose to separate the real- and imaginary parts into two separate columns. This works as well. An example tabulated data file is shown below.

4. Using a materials database - tabulated or dispersion formula

> The refractiveindex.info database is supported by default, and contains many user-specified materials (i.e. `Si`, `SiO2`, `Ti`, `Pt`. This database provides both tabulated data and dispersion formulas (see dispersion formulas), depending on the material used. CAUTION: if using this database, wavelength units must be specified in micrometers.

## Interpolation and Extrapolation

If using tabulated data, you may use any wavelength between the minimum and maximum values in the table, and the permittivity will be linearly interpolated if the desired wavelength falls between two tabulated points. If the desired wavelength falls outside the minimum or maximum, `rcwa` will attempt to extrapolate using the slope near the boundary and give a warning.

## Imaginary Sign Convention

Lossy materials are represented with a positive imaginary refractive index (i.e. `2 + 0.1j`. Materials with gain are represented by a negative imaginary refractive index (i.e. `2 - 0.1j`).

## Example Tabulated Data Files

Below is what an example file for tabulated n/k data should look like, let’s call it `custom_material.csv`:

    wavelength, n, k
    0.76, 2, 0.1
    0.77, 2.1, 0.2
    0.78, 2.1, 0.4

And a valid alternative `custom_material2.csv`:

    wavelength, n
    0.76, 2 + 0.1j
    0.77, 2.1 + 0.2j
    0.78, 2.1 + 0.4j

Note: the files must have a header.

## Material Examples

    from rcwa import Material

    # Use a constant index or permittivity
    my_material = Material(n=5 + 0.1j)
    my_material_2 = Material(er=4, ur=1.1)

    # Use a custom function
    def n_func(wavelength):
        return 1 + wavelength / 1.5

    my_dispersive_material = Material(n=n_func)

    # Use built-in databases
    Si = Material('Si')
    SiO2 = Material('SiO2')

    # Use a custom file
    custom_material = Material(filename='custom_filename.csv')