Skip to content

Conversation

damiano-flex
Copy link
Contributor

@damiano-flex damiano-flex commented Jul 17, 2025

Refactors semiconductor material modeling by introducing modular DOS and band gap models, replacing hardcoded values with configurable model classes.

  • Added new model classes in tidy3d/__init__.py including ConstantEffectiveDOS, IsotropicEffectiveDOS, MultiValleyEffectiveDOS, and various energy band gap models
  • Modified SemiconductorMedium in components/material/tcad/charge.py to use model-based implementations for N_c, N_v, and E_g parameters
  • Updated cSi material properties in material_library/material_library.py to use new model classes while preserving existing values
  • Modified test cases in test_heat_charge.py to use the new model classes instead of hardcoded values

Greptile Summary

This PR introduces a significant architectural improvement to the semiconductor material modeling system in Tidy3D. It replaces hardcoded material parameters with a flexible, model-based approach for calculating Density of States (DOS) and energy band gaps. The changes enable more sophisticated physics modeling while maintaining backward compatibility.

Key changes:

  1. Introduces new model classes for DOS (Constant, Isotropic, Multi-Valley, Dual-Valley)
  2. Adds energy band gap models (Constant, Quadratic, Varshni)
  3. Refactors SemiconductorMedium to use these models instead of hardcoded values
  4. Updates material library and tests to use the new model-based approach

The change maintains existing numerical values for silicon (e.g., N_c=2.86e19, N_v=3.1e19, E_g=1.11) while providing infrastructure for more complex physics in the future. This is particularly relevant for the non-isothermal branch it's targeting, as temperature-dependent calculations will be crucial.

PR Description Notes:

  • Documentation formatting issue in bandgap_energy.py (unmatched $ in Varshni formula)
  • Inconsistency in class name reference (VarshniBandGap vs VarshniEnergyBandGap)

Confidence score: 4 /5

  1. This PR is generally safe to merge with minor documentation fixes needed
  2. Score reflects strong architectural improvements but needs small documentation corrections
  3. Files needing attention:
    • tidy3d/components/tcad/bandgap_energy.py (documentation formatting)
    • tests to verify temperature-dependent behavior

7 files reviewed, 4 comments
Edit PR Review Bot Settings | Greptile

@damiano-flex damiano-flex requested a review from marc-flex July 17, 2025 10:51
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing changes made in this pull request

Example
-------
>>> # Parameters for Silicon (Si)
>>> si_model = VarshniBandGap(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Class name in example is 'VarshniBandGap' but actual class is 'VarshniEnergyBandGap'

Suggested change
>>> si_model = VarshniBandGap(
>>> si_model = VarshniEnergyBandGap(

def get_effective_DOS(self, T: float):
if T <= 0:
raise DataError(
f"Incorrect temperature value ({T}) for the effectve density of states calculation."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: Typo in error message: 'effectve' should be 'effective'

Suggested change
f"Incorrect temperature value ({T}) for the effectve density of states calculation."
f"Incorrect temperature value ({T}) for the effective density of states calculation."

Comment on lines +107 to +109
...,
title="Longitudinal effective mass",
description="Effective mass of the carriers in the transverse direction",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: Copy-paste error in title: 'Longitudinal effective mass' should be 'Transverse effective mass'

Suggested change
...,
title="Longitudinal effective mass",
description="Effective mass of the carriers in the transverse direction",
...,
title="Transverse effective mass",
description="Effective mass of the carriers in the transverse direction",



class DualValleyEffectiveDOS(EffectiveDOS):
"""Effective density of states model that assumes combibation of light holes and heavy holes with isotropic effective masses.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: Typo in docstring: 'combibation' should be 'combination'

Suggested change
"""Effective density of states model that assumes combibation of light holes and heavy holes with isotropic effective masses.
"""Effective density of states model that assumes combination of light holes and heavy holes with isotropic effective masses.

@damiano-flex damiano-flex merged commit 5a0345b into marc/non_isothermal Aug 18, 2025
@damiano-flex damiano-flex deleted the damiano/effective_dos_v2 branch August 18, 2025 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants