Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
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.