pulsesuite.PSTD3D.rhoPJ¶
Quantum wire polarization and current density calculations for 3D Maxwell propagation.
This module handles the interface between 1D quantum wire calculations and 3D Maxwell field propagation, including polarization placement, current density calculation, and longitudinal field computation from charge density.
Author: Rahul R. Sah
Attributes¶
Classes¶
Quantum wire array state for 3D Maxwell propagation. |
Functions¶
|
Backward-compatible shim — delegates to _default_qw. |
|
Backward-compatible shim — delegates to _default_qw. |
|
Compute free current density from charge density time derivative. |
|
Place 1D quantum wire field into 3D Maxwell grid. |
|
Calculate longitudinal electric fields from polarization and charge density. |
|
Backward-compatible shim — delegates to _default_qw. |
|
Backward-compatible shim — delegates to _default_qw. |
Module Contents¶
- pulsesuite.PSTD3D.rhoPJ.eps0¶
- pulsesuite.PSTD3D.rhoPJ.ii = 1j¶
- pulsesuite.PSTD3D.rhoPJ.read_qw_parameters(filename)¶
Read quantum wire parameters from file.
Reads QW configuration parameters from a file and updates module-level variables. If the file cannot be opened, prints an error message.
- pulsesuite.PSTD3D.rhoPJ.QuantumWire(space, dt, n, Ex, Ey, Ez, Jx, Jy, Jz, Rho, ExlfromPRho, EylfromPRho, EzlfromPRho, ExlfromP, EylfromP, EzlfromP, ExlfromRho, EylfromRho, EzlfromRho, RhoBound)¶
Main quantum wire calculation routine.
Calculates polarization and charge density for quantum wires and deposits them into 3D Maxwell grid. Handles multiple wires and computes longitudinal fields from polarization and charge density.
- Parameters:
space (object) – Space configuration object (from typespace)
dt (float) – Time step (s)
n (int) – Current time step number
Ex (ndarray) – X-component electric field (complex), 3D array
Ey (ndarray) – Y-component electric field (complex), 3D array
Ez (ndarray) – Z-component electric field (complex), 3D array
Jx (ndarray) – X-component current density (complex, modified in-place), 3D array
Jy (ndarray) – Y-component current density (complex, modified in-place), 3D array
Jz (ndarray) – Z-component current density (complex, modified in-place), 3D array
Rho (ndarray) – Charge density (complex, modified in-place), 3D array
ExlfromPRho (ndarray) – X-component longitudinal field from P+Rho (output), 3D array
EylfromPRho (ndarray) – Y-component longitudinal field from P+Rho (output), 3D array
EzlfromPRho (ndarray) – Z-component longitudinal field from P+Rho (output), 3D array
ExlfromP (ndarray) – X-component longitudinal field from P (output), 3D array
EylfromP (ndarray) – Y-component longitudinal field from P (output), 3D array
EzlfromP (ndarray) – Z-component longitudinal field from P (output), 3D array
ExlfromRho (ndarray) – X-component longitudinal field from Rho (output), 3D array
EylfromRho (ndarray) – Y-component longitudinal field from Rho (output), 3D array
EzlfromRho (ndarray) – Z-component longitudinal field from Rho (output), 3D array
RhoBound (ndarray) – Bound charge density (output), 3D array
- Returns:
All output arrays are modified in-place.
- Return type:
None
- pulsesuite.PSTD3D.rhoPJ.CalcJfx(RhoNew, RhoPrev, dt, dx)¶
Compute free current density from charge density time derivative.
Calculates J_free = - ∫(∂ρ/∂t) dx using local approximation (Riemann sums).
- pulsesuite.PSTD3D.rhoPJ.QWPlacement(Fwire, gx, gy, gz, Fgrid)¶
Place 1D quantum wire field into 3D Maxwell grid.
Deposits a 1D field Fwire along the x-axis into a 3D grid Fgrid using gate profiles gx, gy, gz for spatial weighting.
- Parameters:
Fwire (ndarray) – Complex field along x-axis (length Nx), 1D array
gx (ndarray) – Gate profile in x direction, 1D array
gy (ndarray) – Gate profile in y direction, 1D array
gz (ndarray) – Gate profile in z direction, 1D array
Fgrid (ndarray) – Complex 3D Maxwell grid array to deposit into (modified in-place), 3D array
- Returns:
Fgrid is modified in-place.
- Return type:
None
- pulsesuite.PSTD3D.rhoPJ.ElongfromRho(space, Rho, Px, Py, Pz, ExlfromPRho, EylfromPRho, EzlfromPRho, ExlfromP, EylfromP, EzlfromP, ExlfromRho, EylfromRho, EzlfromRho, RhoBound)¶
Calculate longitudinal electric fields from polarization and charge density.
Computes longitudinal (Coulomb) electric fields in k-space from polarization and free charge density, then transforms back to real space.
- Parameters:
space (object) – Space configuration object (from typespace)
Rho (ndarray) – Free charge density (complex), 3D array
Px (ndarray) – X-component polarization (complex, modified in-place), 3D array
Py (ndarray) – Y-component polarization (complex, modified in-place), 3D array
Pz (ndarray) – Z-component polarization (complex, modified in-place), 3D array
ExlfromPRho (ndarray) – X-component longitudinal field from P+Rho (output), 3D array
EylfromPRho (ndarray) – Y-component longitudinal field from P+Rho (output), 3D array
EzlfromPRho (ndarray) – Z-component longitudinal field from P+Rho (output), 3D array
ExlfromP (ndarray) – X-component longitudinal field from P (output), 3D array
EylfromP (ndarray) – Y-component longitudinal field from P (output), 3D array
EzlfromP (ndarray) – Z-component longitudinal field from P (output), 3D array
ExlfromRho (ndarray) – X-component longitudinal field from Rho (output), 3D array
EylfromRho (ndarray) – Y-component longitudinal field from Rho (output), 3D array
EzlfromRho (ndarray) – Z-component longitudinal field from Rho (output), 3D array
RhoBound (ndarray) – Bound charge density (output), 3D array
- Returns:
All output arrays are modified in-place.
- Return type:
None
- class pulsesuite.PSTD3D.rhoPJ.QWArray¶
Quantum wire array state for 3D Maxwell propagation.
Encapsulates all mutable module-level state (QW parameters, old polarization/charge arrays) enabling multiple independent QW array simulations.
Usage (mirrors Fortran workflow via shim):
# Implicit via shim — zero caller changes: QuantumWire(space, dt, n, Ex, Ey, Ez, ...) # Explicit — for multi-instance: qw = QWArray() qw.QuantumWire(space, dt, n, Ex, Ey, Ez, ...)
- Nw = 4¶
- y0 = 0.0¶
- x0 = 0.0¶
- z0 = 0.0¶
- dxqw = 0.0¶
- ay = 5e-09¶
- az = 5e-09¶
- QW = True¶
- host = False¶
- propagate = True¶
- PxxOld = None¶
- PyyOld = None¶
- PzzOld = None¶
- RhoOld = None¶
- read_qw_parameters(filename)¶
Read quantum wire parameters from file.
- QuantumWire(space, dt, n, Ex, Ey, Ez, Jx, Jy, Jz, Rho, ExlfromPRho, EylfromPRho, EzlfromPRho, ExlfromP, EylfromP, EzlfromP, ExlfromRho, EylfromRho, EzlfromRho, RhoBound)¶
Main quantum wire calculation routine.
Calculates polarization and charge density for quantum wires and deposits them into 3D Maxwell grid. Handles multiple wires and computes longitudinal fields from polarization and charge density.
All output arrays are modified in-place.
- pulsesuite.PSTD3D.rhoPJ.QuantumWire(space, dt, n, Ex, Ey, Ez, Jx, Jy, Jz, Rho, ExlfromPRho, EylfromPRho, EzlfromPRho, ExlfromP, EylfromP, EzlfromP, ExlfromRho, EylfromRho, EzlfromRho, RhoBound)¶
Backward-compatible shim — delegates to _default_qw.
- pulsesuite.PSTD3D.rhoPJ.read_qw_parameters(filename)¶
Backward-compatible shim — delegates to _default_qw.