Skip to content

Gsoc symbolic parser mvp#1040

Open
ajatshatru01 wants to merge 2 commits intoSciML:masterfrom
ajatshatru01:gsoc-symbolic-parser-mvp
Open

Gsoc symbolic parser mvp#1040
ajatshatru01 wants to merge 2 commits intoSciML:masterfrom
ajatshatru01:gsoc-symbolic-parser-mvp

Conversation

@ajatshatru01
Copy link

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Context / Background
As part of the continuous evolution of NeuralPDE.jl and preparation for the GSoC 2026 project "Modelingtoolkit based Parser for Physics Informed Neural Networks", this PR introduces a highly experiential prototype MVP that natively bridges ModelingToolkit equations to compiled Lux loss functions without manual Julia AST string/macro manipulation.

Currently, the build_symbolic_loss_function pipeline constructs explicit Expr trees. By instead lowering to Symbolics.build_function, we allow the compiler to build structurally sound evaluation pipelines spanning arbitrary boundary conditions and multi-variable differential operations via Lazy Grid-Sums.

Changes Made:-

  • New Core File: Added src/symbolic_pinn_parser.jl

  • Parser Logic: Ported the _replace_dv_calls and build_pinn_loss routines perfectly mapping symbolic Differential operators onto Lux.apply operations dynamically at compilation time.

  • Export Alignment: Exported build_pinn_loss seamlessly into the core module framework (src/NeuralPDE.jl).

  • Demonstration: Included a demo_symbolic_parser.jl script showing exactly how to execute a 1D Advection Equation mapping from PDESystem directly explicitly printed symbolic templates demo_symbolic_expression.txt.

Verification:-

  • Confirmed the 1D Advection PDE solves correctly via Optimization with 0.27 Max Error across a 10-point grid spanning a trivial 1-layer Neural Network.

  • Generated perfectly matching expanded Symbolic equation blocks exactly mapping layer evaluations directly to grid residuals perfectly scaled.

  • All structural changes remain completely non-breaking to the existing API structure, adding purely additive experimental features.

Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant