pulsesuite.PSTD3D.sbetestpropnov30¶
SBE Test Program - Full Version with Longitudinal Field Decomposition.
This program tests the Semiconductor Bloch Equations (SBE) solver by simulating quantum wire response to plane wave electromagnetic fields with complete longitudinal field analysis. It tracks E-fields from polarization (P), charge density (Rho), and their combination (P+Rho).
Author: Rahul R. Sah
Attributes¶
Functions¶
|
Initialize all field arrays to zero. |
|
Create a plane wave propagating in the x-direction. |
|
Create a plane wave propagating in the y-direction. |
|
Create a plane wave propagating in the x-direction (z-polarized). |
|
Create a temporally-varying uniform field. |
|
Separate longitudinal and transverse electric field components. |
|
Convert integer to string for filename generation. |
|
Main SBE test program with full longitudinal field analysis. |
|
Main entry point for command-line execution. |
Module Contents¶
- pulsesuite.PSTD3D.sbetestpropnov30.JIT_AVAILABLE = True¶
- pulsesuite.PSTD3D.sbetestpropnov30.c0 = 299792458.0¶
- pulsesuite.PSTD3D.sbetestpropnov30.pi¶
- pulsesuite.PSTD3D.sbetestpropnov30.twopi¶
- pulsesuite.PSTD3D.sbetestpropnov30.DEFAULT_DT = 1e-17¶
- pulsesuite.PSTD3D.sbetestpropnov30.DEFAULT_NT = 10000¶
- pulsesuite.PSTD3D.sbetestpropnov30.DEFAULT_TP = 5e-14¶
- pulsesuite.PSTD3D.sbetestpropnov30.DEFAULT_LAM = 8e-07¶
- pulsesuite.PSTD3D.sbetestpropnov30.DEFAULT_TW = 1e-14¶
- pulsesuite.PSTD3D.sbetestpropnov30.DEFAULT_N0 = 3.1¶
- pulsesuite.PSTD3D.sbetestpropnov30.DEFAULT_E0X = 200000000.0¶
- pulsesuite.PSTD3D.sbetestpropnov30.DEFAULT_E0Y = 0.0¶
- pulsesuite.PSTD3D.sbetestpropnov30.DEFAULT_E0Z = 0.0¶
- pulsesuite.PSTD3D.sbetestpropnov30.initializefields(F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20)¶
Initialize all field arrays to zero.
Sets all 20 complex field arrays to zero for the start of simulation. This extended version includes longitudinal field decompositions.
- Parameters:
F1 (ndarray) – Electric field components (Ex, Ey, Ez), 3D complex arrays
F2 (ndarray) – Electric field components (Ex, Ey, Ez), 3D complex arrays
F3 (ndarray) – Electric field components (Ex, Ey, Ez), 3D complex arrays
F4 (ndarray) – Current density components (Jx, Jy, Jz), 3D complex arrays
F5 (ndarray) – Current density components (Jx, Jy, Jz), 3D complex arrays
F6 (ndarray) – Current density components (Jx, Jy, Jz), 3D complex arrays
F7 (ndarray) – Charge density (Rho), 3D complex array
F8 (ndarray) – Longitudinal field components from Helmholtz decomposition (Exl, Eyl, Ezl), 3D complex arrays
F9 (ndarray) – Longitudinal field components from Helmholtz decomposition (Exl, Eyl, Ezl), 3D complex arrays
F10 (ndarray) – Longitudinal field components from Helmholtz decomposition (Exl, Eyl, Ezl), 3D complex arrays
F11 (ndarray) – Longitudinal fields from P+Rho (ExlfromPRho, EylfromPRho, EzlfromPRho), 3D complex arrays
F12 (ndarray) – Longitudinal fields from P+Rho (ExlfromPRho, EylfromPRho, EzlfromPRho), 3D complex arrays
F13 (ndarray) – Longitudinal fields from P+Rho (ExlfromPRho, EylfromPRho, EzlfromPRho), 3D complex arrays
F14 (ndarray) – Longitudinal fields from P only (ExlfromP, EylfromP, EzlfromP), 3D complex arrays
F15 (ndarray) – Longitudinal fields from P only (ExlfromP, EylfromP, EzlfromP), 3D complex arrays
F16 (ndarray) – Longitudinal fields from P only (ExlfromP, EylfromP, EzlfromP), 3D complex arrays
F17 (ndarray) – Longitudinal fields from Rho only (ExlfromRho, EylfromRho, EzlfromRho), 3D complex arrays
F18 (ndarray) – Longitudinal fields from Rho only (ExlfromRho, EylfromRho, EzlfromRho), 3D complex arrays
F19 (ndarray) – Longitudinal fields from Rho only (ExlfromRho, EylfromRho, EzlfromRho), 3D complex arrays
F20 (ndarray) – Bound charge density (RhoBound), 3D complex array
- Returns:
All arrays are modified in-place.
- Return type:
None
- pulsesuite.PSTD3D.sbetestpropnov30.MakePlaneWaveX(Ey, space, t, Emax0, lam, tw, tp)¶
Create a plane wave propagating in the x-direction.
Generates E = (0, Ey(x,t), 0) with Gaussian envelope and super-Gaussian cutoff, propagating along the x-axis.
- Parameters:
Ey (ndarray) – Y-component electric field to populate (modified in-place), 3D complex array
space (ss) – Space structure containing grid parameters
t (float) – Current time (s)
Emax0 (float) – Peak field amplitude (V/m)
lam (float) – Wavelength (m)
tw (float) – Pulse width (s)
tp (float) – Time of pulse peak (s)
- Returns:
Ey array is modified in-place.
- Return type:
None
Notes
Uses a background refractive index n0 = 3.1 (hardcoded). Super-Gaussian cutoff (power 20) prevents spurious oscillations.
- pulsesuite.PSTD3D.sbetestpropnov30.MakePlaneWaveY(Ex, space, t, Emax0, lam, tw, tp)¶
Create a plane wave propagating in the y-direction.
Generates E = (Ex(y,t), 0, 0) with Gaussian envelope and super-Gaussian cutoff, propagating along the y-axis.
- Parameters:
Ex (ndarray) – X-component electric field to populate (modified in-place), 3D complex array
space (ss) – Space structure containing grid parameters
t (float) – Current time (s)
Emax0 (float) – Peak field amplitude (V/m)
lam (float) – Wavelength (m)
tw (float) – Pulse width (s)
tp (float) – Time of pulse peak (s)
- Returns:
Ex array is modified in-place.
- Return type:
None
Notes
Uses a background refractive index n0 = 3.1 (hardcoded). Super-Gaussian cutoff (power 20) prevents spurious oscillations.
- pulsesuite.PSTD3D.sbetestpropnov30.MakePlaneWaveZ(Ez, space, t, Emax0, lam, tw, tp)¶
Create a plane wave propagating in the x-direction (z-polarized).
Generates E = (0, 0, Ez(x,t)) with Gaussian envelope and super-Gaussian cutoff, propagating along the x-axis.
- Parameters:
Ez (ndarray) – Z-component electric field to populate (modified in-place), 3D complex array
space (ss) – Space structure containing grid parameters
t (float) – Current time (s)
Emax0 (float) – Peak field amplitude (V/m)
lam (float) – Wavelength (m)
tw (float) – Pulse width (s)
tp (float) – Time of pulse peak (s)
- Returns:
Ez array is modified in-place.
- Return type:
None
Notes
Uses a background refractive index n0 = 3.1 (hardcoded). Super-Gaussian cutoff (power 20) prevents spurious oscillations. Note: The wave propagates along x-axis, not z-axis.
- pulsesuite.PSTD3D.sbetestpropnov30.MakePlaneWaveTemporal(Ex, t, Emax0, lam, tw, tp)¶
Create a temporally-varying uniform field.
Generates E = (Ex(t), 0, 0) that is uniform in space but varies in time with a Gaussian envelope.
- Parameters:
- Returns:
Ex array is modified in-place.
- Return type:
None
Notes
This creates a spatially uniform field that oscillates in time. Useful for testing temporal response without spatial propagation effects.
- pulsesuite.PSTD3D.sbetestpropnov30.ElongSeparate(space, Ex, Ey, Ez, Exl, Eyl, Ezl)¶
Separate longitudinal and transverse electric field components.
Placeholder function for field decomposition using Helmholtz decomposition. In the full implementation, this would separate E into transverse and longitudinal components.
- Parameters:
space (ss) – Space structure containing grid parameters
Ex (ndarray) – Total electric field components, 3D complex arrays
Ey (ndarray) – Total electric field components, 3D complex arrays
Ez (ndarray) – Total electric field components, 3D complex arrays
Exl (ndarray) – Longitudinal electric field components (output), 3D complex arrays
Eyl (ndarray) – Longitudinal electric field components (output), 3D complex arrays
Ezl (ndarray) – Longitudinal electric field components (output), 3D complex arrays
- Returns:
Exl, Eyl, Ezl are modified in-place.
- Return type:
None
Notes
Currently a stub. Full implementation would compute: E_long = -∇φ where ∇²φ = ∇·E E_trans = E - E_long
- pulsesuite.PSTD3D.sbetestpropnov30.int2str(n)¶
Convert integer to string for filename generation.
Simple helper function to convert integers to strings for output filenames.
- pulsesuite.PSTD3D.sbetestpropnov30.SBETest(space_params_file='params/space.params', dt=DEFAULT_DT, Nt=DEFAULT_NT, tp=DEFAULT_TP, lam=DEFAULT_LAM, tw=DEFAULT_TW, n0=DEFAULT_N0, E0x=DEFAULT_E0X, E0y=DEFAULT_E0Y, E0z=DEFAULT_E0Z, output_dir='fields', write_2d_slices=True, slice_interval=10)¶
Main SBE test program with full longitudinal field analysis.
Simulates quantum wire response to plane wave electromagnetic fields with complete tracking of longitudinal field components from polarization (P), charge density (Rho), and their combination.
- Parameters:
space_params_file (str, optional) – Path to space parameters file (default: ‘params/space.params’)
dt (float, optional) – Time step in seconds (default: 10e-18 s)
Nt (int, optional) – Number of time steps (default: 10000)
tp (float, optional) – Time of pulse peak in seconds (default: 50e-15 s)
lam (float, optional) – Field wavelength in meters (default: 800e-9 m)
tw (float, optional) – Pulse width in seconds (default: 10e-15 s)
n0 (float, optional) – Background refractive index (default: 3.1)
E0x (float, optional) – Peak Ex-field value in V/m (default: 2e8 V/m)
E0y (float, optional) – Peak Ey-field value in V/m (default: 0.0 V/m)
E0z (float, optional) – Peak Ez-field value in V/m (default: 0.0 V/m)
output_dir (str, optional) – Directory for output files (default: ‘fields’)
write_2d_slices (bool, optional) – Whether to write 2D slice files (default: True)
slice_interval (int, optional) – Interval for writing 2D slices (default: 10)
- Returns:
Dictionary containing final field arrays and statistics
- Return type:
Notes
This function: 1. Reads spatial grid parameters 2. Allocates all field arrays including longitudinal decompositions 3. Initializes SBE solver 4. Time-loops with plane wave excitation 5. Calls QuantumWire with full longitudinal field outputs 6. Tracks max/min values for all fields 7. Writes time series and 2D slices to files
- pulsesuite.PSTD3D.sbetestpropnov30.main()¶
Main entry point for command-line execution.
Runs the SBE test program with default parameters. Creates a timestamped run directory so each simulation’s output is preserved separately.