API Reference¶
Geometry Module¶
- morpho.geometry.Geometry(*args, **kwargs)[source]¶
Geometry factory.
- Parameters
args – args
kwargs – kwargs
- Returns
- Return type
Union[Geometry1D, Geometry2D, Geometry3D]
- class morpho.geometry.Geometry1D(a1, n1=64, eps_rf=None, mu_rf=None)[source]¶
Bases:
morpho.geometry.GeometryBaseGeometry class.
- Parameters
a1 (Tuple[float, ...]) – Direct a1 vector.
n1 (int) – Number of divisions in the a1 vector direction.
eps_rf (Optional[Callable]) – Permittivity matrix eps_r if directly supplied.
mu_rf (Optional[Callable]) – Permeabillity matrix mu_r if directly supplied.
- property X¶
Return cartesian positions.
- class morpho.geometry.Geometry2D(a1, a2, n1=64, n2=64, eps_rf=None, mu_rf=None)[source]¶
Bases:
morpho.geometry.GeometryBaseGeometry class.
- Parameters
a1 (Tuple[float, ...]) – Direct a1 vector.
a2 (Optional[Tuple[float, ...]]) – Direct a2 vector.
n1 (int) – Number of divisions in the a1 vector direction.
n2 (int) – Number of divisions in the a2 vector direction.
eps_rf (Optional[Callable]) – Permittivity matrix eps_r if directly supplied.
mu_rf (Optional[Callable]) – Permeabillity matrix mu_r if directly supplied.
- property X¶
Return cartesian positions.
- property eps_r¶
Return the relative permittivity matrice.
- property mu_r¶
Return the relative permeabillity matrice.
- class morpho.geometry.Geometry3D(a1, a2, a3, n1=64, n2=64, n3=64, eps_rf=None, mu_rf=None)[source]¶
Bases:
morpho.geometry.GeometryBaseGeometry class.
- Parameters
a1 (Tuple[float, float, float]) – Direct a1 vector.
a2 (Optional[Tuple[float, float, float]]) – Direct a2 vector.
a3 (Optional[Tuple[float, float, float]]) – Direct a3 vector.
n1 (int) – Number of divisions in the a1 vector direction.
n2 (int) – Number of divisions in the a2 vector direction.
n3 (int) – Number of divisions in the a3 vector direction.
eps_rf (Optional[Callable]) – Permittivity matrix function eps_rf if directly supplied.
mu_rf (Optional[Callable]) – Permeabillity matrix function mu_rf if directly supplied.
- property X¶
Return cartesian positions.
- property eps_r¶
Return the relative permittivity matrice.
- property mu_r¶
Return the relative permeabillity matrice.
BrillouinZone Module¶
- class morpho.brillouinzone.SymmetryPoint(point, name)[source]¶
Bases:
objectModel of a symmetry point at the brillouinzone.
- Parameters
point (Tuple[float, ...]) – A point in the reciprocal domain.
name (str) – A label to describe the point.
- class morpho.brillouinzone.BrillouinZonePath1D(a1, path, n_points=50, strategy='linear')[source]¶
Bases:
morpho.brillouinzone.BrillouinZonePathBaseBrillouinZonePath1D.
- Parameters
a1 (Tuple[float]) – Direct lattice vector a1.
path (List[SymmetryPoint]) – List of symmetry points.
n_points (int) – Number of vectors.
strategy (str = 'linear') – Strategy to interpolate.
- property b1¶
Return reciprocal lattice vector b1.
- property betas¶
Return beta vector values and cumsum.
- class morpho.brillouinzone.BrillouinZonePath2D(a1, a2, path, n_points=50, strategy='linear')[source]¶
Bases:
morpho.brillouinzone.BrillouinZonePathBaseBrillouinZonePath2D.
- Parameters
a1 (Tuple[float, float]) – Direct lattice vector a1.
a2 (Tuple[float, float]) – Direct lattice vector a2.
path (List[SymmetryPoint]) – List of symmetry points.
n_points (int) – Number of vectors.
strategy (str = 'linear') – Strategy to interpolate.
- property b1¶
Return reciprocal lattice vector b1.
- property b2¶
Return reciprocal lattice vector b2.
- property betas¶
Return beta vector values and cumsum.
- class morpho.brillouinzone.BrillouinZonePath3D(a1, a2, a3, path, n_points=50, strategy='interpolate')[source]¶
Bases:
morpho.brillouinzone.BrillouinZonePathBaseBrillouinZonePath3D.
- Parameters
a1 (Tuple[float, float, float]) – Direct lattice vector a1.
a2 (Tuple[float, float, float]) – Direct lattice vector a2.
a3 (Tuple[float, float, float]) – Direct lattice vector a3.
path (List[SymmetryPoint]) – List of symmetry points.
n_points (int) – Number of vectors.
strategy (str = 'linear') – Strategy to interpolate.
- property b1¶
Return reciprocal lattice vector b1.
- property b2¶
Return reciprocal lattice vector b2.
- property b3¶
Return reciprocal lattice vector b3.
- property betas¶
Return beta vector values and cumsum.
Solver Module¶
- class morpho.solver.Solver2D(geometry, path, P=1, Q=1, pol='TM')[source]¶
Bases:
objectImplement a 2D PWE Solver.
- Parameters
geometry (Geometry) – geometry
path (BrillouinZonePath) – A BrillouinZonePath object.
P (int) – Number of terms in the direction of the reciprocal vector b1.
Q (int) – Number of terms in the direction of the reciprocal vector b2.
- class morpho.solver.Solver3D(geometry, path, P=1, Q=1, R=1)[source]¶
Bases:
objectImplement a 3D PWE Solver.
- Parameters
geometry (Geometry) – geometry
path (BrillouinZonePath) – A BrillouinZonePath object.
P (int) – Number of terms in the direction of the reciprocal vector b1.
Q (int) – Number of terms in the direction of the reciprocal vector b2.
R (int) – Number of terms in the direction of the reciprocal vector b3.
Utils Module¶
- morpho.utils.convmat(A, P=1, Q=1, R=1)[source]¶
Return a permittivity/permeability convolution matrix.
- Parameters
A (np.ndarray) – A 3D/2D/1D permittivity or permeability matrix.
P (int) – Number of terms in the direction of the reciprocal vector T1.
Q (int) – Number of terms in the direction of the reciprocal vector T2.
R (int) – Number of terms in the direction of the reciprocal vector T3.
Base Classes¶
- class morpho.brillouinzone.BrillouinZonePathBase(path, n_points=50, strategy='linear')[source]¶
Bases:
abc.ABCBrillouinZoneBase class.
- abstract property betas¶
Return bloch wave vectors.
- property point_locations¶
Return cumulative sum of vectors’ length.
- property point_names¶
Return list of symmetry point names.
Exceptions Module¶
Implement morpho exceptions.