2021-11-08 16:00:50 +0200 | marked best answer | Use expression.find with SR.wild in python scripts I want to detect polynomials of the form Found this helpful piece of code that works perfectly in sage's jupyter notebook: However, when I throw this into a Minimal Failing Example: What am I missing? |
2021-10-27 16:21:11 +0200 | asked a question | Use expression.find with SR.wild in python scripts Use expression.find with SR.wild in python scripts I want to detect polynomials of the form x^n + m in a python script. |
2021-02-24 15:00:45 +0200 | received badge | ● Supporter (source) |
2021-02-24 15:00:36 +0200 | received badge | ● Scholar (source) |
2021-02-01 20:52:04 +0200 | received badge | ● Student (source) |
2021-02-01 13:22:06 +0200 | received badge | ● Editor (source) |
2021-02-01 11:17:11 +0200 | asked a question | Use vector as variable for diff but as values for calculation I am implementing the Squared Exponential kernel in SageMath, for now let's say it's defined as follows: $f(x_i,x_k)=σ^2 \exp\left(−\frac{1}{2 \ell^2} \sum_{j=1}^q (x_{i,j} − x_{k,j})^2 \right)$ With $x_i$ and $x_k$ vectors of variable, but equal, length, $\sigma$ and $l$ constant. (In the future $l$ might be vector valued as well, I hope this can be handled then). The function $f$ must be differentiable in $x_i$ and $x_k$ (not its entries!). But what I actually want is this: So that, hopefully, I can do Is there any obvious method I have missed, or is it not implemented in sage yet? -> If there is no such method, what would be good starting points for me to implement that myself? Notes: For later processing I need the function to be a differentiable SageMath expression instead of e.g. a Python-function call. Further, it would be great (but not 100% required) to pass variable length vectors to $f$ instead of specifying the length beforehand. |