[sage-support] Re: Arithmetic in Jacobians of Hyperelliptic Curves

2021-06-21 Thread Zachary Scherr
Thanks!  I can try to investigate, but in the meantime I will open a ticket 
for this on trac.

On Sunday, June 20, 2021 at 7:32:47 AM UTC-4 Kwankyu wrote:

> Hi,
>
> On Sunday, June 20, 2021 at 10:18:50 AM UTC+9 zsc...@gmail.com wrote:
>
>> I have reason to believe that the point P is not torsion and so Magma is 
>> correct and Sage is incorrect.  I don't know enough about the algorithms 
>> used to work with points on hyperelliptic Jacobians and so I'm not 
>> confident in my ability to track down what's going on.
>>
>
> By my own computation, I confirm that Sage is incorrect. Looking at the 
> Sage source code, I see that Sage uses Cantor's reduction algorithm based 
> on Mumford representation of divisors by ideals. Sage wrongly computes 5*P 
> to (1) unit ideal. So I guess there seems a bug in the implementation of 
> Cantor's 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/a6be3412-36b0-4470-ad82-bdcadb74fbd2n%40googlegroups.com.


[sage-support] Arithmetic in Jacobians of Hyperelliptic Curves

2021-06-19 Thread Zachary Scherr
Hi,

   I believe that I found a disagreement between Sage and Magma in the 
following calculations:

Sage:

R. = QQ[]
f = 144*x^6 - 240*x^5 + 148*x^4 + 16*x^3 - 16*x^2 - 4*x + 1
H = HyperellipticCurve(f)
J = Jacobian(H)
P = J(H(0,1))-J(H(0,-1))
(5*P).is_zero()

returns True

Magma:

R := PolynomialRing(Rationals());
f := 144*x^6 - 240*x^5 + 148*x^4 + 16*x^3 - 16*x^2 - 4*x + 1;
H := HyperellipticCurve(f);
J := Jacobian(H);
P := H![0,1] - H![0,-1];
IsZero(5*P);

returns false.

I have reason to believe that the point P is not torsion and so Magma is 
correct and Sage is incorrect.  I don't know enough about the algorithms 
used to work with points on hyperelliptic Jacobians and so I'm not 
confident in my ability to track down what's going on.

-- 
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/ecfcda99-b50e-4bb0-b380-92a4087e9100n%40googlegroups.com.


[sage-support] Re: Sage Crash Report

2021-01-04 Thread Zachary Scherr
Glad I can help.  This is another reason why these virtual environments are 
really useful! I have one environment for sage which I never try to update 
since I know that everything works.  Separately, I have my "main" 
environment that I update regularly, which will occasionally break things. 
 I broke ipython in that environment and then stumbled 
on https://github.com/ipython/ipython/issues/12740 which tracks this 
problem.

You can also feel free to experiment without fear of breaking things using 
conda.  For example, I see that you have sage installed with python 3.8. 
 If you wanted to try sage with python 3.9 without any fear you could do 
something like

conda create -n sage_python3.9 sage=9.2 python=3.9 -c conda-forge

and then you would have a new environment with sage 9.2 and python 3.9.  

Given how often Mac's new operating systems break everything, it's kind of 
amazing that conda has been so stable.  A lot of credit goes to Isuru 
Fernando and the work that he puts in on maintaining sage on conda forge.

On Monday, January 4, 2021 at 12:58:09 PM UTC-5 maciek...@gmail.com wrote:

> ad. 1. It turned out that indeed I had installed the most recent version 
> of jedi. Installing 0.17.2 fixed the problem - thank you very much!
>
> ad. 2. I see - I am new to conda and I only used it to install sage; 
> thanks for your explanation.
>
> On Monday, January 4, 2021 at 6:38:01 PM UTC+1 zsc...@gmail.com wrote:
>
>> 1.  Did you by any chance accidentally update the jedi package? This is 
>> not really a sage problem, but ipython 7.19.0 is incompatible with the most 
>> recent version of jedi 0.18.0.  In your sage environment you can run "conda 
>> list" to see what packages you have installed.  If jedi 0.18.0 is listed 
>> then you can run "conda install jedi==0.17.2".
>>
>> 2.  That's kinda the whole point behind anaconda/miniconda.  You can put 
>> different python projects into different environments so that their 
>> dependencies don't contaminate one another.  If you want to have your sage 
>> environment always loaded you can activate it in your .zshrc file or you 
>> can do something like 
>>
>> >> alias sage="whatever your path to the conda sage binary is".
>>
>> On Monday, January 4, 2021 at 8:48:28 AM UTC-5 maciek...@gmail.com wrote:
>>
>>> Hi,
>>>
>>> I encountered the following problems with sage:
>>>
>>> 1. It crashes when I am using tab auto completion - report attached.
>>> 2. Each time I want to use sage (by command 'sage') after restarting the 
>>> system I need to type 'conda activate sage'. Otherwise command sage is 
>>> not recognized ('-bash: sage: command not found').
>>>
>>> I run Sage 9.2 on MacOS Big Sur 11.1 (Macbook Pro) which was installed 
>>> by Conda.
>>>
>>> Best,
>>> Maciek
>>>
>>

-- 
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/d261b6be-8ca6-417e-bcdc-0647ac9a53cdn%40googlegroups.com.


[sage-support] Re: Sage Crash Report

2021-01-04 Thread Zachary Scherr
1.  Did you by any chance accidentally update the jedi package? This is not 
really a sage problem, but ipython 7.19.0 is incompatible with the most 
recent version of jedi 0.18.0.  In your sage environment you can run "conda 
list" to see what packages you have installed.  If jedi 0.18.0 is listed 
then you can run "conda install jedi==0.17.2".

2.  That's kinda the whole point behind anaconda/miniconda.  You can put 
different python projects into different environments so that their 
dependencies don't contaminate one another.  If you want to have your sage 
environment always loaded you can activate it in your .zshrc file or you 
can do something like 

>> alias sage="whatever your path to the conda sage binary is".

On Monday, January 4, 2021 at 8:48:28 AM UTC-5 maciek...@gmail.com wrote:

> Hi,
>
> I encountered the following problems with sage:
>
> 1. It crashes when I am using tab auto completion - report attached.
> 2. Each time I want to use sage (by command 'sage') after restarting the 
> system I need to type 'conda activate sage'. Otherwise command sage is 
> not recognized ('-bash: sage: command not found').
>
> I run Sage 9.2 on MacOS Big Sur 11.1 (Macbook Pro) which was installed by 
> Conda.
>
> Best,
> Maciek
>

-- 
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/f7acfe71-e5ea-4a46-afee-cc333f371222n%40googlegroups.com.


[sage-support] Re: Why is f.inverse() so slow?

2020-11-10 Thread Zachary Scherr
Are you sure it's the inverse function which is slow? Just looking at the 
command 

f = prod((1 - x^n)^a(n) for n in (1..size)) + O(x^size)

I would guess that first the gigantic product is computed, and only then 
would the resulting polynomial be truncated by the O(x^size) part.

Maybe try to alter that via:

f = prod((1 - x^n + O(x^size))^a(n) for n in (1..size))



On Tuesday, November 10, 2020 at 4:07:12 PM UTC-5 Peter Luschny wrote:

> Hi all,
>
> I wanted to implement the Euler Transformation. 
> https://oeis.org/wiki/Euler_transform
> My first attempt was:
>
> def EulerTransform(size, a):
> R. = ZZ[[]]
> f = prod((1 - x^n)^a(n) for n in (1..size)) + O(x^size)
> return f.inverse().list()
>
> print(EulerTransform(6, lambda n: factorial(n)))
>
> Now try this with size = 30. I have no idea how long this 
> takes because after 3 years I turned the computer off.
>
> Am I doing something fundamentally wrong, or is f.inverse() 
> hopelessly slow?
>
> You can of course implement it differently, but that's not my 
> question. For those who are interested in the transformation
> here the fast variant:
>
> def EulerTrans(a):
> @cached_function
> def b(n):
> if n == 0: return 1
> s = sum(sum(d*a(d) for d in divisors(j))*b(n-j) for j in (1..n))
> return s//n
> return b
> 
> b = EulerTrans(lambda n: factorial(n))
> print([b(n) for n in range(30)])
>
> Thanks
>
>
>

-- 
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/eb26f117-fe6c-4cbd-94c4-5b63f374500en%40googlegroups.com.


[sage-support] Re: Error while applying 'make' to a Sage package

2020-10-16 Thread Zachary Scherr
Dima is the expert on this and can correct me if I'm wrong, but I think 
Xcode 12 broke sage 9.1.  Fortunately this is being fixed for 9.2 which is 
already on a release candidate but has not been released in the wild yet. 
 Probably the easiest thing to do would be to clone the git repository and 
install the latest developer version:

git clone git://github.com/sagemath/sage.git
cd sage
./bootstrap
source .homebrew-build-env
./configure
make -j16

Also, you can see from config.log that sage encourages you to brew install 
python3, which isn't necessary but could speed things up a tiny amount.

On Friday, October 16, 2020 at 5:27:43 PM UTC-4 Douglas Hulbert wrote:

> Dima and Zachary, thank you for rapid responses.
> Attached is the config.log file, found in the directory 
> /Users/douglashulbert/sage-9.1.
> I noticed that there's a gap in the version numbers between my OS version 
> and those posted on the MIT mirror site.  
> I went to http://mirrors.mit.edu/sage/devel/index.html.  I'm working to 
> see how to choose the appropriate tar file. 
>
> On Friday, October 16, 2020 at 1:07:37 PM UTC-7 zsc...@gmail.com wrote:
>
>> Can you post the config.log file that was generated by running 
>> ./configure before running make?
>>
>> On Friday, October 16, 2020 at 3:19:27 PM UTC-4 Douglas Hulbert wrote:
>>
>>> Dear Member of the SAGE-DEVEL team:
>>>
>>>
>>>1. My latest attempt to use MAKE to install sage is unsuccessful.
>>>2. I'm using a MacBook Pro 15" 2019 2.4 GHz 8-core Intel Core i9 
>>>running macOS Catalina V. 10.15.7.
>>>3. A log file requested in zsh shell output response to the MAKE 
>>>command is attached.
>>>4. Other zsh output is pasted below.
>>>5. Just this month retired from USGovt service, I'm a math Ph.D. and 
>>>former professor who is enthused about the prospects of putting sage to 
>>>work in math education.
>>>
>>> Best regards to you and your team,
>>>
>>> Doug Hulbert
>>>
>>>
>>>
>>>
>>> 
>>>
>>> Error configuring gf2x-1.2.p0 See the file
>>>
>>> 
>>> /Users/douglashulbert/sage-9.1/local/var/tmp/sage/build/gf2x-1.2.p0/src/config.log
>>>
>>> for details.
>>>
>>>
>>> 
>>>
>>>
>>> real0m11.990s
>>>
>>> user0m4.785s
>>>
>>> sys 0m4.486s
>>>
>>> 
>>>
>>> Error installing package gf2x-1.2.p0
>>>
>>> 
>>>
>>> Please email sage-devel (http://groups.google.com/group/sage-devel)
>>>
>>> explaining the problem and including the log file
>>>
>>>   /Users/douglashulbert/sage-9.1/logs/pkgs/gf2x-1.2.p0.log
>>>
>>

-- 
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/35c5e2ba-48c3-45b8-8c16-9e40d206d9cfn%40googlegroups.com.


[sage-support] Re: Error while applying 'make' to a Sage package

2020-10-16 Thread Zachary Scherr
Can you post the config.log file that was generated by running ./configure 
before running make?

On Friday, October 16, 2020 at 3:19:27 PM UTC-4 Douglas Hulbert wrote:

> Dear Member of the SAGE-DEVEL team:
>
>
>1. My latest attempt to use MAKE to install sage is unsuccessful.
>2. I'm using a MacBook Pro 15" 2019 2.4 GHz 8-core Intel Core i9 
>running macOS Catalina V. 10.15.7.
>3. A log file requested in zsh shell output response to the MAKE 
>command is attached.
>4. Other zsh output is pasted below.
>5. Just this month retired from USGovt service, I'm a math Ph.D. and 
>former professor who is enthused about the prospects of putting sage to 
>work in math education.
>
> Best regards to you and your team,
>
> Doug Hulbert
>
>
>
>
> 
>
> Error configuring gf2x-1.2.p0 See the file
>
> 
> /Users/douglashulbert/sage-9.1/local/var/tmp/sage/build/gf2x-1.2.p0/src/config.log
>
> for details.
>
>
> 
>
>
> real0m11.990s
>
> user0m4.785s
>
> sys 0m4.486s
>
> 
>
> Error installing package gf2x-1.2.p0
>
> 
>
> Please email sage-devel (http://groups.google.com/group/sage-devel)
>
> explaining the problem and including the log file
>
>   /Users/douglashulbert/sage-9.1/logs/pkgs/gf2x-1.2.p0.log
>

-- 
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/50a8e0a0-2a5c-4957-8d0d-59ecbc2d6a0cn%40googlegroups.com.