Re: [sage-support] smith form may be too slow

2023-12-13 Thread Enrique Artal
Sure, any field is a PID but it is not the targe of a Smith form :)
This question came from an actual computation of a colleague where the 
direct approach is taking days and hermite+smith is very fast, and could be 
useful for any one variable ring. Any way,  I agree with you that maybe a 
Summer of Code is a good idea. Until this, a small PR could be helpful?

El jueves, 14 de diciembre de 2023 a las 6:37:29 UTC+1, Nils Bruin escribió:

> (side note: Q is generally considered a PID, but indeed it makes little 
> sense worrying about Smith normal form over it)
>
> Concerning the slow performance: from the documentation, 
> R._matrix_smith_form would allow an optimized routine to kick in. That 
> doesn't exist, though. 
> ZZ doesn't have it either, but there is a whole different class for that 
> in sage/matrix/matrix_integer_dense.pyx that provides a specific-for-ZZ 
> smith form algorithm. For QQ['t'] you end up with the generic algorithm, 
> which is liable to be inefficient and have quirks such having large 
> variations in runtime, depending on the specific input.
>
> So: it makes sense it's not very optimal (yet?). It would require work to 
> get a better implementation specific for QQ['t']. This could be worthwhile 
> to do well. Summer of Code?
>
>
> On Thursday 14 December 2023 at 04:05:47 UTC+13 Enrique Artal wrote:
>
>> It is over the ring of polynomials in one variable over Q.
>>
>> El miércoles, 13 de diciembre de 2023 a las 15:05:00 UTC+1, Dima 
>> Pasechnik escribió:
>>
>>> On Wed, Dec 13, 2023 at 10:55 AM Enrique Artal  
>>> wrote: 
>>> > 
>>> > I have the toy example belowto compare the direct use of smith_form 
>>> and the combination of hermite_form and smith_form. 
>>> > 
>>> > Last execution (there are random inputs) gave: 
>>> > CPU times: user 2.22 s, sys: 5.93 ms, total: 2.23 s Wall time: 2.23 s 
>>> CPU times: user 454 ms, sys: 990 µs, total: 455 ms Wall time: 456 ms 
>>> > 
>>> > % 
>>> > R. = QQ[] 
>>> > n = 3 
>>> > m = 5 
>>> > ds = (n, m) 
>>> > M = MatrixSpace(R, n, m) 
>>> > V = random_vector(R, n) 
>>> > A0 = Matrix(R, n, m) 
>>> > A0[0, 0] = R.random_element() 
>>> > for j in range(1, n): 
>>> > A0[j, j] = A0[j -1, j - 1] * R.random_element() 
>>> > def par(n): 
>>> > i1 = ZZ.random_element(0,n) 
>>> > j1 = i1 
>>> > while j1 == i1: 
>>> > j1 = ZZ.random_element(0,n) 
>>> > return (i1, j1) 
>>> > def smith_hermite(A): 
>>> > D1, U1 = A.hermite_form(transformation=True) 
>>> > D, U2, V = D1.smith_form() 
>>> > U = U2 * U1 
>>> > return D, U, V 
>>> > P = {j: identity_matrix(R, ds[j]) for j in range(2)} 
>>> > s = 20 
>>> > for k in range(2): 
>>> > for a in range(s): 
>>> > i, j = par(n) 
>>> > f = R.random_element() 
>>> > P[k].add_multiple_of_row(i, j ,f) 
>>> > i, j = par(n) 
>>> > P[k].swap_rows(i, j) 
>>> > i, j = par(n) 
>>> > f = R.random_element() 
>>> > P[k].add_multiple_of_column(i, j ,f) 
>>> > i, j = par(n) 
>>> > P[0].swap_columns(i, j) 
>>> > A = P[0] * A0 * P[1] 
>>> > %time D, U, V = A.smith_form() 
>>> > %time D1, U1, V1 = smith_hermite(A) 
>>>
>>> hmm, what's Smith form of a matrix over Q ? 
>>> Q is not a PID. 
>>> > 
>>> > -- 
>>> > You received this message because you are subscribed to the Google 
>>> Groups "sage-support" group. 
>>> > To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to sage-support...@googlegroups.com. 
>>> > To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/sage-support/dec24250-3a00-4c3e-a2e6-e352cde6ff2bn%40googlegroups.com.
>>>  
>>>
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/64db95b0-6db8-44eb-93ab-ff5ff4c5570dn%40googlegroups.com.


Re: [sage-support] smith form may be too slow

2023-12-13 Thread Enrique Artal
It is over the ring of polynomials in one variable over Q.

El miércoles, 13 de diciembre de 2023 a las 15:05:00 UTC+1, Dima Pasechnik 
escribió:

> On Wed, Dec 13, 2023 at 10:55 AM Enrique Artal  
> wrote:
> >
> > I have the toy example belowto compare the direct use of smith_form and 
> the combination of hermite_form and smith_form.
> >
> > Last execution (there are random inputs) gave:
> > CPU times: user 2.22 s, sys: 5.93 ms, total: 2.23 s Wall time: 2.23 s 
> CPU times: user 454 ms, sys: 990 µs, total: 455 ms Wall time: 456 ms
> >
> > %
> > R. = QQ[]
> > n = 3
> > m = 5
> > ds = (n, m)
> > M = MatrixSpace(R, n, m)
> > V = random_vector(R, n)
> > A0 = Matrix(R, n, m)
> > A0[0, 0] = R.random_element()
> > for j in range(1, n):
> > A0[j, j] = A0[j -1, j - 1] * R.random_element()
> > def par(n):
> > i1 = ZZ.random_element(0,n)
> > j1 = i1
> > while j1 == i1:
> > j1 = ZZ.random_element(0,n)
> > return (i1, j1)
> > def smith_hermite(A):
> > D1, U1 = A.hermite_form(transformation=True)
> > D, U2, V = D1.smith_form()
> > U = U2 * U1
> > return D, U, V
> > P = {j: identity_matrix(R, ds[j]) for j in range(2)}
> > s = 20
> > for k in range(2):
> > for a in range(s):
> > i, j = par(n)
> > f = R.random_element()
> > P[k].add_multiple_of_row(i, j ,f)
> > i, j = par(n)
> > P[k].swap_rows(i, j)
> > i, j = par(n)
> > f = R.random_element()
> > P[k].add_multiple_of_column(i, j ,f)
> > i, j = par(n)
> > P[0].swap_columns(i, j)
> > A = P[0] * A0 * P[1]
> > %time D, U, V = A.smith_form()
> > %time D1, U1, V1 = smith_hermite(A)
>
> hmm, what's Smith form of a matrix over Q ?
> Q is not a PID.
> >
> > --
> > You received this message because you are subscribed to the Google 
> Groups "sage-support" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to sage-support...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/dec24250-3a00-4c3e-a2e6-e352cde6ff2bn%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/87a33d6e-b0e5-4dbf-9b53-30c0535f7f53n%40googlegroups.com.


[sage-support] smith form may be too slow

2023-12-13 Thread Enrique Artal
I have the toy example  belowto compare the direct use of smith_form and 
the combination of hermite_form and smith_form.

Last execution (there are random inputs) gave:
CPU times: user 2.22 s, sys: 5.93 ms, total: 2.23 s Wall time: 2.23 s CPU 
times: user 454 ms, sys: 990 µs, total: 455 ms Wall time: 456 ms

%
R. = QQ[]
n = 3
m = 5
ds = (n, m)
M = MatrixSpace(R, n, m)
V = random_vector(R, n)
A0 = Matrix(R, n, m)
A0[0, 0] = R.random_element()
for j in range(1, n):
A0[j, j] = A0[j -1, j - 1] * R.random_element()
def par(n):
i1 = ZZ.random_element(0,n)
j1 = i1
while j1 == i1:
j1 = ZZ.random_element(0,n)
return (i1, j1)
def smith_hermite(A):
D1, U1 = A.hermite_form(transformation=True)
D, U2, V = D1.smith_form()
U = U2 * U1  
return D, U, V
P = {j: identity_matrix(R, ds[j]) for j in range(2)}
s = 20
for k in range(2):
for a in range(s):
i, j = par(n)
f = R.random_element()
P[k].add_multiple_of_row(i, j ,f)
i, j = par(n)
P[k].swap_rows(i, j)
i, j = par(n)
f = R.random_element()
P[k].add_multiple_of_column(i, j ,f)
i, j = par(n)
P[0].swap_columns(i, j)
A = P[0] * A0 * P[1]
%time D, U, V = A.smith_form()
%time D1, U1, V1 = smith_hermite(A)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/dec24250-3a00-4c3e-a2e6-e352cde6ff2bn%40googlegroups.com.


[sage-support] bug ih hom?

2020-12-22 Thread Enrique Artal
I am running sage in Fedora 33, x86_64 sage 9.3beta4 (though the bug 
appears also in ubuntu sage 9.1). This is a toy example:

K=GF(2)
V=K^2
B=V.basis()
B1=[vector(K,[i,j]) for i,j in [(1,0),(1,1)]] 
V1=V.subspace_with_basis(B1)

I considere a vector space V of dimension 2 over the field of two elements 
with two distinct bases. The following define linear maps using hom:

a=V.hom(B,V)
b=V.hom(B1,V)
c=V1.hom(B,V)
d=V1.hom(B1,V)

The output of [a==k for k in (a,b,c,d)] is [True, False, True, False] and 
as it should be the output all([a(v)==c(v) for v in V]) is False and the 
output of all([a(v)==d(v) for v in V]) is True.

It seems it checks the equality of the lists of images and not the equality 
of the maps (a and d are the identity and not b and c).

Best, Enrique.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/e9185b94-c6a0-44a2-8afd-84e3bc63cbe2n%40googlegroups.com.


[sage-support] Re: optional packages and binder

2019-11-01 Thread Enrique Artal
Thanks for the help to Alexander and Vincent. It works now (branch sage); I 
have no excuses to avoid to add more comments to the notebook. Best, 
Enrique.

El sábado, 2 de noviembre de 2019, 0:53:19 (UTC+1), Enrique Artal escribió:
>
> Yes:
> https://github.com/enriqueartal/GuervilleViuZariskiPairs
>
> Thanks for the link, I am going to try. Best wishes, Enrique.
>
>
> El viernes, 1 de noviembre de 2019, 21:39:19 (UTC+1), Alexander Konovalov 
> escribió:
>>
>> This is an example by Nicolas M. Thiéry which worked earlier this week: 
>> https://github.com/OpenDreamKit/demo-semigroup-representation-theory/blob/master/Dockerfile
>>  
>>
>> Hope it may help. Is your setup somewhere on GitHub?
>>
>> Best wishes
>> Alex
>>
>> On Tuesday, October 29, 2019 at 12:13:34 PM UTC, Enrique Artal wrote:
>>>
>>> I want to make available some of my notebooks in binder. I found very 
>>> useful sage-binder-env but I ran into problems in a case where I needed an 
>>> optional package, namely gap_packages. As stated I installed make package 
>>> using the Dockerfile but the installation stops with an error in make 
>>> all-toolchain. I guess I need to install more packages but I do not know 
>>> which ones. Best regards, Enrique.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/6ed5a3f5-9fdf-460a-bbcc-a9b1f6427169%40googlegroups.com.


[sage-support] Re: optional packages and binder

2019-11-01 Thread Enrique Artal
Yes:
https://github.com/enriqueartal/GuervilleViuZariskiPairs

Thanks for the link, I am going to try. Best wishes, Enrique.


El viernes, 1 de noviembre de 2019, 21:39:19 (UTC+1), Alexander Konovalov 
escribió:
>
> This is an example by Nicolas M. Thiéry which worked earlier this week: 
> https://github.com/OpenDreamKit/demo-semigroup-representation-theory/blob/master/Dockerfile
>  
>
> Hope it may help. Is your setup somewhere on GitHub?
>
> Best wishes
> Alex
>
> On Tuesday, October 29, 2019 at 12:13:34 PM UTC, Enrique Artal wrote:
>>
>> I want to make available some of my notebooks in binder. I found very 
>> useful sage-binder-env but I ran into problems in a case where I needed an 
>> optional package, namely gap_packages. As stated I installed make package 
>> using the Dockerfile but the installation stops with an error in make 
>> all-toolchain. I guess I need to install more packages but I do not know 
>> which ones. Best regards, Enrique.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/681ba696-b0c6-45c6-82fb-edb96243f71f%40googlegroups.com.


Re: [sage-support] optional packages and binder

2019-10-31 Thread Enrique Artal
Thanks for the type. It built the image (including gap_packages) but when 
pushing it to binder it failed because a wrong checksum of "
usr/lib64/perl5/vendor_perl/Unicode/Collate/Locale/kok.pl"

El miércoles, 30 de octubre de 2019, 17:23:01 (UTC+1), vdelecroix escribió:
>
> Estimado Enrique, 
>
> If you want to compile anything, you should be using development 
> docker image, that is 
>
> sagemath/sagemath-dev 
>
> (you can tag if 8.8 if you wish). Be careful that the image is 
> twice bigger. See the documentation at 
>
>  https://hub.docker.com/u/sagemath/sagemath 
>
> Vincent 
>
> Le 30/10/2019 à 09:11, Enrique Artal a écrit : 
> > Cher Vincent, 
> > 
> > I hope to add now enough additional info. I am using mybinder.org (I 
> did 
> > not find another address); my Dockerfile is adapted from a file in 
> > sage-binder-env: 
> > 
> > FROM sagemath/sagemath:8.8 
> > USER root 
> > RUN apt-get -qq update \ 
> > && apt-get -qq install -y --no-install-recommends gcc build-essential 
> make \ 
> > && apt-get -qq clean 
> > USER sage 
> > RUN sage -i gap_packages 
> > # Make sure the contents of the repository is in ${HOME} 
> > COPY --chown=sage:sage . ${HOME} In the original file the version was 
> 8.6; 
> > 8.9 did not work. The whole log is: 
> > 
> > Waiting for build to start... 
> > Picked Git content provider. 
> > Cloning into '/tmp/repo2dockerarcwd43e'... 
> > HEAD is now at a95a550 Update Dockerfile 
> > Using DockerBuildPack builder 
> > Step 1/6 : FROM sagemath/sagemath:8.8 
> >   ---> 8826a965812be... 
> > Step 2/6 : USER root 
> >   ---> Running in 5de1f0b3cfbb 
> > Removing intermediate container 5de1f0b3cfbb 
> >   ---> c39c95bbdcff 
> > Step 3/6 : RUN apt-get -qq update  && apt-get -qq install -y 
> > --no-install-recommends gcc build-essential make  && apt-get -qq clean 
> >   ---> Running in fe5e1e365ff8 
> > debconf: delaying package configuration, since apt-utils is not 
> installed 
> > Selecting previously unselected package libgdbm3:amd64. 
> > (Reading database ... 7609 files and directories currently installed.) 
> > Preparing to unpack .../libgdbm3_1.8.3-13.1_amd64.deb ... 
> > Unpacking libgdbm3:amd64 (1.8.3-13.1) ... 
> > Selecting previously unselected package perl-modules-5.22. 
> > Preparing to unpack .../perl-modules-5.22_5.22.1-9ubuntu0.6_all.deb ... 
> > Unpacking perl-modules-5.22 (5.22.1-9ubuntu0.6) ... 
> > Preparing to unpack .../libbz2-1.0_1.0.6-8ubuntu0.2_amd64.deb ... 
> > Unpacking libbz2-1.0:amd64 (1.0.6-8ubuntu0.2) over (1.0.6-8) ... 
> > Processing triggers for libc-bin (2.23-0ubuntu11) ... 
> > Setting up libbz2-1.0:amd64 (1.0.6-8ubuntu0.2) ... 
> > Processing triggers for libc-bin (2.23-0ubuntu11) ... 
> > Selecting previously unselected package libperl5.22:amd64. 
> > (Reading database ... 8846 files and directories currently installed.) 
> > Preparing to unpack .../libperl5.22_5.22.1-9ubuntu0.6_amd64.deb ... 
> > Unpacking libperl5.22:amd64 (5.22.1-9ubuntu0.6) ... 
> > Selecting previously unselected package perl. 
> > Preparing to unpack .../perl_5.22.1-9ubuntu0.6_amd64.deb ... 
> > Unpacking perl (5.22.1-9ubuntu0.6) ... 
> > Selecting previously unselected package bzip2. 
> > Preparing to unpack .../bzip2_1.0.6-8ubuntu0.2_amd64.deb ... 
> > Unpacking bzip2 (1.0.6-8ubuntu0.2) ... 
> > Selecting previously unselected package make. 
> > Preparing to unpack .../archives/make_4.1-6_amd64.deb ... 
> > Unpacking make (4.1-6) ... 
> > Selecting previously unselected package libdpkg-perl. 
> > Preparing to unpack .../libdpkg-perl_1.18.4ubuntu1.6_all.deb ... 
> > Unpacking libdpkg-perl (1.18.4ubuntu1.6) ... 
> > Selecting previously unselected package xz-utils. 
> > Preparing to unpack .../xz-utils_5.1.1alpha+20120614-2ubuntu2_amd64.deb 
> ... 
> > Unpacking xz-utils (5.1.1alpha+20120614-2ubuntu2) ... 
> > Selecting previously unselected package patch. 
> > Preparing to unpack .../patch_2.7.5-1ubuntu0.16.04.2_amd64.deb ... 
> > Unpacking patch (2.7.5-1ubuntu0.16.04.2) ... 
> > Selecting previously unselected package dpkg-dev. 
> > Preparing to unpack .../dpkg-dev_1.18.4ubuntu1.6_all.deb ... 
> > Unpacking dpkg-dev (1.18.4ubuntu1.6) ... 
> > Selecting previously unselected package build-essential. 
> > Preparing to unpack .../build-essential_12.1ubuntu2_amd64.deb ... 
> > Unpacking build-essential (12.1ubuntu2) ... 
> > Setting up libgdbm3:amd64 (1.8.3-13.1) ... 
> > Setting up perl-mod

Re: [sage-support] optional packages and binder

2019-10-30 Thread Enrique Artal
Cher Vincent,

I hope to add now enough additional info. I am using mybinder.org (I did 
not find another address); my Dockerfile is adapted from a file in 
sage-binder-env: 

FROM sagemath/sagemath:8.8
USER root
RUN apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends gcc build-essential make \
&& apt-get -qq clean
USER sage
RUN sage -i gap_packages
# Make sure the contents of the repository is in ${HOME}
COPY --chown=sage:sage . ${HOME} In the original file the version was 8.6; 
8.9 did not work. The whole log is:

Waiting for build to start...
Picked Git content provider.
Cloning into '/tmp/repo2dockerarcwd43e'...
HEAD is now at a95a550 Update Dockerfile
Using DockerBuildPack builder
Step 1/6 : FROM sagemath/sagemath:8.8
 ---> 8826a965812be...
Step 2/6 : USER root
 ---> Running in 5de1f0b3cfbb
Removing intermediate container 5de1f0b3cfbb
 ---> c39c95bbdcff
Step 3/6 : RUN apt-get -qq update  && apt-get -qq install -y 
--no-install-recommends gcc build-essential make  && apt-get -qq clean
 ---> Running in fe5e1e365ff8
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libgdbm3:amd64.
(Reading database ... 7609 files and directories currently installed.)
Preparing to unpack .../libgdbm3_1.8.3-13.1_amd64.deb ...
Unpacking libgdbm3:amd64 (1.8.3-13.1) ...
Selecting previously unselected package perl-modules-5.22.
Preparing to unpack .../perl-modules-5.22_5.22.1-9ubuntu0.6_all.deb ...
Unpacking perl-modules-5.22 (5.22.1-9ubuntu0.6) ...
Preparing to unpack .../libbz2-1.0_1.0.6-8ubuntu0.2_amd64.deb ...
Unpacking libbz2-1.0:amd64 (1.0.6-8ubuntu0.2) over (1.0.6-8) ...
Processing triggers for libc-bin (2.23-0ubuntu11) ...
Setting up libbz2-1.0:amd64 (1.0.6-8ubuntu0.2) ...
Processing triggers for libc-bin (2.23-0ubuntu11) ...
Selecting previously unselected package libperl5.22:amd64.
(Reading database ... 8846 files and directories currently installed.)
Preparing to unpack .../libperl5.22_5.22.1-9ubuntu0.6_amd64.deb ...
Unpacking libperl5.22:amd64 (5.22.1-9ubuntu0.6) ...
Selecting previously unselected package perl.
Preparing to unpack .../perl_5.22.1-9ubuntu0.6_amd64.deb ...
Unpacking perl (5.22.1-9ubuntu0.6) ...
Selecting previously unselected package bzip2.
Preparing to unpack .../bzip2_1.0.6-8ubuntu0.2_amd64.deb ...
Unpacking bzip2 (1.0.6-8ubuntu0.2) ...
Selecting previously unselected package make.
Preparing to unpack .../archives/make_4.1-6_amd64.deb ...
Unpacking make (4.1-6) ...
Selecting previously unselected package libdpkg-perl.
Preparing to unpack .../libdpkg-perl_1.18.4ubuntu1.6_all.deb ...
Unpacking libdpkg-perl (1.18.4ubuntu1.6) ...
Selecting previously unselected package xz-utils.
Preparing to unpack .../xz-utils_5.1.1alpha+20120614-2ubuntu2_amd64.deb ...
Unpacking xz-utils (5.1.1alpha+20120614-2ubuntu2) ...
Selecting previously unselected package patch.
Preparing to unpack .../patch_2.7.5-1ubuntu0.16.04.2_amd64.deb ...
Unpacking patch (2.7.5-1ubuntu0.16.04.2) ...
Selecting previously unselected package dpkg-dev.
Preparing to unpack .../dpkg-dev_1.18.4ubuntu1.6_all.deb ...
Unpacking dpkg-dev (1.18.4ubuntu1.6) ...
Selecting previously unselected package build-essential.
Preparing to unpack .../build-essential_12.1ubuntu2_amd64.deb ...
Unpacking build-essential (12.1ubuntu2) ...
Setting up libgdbm3:amd64 (1.8.3-13.1) ...
Setting up perl-modules-5.22 (5.22.1-9ubuntu0.6) ...
Setting up libperl5.22:amd64 (5.22.1-9ubuntu0.6) ...
Setting up perl (5.22.1-9ubuntu0.6) ...
update-alternatives: using /usr/bin/prename to provide /usr/bin/rename 
(rename) in auto mode
Setting up bzip2 (1.0.6-8ubuntu0.2) ...
Setting up make (4.1-6) ...
Setting up libdpkg-perl (1.18.4ubuntu1.6) ...
Setting up xz-utils (5.1.1alpha+20120614-2ubuntu2) ...
update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in 
auto mode
Setting up patch (2.7.5-1ubuntu0.16.04.2) ...
Setting up dpkg-dev (1.18.4ubuntu1.6) ...
Setting up build-essential (12.1ubuntu2) ...
Processing triggers for libc-bin (2.23-0ubuntu11) ...
Removing intermediate container fe5e1e365ff8
 ---> fa9dc2999b1d
Step 4/6 : USER sage
 ---> Running in d86e77e74948
Removing intermediate container d86e77e74948
 ---> 6535d64a4eae
Step 5/6 : RUN sage -i gap_packages
 ---> Running in e012d50d35ae
make: *** No rule to make target 'all-toolchain'.  Stop.
Removing intermediate container e012d50d35ae
The command '/bin/sh -c sage -i gap_packages' returned a non-zero code: 2

I think the non-zero code is variable. Thanks, Enrique.


El miércoles, 30 de octubre de 2019, 4:44:27 (UTC+1), vdelecroix escribió:
>
> Dear Enrique, 
>
> It would be helpful to have the complete error message and the log 
> of the failed build. And if you know how to do that, you can open 
> a trac ticket. 
>
> Also, it would be nice to have docker images for Sage with most (if 
> not all) optional packages ins

[sage-support] optional packages and binder

2019-10-29 Thread Enrique Artal
I want to make available some of my notebooks in binder. I found very 
useful sage-binder-env but I ran into problems in a case where I needed an 
optional package, namely gap_packages. As stated I installed make package 
using the Dockerfile but the installation stops with an error in make 
all-toolchain. I guess I need to install more packages but I do not know 
which ones. Best regards, Enrique.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/c65c381a-8246-40ab-a52c-39f3d4168ac7%40googlegroups.com.


Re: [sage-support] Problem with factor in SymbolicRing

2019-08-07 Thread Enrique Artal
The behavior is quite erratic; my first example was more complicated; I 
eliminate terms and sometimes it worked, some times not.

El domingo, 4 de agosto de 2019, 15:19:59 (UTC+2), vdelecroix escribió:
>
> I confirm the bug on 8.9.beta5. It is most probably a bug in Pynac. Note 
> that if you multiply by 2 it "works" 
>
> sage: (2*num).factor() 
> (16*r^6 - 32*r^4*x^2 + 16*r^2*x^4 + 32*r^4*y^2 + 32*r^2*x^2*y^2 + 
> 16*r^2*y^4 + 80*r^2*x^2 + 16*x^4 + 16*r^2*y^2 + 32*x^2*y^2 + 16*y^4 - 
> 16*x^2 - 16*y^2)*r^4/(r^6 + 6*r^4*x^2 + r^2*x^4 + 2*r^4*y^2 + 
> 2*r^2*x^2*y^2 + r^2*y^4 - 2*r^2*x^2 + x^4 + 2*r^2*y^2 + 2*x^2*y^2 + y^4)^2 
>
>
> Le 24/07/2019 à 13:31, Enrique Artal a écrit : 
> > I have encountered a problem with factor in SR which can be avoided but 
> it 
> > shows a problem. If I run this code: 
> > 
> > var('t',domain='complex') 
> > var('r,x,y',domain='real') 
> > h= r^6+r^4*t^2 + 4*r^4*t*conjugate(t) + r^4*conjugate(t)^2 + 
> > r^2*t^2*conjugate(t)^2  - r^2*t^2 - r^2*conjugate(t)^2 + 
> t^2*conjugate(t)^2 
> > H=h(t=x+I*y).factor() 
> > 
> num=1/2*(H.derivative(x)/H).derivative(x)+1/2*(H.derivative(y)/H).derivative(y)
>  
>
> > num.factor() 
> > 
> > I get the following error 
> > 
> > 
> ---ValueError
>  
>Traceback (most recent call 
> last) in ()  6 
> H=h(t=x+I*y).factor()  7 
> num=Integer(1)/Integer(2)*(H.derivative(x)/H).derivative(x)+Integer(1)/Integer(2)*(H.derivative(y)/H).derivative(y)>
>  
> 8 num.factor() 
> > 
> /home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx
>  
> in sage.symbolic.expression.Expression.factor 
> (build/cythonized/sage/symbolic/expression.cpp:57759)()  11107 cdef 
> GEx x  11108 cdef bint b> 11109 if dontfactor or not 
> self.is_rational_expression():  0 m = self._maxima_() 
>  1 name = m.name() 
> > 
> /home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx
>  
> in sage.symbolic.expression.Expression.is_rational_expression 
> (build/cythonized/sage/symbolic/expression.cpp:15368)()   2030 
> False   2031 """-> 2032 return all(part.is_polynomial(v)   
> 2033for part in (self.numerator(), self.denominator()) 
>   2034for v in part.variables()) 
> > 
> /home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx
>  
> in genexpr (build/cythonized/sage/symbolic/expression.cpp:15110)()   2031   
>   """   2032 return all(part.is_polynomial(v)-> 2033   
>  for part in (self.numerator(), self.denominator())   2034 
>for v in part.variables())   2035 
> > 
> /home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx
>  
> in sage.symbolic.expression.Expression.numerator 
> (build/cythonized/sage/symbolic/expression.cpp:48252)()   9377 
> sig_on()   9378 try:-> 9379 ex = 
> self._gobj.numer()   9380 finally:   9381 
> sig_off() 
> > ValueError: divide: arguments must be polynomials over the rationals 
> > 
> > 
> > This error does not happen if I erase some terms of h; and some times it 
> gives the error only if I did not restart the jupyter notebook. Any ideas? 
> Enrique. 
> > 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/e3816754-fef3-47ad-8551-bfdd4f2438c4%40googlegroups.com.


[sage-support] Re: Problem with factor in SymbolicRing

2019-07-24 Thread Enrique Artal
I forgot to add, it worked in 8.1 version and it does not work since 8.4 
(at least). Adding the option dontfactor=[some variable not involved in h] 
it works but much slower.

El miércoles, 24 de julio de 2019, 13:31:08 (UTC+2), Enrique Artal escribió:
>
> I have encountered a problem with factor in SR which can be avoided but it 
> shows a problem. If I run this code:
>
> var('t',domain='complex')
> var('r,x,y',domain='real')
> h= r^6+r^4*t^2 + 4*r^4*t*conjugate(t) + r^4*conjugate(t)^2 + 
> r^2*t^2*conjugate(t)^2  - r^2*t^2 - r^2*conjugate(t)^2 + t^2*conjugate(t)^2
> H=h(t=x+I*y).factor()
>
> num=1/2*(H.derivative(x)/H).derivative(x)+1/2*(H.derivative(y)/H).derivative(y)
> num.factor()
>
> I get the following error
>
> ---ValueError
> Traceback (most recent call 
> last) in ()  6 
> H=h(t=x+I*y).factor()  7 
> num=Integer(1)/Integer(2)*(H.derivative(x)/H).derivative(x)+Integer(1)/Integer(2)*(H.derivative(y)/H).derivative(y)>
>  8 num.factor()
> /home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx
>  in sage.symbolic.expression.Expression.factor 
> (build/cythonized/sage/symbolic/expression.cpp:57759)()  11107 cdef 
> GEx x  11108 cdef bint b> 11109 if dontfactor or not 
> self.is_rational_expression():  0 m = self._maxima_()  1  
>name = m.name()
> /home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx
>  in sage.symbolic.expression.Expression.is_rational_expression 
> (build/cythonized/sage/symbolic/expression.cpp:15368)()   2030 
> False   2031 """-> 2032 return all(part.is_polynomial(v)   
> 2033for part in (self.numerator(), self.denominator())   
> 2034for v in part.variables())
> /home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx
>  in genexpr (build/cythonized/sage/symbolic/expression.cpp:15110)()   2031
>  """   2032 return all(part.is_polynomial(v)-> 2033   
>  for part in (self.numerator(), self.denominator())   2034
> for v in part.variables())   2035 
> /home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx
>  in sage.symbolic.expression.Expression.numerator 
> (build/cythonized/sage/symbolic/expression.cpp:48252)()   9377 
> sig_on()   9378 try:-> 9379 ex = 
> self._gobj.numer()   9380 finally:   9381 
> sig_off()
> ValueError: divide: arguments must be polynomials over the rationals
>
>
> This error does not happen if I erase some terms of h; and some times it 
> gives the error only if I did not restart the jupyter notebook. Any ideas? 
> Enrique.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/63b7b8be-52e3-46eb-8641-30305686fd1d%40googlegroups.com.


[sage-support] Problem with factor in SymbolicRing

2019-07-24 Thread Enrique Artal
I have encountered a problem with factor in SR which can be avoided but it 
shows a problem. If I run this code:

var('t',domain='complex')
var('r,x,y',domain='real')
h= r^6+r^4*t^2 + 4*r^4*t*conjugate(t) + r^4*conjugate(t)^2 + 
r^2*t^2*conjugate(t)^2  - r^2*t^2 - r^2*conjugate(t)^2 + t^2*conjugate(t)^2
H=h(t=x+I*y).factor()
num=1/2*(H.derivative(x)/H).derivative(x)+1/2*(H.derivative(y)/H).derivative(y)
num.factor()

I get the following error

---ValueError
Traceback (most recent call 
last) in ()  6 H=h(t=x+I*y).factor()  
7 
num=Integer(1)/Integer(2)*(H.derivative(x)/H).derivative(x)+Integer(1)/Integer(2)*(H.derivative(y)/H).derivative(y)>
 8 num.factor()
/home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx 
in sage.symbolic.expression.Expression.factor 
(build/cythonized/sage/symbolic/expression.cpp:57759)()  11107 cdef GEx 
x  11108 cdef bint b> 11109 if dontfactor or not 
self.is_rational_expression():  0 m = self._maxima_()  1
 name = m.name()
/home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx 
in sage.symbolic.expression.Expression.is_rational_expression 
(build/cythonized/sage/symbolic/expression.cpp:15368)()   2030 
False   2031 """-> 2032 return all(part.is_polynomial(v)   2033 
   for part in (self.numerator(), self.denominator())   2034
for v in part.variables())
/home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx 
in genexpr (build/cythonized/sage/symbolic/expression.cpp:15110)()   2031   
  """   2032 return all(part.is_polynomial(v)-> 2033
for part in (self.numerator(), self.denominator())   2034
for v in part.variables())   2035 
/home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx 
in sage.symbolic.expression.Expression.numerator 
(build/cythonized/sage/symbolic/expression.cpp:48252)()   9377 
sig_on()   9378 try:-> 9379 ex = self._gobj.numer() 
  9380 finally:   9381 sig_off()
ValueError: divide: arguments must be polynomials over the rationals


This error does not happen if I erase some terms of h; and some times it gives 
the error only if I did not restart the jupyter notebook. Any ideas? Enrique.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/989be80f-5124-4d8c-92cf-7354412dc817%40googlegroups.com.


Re: [sage-support] Erase a cell in sagenb

2019-03-29 Thread Enrique Artal
I agree, and I use them for personal use. We are trying to change sagenb to 
jupyter in our servers for teaching but meanwhile we need sagenb.

El viernes, 29 de marzo de 2019, 0:28:47 (UTC+1), Dima Pasechnik escribió:
>
> On Thu, Mar 28, 2019 at 11:23 PM Enrique Artal  > wrote: 
> > 
> > In chrome one can erase a cell of a sagenb worksheet, making it empty 
> and the backspace. It used to work in firefox but not any more (version 66 
> in my case, but may be in prior versions also). Is there a simple 
> workaround? Best, Enrique. 
>
> use jupyter notebooks, please... 
> I am saying this as the de facto maintainer of  sagenb :-) 
>
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "sage-support" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to sage-s...@googlegroups.com . 
> > To post to this group, send email to sage-s...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/sage-support. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Erase a cell in sagenb

2019-03-28 Thread Enrique Artal
In chrome one can erase a cell of a sagenb worksheet, making it empty and 
the backspace. It used to work in firefox but not any more (version 66 in 
my case, but may be in prior versions also). Is there a simple workaround? 
Best, Enrique.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: maximal integrals

2019-02-18 Thread Enrique Artal
I'll do it, but anyway it is strange that the wrong result is not reproduce 
using sage -maxima.

El martes, 19 de febrero de 2019, 1:34:21 (UTC+1), slelievre escribió:
>
> Mon 2019-02-18 18:55:56 UTC+1, Enrique Artal:
> >
> > The integral of functions like sqrt(a+b*sin(t)^2) for most
> > values of a,b produce wrong results in sage, using maxima
> > algorithm, but it is not the case if one uses maxima interface.
> > Is there a way to try to debug the problem? Best, Enrique
>
> About Maxima bugs observed in Sage and how to debug them
> in standalone Maxima, see some comments at
>
> https://trac.sagemath.org/ticket/26625#comment:15
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] maximal integrals

2019-02-18 Thread Enrique Artal
The integral of functions like sqrt(a+b*sin(t)^2) for most values of a,b 
produce wrong results in sage, using maxima algorithmI, but it is not the 
case if one uses  maxima interface. Is there a way to try to debug the 
problem? Best, Enrique 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Loading heavy computations

2019-01-23 Thread Enrique Artal
I would be happy to be helpful, at least testing.

El martes, 22 de enero de 2019, 20:03:29 (UTC+1), Nils Bruin escribió:
>
> See:
>
> https://trac.sagemath.org/ticket/27091
>
> Balanced summing (which you are basically doing) already makes a bit of a 
> difference. If that's indeed the issue then using a balanced summing 
> strategy already gives a better order on the algorithm.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Loading heavy computations

2019-01-22 Thread Enrique Artal
The answer is very helpful. I saw a way to solve the specific problem using 
other techniques but I tried to see anyway how to recover the computation. 
The key of the problem was a polynomial with more that 16 millions of 
monomials. I made the following approaches:

   1. Save the object in a sobj file, load it in other session. The action 
   of loading was stopped after more than one day of computation.
   2. Compute the dictionnary and save it in a sobj file (less than 400Mb). 
   In a new session, loading the dictionnary took less than 4 minutes. But as 
   it was pointed in the previous message, this was not the point. Recovering  
   the polynomial took too long, stopped after one day.
   3. Compute the dictionnary and save it as text in a sage file (around 
   800Mb). In a new session, loading the dictionnary  produced some errors 
   about memory problems (I could reproduce it if necessary).
   4. Save the polynomial as a chain in a sage file (around 700Mb). In a 
   new session, reading this file produced other memory problems and stopped 
   the session.
   5. With the sobj file in 2, I broke the dictionnary in around 1600 
   dictionnaries with 1 terms. This was very short time. Computing the 
   1600 polynomials of 1 monomials took 12 minutes and summing them, 24 
   minutes.

The last option takes around 40 minutes and It may exist better partitions 
to do this. I wonder if this approach could be made automatic.

El viernes, 18 de enero de 2019, 4:50:09 (UTC+1), Nils Bruin escribió:
>
> On Thursday, January 17, 2019 at 3:37:36 PM UTC-8, Enrique Artal wrote:
>>
>> I made some computations, I skip the details for now, but the result was 
>> a rational function with rational coefficients and 13 indeterminates. The 
>> computation took around three hours and used a lot of memory so I made it 
>> using a script. The first time I saved the rational function in a pickle 
>> file, the second time in a sobj file.
>>
>
> Both are actually pickles, but the standard python "pickle" defaults to an 
> older version of the protocol. Sage's "sobj" wrappers select a more modern 
> version of the protocol and a more compact (binary) file representation.
>  
>
>> The first one was 1.2Gb, the second one around 300Mb. The main issue is 
>> that opening a sage session (or using a script) takes much more time than 
>> computing (with pickle more than 12 hours, I stopped it, with sobj 10 hours 
>> and counting).
>>
>
> The pickle format basically consists of a simple programming language with 
> instructions to build data structures. To get an idea what it does, you can 
> use, for instance,
>
> sage: R.=QQ[]
> sage: f=(x^2+y^2)/x
> sage: import pickletools
> sage: pickletools.dis(sage.misc.explainpickle.comp.decompress(dumps(f)))
>
> or, to get a more or less equivalent piece of sage code:
>
> sage: explain_pickle(dumps(f))
>  
>
>> I did not try a text file, but I wonder which is the best strategy to 
>> save a heavy result and being able to load it using less time than the 
>> actual computation.
>>
>  
> The main thing you learn from the above exercise is that pickle in 
> principle does something fairly sensible for rational functions: It 
> constructs numerator and denominator via a dictionary.
>
> It may be that this happens with a lot of overhead, so perhaps you can 
> gain something if you do it via another route, but it may well be that the 
> bottleneck is in the sage-to-libsingular interface, and other construction 
> methods won't get around that. 
>
> It's not always the case that reconstructing something from a file store 
> is faster than computing it. A silly example:
>
> a=2**(10**10)
>
> completes quite quickly, but writing the bit representation to a file and 
> reading it in will be considerable work.
>
> It's unlikely your example is as extreme as the one above, but your 
> experience indicates that the size of the polynomials involved in your case 
> (the size of the "sobj" file is a poor measure for that) is beyond what 
> sage has been tested with regularly. It looks like there's significant room 
> for improvement here. Pickle really should be able to do this.
>
>> Ideas would be appreciated. Thanks, Enrique Artal.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Loading heavy computations

2019-01-17 Thread Enrique Artal
I made some computations, I skip the details for now, but the result was a 
rational function with rational coefficients and 13 indeterminates. The 
computation took around three hours and used a lot of memory so I made it 
using a script. The first time I saved the rational function in a pickle 
file, the second time in a sobj file. The first one was 1.2Gb, the second 
one around 300Mb. The main issue is that opening a sage session (or using a 
script) takes much more time than computing (with pickle more than 12 
hours, I stopped it, with sobj 10 hours and counting). I did not try a text 
file, but I wonder which is the best strategy to save a heavy result and 
being able to load it using less time than the actual computation.

Ideas would be appreciated. Thanks, Enrique Artal.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-18 Thread Enrique Artal
If I am not wrong it works from a terminal and also if one uses either sage 
-m jupyter or sage -n jupyterlab. 
It is possible to use it directly from jupyter or jupyter lab if the 
sagemath kernel is availabe to jupyter, e.g. at 
/usr/local/share/jupyter/kernels or .local/share/jupyter/kernels, and the 
nbextensions (jsmol,mathjax threejs) linked should not interfere your 
jupyter installation.. 
It may be more complicated using jupyterhub; at least for threejs, if I am 
not wrong something must be changed in order to look for the non-found 
files in external places since jupyterhub is not able to find them locally. 
At some point I was able to use it changing some sage files but I do not 
know how to do it properly.

El lunes, 19 de noviembre de 2018, 3:38:49 (UTC+1), Kolen Cheung escribió:
>
> I tried to install threejs by jupyter labextension install jupyter-threejs 
> but it still doesn’t work. I tried on both jupyter and jupyterlab. I didn’t 
> tried symlinking the directories you mentioned though, because I don’t want 
> to mess up the virtual environments created by conda (my jupyterlab 
> environment is created using conda.)
> ​
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-18 Thread Enrique Artal
If I am not wrong it works from a terminal and also if one uses either sage 
-m jupyter or sage -n jupyterlab. 
It is possible to use it directly from jupyter or jupyter lab if the 
sagemath kernel is availabe to jupyter, e.g. at 
/usr/local/share/jupyter/kernels or .local/share/jupyter/kernels, and the 
nbextensions (jsmol,mathjax threejs) linked should not interfere your 
jupyter installation.. 
It may be more complicated using jupyterhub; at least for threejs, if I am 
not wrong something must be changed in order to look for the non-found 
files in external places since jupyterhub is not able to find them locally. 
At some point I was able to use it changing some sage files but I do not 
know how to do it properly.

El lunes, 19 de noviembre de 2018, 3:38:49 (UTC+1), Kolen Cheung escribió:
>
> I tried to install threejs by jupyter labextension install jupyter-threejs 
> but it still doesn’t work. I tried on both jupyter and jupyterlab. I didn’t 
> tried symlinking the directories you mentioned though, because I don’t want 
> to mess up the virtual environments created by conda (my jupyterlab 
> environment is created using conda.)
> ​
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Possible mistake in ParametrizedSurface3d

2018-03-16 Thread Enrique Artal
The function ParametrizedSurface3d is particularly useful for teaching on 
differentiable surfaces, but if I am not wrong there is a problem with the 
computation of principal directions. They are the eigenspaces for the shape 
operator. The issue is that the shape operator is presented as a matrix 
with a left action on vectors, while the eigenvalues are computed as if it 
was a right action.
The following code shows the problem (it is a helicoid with a 
parametrization such that the first fundamental form is not diagonal):

var('u,v',domain='real')
V=vector([u*cos(u+v),u*sin(u+v),u+v])
S=ParametrizedSurface3D(V,(u,v))
dN=S.shape_operator()
U=[(i,j[0]) for i,j,k in S.principal_directions()]# A list with eigenvalues 
and eigenvectors.

#Check if they are eigenvalues for the left action
[(dN*j-i*j).simplify_full() for i,j in U]

Output:
[((2*u^2 - (2*u^2 + 1)*sqrt(u^2 + 1) + 1)/(u^4 + u^2), (2*u^2 + 1)/(u^2 + 
1)^(3/2)),
 (-(2*u^2 + (2*u^2 + 1)*sqrt(u^2 + 1) + 1)/(u^4 + u^2), (2*u^2 + 1)/(u^2 + 
1)^(3/2))] 

False

#Check if they are eigenvalues for the left action
[(j*dN-i*j).simplify_full() for i,j in U]
Output:
[(0, 0), (0, 0)]
True

Best, Enrique Artal.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: integrals and algorithms

2017-11-13 Thread Enrique Artal
Thanks to you for your work!

El lunes, 13 de noviembre de 2017, 15:06:13 (UTC+1), Ralf Stephan escribió:
>
> On Sunday, November 12, 2017 at 11:30:51 AM UTC+1, Enrique Artal wrote:
>>
>> It seems that fresnels is defined in sympy but not in sagemath, Is it 
>> possible to correct these errors? Thanks, Enrique.
>>
>>
>  I opened https://trac.sagemath.org/ticket/24212
>
> Thanks for the report,
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] integrals and algorithms

2017-11-12 Thread Enrique Artal
Sorry. 
For the first one

integral(x,x,algorithm='mathematica_free')

You can replace the first x by any function; a previous problem was solved 
in #22641 <https://trac.sagemath.org/ticket/22641> but now I does not work. 
For the the second one the problem is with

integral(sin(x^2),x,algorithm='mathematica_free')

and I presume it is due to the non-existence of Fresnel integrals in sage. 
It works for other integrals, and it works also importing sympy as you did.

El domingo, 12 de noviembre de 2017, 11:57:06 (UTC+1), vdelecroix escribió:
>
> You should give the command that leads you to the error. 
>
> Concerning sympy, note that you can use it directly within Sage 
>
> sage: import sympy 
> sage: x = sympy.Symbol('x') 
> sage: sympy.integrate(sympy.sin(x^2), x) 
> 3*sqrt(2)*sqrt(pi)*fresnels(sqrt(2)*x/sqrt(pi))*gamma(3/4)/(8*gamma(7/4)) 
>
> On 12/11/2017 11:30, Enrique Artal wrote: 
> > I was prepairing some exercises and I got some errors using differente 
> > algorithms for integral, using version 8.0. Integrating with 
> > mathematica_free, I got this error: 
> > Traceback (most recent call last): 
> >File "", line 1, in  
> >File "_sage_input_4.py", line 10, in  
> >  exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 
> > -*-\\n" + 
> > 
> _support_.preparse_worksheet_cell(base64.b64decode("aW50ZWdyYWwoeCx4LGFsZ29yaXRobT0nbWF0aGVtYXRpY2FfZnJlZScp"),globals())+"\\n");
>  
>
> > execfile(os.path.abspath("___code___.py")) 
> >File "", line 1, in  
> >   
> >File "/tmp/tmpfvk1XJ/___code___.py", line 2, in  
> >  exec compile(u"integral(x,x,algorithm='mathematica_free')" + '\n', 
> '', 
> > 'single') 
> >File "", line 1, in  
> >   
> >File 
> > 
> "/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/misc/functional.py",
>  
>
> > line 721, in integral 
> >  return x.integral(*args, **kwds) 
> >File "sage/symbolic/expression.pyx", line 12275, in 
> > sage.symbolic.expression.Expression.integral 
> > 
> (/usr/local/sage-8.0/src/build/cythonized/sage/symbolic/expression.cpp:69945) 
>
> >File 
> > 
> "/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py",
>  
>
> > line 795, in integrate 
> >  return integrator(expression, v, a, b) 
> >File 
> > 
> "/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py",
>  
>
> > line 97, in mma_free_integrator 
> >  page = page[page.index('"inputForm"'):page.index('"outputForm"')] 
> > ValueError: substring not found 
> > 
> > 
> > If I try  integral(sin(x^2),x,algorithm='sympy') I get: 
> > 
> > Traceback (most recent call last): 
> >File "", line 1, in  
> >File "_sage_input_20.py", line 10, in  
> >  exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 
> > -*-\\n" + 
> > 
> _support_.preparse_worksheet_cell(base64.b64decode("aD1pbnRlZ3JhbChzaW4oeF4yKSx4LGFsZ29yaXRobT0nc3ltcHknKQ=="),globals())+"\\n");
>  
>
> > execfile(os.path.abspath("___code___.py")) 
> >File "", line 1, in  
> >   
> >File "/tmp/tmpK8eQi1/___code___.py", line 3, in  
> >  exec compile(u"h=integral(sin(x**_sage_const_2 
> ),x,algorithm='sympy')" 
> > + '\n', '', 'single') 
> >File "", line 1, in  
> >   
> >File 
> > 
> "/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/misc/functional.py",
>  
>
> > line 721, in integral 
> >  return x.integral(*args, **kwds) 
> >File "sage/symbolic/expression.pyx", line 12275, in 
> > sage.symbolic.expression.Expression.integral 
> > 
> (/usr/local/sage-8.0/src/build/cythonized/sage/symbolic/expression.cpp:69945) 
>
> >File 
> > 
> "/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py",
>  
>
> > line 795, in integrate 
> >  return integrator(expression, v, a, b) 
> >File 
> > 
> "/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py",
>  
>
>

Re: [sage-support] integrals and algorithms

2017-11-12 Thread Enrique Artal
Sorry. 
For the first one

integral(x,x,algorithm='mathematica_free')

You can replace the first x by any function; a previous problem was solved 
in #22641 <https://trac.sagemath.org/ticket/22641> but now I does not work. 
For the the second one the problem is with

integral(sin(x^2),x,algorithm='mathematica_free')

and I presume it is due to the non-existence of Fresnel integrals in sage. 
It works for other integrals, and it works also importing sympy as you did.

El domingo, 12 de noviembre de 2017, 11:57:06 (UTC+1), vdelecroix escribió:
>
> You should give the command that leads you to the error. 
>
> Concerning sympy, note that you can use it directly within Sage 
>
> sage: import sympy 
> sage: x = sympy.Symbol('x') 
> sage: sympy.integrate(sympy.sin(x^2), x) 
> 3*sqrt(2)*sqrt(pi)*fresnels(sqrt(2)*x/sqrt(pi))*gamma(3/4)/(8*gamma(7/4)) 
>
> On 12/11/2017 11:30, Enrique Artal wrote: 
> > I was prepairing some exercises and I got some errors using differente 
> > algorithms for integral, using version 8.0. Integrating with 
> > mathematica_free, I got this error: 
> > Traceback (most recent call last): 
> >File "", line 1, in  
> >File "_sage_input_4.py", line 10, in  
> >  exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 
> > -*-\\n" + 
> > 
> _support_.preparse_worksheet_cell(base64.b64decode("aW50ZWdyYWwoeCx4LGFsZ29yaXRobT0nbWF0aGVtYXRpY2FfZnJlZScp"),globals())+"\\n");
>  
>
> > execfile(os.path.abspath("___code___.py")) 
> >File "", line 1, in  
> >   
> >File "/tmp/tmpfvk1XJ/___code___.py", line 2, in  
> >  exec compile(u"integral(x,x,algorithm='mathematica_free')" + '\n', 
> '', 
> > 'single') 
> >File "", line 1, in  
> >   
> >File 
> > 
> "/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/misc/functional.py",
>  
>
> > line 721, in integral 
> >  return x.integral(*args, **kwds) 
> >File "sage/symbolic/expression.pyx", line 12275, in 
> > sage.symbolic.expression.Expression.integral 
> > 
> (/usr/local/sage-8.0/src/build/cythonized/sage/symbolic/expression.cpp:69945) 
>
> >File 
> > 
> "/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py",
>  
>
> > line 795, in integrate 
> >  return integrator(expression, v, a, b) 
> >File 
> > 
> "/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py",
>  
>
> > line 97, in mma_free_integrator 
> >  page = page[page.index('"inputForm"'):page.index('"outputForm"')] 
> > ValueError: substring not found 
> > 
> > 
> > If I try  integral(sin(x^2),x,algorithm='sympy') I get: 
> > 
> > Traceback (most recent call last): 
> >File "", line 1, in  
> >File "_sage_input_20.py", line 10, in  
> >  exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 
> > -*-\\n" + 
> > 
> _support_.preparse_worksheet_cell(base64.b64decode("aD1pbnRlZ3JhbChzaW4oeF4yKSx4LGFsZ29yaXRobT0nc3ltcHknKQ=="),globals())+"\\n");
>  
>
> > execfile(os.path.abspath("___code___.py")) 
> >File "", line 1, in  
> >   
> >File "/tmp/tmpK8eQi1/___code___.py", line 3, in  
> >  exec compile(u"h=integral(sin(x**_sage_const_2 
> ),x,algorithm='sympy')" 
> > + '\n', '', 'single') 
> >File "", line 1, in  
> >   
> >File 
> > 
> "/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/misc/functional.py",
>  
>
> > line 721, in integral 
> >  return x.integral(*args, **kwds) 
> >File "sage/symbolic/expression.pyx", line 12275, in 
> > sage.symbolic.expression.Expression.integral 
> > 
> (/usr/local/sage-8.0/src/build/cythonized/sage/symbolic/expression.cpp:69945) 
>
> >File 
> > 
> "/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py",
>  
>
> > line 795, in integrate 
> >  return integrator(expression, v, a, b) 
> >File 
> > 
> "/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py",
>  
>
>

[sage-support] integrals and algorithms

2017-11-12 Thread Enrique Artal
I was prepairing some exercises and I got some errors using differente 
algorithms for integral, using version 8.0. Integrating with 
mathematica_free, I got this error:
Traceback (most recent call last):
  File "", line 1, in 
  File "_sage_input_4.py", line 10, in 
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 
-*-\\n" + 
_support_.preparse_worksheet_cell(base64.b64decode("aW50ZWdyYWwoeCx4LGFsZ29yaXRobT0nbWF0aGVtYXRpY2FfZnJlZScp"),globals())+"\\n");
 
execfile(os.path.abspath("___code___.py"))
  File "", line 1, in 

  File "/tmp/tmpfvk1XJ/___code___.py", line 2, in 
exec compile(u"integral(x,x,algorithm='mathematica_free')" + '\n', '', 
'single')
  File "", line 1, in 

  File 
"/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/misc/functional.py",
 
line 721, in integral
return x.integral(*args, **kwds)
  File "sage/symbolic/expression.pyx", line 12275, in 
sage.symbolic.expression.Expression.integral 
(/usr/local/sage-8.0/src/build/cythonized/sage/symbolic/expression.cpp:69945)
  File 
"/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py",
 
line 795, in integrate
return integrator(expression, v, a, b)
  File 
"/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py",
 
line 97, in mma_free_integrator
page = page[page.index('"inputForm"'):page.index('"outputForm"')]
ValueError: substring not found
  

If I try  integral(sin(x^2),x,algorithm='sympy') I get:

Traceback (most recent call last):
  File "", line 1, in 
  File "_sage_input_20.py", line 10, in 
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 
-*-\\n" + 
_support_.preparse_worksheet_cell(base64.b64decode("aD1pbnRlZ3JhbChzaW4oeF4yKSx4LGFsZ29yaXRobT0nc3ltcHknKQ=="),globals())+"\\n");
 
execfile(os.path.abspath("___code___.py"))
  File "", line 1, in 

  File "/tmp/tmpK8eQi1/___code___.py", line 3, in 
exec compile(u"h=integral(sin(x**_sage_const_2 ),x,algorithm='sympy')" 
+ '\n', '', 'single')
  File "", line 1, in 

  File 
"/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/misc/functional.py",
 
line 721, in integral
return x.integral(*args, **kwds)
  File "sage/symbolic/expression.pyx", line 12275, in 
sage.symbolic.expression.Expression.integral 
(/usr/local/sage-8.0/src/build/cythonized/sage/symbolic/expression.cpp:69945)
  File 
"/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py",
 
line 795, in integrate
return integrator(expression, v, a, b)
  File 
"/usr/local/sage-8.0/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py",
 
line 56, in sympy_integrator
return result._sage_()
  File 
"/usr/local/sage-8.0/local/lib/python2.7/site-packages/sympy/core/mul.py", 
line 1572, in _sage_
s *= x._sage_()
  File 
"/usr/local/sage-8.0/local/lib/python2.7/site-packages/sympy/core/function.py", 
line 707, in _sage_
func = getattr(sage, fname)
AttributeError: 'module' object has no attribute 'fresnels'

It seems that fresnels is defined in sympy but not in sagemath, Is it 
possible to correct these errors? Thanks, Enrique.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] jupyterhub and plot3d

2017-09-13 Thread Enrique Artal
Dear all,
plot3d with threejs worked in 7.6 but it does not work in 8.0. Has anyone 
seen it? Enrique

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Sage crashes on Arch Linux

2017-07-12 Thread Enrique Artal
Similar issue in fedora 26; sage -i -f openblas solved it 

El martes, 11 de julio de 2017, 14:58:54 (UTC+2), Kathlén Kohn escribió:
>
> I just installed sagemath 7.6-8 using pacman and it crashes right away.
> The crash report is attached.
>
> It says "libgfortran.so.3: cannot open shared object file: No such file or 
> directory".
> The only package I find that contains a file of that name is gcc5, and 
> after installing gcc5 I only get the following files:
> libgfortran.so, libgfortran.so.4, libgfortran.so.4.0.0, libgfortran.spec
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: sage and fedora 26

2017-07-12 Thread Enrique Artal
I do not know exactly what you mean; I had built from source at the time of 
installation; now it was enough to apply "sage -i -f openblas"

El miércoles, 12 de julio de 2017, 17:06:53 (UTC+2), Dima Pasechnik 
escribió:
>
> Rebuild from source?
>
> On Wednesday, July 12, 2017 at 2:59:39 PM UTC+1, Enrique Artal wrote:
>>
>> I have just updated my personal computer to fedora 26 and sagemath 
>> crashed. The problem is that libgfortran.so.3 does not exist any more 
>> (version 4); finally it worked forcing the reinstallation of openblas (sage 
>> -i -f openblas). I do not know if there is an easiest work to solve the 
>> issue.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] sage and fedora 26

2017-07-12 Thread Enrique Artal
I have just updated my personal computer to fedora 26 and sagemath crashed. 
The problem is that libgfortran.so.3 does not exist any more (version 4); 
finally it worked forcing the reinstallation of openblas (sage -i -f 
openblas). I do not know if there is an easiest work to solve the issue.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: new sagenb pre-release, please test

2017-05-11 Thread Enrique Artal
Is there any particular change to test?

El miércoles, 10 de mayo de 2017, 16:12:26 (UTC+2), Dima Pasechnik escribió:
>
> Please test ​https://github.com/sagemath/sagenb/tree/1.0.rc0 (copy of the 
> current master) before I go ahead with making a new Sage package. It works 
> for me following the instructions in HASKING (updated, to take care of 
> changed names and of the need to deal with mathjax).
>
> Report issues on github, please.
>
>
> Dima
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Small problem with ParametrizedSurface3D

2017-03-03 Thread Enrique Artal
I have defined a ParametrizedSurface3D , named S. The output of show(S) 
gives the parametrization of S, while the output of S is:

) failed: TypeError: not all arguments converted during 
string formatting>

The output of print S is:
TypeError Traceback (most recent call last)
 in ()
> 1 print S

/usr/local/sage-7.5/src/sage/structure/sage_object.pyx in 
sage.structure.sage_object.SageObject.__repr__ 
(/usr/local/sage-7.5/src/build/cythonized/sage/structure/sage_object.c:2691)()
190 return str(type(self))
191 else:
--> 192 result = repr_func()
193 if isinstance(result, unicode):
194 # Py3 compatibility: allow _repr_ to return unicode

/usr/local/sage-7.5/local/lib/python2.7/site-packages/sage/geometry/riemannian_manifolds/parametrized_surface3d.pyc
 
in _repr_(self)
388 name = 'Parametrized surface'
389 if self.name is not None:
--> 390 name += " ('%s')" % self.name
391 s ='%(designation)s with equation %(eq)s' % \
392 {'designation': name, 'eq': str(self.equation)}

TypeError: not all arguments converted during string formatting

It happens with both Sage 7.5 and Sage 7.3 (sagenb and jupyter)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: threejs, fedora and ubuntu

2017-02-14 Thread Enrique Artal
Thanks! I guess there are some license issues to do not include the scripts 
in the sage tree.

El martes, 14 de febrero de 2017, 0:18:37 (UTC+1), Paul Masson escribió:
>
> This issue was fixed in 7.6.beta0. You can fix it on your affected 
> machines without reinstalling by replacing the Three.js template file with 
> this one:
>
>
> https://raw.githubusercontent.com/sagemath/sage/7.6.beta0/src/ext/threejs/threejs_template.html
>
> The template is located under your Sage root directory in the folder 
> local/share/sage/ext/threejs.
>
> Future updates to the template will generally require reinstallation, but 
> this happens to be a simple fix.
>
>
> On Monday, February 13, 2017 at 9:45:50 AM UTC-8, Enrique Artal wrote:
>>
>> I inspected the page in the browser and it complained about insecure 
>> script in  '
>> http://rawgit.com/mrdoob/three.js/r80/examples/js/controls/OrbitControls.js' 
>> not in https 
>>
>> El lunes, 13 de febrero de 2017, 18:38:15 (UTC+1), Enrique Artal escribió:
>>>
>>> I have installed sage 7.5 in several machines. When threejs works, it is 
>>> quite awesome but I found several issues:
>>>
>>>- It does not work with ubuntu 16.04: no error, but no plot
>>>- In fedora 25 it works with both sagenb and jupyter
>>>- in fedora 25 it does not work if I use it using a personal server.
>>>
>>> The last issue is not important, but I do not know if someone 
>>> experienced also the problem in ubuntu. Enrique.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: threejs, fedora and ubuntu

2017-02-13 Thread Enrique Artal
I inspected the page in the browser and it complained about insecure script 
in  
'http://rawgit.com/mrdoob/three.js/r80/examples/js/controls/OrbitControls.js' 
not in https 

El lunes, 13 de febrero de 2017, 18:38:15 (UTC+1), Enrique Artal escribió:
>
> I have installed sage 7.5 in several machines. When threejs works, it is 
> quite awesome but I found several issues:
>
>- It does not work with ubuntu 16.04: no error, but no plot
>- In fedora 25 it works with both sagenb and jupyter
>- in fedora 25 it does not work if I use it using a personal server.
>
> The last issue is not important, but I do not know if someone experienced 
> also the problem in ubuntu. Enrique.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] threejs, fedora and ubuntu

2017-02-13 Thread Enrique Artal
I have installed sage 7.5 in several machines. When threejs works, it is 
quite awesome but I found several issues:

   - It does not work with ubuntu 16.04: no error, but no plot
   - In fedora 25 it works with both sagenb and jupyter
   - in fedora 25 it does not work if I use it using a personal server.

The last issue is not important, but I do not know if someone experienced 
also the problem in ubuntu. Enrique.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: How to limit heavy computations

2017-02-12 Thread Enrique Artal
The final debugging process (IPhyton5.0 seems to be responsible) is 
described in sage-devel group

El sábado, 4 de febrero de 2017, 23:07:43 (UTC+1), Enrique Artal escribió:
>
> I was wrong, but now I am quite sure that the issue seems to appear in 
> sage-7.4.beta0.
>
> El miércoles, 1 de febrero de 2017, 23:27:35 (UTC+1), Enrique Artal 
> escribió:
>>
>> If I am not wrong the problem is created in sage-7.3.beta3. I can try 
>> with the different patches beta2->beta3. Can anyone guess a good order to 
>> do that?
>>
>> El sábado, 14 de enero de 2017, 19:18:32 (UTC+1), Enrique Artal escribió:
>>>
>>> I have installed 7.3, 7.4 and 7.5 and we use several instances of sagenb 
>>> (it is for teaching and we use different addresses for different studies). 
>>> With 7.3, if a user reaches the limit of CPU time, his worksheet stops and 
>>> all the data in memory is lost, but quitting and opening the worksheet 
>>> again causes no problem, and it does not affect other users. With 7.5, the 
>>> instance of the notebook must be restarted because it does not work for any 
>>> user of this instance (no problem for the other ones). 
>>> Is there some documentation for the debugging technique? Is it possible 
>>> to take beta releases? Enrique. 
>>>
>>> El sábado, 14 de enero de 2017, 11:13:37 (UTC+1), Dima Pasechnik 
>>> escribió:
>>>>
>>>> Oh, right, this certainly has nothing to do with sagenb, what is not 
>>>> stopped is sage worker that does the computation itself, right?
>>>>
>>>> Could it be that you updated your OS in the meantime, and if you roll 
>>>> back to sage 7.3 you would still see the same behaviour?
>>>>
>>>> On sage's side it might be ipython update, although I am guessing.
>>>>
>>>> There is a debugging technique that would let you find a git commit 
>>>> that caused the change you noticed, using git bisect, although this might 
>>>> take a full day of work or so, just because there were few hundred commits 
>>>> and you would need to run 'make build' a dozen times or so, with testing 
>>>> after each rebuild...
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: How to limit heavy computations

2017-02-04 Thread Enrique Artal
I was wrong, but now I am quite sure that the issue seems to appear in 
sage-7.4.beta0.

El miércoles, 1 de febrero de 2017, 23:27:35 (UTC+1), Enrique Artal 
escribió:
>
> If I am not wrong the problem is created in sage-7.3.beta3. I can try with 
> the different patches beta2->beta3. Can anyone guess a good order to do 
> that?
>
> El sábado, 14 de enero de 2017, 19:18:32 (UTC+1), Enrique Artal escribió:
>>
>> I have installed 7.3, 7.4 and 7.5 and we use several instances of sagenb 
>> (it is for teaching and we use different addresses for different studies). 
>> With 7.3, if a user reaches the limit of CPU time, his worksheet stops and 
>> all the data in memory is lost, but quitting and opening the worksheet 
>> again causes no problem, and it does not affect other users. With 7.5, the 
>> instance of the notebook must be restarted because it does not work for any 
>> user of this instance (no problem for the other ones). 
>> Is there some documentation for the debugging technique? Is it possible 
>> to take beta releases? Enrique. 
>>
>> El sábado, 14 de enero de 2017, 11:13:37 (UTC+1), Dima Pasechnik escribió:
>>>
>>> Oh, right, this certainly has nothing to do with sagenb, what is not 
>>> stopped is sage worker that does the computation itself, right?
>>>
>>> Could it be that you updated your OS in the meantime, and if you roll 
>>> back to sage 7.3 you would still see the same behaviour?
>>>
>>> On sage's side it might be ipython update, although I am guessing.
>>>
>>> There is a debugging technique that would let you find a git commit that 
>>> caused the change you noticed, using git bisect, although this might take a 
>>> full day of work or so, just because there were few hundred commits and you 
>>> would need to run 'make build' a dozen times or so, with testing after each 
>>> rebuild...
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: How to limit heavy computations

2017-02-01 Thread Enrique Artal
If I am not wrong the problem is created in sage-7.3.beta3. I can try with 
the different patches beta2->beta3. Can anyone guess a good order to do 
that?

El sábado, 14 de enero de 2017, 19:18:32 (UTC+1), Enrique Artal escribió:
>
> I have installed 7.3, 7.4 and 7.5 and we use several instances of sagenb 
> (it is for teaching and we use different addresses for different studies). 
> With 7.3, if a user reaches the limit of CPU time, his worksheet stops and 
> all the data in memory is lost, but quitting and opening the worksheet 
> again causes no problem, and it does not affect other users. With 7.5, the 
> instance of the notebook must be restarted because it does not work for any 
> user of this instance (no problem for the other ones). 
> Is there some documentation for the debugging technique? Is it possible to 
> take beta releases? Enrique. 
>
> El sábado, 14 de enero de 2017, 11:13:37 (UTC+1), Dima Pasechnik escribió:
>>
>> Oh, right, this certainly has nothing to do with sagenb, what is not 
>> stopped is sage worker that does the computation itself, right?
>>
>> Could it be that you updated your OS in the meantime, and if you roll 
>> back to sage 7.3 you would still see the same behaviour?
>>
>> On sage's side it might be ipython update, although I am guessing.
>>
>> There is a debugging technique that would let you find a git commit that 
>> caused the change you noticed, using git bisect, although this might take a 
>> full day of work or so, just because there were few hundred commits and you 
>> would need to run 'make build' a dozen times or so, with testing after each 
>> rebuild...
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] simplifying radicals of trigonometric expressions

2017-01-15 Thread Enrique Artal
Thanks! I did not expect a particular simplification of the function; the 
problem is that the given simplification caused problems. This function 
appeared as a factor in the computation of the curvature of some spatial 
curve.

El domingo, 15 de enero de 2017, 15:50:06 (UTC+1), Michael Orlitzky 
escribió:
>
> On 01/14/2017 03:42 AM, Enrique Artal wrote: 
> > This is true. The problem is that if not used, simple expressions keep 
> to 
> > be too much complicated. Is there any compromise? 
> > 
>
> There is simplify_full() which should be safe for all expressions, and 
> simplify_real() that assumes everything is real. Those two methods use 
> our Maxima backend. 
>
> The sympy backend has improved a lot, too. There's no easy way to get 
> access to it, but something like this should work: 
>
>   sage: import sympy 
>   sage: f = sin(x/(x^2 + x)) 
>   sage: sympy.simplify(sympy.sympify(f)) 
>   sin(1/(x + 1)) 
>
> In the case of f = sqrt(cos(x)^3 - 3*cos(x)^2 - cos(x) + 6), did you 
> have any particular simplification in mind? I don't see anything obvious 
> that can be done. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: How to limit heavy computations

2017-01-14 Thread Enrique Artal
I have installed 7.3, 7.4 and 7.5 and we use several instances of sagenb 
(it is for teaching and we use different addresses for different studies). 
With 7.3, if a user reaches the limit of CPU time, his worksheet stops and 
all the data in memory is lost, but quitting and opening the worksheet 
again causes no problem, and it does not affect other users. With 7.5, the 
instance of the notebook must be restarted because it does not work for any 
user of this instance (no problem for the other ones). 
Is there some documentation for the debugging technique? Is it possible to 
take beta releases? Enrique. 

El sábado, 14 de enero de 2017, 11:13:37 (UTC+1), Dima Pasechnik escribió:
>
> Oh, right, this certainly has nothing to do with sagenb, what is not 
> stopped is sage worker that does the computation itself, right?
>
> Could it be that you updated your OS in the meantime, and if you roll back 
> to sage 7.3 you would still see the same behaviour?
>
> On sage's side it might be ipython update, although I am guessing.
>
> There is a debugging technique that would let you find a git commit that 
> caused the change you noticed, using git bisect, although this might take a 
> full day of work or so, just because there were few hundred commits and you 
> would need to run 'make build' a dozen times or so, with testing after each 
> rebuild...
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] simplifying radicals of trigonometric expressions

2017-01-14 Thread Enrique Artal
This is true. The problem is that if not used, simple expressions keep to 
be too much complicated. Is there any compromise?

El viernes, 13 de enero de 2017, 21:08:16 (UTC+1), Michael Orlitzky 
escribió:
>
> On 01/13/2017 05:12 AM, Enrique Artal wrote: 
> > I would like to know how to handle with this issue. Consider a function 
> > f=sqrt(cos(x)^3 - 3*cos(x)^2 - cos(x) + 6). It is possible to deal with 
> > this function for standard procedures like numerical_integral in (-1,1). 
> > If one considers f.canonicalize_radical() it is presented 
> > as sqrt(cos(x)^2 - cos(x) - 3)*sqrt(cos(x) - 2), which avoids numerical 
> > integration in particular since each factor is complex in (-1,1). It is 
> > not solved if x is declared as a real variable (with domain='real'). For 
> > this particular function, it is not hard to avoid the issue, but if it 
> > appears in more complex expressions, it is less obvious. 
>
> Don't use canonicalize_radical =) 
>
> If you read its documentation, there is a big WARNING stating that it is 
> going to do weird and unpredictable things. As you have discovered, it's 
> not a form of simplification -- the input and output may be wildly 
> different functions. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: How to limit heavy computations

2017-01-14 Thread Enrique Artal
sagenb

El viernes, 13 de enero de 2017, 19:34:15 (UTC+1), Dima Pasechnik escribió:
>
>
>
> On Friday, January 13, 2017 at 5:30:04 PM UTC, Enrique Artal wrote:
>>
>> Putting limits in /etc/security/limits.conf (or in files in limits.d) 
>> works right up to Sage 7.3. Namely, if a user performs a strong computation 
>> (memory or CPU time), the system stops the computation when the limit is 
>> reached; usually one needs to quit the worksheet, but it is possible to 
>> reuse the notebook. With 7.4 and 7.5, when the limit is reached the 
>> notebook becomes unusable and the only possibility to work is to kill and 
>> restart it. Some change between 7.3 and 7.4 may cause it.
>>
>
> "the notebook"? Which one? sagenb, or jupyter?
>  
>
>>
>>
>> El domingo, 27 de noviembre de 2016, 21:55:06 (UTC+1), Enrique Artal 
>> escribió:
>>>
>>> It seems to work now with the ulimits for the server_pool users. If they 
>>> become too strict, we (maybe more precisely MIguel Marco) will try the 
>>> worker user approach. We will let know. Thanks for the help!
>>>
>>> El domingo, 27 de noviembre de 2016, 21:23:33 (UTC+1), Nils Bruin 
>>> escribió:
>>>>
>>>> On Sunday, November 27, 2016 at 3:04:48 AM UTC-8, Enrique Artal wrote:
>>>>>
>>>>> Thanks, As you say, it would be better something more direct, but your 
>>>>> approach is a strong improvement for my needs. 
>>>>> By the way, I changed in our experimental notebook 7.4 -> 7.3 and the 
>>>>> limits work: they stop the process and the notebook is still running.
>>>>>
>>>>
>>>> for sage 7.5beta(?) setting ulimits does have effect: with
>>>>
>>>> sh$ ulimit  -v 1000
>>>> sh$ sage -c 'L=[1]
>>>> for i in [1..1000]:
>>>>   L = L+L
>>>>   print i'
>>>>
>>>> I get a memory error after "28" has been printed (and without it, it 
>>>> continues longer), and if I take the bound much lower sage will not even 
>>>> start.
>>>>
>>>> So if you configure the "worker" user to have such a ulimit, I'd expect 
>>>> memory problems to be significantly reduced. People who try to use more 
>>>> memory should see their kernel die before it's causing problems for other 
>>>> people.
>>>>
>>>> Given that there's no way of controling which notebook user gets mapped 
>>>> to which worker uid, I don't think there's much mileage to be had from 
>>>> configuring multiple worker uids (other than having them on multiple 
>>>> machines to load-balance a little bit).
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: How to limit heavy computations

2017-01-13 Thread Enrique Artal
Putting limits in /etc/security/limits.conf (or in files in limits.d) works 
right up to Sage 7.3. Namely, if a user performs a strong computation 
(memory or CPU time), the system stops the computation when the limit is 
reached; usually one needs to quit the worksheet, but it is possible to 
reuse the notebook. With 7.4 and 7.5, when the limit is reached the 
notebook becomes unusable and the only possibility to work is to kill and 
restart it. Some change between 7.3 and 7.4 may cause it.

El domingo, 27 de noviembre de 2016, 21:55:06 (UTC+1), Enrique Artal 
escribió:
>
> It seems to work now with the ulimits for the server_pool users. If they 
> become too strict, we (maybe more precisely MIguel Marco) will try the 
> worker user approach. We will let know. Thanks for the help!
>
> El domingo, 27 de noviembre de 2016, 21:23:33 (UTC+1), Nils Bruin escribió:
>>
>> On Sunday, November 27, 2016 at 3:04:48 AM UTC-8, Enrique Artal wrote:
>>>
>>> Thanks, As you say, it would be better something more direct, but your 
>>> approach is a strong improvement for my needs. 
>>> By the way, I changed in our experimental notebook 7.4 -> 7.3 and the 
>>> limits work: they stop the process and the notebook is still running.
>>>
>>
>> for sage 7.5beta(?) setting ulimits does have effect: with
>>
>> sh$ ulimit  -v 1000
>> sh$ sage -c 'L=[1]
>> for i in [1..1000]:
>>   L = L+L
>>   print i'
>>
>> I get a memory error after "28" has been printed (and without it, it 
>> continues longer), and if I take the bound much lower sage will not even 
>> start.
>>
>> So if you configure the "worker" user to have such a ulimit, I'd expect 
>> memory problems to be significantly reduced. People who try to use more 
>> memory should see their kernel die before it's causing problems for other 
>> people.
>>
>> Given that there's no way of controling which notebook user gets mapped 
>> to which worker uid, I don't think there's much mileage to be had from 
>> configuring multiple worker uids (other than having them on multiple 
>> machines to load-balance a little bit).
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] simplifying radicals of trigonometric expressions

2017-01-13 Thread Enrique Artal
I would like to know how to handle with this issue. Consider a function 
f=sqrt(cos(x)^3 - 3*cos(x)^2 - cos(x) + 6). It is possible to deal with 
this function for standard procedures like numerical_integral in (-1,1). If 
one considers f.canonicalize_radical() it is presented as sqrt(cos(x)^2 - 
cos(x) - 3)*sqrt(cos(x) - 2), which avoids numerical integration in 
particular since each factor is complex in (-1,1). It is not solved if x is 
declared as a real variable (with domain='real'). For this particular 
function, it is not hard to avoid the issue, but if it appears in more 
complex expressions, it is less obvious.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Using extra gap packages

2016-12-24 Thread Enrique Artal
Thanks!

El domingo, 25 de diciembre de 2016, 0:40:43 (UTC+1), Dima Pasechnik 
escribió:
>
>
>
> On Saturday, December 24, 2016 at 11:20:32 PM UTC, Dima Pasechnik wrote:
>>
>>
>>
>> On Saturday, December 24, 2016 at 3:38:43 PM UTC, Enrique Artal wrote:
>>>
>>> I need to use a gap package which is not installed by sage, namely nq. I 
>>> have been able to install it using wiki instructions and I can use it in a 
>>> gap session inside sage: e.g., 
>>>
>>> LowerCentralFactors(FreeGroup(1),1);
>>>
>>> after the package has been loaded. In a sage session the following code 
>>> works 
>>>
>>> gap_reset_workspace()
>>> gap.LoadPackage('"nq"')
>>> F0=gap.FreeGroup(1)
>>> gap.LowerCentralFactors(F0,1)
>>>
>>> but not the following one
>>>
>>> gap.LowerCentralFactors(FreeGroup(1).gap(),1)
>>>
>>
>> I'd suggest using libgap. rather than gap., in particular as Sage's 
>> FreeGroup is implemented using libgap
>> interface. So the last command needs to cross from GAP to libGAP 
>> interface, and this might be flaky.
>>
>
> indeed, the following works (afer installing nq):
>
> sage: libgap.LowerCentralFactors(FreeGroup(1),1)
> [ [ 0 ] ]
> sage: libgap.LoadPackage('nq') # single ' here!
> true
> sage: F0=libgap.FreeGroup(1)
> sage: libgap. (F0,1)
> [ [ 0 ] ]
> sage: libgap.LowerCentralFactors(FreeGroup(1),1)
> [ [ 0 ] ]
>   
> To make this work you will need to edit the file
> SAGE_ROOT/src/sage/libs/gap/gap_functions.py
> and add the line
>
>   'LowerCentralFactors',
>
> into the long list of GAP functions there. 
> (And probably more functions from the package
> need to be added to be callable this way)
>
> we will need to automate this at some point...
>
> Don't forget to run 'sage -b' for this change to take effect.
>
> HTH
> Dima
>
>
>>
>>  
>>
>>>
>>> Thanks, Enrique
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Using extra gap packages

2016-12-24 Thread Enrique Artal
I need to use a gap package which is not installed by sage, namely nq. I 
have been able to install it using wiki instructions and I can use it in a 
gap session inside sage: e.g., 

LowerCentralFactors(FreeGroup(1),1);

after the package has been loaded. In a sage session the following code 
works 

gap_reset_workspace()
gap.LoadPackage('"nq"')
F0=gap.FreeGroup(1)
gap.LowerCentralFactors(F0,1)

but not the following one

gap.LowerCentralFactors(FreeGroup(1).gap(),1)

Thanks, Enrique

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: How to limit heavy computations

2016-11-27 Thread Enrique Artal
It seems to work now with the ulimits for the server_pool users. If they 
become too strict, we (maybe more precisely MIguel Marco) will try the 
worker user approach. We will let know. Thanks for the help!

El domingo, 27 de noviembre de 2016, 21:23:33 (UTC+1), Nils Bruin escribió:
>
> On Sunday, November 27, 2016 at 3:04:48 AM UTC-8, Enrique Artal wrote:
>>
>> Thanks, As you say, it would be better something more direct, but your 
>> approach is a strong improvement for my needs. 
>> By the way, I changed in our experimental notebook 7.4 -> 7.3 and the 
>> limits work: they stop the process and the notebook is still running.
>>
>
> for sage 7.5beta(?) setting ulimits does have effect: with
>
> sh$ ulimit  -v 1000
> sh$ sage -c 'L=[1]
> for i in [1..1000]:
>   L = L+L
>   print i'
>
> I get a memory error after "28" has been printed (and without it, it 
> continues longer), and if I take the bound much lower sage will not even 
> start.
>
> So if you configure the "worker" user to have such a ulimit, I'd expect 
> memory problems to be significantly reduced. People who try to use more 
> memory should see their kernel die before it's causing problems for other 
> people.
>
> Given that there's no way of controling which notebook user gets mapped to 
> which worker uid, I don't think there's much mileage to be had from 
> configuring multiple worker uids (other than having them on multiple 
> machines to load-balance a little bit).
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: How to limit heavy computations

2016-11-27 Thread Enrique Artal
Thanks, As you say, it would be better something more direct, but your 
approach is a strong improvement for my needs. 
By the way, I changed in our experimental notebook 7.4 -> 7.3 and the 
limits work: they stop the process and the notebook is still running.

Enrique.

El domingo, 27 de noviembre de 2016, 6:07:05 (UTC+1), jori.ma...@uta.fi 
escribió:
>
> On Sat, 26 Nov 2016, Enrique Artal wrote: 
>
> > By the way, using server_pool, is there a way to know which user of the 
> > notebook is using a user of the server_pool?  
>
> AFAIK not really. I can list files in /tmp and run fuser for them, i.e. 
>
> fuser /tmp/* 
>
> and see, for example 
>
> /tmp/tmpwIR2_j:   7589c 
>
> and in that file I can see a line like 
>
> DATA = . . . /sage_notebook.sagenb/home/jm58660 
>
> and hence user jm58660 is behind the process #7589. 
>
> This could be scripted of course, but I would like to have better NB made 
> as admin viewpoint in mind. 
>
> -- 
> Jori Mäntysalo

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Bug(?) in the division of polynomials with the TermOrder('neglex')

2016-11-26 Thread Enrique Artal
I think the problem was not in Singular but in the Sage code for division 
of polynomials. There is a ticket, https://trac.sagemath.org/ticket/17638. 
I may help but my skills are not enough to solve the problem.

El martes, 22 de noviembre de 2016, 19:18:07 (UTC+1), Justin C. Walker 
escribió:
>
>
> On Nov 22, 2016, at 05:40 , Dima Pasechnik wrote: 
>
> > 
> > On Tuesday, November 22, 2016 at 12:19:37 PM UTC, Sho Takemori wrote: 
> >> 
> >> Thank you very much for your explanation. I have seen your post at 
> >> sage-devel before, but completely forgot it. 
> >> 
> >> I guess it would be better to raise an error or print a message than to 
> >> return a wrong result, if it is a known bug and not fixed yet. 
> >> 
> > 
> > In fact, Singular 4.0.3 (now in Sage 7.5.beta3) 
> > does the right thing: 
> > 
> >> ring r=0,(a),ls; 
> >> (1/2+a)/(1+2*a); 
> > 1/2 
> > 
> > (same if I use more variables while defining r, not just one) 
> > 
> > Thus I guess Sage does not get from Singular the data right... 
>
> I see the same with Singular 3.1.3: 
> $ Singular 
>  SINGULAR / 
>  Development 
>  A Computer Algebra System for Polynomial Computations   /   version 
> 3-1-3 
>0< 
>  by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann \   March 
> 2011 
> FB Mathematik der Universitaet, D-67653 Kaiserslautern\ 
> // ** executing /SandBox/Justin/sb/Singular/3-1-3/LIB/.singularrc 
> > ring R=0,x,dp; 
> // ** redefining R ** 
> > poly f1=(1/2)+x; 
> > poly f2=1+2*x; 
> > f1/f2; 
> 1/2 
>
> FWIW. 
>
> Justin 
>
> -- 
> Justin C. Walker, Curmudgeon at Large 
> Institute for the Absorption of Federal Funds 
> --- 
> I want to die, peacefully in my sleep, like my grandfather; 
> not screaming in terror, like his passengers. 
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: How to limit heavy computations

2016-11-26 Thread Enrique Artal
By the way, using server_pool, is there a way to know which user of the 
notebook is using a user of the server_pool? 

El sábado, 26 de noviembre de 2016, 11:50:12 (UTC+1), Enrique Artal 
escribió:
>
> I forgot to mention we use server_pool (there is one master-server and the 
> ssh connections go to accounts in both the master-server and the 
> secondary-server). All the users have unlimited ulimit, we put the ulimit 
> as an option for the notebook.
> For one notebook we put limits on the users, the problem is that if they 
> reach the limit, their process are stopped but no one can access anymore 
> the notebook. This is what happens also if will kill manually the big 
> processes in the notebooks where the users have no limits.
>
> Any help will be welcome. If we put no limits we may loose any access to 
> the computer and the only option is turn off and on; if we put, we do not 
> loose access, but the notebook is stopped too soon.
> Enrique.
>
> El sábado, 26 de noviembre de 2016, 2:49:09 (UTC+1), Nils Bruin escribió:
>>
>> On Friday, November 25, 2016 at 2:24:49 PM UTC-8, Enrique Artal wrote:
>>>
>>> In my University, most math labs are done using Sagemath; for this 
>>> purpose we have two PC's with sagenb service to which students access 
>>> remotely. In general, it works smoothly; three classrooms with 20 students 
>>> each, and people working at home simultaneously does not saturate the 
>>> servers. Sometimes, students program some infinite loops or try heavy 
>>> computations. The notebook is launched with ulimits but they do not seem to 
>>> work, and 30GB process (resident memory) arise, and they usually hang the 
>>> notebook; killing the process is not enough, one must restart the notebook.
>>>
>>
>> Unless
>>
>> https://trac.sagemath.org/ticket/9398
>>
>> has reared its head again, ulimits should be respected. However, you 
>> probably run the notebook setup in a "server pool" setup. You need to 
>> configure those accounts to set the ulimit in order to limit the memory use 
>> of the computer processes.
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: How to limit heavy computations

2016-11-26 Thread Enrique Artal
I forgot to mention we use server_pool (there is one master-server and the 
ssh connections go to accounts in both the master-server and the 
secondary-server). All the users have unlimited ulimit, we put the ulimit 
as an option for the notebook.
For one notebook we put limits on the users, the problem is that if they 
reach the limit, their process are stopped but no one can access anymore 
the notebook. This is what happens also if will kill manually the big 
processes in the notebooks where the users have no limits.

Any help will be welcome. If we put no limits we may loose any access to 
the computer and the only option is turn off and on; if we put, we do not 
loose access, but the notebook is stopped too soon.
Enrique.

El sábado, 26 de noviembre de 2016, 2:49:09 (UTC+1), Nils Bruin escribió:
>
> On Friday, November 25, 2016 at 2:24:49 PM UTC-8, Enrique Artal wrote:
>>
>> In my University, most math labs are done using Sagemath; for this 
>> purpose we have two PC's with sagenb service to which students access 
>> remotely. In general, it works smoothly; three classrooms with 20 students 
>> each, and people working at home simultaneously does not saturate the 
>> servers. Sometimes, students program some infinite loops or try heavy 
>> computations. The notebook is launched with ulimits but they do not seem to 
>> work, and 30GB process (resident memory) arise, and they usually hang the 
>> notebook; killing the process is not enough, one must restart the notebook.
>>
>
> Unless
>
> https://trac.sagemath.org/ticket/9398
>
> has reared its head again, ulimits should be respected. However, you 
> probably run the notebook setup in a "server pool" setup. You need to 
> configure those accounts to set the ulimit in order to limit the memory use 
> of the computer processes.
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] How to limit heavy computations

2016-11-25 Thread Enrique Artal
In my University, most math labs are done using Sagemath; for this purpose 
we have two PC's with sagenb service to which students access remotely. In 
general, it works smoothly; three classrooms with 20 students each, and 
people working at home simultaneously does not saturate the servers. 
Sometimes, students program some infinite loops or try heavy computations. 
The notebook is launched with ulimits but they do not seem to work, and 
30GB process (resident memory) arise, and they usually hang the notebook; 
killing the process is not enough, one must restart the notebook.
We have tried some limitations of memlock and cpu time in 
/etc/security/limits.conf but it seems they are too strict; I am not sure 
if it is the reason, but an open worksheet seems to use CPU time even with 
no computation and then the notebook becomes completely inaccessible. 
Which is the good strategy to avoid this? The systems run Ubuntu 16.04 and 
Sagemath 7.3
Thanks, Enrique Artal.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Bug(?) in the division of polynomials with the TermOrder('neglex')

2016-11-22 Thread Enrique Artal
This is an old bug affecting polynomials with local or semilocal orders. 
The problem is that at some point, the definition of the division by a 
polynomial checks first if the polynomial is a unit and in that case it 
identifies it with the constant term. This works for global orderings, but 
it causes this problems with local ones. Some people suggested to create a 
new class of rings to take into account that when considering non global 
rings the actual ring is bigger than the polynomial ring. For me, this is 
beyond my sage abilities.

El viernes, 18 de noviembre de 2016, 3:03:01 (UTC+1), Sho Takemori escribió:
>
> Dear all,
>
> I created a polynomial ring with the "neglex" term order and computed the 
> division of polynomials as follows.
>
> sage: R. = PolynomialRing(QQ, 1, order=TermOrder('neglex'))
> sage: (1/2 + a) / (1 + 2 * a)
> 1/2 + a
>
> I expected the result was 1/2.
> The Sage version is 7.4 and Sage is running on Ubuntu 16.04.
>
> Best regards,
> Sho Takemori
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Fraction field with local orderings

2015-01-14 Thread Enrique Artal
Hello,
I have encountered a problem if we work with the fraction field of a 
polynomial ring with a local ordering. The following code is done in 6.4:

sage: R2.=PolynomialRing(QQ,order='lex')
sage: g=1+x
sage: 1/g
1/(x + 1)
sage: (1/g).parent()
Fraction Field of Multivariate Polynomial Ring in x, y over Rational Field
sage: S2.=PolynomialRing(QQ,order='negdeglex')
sage: f=1+x
sage: 1/f
1
sage: f.parent()
Multivariate Polynomial Ring in x, y over Rational Field
sage: (1/f).parent()
Fraction Field of Multivariate Polynomial Ring in x, y over Rational Field
sage: f.is_unit()
True

Note that the result is correct with a global ordering but not with a local 
one. Miguel Marco looked into the definitions and it seems that since the 
problem may come from the definition of division. If the denominator is a 
unit then the result is a polynomial with all the monomial divided by the 
denominator; assuming that the base ring is a field the units are the 
non-zero scalars. It seems that Singular rings are not actual polynomial 
rings but localizations of those (a polynomial is a unit if and only if its 
leading monomial is 1) and hence a fraction p/q becomes the quotient 
between p and the leading monomial of q when q is a scalar.

Besides that, I tried to reproduce the example with only one variable but 
in that case both rings are equal.

Unfortunately I do not know the best way to correct it. The quotient 
algorithm should be modified and I wonder if S2 as set should be the 
polynomial ring or the ordering ring (in this case the localisation on the 
maximal ideal).

Best, Enrique.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: gap packages and sage

2011-06-17 Thread Enrique Artal
Hi Dimitrii and Simon,

Finally I was able to compile the package nq (after installing glibc
and gmp static versions).
I installed also alnuth and polycyclic, but the order
gap_reset_workspace() is not enough
in my installation. I will try other solutions. Best, Enrique.

On 16 jun, 18:44, Simon King  wrote:
> Hi Dmitrii and Enrique,
>
> On 16 Jun., 17:17, Dima Pasechnik  wrote:
>
> > On 16-Jun-2011, at 3:28 PM, Enrique Artal Bartolo wrote:
>
> > > Dear Dimitri,
> > > I am not sure if your are the good correspondant for this mail. I am a 
> > > gap user and now
> > > I started to use sage. I appreciate a lot your work but I have a small 
> > > problem.
> > > I installed the optional spkg with additional packages for gap; there are 
> > > some
> > > packages which I use with gap (outside sage) which are not included. I 
> > > tried
> > > to compile them in the sage tree but sage-gap does not recognize them.
>
> IIRC compiling them in the Sage tree (or more precisely in the
> location Dmitrii has indicated) almost suffices. But it may be needed
> to run the command
>    sage: gap_reset_workspace()
> to make GAP in Sage aware of the existence of the new package.
>
> At least that's what I do when I install GAP packages that are not
> part of the optional spkg.
>
> Cheers,
> Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org