jax-ml / jax-ml/jax

Using `lpmn_values` for Legendre polynomials.

Open
#14,101 8 comments 1 reaction 0 assignees View on GitHub
contributions welcome enhancement
Dominant language
Python
Stars
36.3k
Forks
3.8k
Avg merge
1d 6h
Merged PRs (30d)
399

Description

I have been looking for a function that does something similar to that of scipy's `scipy.special.eval_legendre` function. I dont know the math well but I have been told that the function that is supported by jax `jax.scipy.special.lpmn_values` would be a good use by making the function's parameter `m=0` and this solves for the polynomial.

[Legendre function Wiki Page](https://en.wikipedia.org/wiki/Legendre_function)
> The polynomial solutions when λ is an integer (denoted n), and μ = 0 are the Legendre polynomials Pn;

However I found that when I looked at the source code:

Found [Here](https://jax.readthedocs.io/en/latest/_modules/jax/_src/scipy/special.html#lpmn_values)
```python
if m != n:
raise NotImplementedError('Computations for m!=n are not yet supported.')
```
It would be really great to be able to solve for the Legendre polynomial. I dont know the math well enough (yet) to implement this myself so im hoping a more experienced person might be able to help.

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked JAX lpmn_values source and comparing its behavior with scipy.special.eval_legendre for m=0. Confirm the intended Legendre-polynomial cases and expected numerical behavior before deciding what implementation and tests are needed; done means the requested m=0 use case is supported and validated.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.