-
Notifications
You must be signed in to change notification settings - Fork 69
Add effective DOS classes for the Charge solver #2375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6f399fd
Add effective DOS classes for the Charge solver
vasilyzabelin c267f47
Add effective DOS classes for the Charge solver
vasilyzabelin ab2abdd
Add effective DOS classes for the Charge solver
vasilyzabelin acdae49
Update of the effective DOS model according to the comments.
vasilyzabelin 529b2b8
Minor code change
vasilyzabelin 3c5faa3
Removed possibility to define the density of states by a float number
vasilyzabelin b81f6c6
Update tests for the Charge solver
vasilyzabelin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| from abc import ABC, abstractmethod | ||
|
|
||
| import numpy as np | ||
| import pydantic.v1 as pd | ||
|
|
||
| from tidy3d.components.base import Tidy3dBaseModel | ||
| from tidy3d.constants import C_0, HBAR, K_B | ||
|
|
||
| from ...exceptions import DataError | ||
|
|
||
| # constants definition | ||
| m_e_C_square = 0.51099895069e6 # (electron mass * C_0^2) in eV | ||
| m_e_eV = m_e_C_square / C_0 / C_0 # equivalent electron mass in eV | ||
| um_3_to_cm_3 = 1e12 # conversion factor from micron^(-3) to cm^(-3) | ||
|
|
||
| DOS_aux_const = 2.0 * np.power((m_e_eV * K_B) / (2 * np.pi * HBAR * HBAR), 1.5) * um_3_to_cm_3 | ||
|
|
||
|
|
||
| class EffectiveDOS(Tidy3dBaseModel, ABC): | ||
| """Abstract class for the effective density of states""" | ||
|
|
||
| @abstractmethod | ||
| def _calc_eff_dos(self, T: float): | ||
| """Abstract method to calculate the effective density of states.""" | ||
| pass | ||
|
|
||
| @abstractmethod | ||
| def _calc_eff_dos_derivative(self, T: float): | ||
| """Abstract method to calculate the temperature derivative of the effective density of states.""" | ||
| pass | ||
|
|
||
| def get_effective_DOS(self, T: float): | ||
| if T <= 0: | ||
| raise DataError( | ||
| f"Incorrect temperature value ({T}) for the effectve density of states calculation." | ||
| ) | ||
|
|
||
| return self._calc_eff_dos(T) | ||
|
|
||
| def get_effective_DOS_derivative(self, T: float): | ||
| if T <= 0: | ||
| raise DataError( | ||
| f"Incorrect temperature value ({T}) for the effectve density of states calculation." | ||
| ) | ||
|
|
||
| return self._calc_eff_dos_derivative(T) | ||
|
|
||
|
|
||
| class ConstantEffectiveDOS(EffectiveDOS): | ||
| """Constant effective density of states model.""" | ||
|
|
||
| N: pd.PositiveFloat = pd.Field( | ||
| ..., title="Effective DOS", description="Effective density of states", units="cm^(-3)" | ||
| ) | ||
|
|
||
| def _calc_eff_dos(self, T: float): | ||
| return self.N | ||
|
|
||
| def _calc_eff_dos_derivative(self, T: float): | ||
| return 0.0 | ||
|
|
||
|
|
||
| class IsotropicEffectiveDOS(EffectiveDOS): | ||
| """Effective density of states model that assumes single valley and isotropic effective mass. | ||
| The model assumes the standard equation for the 3D semiconductor with parabolic energy dispersion: | ||
|
|
||
| .. math:: | ||
|
|
||
| \\begin{equation} | ||
| \\mathbf{N_eff} = 2 * (\\frac{m_eff * m_e * k_B T}{2 \\pi \\hbar^2})^(3/2) | ||
| \\end{equation} | ||
| """ | ||
|
|
||
| m_eff: pd.PositiveFloat = pd.Field( | ||
| ..., | ||
| title="Effective mass", | ||
| description="Effective mass of the carriers", | ||
| units="Electron mass", | ||
| ) | ||
|
|
||
| def _calc_eff_dos(self, T: float): | ||
| return np.power(self.m_eff * T, 1.5) * DOS_aux_const | ||
|
|
||
| def _calc_eff_dos_derivative(self, T: float): | ||
| return self._calc_eff_dos(T) * 1.5 / T | ||
|
|
||
|
|
||
| class MultiValleyEffectiveDOS(EffectiveDOS): | ||
| """Effective density of states model that assumes multiple equivalent valleys and anisotropic effective mass. | ||
| The model assumes the standard equation for the 3D semiconductor with parabolic energy dispersion: | ||
|
|
||
| .. math:: | ||
|
|
||
| \\begin{equation} | ||
| \\mathbf{N_eff} = 2 * N_valley * (m_{eff_long} * m_{eff_trans} * m_{eff_trans})^(1/2) *(\\frac{m_e * k_B * T}{2 \\pi * \\hbar^2})^(3/2) | ||
| \\end{equation} | ||
| """ | ||
|
|
||
| m_eff_long: pd.PositiveFloat = pd.Field( | ||
| ..., | ||
| title="Longitudinal effective mass", | ||
| description="Effective mass of the carriers in the longitudinal direction", | ||
| units="Electron mass", | ||
| ) | ||
|
|
||
| m_eff_trans: pd.PositiveFloat = pd.Field( | ||
| ..., | ||
| title="Longitudinal effective mass", | ||
| description="Effective mass of the carriers in the transverse direction", | ||
| units="Electron mass", | ||
| ) | ||
|
|
||
| N_valley: pd.PositiveFloat = pd.Field( | ||
| ..., title="Number of valleys", description="Number of effective valleys" | ||
| ) | ||
|
|
||
| def _calc_eff_dos(self, T: float): | ||
| return ( | ||
| self.N_valley | ||
| * np.power(self.m_eff_long * self.m_eff_trans * self.m_eff_trans, 0.5) | ||
| * np.power(T, 1.5) | ||
| * DOS_aux_const | ||
| ) | ||
|
|
||
| def _calc_eff_dos_derivative(self, T: float): | ||
| return self._calc_eff_dos(T) * 1.5 / T | ||
|
|
||
|
|
||
| class DualValleyEffectiveDOS(EffectiveDOS): | ||
| """Effective density of states model that assumes combibation of light holes and heavy holes with isotropic effective masses. | ||
| The model assumes the standard equation for the 3D semiconductor with parabolic energy dispersion: | ||
|
|
||
| .. math:: | ||
|
|
||
| \\begin{equation} | ||
| \\mathbf{N_eff} = 2 * ( {\\frac{m_{eff_lh} * m_e * k_B * T}{2 \\pi \\hbar^2})^(3/2) + (\\frac{m_{eff_hh} * m_e * k_B * T}{2 \\pi \\hbar^2})^(3/2) ) | ||
| \\end{equation} | ||
| """ | ||
|
|
||
| m_eff_lh: pd.PositiveFloat = pd.Field( | ||
| ..., | ||
| title="Light hole effective mass", | ||
| description="Effective mass of the light holes", | ||
| units="Electron mass", | ||
| ) | ||
|
|
||
| m_eff_hh: pd.PositiveFloat = pd.Field( | ||
| ..., | ||
| title="Heavy hole effective mass", | ||
| description="Effective mass of the heavy holes", | ||
| units="Electron mass", | ||
| ) | ||
|
|
||
| def _calc_eff_dos(self, T: float): | ||
| return (np.power(self.m_eff_lh * T, 1.5) + np.power(self.m_eff_hh * T, 1.5)) * DOS_aux_const | ||
|
|
||
| def _calc_eff_dos_derivative(self, T: float): | ||
| return self._calc_eff_dos(T) * 1.5 / T | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.