zkit.physics

Automatic physics extraction from a TDSEZ input deck.

Parses the problem expressions (Potential, mass, laser fields, …) straight from the .inp deck via zkit.simulation.Run, differentiates symbolically with sympy to obtain the higher derivatives the Wigner/Moyal analysis needs (V’, V’’, V’’’, V^(5), mass gradient), and exposes fast lambdified callables.

Everything is derived from the deck – no physics is hard-coded in the caller. If the deck supplies an explicit derivative (e.g. PotentialDerivativeX) it is parsed and used; otherwise it is obtained by symbolic differentiation of Potential so the result is always consistent with the deck.

Example

>>> from zkit.simulation import Run
>>> run = Run("build", "ZnSe_d20_A0.005338")
>>> phys = run.physics
>>> phys.V(0.0, 0.0)  # potential at the origin
>>> phys.Ax(1000.0)  # laser vector potential at t=1000 a.u.
>>> phys.snapshot_time(10)  # real time of wfs snapshot #10 (0-based)
class zkit.physics.Physics(meta)

Bases: object

Physics of a TDSEZ run, extracted automatically from its input deck.

V(x, y)
mass(x, y)
Vpx(x, y)
Vpy(x, y)
V3_x_slice(x)

d^3 V / dx^3 evaluated on the y=0 slice.

V5_x_slice(x)

d^5 V / dx^5 evaluated on the y=0 slice.

Ax(t)
Ay(t)
snapshot_time(i)

Real time (a.u.) of wfs snapshot i (0-based).

t_i = i * OutputStrideWFS * TimeStep.

Parameters:

i (int)

Return type:

float

property has_laser: bool
zkit.physics.parse_expression(src, variables=('x', 'y', 't'))

Parse a deck expression string into a sympy expression.

Substitutes any scalar parameter keys (Ampx, Omegax, …) that appear in the string with their numeric values so the returned expression depends only on the named variables.

Parameters:

src (str)