A Python framework for the self-consistent solution of 1D Non-Equilibrium Green's Function (NEGF) and Poisson equations for nanowire structures.
-
1D Poisson solver with Neumann Boundary Conditions.
-
Calculation of electron density and tunneling current using the NEGF formalism (Recursive Green's Function algorithm).
-
Self-consistent loop for the convergence of electrostatic potential and charge density.
-
Adjustable physical parameters including effective mass (
$m^*$ ), relative permittivity ($\epsilon_r$ ), Fermi levels of the leads ($\mu_L$ and$\mu_R$ ), and temperature ($T$ ). -
Built-in visualization for energy band diagrams and carrier density profiles.
This package requires Python 3.11 or newer and the following libraries:
-
numpy -
matplotlib
To install the package, navigate to the root directory of the project (where pyproject.toml is located) in your terminal and run:
pip install -e .
Note: The -e (editable) flag allows you to modify the source code without needing to reinstall the package.
nano_negf/
├── pyproject.toml # Package build configuration
├── nano_negf/ # Main source code
│ ├── __init__.py
│ ├── constants.py # Physical constants
│ ├── physics.py # Physics utilities (energy grids, Fermi functions, self-energy)
│ ├── poisson.py # Matrix-based Poisson solver
│ ├── negf.py # RGF algorithm, density, and current calculations
│ └── solver.py # Main SelfConsistentSolver class
└── example.py # Example usage script
Once installed, you can import and use the SelfConsistentSolver in your scripts or go to the example file and run the code. Here is a basic example:
from nano_negf import SelfConsistentSolver
# 1. Initialize the solver with desired parameters
sim = SelfConsistentSolver(
N=100, # Number of grid points
dx=1e-9, # Grid spacing (m)
m_eff_ratio=0.25, # Electron effective mass ratio
mu_L=0.1, # Left lead chemical potential (eV)
mu_R=0.0, # Right lead chemical potential (eV)
Nd=1e24 # Doping density (1/m^3)
)
# 2. Run the self-consistent loop
sim.run(max_iter=800, mix=0.1, tol=1e-4)
# 3. Plot the results (Band diagram and Carrier density)
sim.plot_results()this package will generate two types of output:
- Terminal Output: Current in each iteration.
- Graphical Output: Energy Band Diagram and Carrier Density
- Homepage = "https://github.com/msaeedforoughi/nano_negf-framework"
- Bug Tracker = "https://github.com/msaeedforoughi/nano_negf-framework/issues"
Copyright (c) 2026 Mohammad Saeed Foroughi
