Skip to content

Sympy#2

Open
Margus2004 wants to merge 9 commits into
uellue:dev2from
Margus2004:sympy
Open

Sympy#2
Margus2004 wants to merge 9 commits into
uellue:dev2from
Margus2004:sympy

Conversation

@Margus2004
Copy link
Copy Markdown

No description provided.

…n for adjusting scan pixel pitch

*sympy based functions: scale(), rotate(), flip_y(), identity(), scale_rotate_flip()
Use sympy functions to calculate sin(), cos() etc.
*generalized function: find a general expression for DescanError while adjusting scan pixel pitch, then convert it to a function for insertinf values and construct new model
*comments: + exchange jnp by np in Parameters4DSTEM for xp value, as symbols are not jax-compatible
+ comment out some assertions with comparisons, as arbitrary symbols compared to a number are undetermined
uellue and others added 2 commits March 5, 2026 12:45
* Cached class method to generate adjustment function with SymPy
* Distinguish docstring for end users from comments for developers
* A few simplifications
* Add simplify to scale_rotate_flip()
…adjust_scan_pixel_pitch()

* Simplify symbol declaration through symbol_maker()
* Assign symbols to parameters using symbol_maker() in _mk_adjust_scan_pixel_pitch()
* Some simplifications in _mk_adjust_scan_pixel_pitch()
@uellue uellue mentioned this pull request Mar 6, 2026
Closed
Margus2004 and others added 6 commits March 10, 2026 16:54
…just_detector_pixel_pitch()

*The added functions work exactly on the way as the previously added _mk_adjust_scan_pixel_pitch()
*_mk_adjust_scan_rotation() does not use rotate(), but depends only on sympy solution of the equation
*Due to type issues it stops at scale_rotate_flip() in params method: the values of the angles become too inaccurate to be compared correctly
Lambdify function that can accept any Jax-compatble trees to specify inputs and outputs.

Different from the sympy lambdify, this lambdifies a function.
Include postfix
...and don't allow generating symbols for unknown types,
instead restrict to numeric types
* Normalize function arguments
* Generate defaults if inputs are not supplied
* TODO integrate in main source, started with not calling function but using supplied result
  in sympy interface part
* Convenient decorator
Work with David: multivariative taylor expansion implementation and Lens and propagate functions test to work with sympy
@uellue
Copy link
Copy Markdown
Owner

uellue commented Mar 26, 2026

Keeping this open for now, will likely close at some point as soon as we are sure everything is migrated to https://github.com/uellue/Microscope-Calibration/tree/sympysimplify and TemGym.

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.

2 participants