That's right. This, or equivalently, `conda install -c conda-forge symjit` should work on Windows, Linux, and MacOS. Even `python -m pip install symjit` may work, but the conda route is preferable. However, there are always corner cases. Please let me know if you have any problems.
It has three main exported functions: `compile_func` is similar to lambdify. `compile_ode` and `compile_jac` generate functions to pass to scipy ODE solvers. -- Shahriar On Sat, Apr 12, 2025 at 1:24 AM <[email protected]> wrote: > Dear Shahriar, > > > > If I understand correctly, symjit is similar to sympy.lambdify(….) but > faster? > > > > I found this on Anaconda’s website: > > So I could install like this and it will install the dependencies? I have > windows. > > > > Thanks a lot! > > > > Peter > > *From:* [email protected] <[email protected]> *On Behalf Of > *Shahriar > Iravanian > *Sent:* Friday, April 11, 2025 9:49 PM > *To:* [email protected] > *Subject:* Re: [sympy] symjit > > > > The latest version of symjit (1.5.0) has just been published. By now, the > Rust backend is stabilized and generates code on Linus/Darwin/Windows and > x86-64 and arm64 machines. > > > > Symjit also has a new plain Python-based backend, which depends only on > the Python standard library and numpy (the numpy dependency is not strictly > necessary) but can generate and run machine code routines. Currently, the > Python backend is used as a backup in cases where the compiled Rust code is > unavailable. However, it already works very well with a minimum > performance drop compared to the Rust backend. > > > > I would like to have your suggestions and recommendations about the next > steps. I hope to add features that align with the maintainers' goals for > sympy. Some possibilities: > > > > 1. Expanding on the current focus on numerical computation and > numpy/scipy/matplotlib inter-operability, for example, adding other data > types besides double (single floats, complex numbers...). > > > > 2. Fast polynomial evaluation, not only for floating point types, but also > over Z, Zp, and Q. The Python-only backend can be tightly coupled to the > polynomial subsystem. However, I don't know how useful having such a fast > polynomial evaluation function is, but, for example, it may be useful in > the combinatorial phase of the Zassenhaus algorithm. On the other hand, it > seems that sympy pivots toward using Flint for many such computations. > > > > 3. A different area would be the Satisfiability module, where writing fast > SAT/SMT solver, with or without interfacing with Z3 or other solvers, is > possible. > > > > Thanks, > > > > Shahriar Iravanian > > > > > > > > > On Thu, Feb 20, 2025 at 10:54 PM Jason Moore <[email protected]> wrote: > > Dear Shahrari, > > > > We have already debugged everything and merged the PR to conda forge: > > > > https://github.com/conda-forge/staged-recipes/pull/29211 > > > > You can install symjit with: > > > > conda install -c conda-forge symjit > > > > Enjoy! > > > > Jason > > moorepants.info > +01 530-601-9791 > > > > > > On Fri, Feb 21, 2025 at 1:24 AM Shahriar Iravanian <[email protected]> > wrote: > > Hi Jason, > > > > Thanks for your help. I got conda-forge working. You can install symjit on > Windows and Linux (Mac will be coming soon). > > > > Here is the meta.yaml that works: > > > > ``` > > {% set name = "symjit" %} > {% set version = "1.2.1" %} > > package: > name: {{ name|lower }} > version: {{ version }} > > source: > url: https://pypi.org/packages/source/{{ name[0] }}/{{ name > }}/symjit-{{ version }}.tar.gz > sha256: 8398ceb11d557c5b5bdce4e7d358b741d2d5278d1e374588f5bd6bbb5a581ebd > > build: > noarch: python > script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation > number: 0 > > requirements: > build: > - {{ compiler('rust') }} > - {{ compiler('c') }} > - {{ stdlib('c') }} > host: > - python >=3.7 > - setuptools > - setuptools-rust > - pip > run: > - python >=3.7 > - numpy > - sympy > - libgcc > > test: > imports: > - symjit > commands: > - pip check > requires: > - pip > > about: > home: https://github.com/siravan/symjit > summary: a light-weight jit for sympy expressions > license: MIT > license_file: LICENSE > > extra: > recipe-maintainers: > - shahriariravanian > > ``` > > > > On Thu, Feb 20, 2025 at 10:35 AM Jason Moore <[email protected]> wrote: > > Hi, > > > > The way conda forge works is that it starts from a source distribution and > compiles the code using their toolchain (they have a rust toolchain). This > generates conda binaries, not wheels. > > > > So, to get it to build there on conda forge we have to debug any Rust > compilation or Rust->Setuptools/python issues. Right now, it is not > compiling for Linux or Mac and it does compile on Windows, but it doesn't > seem to run the test file. So something is not quite right. If you have > tips to fix the build issues, you can post to that PR and we can eventually > get it built for distribution on conda forge. > > > > Jason > > moorepants.info > +01 530-601-9791 > > > > > > On Thu, Feb 20, 2025 at 3:21 PM Shahriar Iravanian <[email protected]> > wrote: > > Hi, > > > > I’m using setuptools. I should try conda next. > > > > Currently, it comes with binaries for Windows, linux x86-64 (built on > ubuntu), and raspbian linux (aarch64). No Mac yet. I will try to compile it > on a Mac. > > > > In the long run, it might be easier to rewrite it in pure python with > hardware dependencies confined to the mmap module. > > > > Shahriar > > > > > > > > > > > > On Thu, Feb 20, 2025 at 7:50 AM Jason Moore <[email protected]> wrote: > > Dear Shahriar, > > > > I opened a PR to package symjit for conda here: > https://github.com/conda-forge/staged-recipes/pull/29211 > > > > I've never tried building any rust packages. There are a couple issues, > but maybe it has to do with conda-forge. I'm not sure. If you have any tips > you can comment there. > > > > I much prefer the name "compile_func" over lambdify. > > > > Jason > > moorepants.info > +01 530-601-9791 > > > > > > On Thu, Feb 20, 2025 at 12:48 PM Shahriar Iravanian < > [email protected]> wrote: > > Thanks a lot. Yes, I meant https://www.sympy.org/en/index.html. I will > send a PR. > > > > Regarding the name, I was thinking about a variation of lambdify but > couldn't come up with one, so I went with compile_func. > > > > -- Shahriar > > > > On Wed, Feb 19, 2025 at 11:05 PM Jason Moore <[email protected]> wrote: > > Yes, this looks interesting, especially that you choose a sane function > name "compile_func". We should have named lambdify that. > > > > Jason > > moorepants.info > +01 530-601-9791 > > > > > > On Wed, Feb 19, 2025 at 11:41 PM Oscar Benjamin < > [email protected]> wrote: > > Hi Shahriar, > > The symjit package sounds very interesting. I will have to take a look at > it. > > I'm not sure what the list of packages you are referring to is. > Presumably a PR to the website can add this? > > https://github.com/sympy/sympy.github.com > > Oscar > > On Wed, 19 Feb 2025 at 22:14, Shahriar Iravanian <[email protected]> > wrote: > > > > Could you please add symjit (https://github.com/siravan/symjit) to the > list of SymPy projects? > > > > Symjit is a lightweight just-in-time (JIT) compiler that directly > translates basic sympy expressions into x86-64 and aarch64 machine codes > (and, optionally, to WebAssembly). Currently, its main utility is to > generate fast numerical functions to feed into different numerical solvers > (quadrature, ode solvers...). It has minimum dependency on external > libraries and does not use a separate compiler, such as LLVM. It also works > very well in the REPL environment. > > > > In addition, if anyone is interested in collaborating to improve and > extend it, please contact me. There are many possibilities for future > works, such as adding modular arithmetic for fast polynomial computations, > adding complex numbers, SIMD instructions, and other instruction sets. > > > > Thanks, > > > > -- Shahriar > > > > -- > > You received this message because you are subscribed to the Google > Groups "sympy" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected]. > > To view this discussion visit > https://groups.google.com/d/msgid/sympy/7468597d-a73a-4aa6-ae0c-c0dd04105cb5n%40googlegroups.com > . > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/sympy/CAHVvXxSYPmF-OkevB3Xz%2BqDYQ04XP9TcYiqdnxNBXguDJrxWMA%40mail.gmail.com > . > > -- > You received this message because you are subscribed to a topic in the > Google Groups "sympy" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sympy/TBGpgEYtnWw/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/sympy/CAP7f1AgM_3x0yi0oc7EvXy0us5moRWHqV6L5T9jRiFTmAiPmVQ%40mail.gmail.com > <https://groups.google.com/d/msgid/sympy/CAP7f1AgM_3x0yi0oc7EvXy0us5moRWHqV6L5T9jRiFTmAiPmVQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > > To view this discussion visit > https://groups.google.com/d/msgid/sympy/CABEBXTbWzaEK%3DfZHEvzMPxWUsWfjHpgJmu-zChv_F9KzEXSiWQ%40mail.gmail.com > <https://groups.google.com/d/msgid/sympy/CABEBXTbWzaEK%3DfZHEvzMPxWUsWfjHpgJmu-zChv_F9KzEXSiWQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to a topic in the > Google Groups "sympy" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sympy/TBGpgEYtnWw/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/sympy/CAP7f1Aj%3DmVXjzsBgAmMYTxKtDhUnpsKFDrFBK%3DbbjWUQq81Szg%40mail.gmail.com > <https://groups.google.com/d/msgid/sympy/CAP7f1Aj%3DmVXjzsBgAmMYTxKtDhUnpsKFDrFBK%3DbbjWUQq81Szg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/sympy/CABEBXTYFckqvBhiNM-_7zzta5pesqRJVLgSUBTNTX57skCzw0A%40mail.gmail.com > <https://groups.google.com/d/msgid/sympy/CABEBXTYFckqvBhiNM-_7zzta5pesqRJVLgSUBTNTX57skCzw0A%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to a topic in the > Google Groups "sympy" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sympy/TBGpgEYtnWw/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/sympy/CAP7f1AjVCwUV7jWwSLZW8NQr0uCPBrdDshDfMCtoT5e1wnYzDQ%40mail.gmail.com > <https://groups.google.com/d/msgid/sympy/CAP7f1AjVCwUV7jWwSLZW8NQr0uCPBrdDshDfMCtoT5e1wnYzDQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/sympy/CABEBXTZZeqR1Sm_8n2wQ-e_498ATUWdKOk%3DHveRCvf85wjkZhw%40mail.gmail.com > <https://groups.google.com/d/msgid/sympy/CABEBXTZZeqR1Sm_8n2wQ-e_498ATUWdKOk%3DHveRCvf85wjkZhw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to a topic in the > Google Groups "sympy" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sympy/TBGpgEYtnWw/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/sympy/CAP7f1AgBRGPgGk%3DMQ57FE7MiPRmurH2zcCaVcry-72QrRDdbdA%40mail.gmail.com > <https://groups.google.com/d/msgid/sympy/CAP7f1AgBRGPgGk%3DMQ57FE7MiPRmurH2zcCaVcry-72QrRDdbdA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/sympy/CABEBXTbrbNhHLM1ttQ31ighR4qdyOwYhAFbRX8s6Pm%3D%2BfPD%2Bew%40mail.gmail.com > <https://groups.google.com/d/msgid/sympy/CABEBXTbrbNhHLM1ttQ31ighR4qdyOwYhAFbRX8s6Pm%3D%2BfPD%2Bew%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to a topic in the > Google Groups "sympy" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sympy/TBGpgEYtnWw/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/sympy/000701dbab6b%241b293f60%24517bbe20%24%40gmail.com > <https://groups.google.com/d/msgid/sympy/000701dbab6b%241b293f60%24517bbe20%24%40gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/sympy/CABEBXTaWt5xxnvLBPt-vR2Xz0KHyXF%3DLh%2BFrVZyyFLcCf2ihFw%40mail.gmail.com.
