Simulation#

class nannos.Simulation(layers, excitation, nh=100, formulation='original')[source]#

Main simulation object.

Parameters
  • layers (list) – A list of Layer objects.

  • excitation (PlaneWave) – A plane wave excitation .

  • nh (int) – Number of Fourier harmonics (the default is 100).

  • formulation (str) – Formulation type. (the default is 'original'). Available formulations are 'original', 'tangent', 'jones' and 'pol'.

diffraction_efficiencies(orders=False, complex=False, return_dict=False)[source]#

Compute the diffraction efficiencies.

Parameters
  • orders (bool) – If True, returns diffracted orders, else returns the sum of reflection and transmission for all propagating orders (the default is False).

  • complex (bool) – If True, return complex valued quantities corresponding to ampitude related coefficients. (the default is False).

  • return_dict (bool) – If True, return quantities as nested dictionaries with keys corresponding to diffraction orders. This works only if orders=True (the default is False).

Returns

The reflection and transmission R and T.

Return type

tuple

get_S_matrix(indices=None)[source]#

Compute the scattering matrix.

Parameters

indices (list) – Indices [i_first,i_last] of the first and last layer (the default is None). By default get the S matrix of the full stack.

Returns

The scattering matrix [[S11, S12], [S21,S22]].

Return type

list

get_layer(id)[source]#

Helper to get layer index and name.

Parameters

id (int or str) – The index of the layer or its name.

Returns

  • layer (nannos.Layer) – The layer object.

  • index (nannos.Layer) – The layer index in the stack.

solve()[source]#

Solve the grating problem.

Examples#