Differentiable spectral element method (DSEM) for PDE-constrained optimization. Embeds GLL spectral element solvers into PyTorch autograd, replacing hand-derived adjoints with automatic differentiation. Matrix-free CG, 1D/2D/3D, L-shaped domains, nonlinear Burgers.