Ask Your Question

21er33's profile - activity

2020-05-05 17:16:33 +0200 received badge  Scholar (source)
2020-05-05 17:16:26 +0200 commented answer update package scipy

sorry, I should have edited my comment, I hadn't restarted sage (maybe...), but it seems to work,

sage: import scipy
sage: scipy.__version__
'1.4.1'

Thanks!

2020-05-05 16:15:22 +0200 commented answer update package scipy

I did this, but sage still gives (and I checked if it was using the newer features of simpy, which is not):

sage: from sage.misc.package import list_packages, installed_packages
sage: installed_packages()['scipy']
'1.2.0'

although:

$ sage -pip show scipy
Name: scipy
Version: 1.4.1
Summary: SciPy: Scientific Library for Python
Home-page: https://www.scipy.org
Author: None
Author-email: None
License: BSD
Location: /home/user/programs/SageMath/local/lib/python3.7/site-packages
Requires: numpy
Required-by:
2020-05-05 13:39:38 +0200 asked a question update package scipy

Hi! I would like to update the scipy package used by sage. It uses 1.2 while I would like to use 1.4 (which I have on my system, but don't mind installing in sage's python toolchain).

Is this possible? Thanks

2020-05-03 21:25:52 +0200 received badge  Student (source)
2020-05-02 18:57:42 +0200 commented question minimization without constraints gives error for multiple dimension

is there a way to use sum([x,y]) for x=var('x')?, with x and y in R^5

2020-05-02 18:33:07 +0200 commented question minimization without constraints gives error for multiple dimension

you are right, it should have been as below, and then x domain is now the one I want

sage: y = random_vector(RR, 5)
sage: f = lambda x : y.dot_product(x)**4
sage: g = lambda x : 4*y*y.dot_product(x)**3
sage: x = random_vector(RR,5)
sage: minimize(f, x, gradient=g)

thanks, I'll try again like so

2020-05-02 18:19:26 +0200 received badge  Editor (source)
2020-05-02 18:13:49 +0200 commented answer minimization without constraints gives error for multiple dimension

I saw the documentation, yes. But my example above should also work, and I think I'm still able to compute gradents by hand. Even if there is an error I don't think it's the one being yielded by sage. Moreover, it should work for a function that is not symbolic.

2020-05-02 14:20:45 +0200 asked a question minimization without constraints gives error for multiple dimension

I'm trying to use minimize(func, x0, gradient=None, hessian=None, algorithm='default', verbose=False, **args) given the gradient function. But I'm getting the following error:

sage: f = lambda x : (x*y)**4
sage: g = lambda x : 4*y*(x*y)**3
sage: y = random_vector(RR, 5)
sage: x = random_vector(RR,5)
sage: minimize(f, x, gradient=g)

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

What am I doing wrong? the gradient return a vector (correctly so). Shouldn't this work?