"매 Nature 의 action S 의 stationary 의 path 의 select". Maupertuis(1744) → Lagrange → Hamilton 의 발전 의 매 classical/quantum/field theory 의 unified backbone — 매 modern ML 의 neural ODEs / Hamiltonian networks 의 기반.
매 핵심
매 정의
Action: S[q] = ∫ L(q, q̇, t) dt, 매 L = T − V (Lagrangian).
Stationary: δS = 0 (not 항상 minimum — 매 stationary point).
Hamiltonian (q, p): 매 phase-space 의 symplectic structure.
Path Integral (Feynman): 매 amplitude = ∫ Dq exp(iS/ℏ) — 매 quantum extension.
매 응용
매 classical mechanics 의 EoM 의 derive.
Optical path (Fermat) — light follows least-time.
Geodesics in GR (least proper-time worldline).
Symplectic ODE integrators (leapfrog).
Hamiltonian Neural Networks, Lagrangian NN.
💻 패턴
SymPy — symbolic Euler-Lagrange (pendulum)
importsympyasspt,m,g,l=sp.symbols("t m g l",positive=True)q=sp.Function("q")(t)T=sp.Rational(1,2)*m*(l*sp.diff(q,t))**2V=-m*g*l*sp.cos(q)L=T-VEL=sp.diff(sp.diff(L,sp.diff(q,t)),t)-sp.diff(L,q)print(sp.simplify(EL))# m*l^2*q'' + m*g*l*sin(q) = 0
importjax,jax.numpyasjnpdeflagrangian(q,qdot):return0.5*jnp.sum(qdot**2)-potential(q)defel_residual(q,qdot,qddot):dL_dq=jax.grad(lagrangian,0)(q,qdot)dL_dqdot=jax.grad(lagrangian,1)(q,qdot)# d/dt(∂L/∂q̇) along trajectory:H=jax.hessian(lagrangian,argnums=(1,1))(q,qdot)d_dt=H@qddot# simplified for autonomous Lreturnd_dt-dL_dq
Lagrangian Neural Network (Cranmer 2020)
# Parameterize L_θ(q,q̇) by an MLP; learn dynamics by enforcing EL eq.classLNN(nn.Module):def__call__(self,q,qdot):returnself.mlp(jnp.concatenate([q,qdot]))defpredicted_qddot(params,q,qdot):L=lambdaq,qd:lnn.apply(params,q,qd)H_qd_qd=jax.hessian(L,1)(q,qdot)grad_q=jax.grad(L,0)(q,qdot)returnjnp.linalg.solve(H_qd_qd,grad_q)
Hamiltonian Neural Network
# Greydanus 2019: parameterize H_θ(q,p); use symplectic gradients.defhnn_dynamics(params,q,p):H=lambdaq,p:hnn.apply(params,q,p)returnjax.grad(H,1)(q,p),-jax.grad(H,0)(q,p)
언제: 매 conservative system 의 dynamics learn / simulate — 매 long-horizon stability 의 priority. 매 physics-informed ML.
언제 X: 매 strongly dissipative / non-conservative — 매 Hamiltonian assumption 의 violate. 매 stochastic — 매 Langevin / SDE.
❌ 안티패턴
"Least" action 으로 misinterpret: 매 stationary, 매 not 항상 min — 매 saddle 도 valid.
Non-symplectic integrator + long horizon: 매 energy drift.
Constraints 의 ad-hoc 처리: 매 generalized coords 또는 Lagrange multipliers 의 use.
Time-dependent L 의 Hamiltonian 으로 conserve assume: 매 ∂L/∂t ≠ 0 → H 의 not conserved.
🧪 검증 / 중복
Verified (Goldstein Classical Mechanics 3e; Arnold Mathematical Methods of CM; Feynman Vol II).
신뢰도 A.
🕓 Changelog
날짜
변경
2026-05-08
Phase 1
2026-05-10
Manual cleanup — Lagrangian/Hamiltonian/symplectic + LNN/HNN modern ML link