[sage-support] Re: solution of a 4th degree equation is real despite containing I but causes trouble

2019-02-20 Thread John H Palmieri
Or range(abs(t))? Then if there is some numerical noise leading to a tiny 
imaginary part (your t might be evaluated to

2.573037896825689 - 4.365411232224172e-17*I

for example), abs(t) won't care.



On Wednesday, February 20, 2019 at 10:42:32 AM UTC-8, John H Palmieri wrote:
>
> How about range(0, RR(t))?
>
>
> On Wednesday, February 20, 2019 at 10:11:14 AM UTC-8, Michael Beeson wrote:
>>
>> Oh,  and  range(0,n(t))  also crashes.
>>
>>

-- 
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: solution of a 4th degree equation is real despite containing I but causes trouble

2019-02-20 Thread John H Palmieri
How about range(0, RR(t))?


On Wednesday, February 20, 2019 at 10:11:14 AM UTC-8, Michael Beeson wrote:
>
> Oh,  and  range(0,n(t))  also crashes.
>
>

-- 
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: solution of a 4th degree equation is real despite containing I but causes trouble

2019-02-20 Thread Michael Beeson
Oh,  and  range(0,n(t))  also crashes.

-- 
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] solution of a 4th degree equation is real despite containing I but causes trouble

2019-02-20 Thread Michael Beeson
The solution of a cubic or quartic may require the use of complex numbers. 
(Indeed that's how the complex numbers were first discovered.)
Below I exhibit a long expression for such a number that solve() found for 
me.
It evaluates using n(t) to a real (decimal) number,  and it passes " t in 
RR" 
although that takes five minutes and turns the fan of my laptop on (a sign 
of
serious CPU use).  Then I enter this number in range(0,t), which should be 
OK 
if t is real,  but it causes the same crash that range(0,I) causes, 
 complaining that 
t is complex.   Below is the code  (Sage version is 8.0--I plan to update 
Real Soon Now).
Well, so you may wonder "what is the actual question"?  It is,  how can I 
get my 
hands on this number in a form that I can actually put into range?   I want 
to bound 
a search by the size of the solution of a quartic and could not manage it 
because of 
this problem.



def test():
t =  -2/3*((sqrt(3)*sqrt((675*(88/30375*I*sqrt(79)*sqrt(3) + 
1328/3375)^(2/3) + 552*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) + 
364)/(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3)) - 
45*sqrt(-(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) - 
704/225*sqrt(3)/sqrt((675*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(2/3) + 
552*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) + 
364)/(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3)) - 
364/675/(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) + 368/225) + 6)^2 - 
90*sqrt(3)*sqrt((675*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(2/3) + 
552*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) + 
364)/(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3)) + 
4050*sqrt(-(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) - 
704/225*sqrt(3)/sqrt((675*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(2/3) + 
552*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) + 
364)/(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3)) - 
364/675/(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) + 368/225) - 
4590)/((sqrt(3)*sqrt((675*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(2/3) + 
552*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) + 
364)/(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3)) - 
45*sqrt(-(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) - 
704/225*sqrt(3)/sqrt((675*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(2/3) + 
552*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) + 
364)/(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3)) - 
364/675/(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) + 368/225) + 
6)*(sqrt(1/3)*sqrt((675*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(2/3) + 
552*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) + 
364)/(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3)) - 
15*sqrt(-(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) - 
704/75*sqrt(1/3)/sqrt((675*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(2/3) 
+ 552*(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) + 
364)/(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3)) - 
364/675/(88/30375*I*sqrt(79)*sqrt(3) + 1328/3375)^(1/3) + 368/225) + 2)) + 
0.0100 
print(n(t))
print(t in RR)
print(range(0,t))

-- 
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] Fwd: Sage Crash Report

2019-02-20 Thread John Cremona
On Wed, 20 Feb 2019 at 14:24, Douglas Webster 
wrote:

> Thank you, Isuru, for the assistance, but I'm afraid it still isn't
> working.  The program is still crashing, but this time it seems to be the
> elliptical curves module that is causing the problem.  A copy of the crash
> report is attached but I think I will reinstall the binary version of sage
> until package has been updated.
>

It looks as if eclib failed to build.  This is first noticed when building
the part of sagelib which uses it.  If you can find the part of your build
log relating to building eclib that might help debug.


>
> Best regards
> Douglas
>
> On Tue, 19 Feb 2019 at 19:18, Isuru Fernando  wrote:
>
>> This is a known issue with the conda package as the sage package hasn't
>> been updated yet for the new compiler runtimes on conda-forge.
>>
>> Try,
>>
>> conda create -n sage sage -c conda-forge/label/cf201901
>>
>> Isuru
>>
>> On Tue, Feb 19, 2019 at 1:11 PM Douglas Webster <
>> douglas.webster2...@gmail.com> wrote:
>>
>>>
>>>
>>>
>>> Operating system: See Attached file.
>>>
>>> I installed Sage using conda giving the following commands during the
>>> session as per the instructions on the sage website:
>>>
>>> conda update --all
>>> anaconda-navigator
>>> conda create -n sage sage
>>> conda activate sage
>>> sage
>>>
>>>
>>> I then removed the conda environment and reinstalled it following the
>>> above method.  The complete re-instillation session record is detailed in
>>> the file CrashReproduction.txt.
>>> Also included is the SystemInfo as reported by the Linux Mint app.
>>> There are two crash reports, Sage_crash_report_1st.txt being generated
>>> from the original installation and Sage_crash_report.txt from the
>>> reinstallation
>>>
>>> I have previously installed sage successfully as a binary package.  This
>>> I removed before trying it as a conda package.
>>>
>>> Hopefully this will be of some help.
>>>
>>> Best regards
>>> Douglas
>>>
>>> --
>>> 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.
>>>
>> --
>> 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.
>>
> --
> 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.
>

-- 
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] groebner basis algorithm: intended way of calling (out of other method)

2019-02-20 Thread Daniel Krenn
On 2019-02-08 10:07, Daniel Krenn wrote:
> Let I be an ideal. Then I might want to compute something involving
> Groebner basis, e.g. computing I.variety().
> Now suppose one wants to select a particular algorithm for the
> computation of the Groebner basis. Then (due to caching) I use something
> along the lines of
> 
>   GB = I.groebner_basis(algorithm='libsingular:slimgb')
>   I.groebner_basis.set_cache(GB)
>   I.variety()
> 
> Is this the intended way of doing so?
> 
> (It somehow feels wrong that one needs quite some background on the
> implementation and technical understanding (caching in SageMath) to
> understand the behavior.)

This is now
  https://trac.sagemath.org/ticket/27328
which proposes to use what is cached if no algorithm is given. Needs review.

-- 
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] Fwd: Sage Crash Report

2019-02-20 Thread Douglas Webster
Thank you, Isuru, for the assistance, but I'm afraid it still isn't
working.  The program is still crashing, but this time it seems to be the
elliptical curves module that is causing the problem.  A copy of the crash
report is attached but I think I will reinstall the binary version of sage
until package has been updated.

Best regards
Douglas

On Tue, 19 Feb 2019 at 19:18, Isuru Fernando  wrote:

> This is a known issue with the conda package as the sage package hasn't
> been updated yet for the new compiler runtimes on conda-forge.
>
> Try,
>
> conda create -n sage sage -c conda-forge/label/cf201901
>
> Isuru
>
> On Tue, Feb 19, 2019 at 1:11 PM Douglas Webster <
> douglas.webster2...@gmail.com> wrote:
>
>>
>>
>>
>> Operating system: See Attached file.
>>
>> I installed Sage using conda giving the following commands during the
>> session as per the instructions on the sage website:
>>
>> conda update --all
>> anaconda-navigator
>> conda create -n sage sage
>> conda activate sage
>> sage
>>
>>
>> I then removed the conda environment and reinstalled it following the
>> above method.  The complete re-instillation session record is detailed in
>> the file CrashReproduction.txt.
>> Also included is the SystemInfo as reported by the Linux Mint app.
>> There are two crash reports, Sage_crash_report_1st.txt being generated
>> from the original installation and Sage_crash_report.txt from the
>> reinstallation
>>
>> I have previously installed sage successfully as a binary package.  This
>> I removed before trying it as a conda package.
>>
>> Hopefully this will be of some help.
>>
>> Best regards
>> Douglas
>>
>> --
>> 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.
>>
> --
> 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.
>

-- 
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.
***

IPython post-mortem report

{'commit_hash': u'033ab93c7',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': 
'/***/**/miniconda3/envs/sage/lib/python2.7/site-packages/IPython',
 'ipython_version': '5.8.0',
 'os_name': 'posix',
 'platform': 'Linux-4.15.0-45-generic-x86_64-with-debian-buster-sid',
 'sys_executable': '/***/**/miniconda3/envs/sage/bin/python',
 'sys_platform': 'linux2',
 'sys_version': '2.7.14 | packaged by conda-forge | (default, Dec  9 2017, 
16:18:43) \n[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)]'}

***



***

Crash traceback:

---
---
ImportError   Python 2.7.14: /***/**/miniconda3/envs/sage/bin/python
   Wed Feb 20 14:10:38 2019
A problem occurred executing Python code.  Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/***/**/miniconda3/envs/sage/bin/sage-ipython in ()
  1 #!/***/**/miniconda3/envs/sage/bin/python
  2 # -*- coding: utf-8 -*-
  3 """
  4 Sage IPython startup script.
  5 """
  6 
  7 from sage.repl.interpreter import SageTerminalApp
  8 
  9 app = SageTerminalApp.instance()
---> 10 app.initialize()
global app.initialize = >
 11 app.start()

 in initialize(self=, argv=None)

/***/**/miniconda3/envs/sage/lib/python2.7/site-packages/traitlets/config/application.pyc
 in catch_config_error(method=, 
app=, *args=(None,), **kwargs={})
 72 TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR = False
 73 else:
 74 raise ValueError("Unsupported value for environment variable: 
'TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR' is 

[sage-support] Re: trig simplify disappointed me

2019-02-20 Thread Emmanuel Charpentier
Well... Sage does not, indeed, "automagically" apply all possible trig 
identities . 
But perusing them allow to select (with a tiny grain of salt) the right one:

sage: tan(1/2*arctan(12/5)).subs(tan(w0/2)==sin(w0)/(1+cos(w0)))
2/3

HTH,


Le mercredi 20 février 2019 09:15:59 UTC+1, Michael Beeson a écrit :
>
> sage: t
>
> tan(1/2*arctan(12/5))
>
> sage: t.trig_simplify()
>
> sin(1/2*arctan(12/5))/cos(1/2*arctan(12/5))
>
> sage: n(t)
>
> 0.667
>
>
> But trig_simplify  couldn't get 2/3.  Maybe there
>
> is a fancier command that will do it?
>
>   
>

-- 
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] trig simplify disappointed me

2019-02-20 Thread Michael Beeson


sage: t

tan(1/2*arctan(12/5))

sage: t.trig_simplify()

sin(1/2*arctan(12/5))/cos(1/2*arctan(12/5))

sage: n(t)

0.667


But trig_simplify  couldn't get 2/3.  Maybe there

is a fancier command that will do it?

  

-- 
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: solve() behavior

2019-02-20 Thread Michael Beeson
after solving an equation (or not) for x,  I can check if the answer still 
contains x  by  ans.has(x).
That should weed out any non-explicit solutions.

But still:  am I guaranteed for any class of equations, e.g. polynomial 
equations of degree <= 4, 
that if solve produces an empty list there really are no solutions?  (I 
mean of course,  am I
guaranteed that if there are no bugs,  this is true?)




>

-- 
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.