SymX Documentation¶
Welcome to the SymX documentation pages. SymX is a C++ library for symbolic differentiation, code generation, and evaluation, designed primarily for non-linear optimization, FEM, and differentiable simulation. Check out the SymX GitHub repo.
In these pages you will find an overview on how SymX works and how to use it through its levels of abstraction. Every explanation comes with example snippets. Note that this is more of a tutorial or a walkthrough than an extensive documentation in a traditional Doxygen sense.
Another important goal of this guide is to help you assess whether SymX can be useful to you. There are many different ways to use symbolics, differentiation and just-in-time compilation, and SymX supports a few use cases out-of-the-box. There are four entry points available in SymX:
Single Expression: Compose a symbolic expression (possibly differentiated), compile it, set values, run it, read the output.
Stencil-based Loops: Compose a symbolic expression (possibly differentiated) to be evaluated in a loop over many instances of an stencil. This is the core of FEM assemblers and iterative predictor/corrector solvers such as Jacobi or Gauss-Seidel.
Global Optimization: Define potentials, discretizations, and degrees of freedom and let SymX minimize a global objective with Newton’s Method or a first-order optimizer. It takes care of differentiation, compilation, and evaluation automatically.
Differentiable Simulation: Define an equilibrium simulation and a loss on its outcome. SymX differentiates through the converged solve with the adjoint method, making inverse problems with many parameters practical.
Depending on your use case, you might choose to skip parts of this tutorial.
Table of Contents¶
Getting Started
Core Concepts (Layers 1, 2)
Symbol-Data Maps (Layer 3)
Global Optimization (Layer 4)
Differentiable Simulation (Layer 5)
Examples