Skip to main content

Python library for creating and running PADRE semiconductor device simulations

Project description

nanohub-padre

A Python library for creating and running PADRE semiconductor device simulations.

Overview

nanohub-padre provides a Pythonic interface to generate PADRE input decks, making it easier to set up complex device simulations programmatically. PADRE (Physics-based Accurate Device Resolution and Evaluation) is a 2D/3D device simulator that solves the drift-diffusion equations for semiconductor devices.

Features

  • Pythonic Interface: Define meshes, regions, doping profiles, and solver settings using Python objects
  • Device Factory Functions: Pre-built functions to create common devices (PN diode, MOSFET, BJT, solar cell, etc.)
  • Complete PADRE Support: Covers mesh generation, material properties, physical models, and solve commands
  • Validation: Built-in parameter validation and helpful error messages
  • Examples: Ready-to-run examples for common device structures

Installation

pip install nanohub-padre

Or install from source:

git clone https://github.com/nanohub/nanohub-padre.git
cd nanohub-padre
pip install -e .

Quick Start

Using Device Factory Functions (Recommended)

from nanohubpadre import create_mosfet, Solve, Log

# Create an NMOS transistor with one line
sim = create_mosfet(
    channel_length=0.05,
    device_type="nmos",
    temperature=300
)

# Add solve commands
sim.add_solve(Solve(initial=True))
sim.add_log(Log(ivfile="idvg"))
sim.add_solve(Solve(v3=0, vstep=0.1, nsteps=15, electrode=3))

# Generate the input deck
print(sim.generate_deck())

Building from Scratch

from nanohubpadre import (
    Simulation, Mesh, Region, Electrode, Doping,
    Contact, Models, System, Solve
)

# Create simulation
sim = Simulation(title="Simple PN Diode")

# Define mesh
sim.mesh = Mesh(nx=100, ny=3)
sim.mesh.add_x_mesh(1, 0)
sim.mesh.add_x_mesh(100, 1.0)
sim.mesh.add_y_mesh(1, 0)
sim.mesh.add_y_mesh(3, 1)

# Define silicon region
sim.add_region(Region(1, ix_low=1, ix_high=100, iy_low=1, iy_high=3, silicon=True))

# Define electrodes
sim.add_electrode(Electrode(1, ix_low=1, ix_high=1, iy_low=1, iy_high=3))
sim.add_electrode(Electrode(2, ix_low=100, ix_high=100, iy_low=1, iy_high=3))

# Define doping
sim.add_doping(Doping(p_type=True, concentration=1e17, uniform=True, x_right=0.5))
sim.add_doping(Doping(n_type=True, concentration=1e17, uniform=True, x_left=0.5))

# Set contacts
sim.add_contact(Contact(all_contacts=True, neutral=True))

# Configure models
sim.models = Models(temperature=300, srh=True, conmob=True, fldmob=True)
sim.system = System(electrons=True, holes=True, newton=True)

# Solve
sim.add_solve(Solve(initial=True))

# Generate and print the input deck
print(sim.generate_deck())

Device Factory Functions

The library includes factory functions for common devices:

Function Description
create_pn_diode PN junction diode
create_mos_capacitor MOS capacitor for C-V analysis
create_mosfet NMOS/PMOS transistor
create_mesfet Metal-semiconductor FET
create_bjt NPN/PNP bipolar transistor
create_schottky_diode Schottky barrier diode
create_solar_cell PN junction solar cell

Examples

The examples/ directory contains Python equivalents of common PADRE simulations:

  • pndiode.py: PN junction diode I-V characterization
  • moscap.py: MOS capacitor C-V analysis
  • mosfet_equivalent.py: NMOS transistor transfer and output characteristics
  • mesfet.py: Metal-Semiconductor FET simulation
  • single_mosgap.py: Simple oxide-silicon structure

Device factory examples in examples/devices/:

  • pn_diode_example.py: PN diode using factory function
  • mosfet_example.py: NMOS using factory function
  • bjt_example.py: NPN BJT using factory function
  • solar_cell_example.py: Solar cell using factory function

Run an example:

PYTHONPATH=. python3 examples/pndiode.py > pndiode.inp
padre < pndiode.inp > pndiode.out

Supported Commands

nanohub-padre supports all major PADRE commands:

Category Commands
Mesh MESH, X.MESH, Y.MESH, Z.MESH
Structure REGION, ELECTRODE
Doping DOPING (uniform, Gaussian, ERFC, file)
Boundaries CONTACT, INTERFACE, SURFACE
Materials MATERIAL, ALLOY
Models MODELS
Solver SYSTEM, METHOD, LINALG, SOLVE
Output LOG, PLOT.1D, PLOT.2D, PLOT.3D, CONTOUR, VECTOR
Control OPTIONS, LOAD, REGRID, ADAPT

Documentation

Full documentation is available at https://nanohub-padre.readthedocs.io/

Testing

Run the test suite:

pytest tests/ -v

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nanohub_padre-0.0.8.tar.gz (123.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nanohub_padre-0.0.8-py3-none-any.whl (135.3 kB view details)

Uploaded Python 3

File details

Details for the file nanohub_padre-0.0.8.tar.gz.

File metadata

  • Download URL: nanohub_padre-0.0.8.tar.gz
  • Upload date:
  • Size: 123.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for nanohub_padre-0.0.8.tar.gz
Algorithm Hash digest
SHA256 22791ad244b963c841a1b8edd8a86e57c215b90aa2c5b67e695b26e795c587b3
MD5 7bfe3eb54639a36d5796b5974a526dc3
BLAKE2b-256 c78bf37f80e12c8b0277268a5d505aa630039684764a76a3cbb4c9b75260f7b5

See more details on using hashes here.

File details

Details for the file nanohub_padre-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: nanohub_padre-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 135.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for nanohub_padre-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5c406f6e66ff739e87a8ec6bbcf04b34bde9ff77e88a4acbab2989f6a339b831
MD5 1ae007341b4c7f3da0e0c33a4ba158bb
BLAKE2b-256 6d476792d17d62012cdc5c33dfd1f1a9a548ae146d46ed650e26fd419a06b945

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page