legume.GuidedModeExp.set_run_options

GuidedModeExp.set_run_options(gmode_compute='exact', gmode_inds=[0], gmode_npts=1000, gmode_step=0.01, gmode_tol=1e-10, numeig=10, compute_im=True, gradients='exact', eig_solver='eigh', eig_sigma=0.0, eps_eff='average', verbose=True, kz_symmetry=None, symm_thr=1e-08, delta_gx=1e-15, delta_gabs=1e-15, use_sparse=False, only_gmodes=False)

Set multiple options for the guided-mode expansion.

Parameters:
  • gmode_compute ({'exact', 'interp'}, optional) – Define whether the guided modes are computed exactly at every k-step (‘exact’), or computed in the beginning and then interpolated (‘interp’).

  • gmode_inds (list or np.ndarray, optional) – Indexes of modes to be included in the expansion. Default is [0].

  • gmode_npts (int, optional) – Number of points over which guided modes are computed. Default is 1000.

  • gmode_step (float, optional) – Step in frequency in the search for guided mode solutions. Default is 1e-2.

  • gmode_tol (float, optional) – Tolerance in the minimum and maximum frequency value when looking for the guided-mode solutions. Default is 1e-10.

  • numeig (int, optional) – Number of eigen-frequencies to be stored (starting from lowest). Default is 10.

  • compute_im (bool, optional) – Should the imaginary parts of the frequencies also be computed. Default is True.

  • gradients ({'exact', 'approx'}, optional) – Whether to compute ‘exact’ gradients, or ‘approx’ (faster).

  • eig_solver ({'eigh', 'eigsh'}, optional) – Eigenvalue solver, ‘eigh’ (numpy.linalg.eigh) or ‘eigsh’ (scipy.sparse.linalg.eigsh)

  • eig_sigma (float, optional) – Target eigenvalue; numeig eigenvalues closest to eig_sigma are stored. Default is 0.

  • eps_eff ({'average', 'background', 'custom'}, optional) – Using the ‘average’, ‘background’ or a ‘custom’ permittivity of the layers in the guided mode computation. If ‘custom’, all the photonic crystal layers, including the claddings, must have a pre-set eps_eff.

  • verbose (bool, optional) – Print information at intermediate steps. Default is True.

  • kz_symmetry (string, optional) – Symmetry seleced with respect to the vertical kz plane of incidence, it can be ‘both’, ‘odd’, ‘even’ or None. With None there is no symmetry sepeartion, and GuidedModeExp.kz_symms is an empty list. If ‘both’, both even and odd modes are saved in attr:GuidedModeExp.freqs and their parity wrt the veritcal plane are saved in GuidedModeExp.kz_symms. With ‘even’ (‘odd’) only ‘even’ (‘odd’) modes are calculated and stored. Default is None.

  • symm_thr (float, optional) – Threshold for out-of-diagonal terms in odd/even separated Hamiltonian. Default is 1e-8.

  • delta_gx (float, optional,) – little component added to the x-component of vectors g = k + G to avoid problems at g = 0. Default is 1e-15.

  • delta_gabs (float, optional,) – small shift of the absolute value of g = k + G , kept for backwards compatibility. Default is 1e-15.

  • use_sparse (boolean, optional) – If True, use sparse matrices for separating even and odd modes w.r.t. the vertical plane of symmetry. Default is False.

  • only_gmodes (boolean, optional) – Should only the guided modes computed withouth the coupling of the PhC periodic patterning. Default is False.