Opened 2 years ago

Last modified 3 months ago

#29235 new enhancement

Make fast_callable accept NumPy arrays

Reported by: vdelecroix Owned by:
Priority: major Milestone: sage-9.7
Component: numerical Keywords:
Cc: mjo, mkoeppe, slelievre, gh-mwageringel Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by vdelecroix)

This ticket stands for allowing numpy arrays (over float/complex) in fast callable (over float/RDF/complex/CDF). Namely, the following should work

sage: import numpy as np
sage: f(x) = cos(x) * sin(x)
sage: g = fast_callable(f, vars=[x], domain=float)
sage: g(np.array([1,2,3]))
array([ 0.45464871, -0.37840125, -0.13970775])
sage: g(np.array([[1,2], [3,4]]))
[[0.4546487134128409, -0.37840124765396416],
 [-0.13970774909946293, 0.4946791233116909]]

There is also the question whether there should be a dedicated numpy interpreter as numpy has a huge database of optimized functions: see ufuncs numpy-1.17.0 reference.

See also #29236

Change History (12)

comment:1 Changed 2 years ago by vdelecroix

  • Authors set to Vincent Delecroix
  • Description modified (diff)

comment:2 Changed 2 years ago by vdelecroix

  • Authors Vincent Delecroix deleted
  • Description modified (diff)

comment:3 Changed 2 years ago by vdelecroix

  • Description modified (diff)

comment:4 Changed 2 years ago by mkoeppe

  • Milestone changed from sage-9.1 to sage-9.2

Batch modifying tickets that will likely not be ready for 9.1, based on a review of the ticket title, branch/review status, and last modification date.

comment:5 Changed 22 months ago by mkoeppe

  • Milestone changed from sage-9.2 to sage-9.3

comment:6 Changed 17 months ago by mkoeppe

  • Milestone changed from sage-9.3 to sage-9.4

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

comment:7 Changed 11 months ago by mkoeppe

  • Milestone changed from sage-9.4 to sage-9.5

comment:8 Changed 11 months ago by mkoeppe

  • Cc mjo added

comment:9 Changed 11 months ago by slelievre

  • Cc mkoeppe slelievre added
  • Summary changed from Make fast callable accepts numpy arrays to Make fast_callable accept NumPy arrays

comment:10 Changed 6 months ago by mkoeppe

  • Milestone changed from sage-9.5 to sage-9.6

comment:11 Changed 4 months ago by gh-mwageringel

  • Cc gh-mwageringel added

comment:12 Changed 3 months ago by mkoeppe

  • Milestone changed from sage-9.6 to sage-9.7
Note: See TracTickets for help on using tickets.