[sage-support] Integration bug?

2018-10-01 Thread Simon King
Hi!

I get the following with sage-8.4.beta5:
  sage: f(x) = cos(pi*x)
  sage: (f(x)*exp(-I*pi*x)).integral(x)(x=1/2) - 
(f(x)*exp(-I*pi*x)).integral(x)(x=-1/2)
  1/2
  sage: (f(x)*exp(-I*pi*x)).integral(x,-1/2,1/2)
  1

The previous two expressions are not equal, but I think they should be
equal. Is it a stupid mistake of mine (but then, Wolfram alpha does the
same stupid mistake), is it a known bug, or a new bug (in that case I
should create some ticket, that would probably be my first on calculus...)?

Best regards,
Simon

-- 
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] Problem installing on Ubuntu 18.04

2018-10-01 Thread Andy Howell
I  do the following:

- cd ~/bin
- untar the Ubuntu 16.04 version
- rename the ~/bin/SageMath to ~/bin/SageMath-8.3 so that I can have
multiple versions if needed.
- ln -s ~/bin/SageMath-8.3/sage sage-8.3
- ln -s ~/bin/SageMath-8.3/sage sage # My default version

~/bin is in my path, so I can just call:

sage

or

sage -n

The later for the notebook.

I'm running Ubuntu 18.04.1 LTS

Hope that helps

Andy



On 10/01/2018 02:02 PM, Augustin Lefevre wrote:
> Hi,
>
> I went through other posts with the same title, and tried several
> different ways to install sage, all without success :
>
> 1) with apt : apt-get install sage-jupyter
> 2) downloading the latest Ubuntu 16 binary : since there are no Ubuntu
> 18 binary I chose the most recent one, then ran sage.
>
> In both cases I had the same crash at runtime, with the
> Sage_crash_report attached.
>
> Does anyone have a clue ?
>
> Best regards
> Augustin Lefèvre
> -- 
> 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.


[sage-support] Re: Problem installing on Ubuntu 18.04

2018-10-01 Thread Augustin Lefevre
 So it seems that when I make a symbolic link to /usr/share, running sage 
crashes

But when I run it directly from the install directory using : ./sage, 
everything runs fine, patches are compiled, and I get through to running a 
notebook.

-- 
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] Problem installing on Ubuntu 18.04

2018-10-01 Thread Augustin Lefevre
Hi,

I went through other posts with the same title, and tried several different 
ways to install sage, all without success : 

1) with apt : apt-get install sage-jupyter
2) downloading the latest Ubuntu 16 binary : since there are no Ubuntu 18 
binary I chose the most recent one, then ran sage.

In both cases I had the same crash at runtime, with the Sage_crash_report 
attached.

Does anyone have a clue ?

Best regards
Augustin Lefèvre

-- 
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'1149d1700',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/usr/local/lib/python2.7/dist-packages/IPython',
 'ipython_version': '5.4.1',
 'os_name': 'posix',
 'platform': 'Linux-4.15.0-34-generic-x86_64-with-Ubuntu-18.04-bionic',
 'sys_executable': '/usr/bin/python',
 'sys_platform': 'linux2',
 'sys_version': '2.7.15rc1 (default, Apr 15 2018, 21:51:34) \n[GCC 7.3.0]'}

***



***

Crash traceback:

---
---
ImportError   Python 2.7.15rc1: /usr/bin/python
   Mon Oct  1 20:58:46 2018
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.
/usr/share/sagemath/bin/sage-ipython in ()
  1 #!/usr/bin/env 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)

/usr/local/lib/python2.7/dist-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 set to '%s' which is none of 
 {'0', '1', 'false', 'true', ''}."% _envvar )
 75 
 76 
 77 @decorator
 78 def catch_config_error(method, app, *args, **kwargs):
 79 """Method decorator for catching invalid config 
(Trait/ArgumentErrors) during init.
 80 
 81 On a TraitError (generally caused by bad config), this will print 
the trait's
 82 message, and exit the app.
 83 
 84 For use on init methods, to prevent invoking excepthook on invalid 
input.
 85 """
 86 try:
---> 87 return method(app, *args, **kwargs)
method = 
app = 
args = (None,)
kwargs = {}
 88 except (TraitError, ArgumentError) as e:
 89 app.print_help()
 90 app.log.fatal("Bad config encountered during initialization:")
 91 app.log.fatal(str(e))
 92 app.log.debug("Config at the time: %s", app.config)
 93 app.exit(1)
 94 
 95 
 96 class ApplicationError(Exception):
 97 pass
 98 
 99 
100 class LevelFormatter(logging.Formatter):
101 """Formatter with additional `highlevel` record
102 

/usr/local/lib/python2.7/dist-packages/IPython/terminal/ipapp.pyc in 
initialize(self=, argv=None)
301 
302 return super(TerminalIPythonApp, self).parse_command_line(argv)
303 
304 @catch_config_error
305 def initialize(self, argv=None):
306 """Do actions after construct, but before starting the app."""
307 super(TerminalIPythonApp, self).initialize(argv)
308 if self.subapp is not None:
309 # don't bother initializing further, starting subapp
310 return
311 # print self.extra_args
312 if self.extra_args and not self.something_to_run:
313 self.file_to_run = self.extra_args[0]
314 self.init_path()
315 # create the shell
--> 316 self.init_shell()
self.init_shell = >
317 # and draw the banner
318 self.init_banner()
319 # Now a variety of things that happen after the banner is 
printed.
320 

[sage-support] simplification of results from Sage Cell Server

2018-10-01 Thread Troels Ring
Dear friends - I have a quotient which I need to differentiate and show the 
differential  is always positive for unknown H>0. We have 7 unknown 
constants all known to be positive and less than 1 except for A which may 
be any positive value. In Sage Cell Server I did this
var('A','K1','K2','K3','f1','f2','f3','H'); B = 
-A*(K1*f1*f2*f3*H^2+2*K1*K2*f1*f3*H+3*K1*K2*K3*f2);D=f1^3*f2*f3*H^3+K1*f1*f2*f3*H^2+K1*K2*f1*f3*H+K1*K2*K3*f2;diff(B,H)*D-diff(D,H)*B

where B is the numerator and D is the denominator of the quotient. 

The result is

(3*H^2*f1^3*f2*f3 + 2*H*K1*f1*f2*f3 + K1*K2*f1*f3)*(H^2*K1*f1*f2*f3 + 
2*H*K1*K2*f1*f3 + 3*K1*K2*K3*f2)*A - 

2*(H^3*f1^3*f2*f3 + H^2*K1*f1*f2*f3 + H*K1*K2*f1*f3 + 
K1*K2*K3*f2)*(H*K1*f1*f2*f3 + K1*K2*f1*f3)*A


which I believe I can see must be positive when the K's and f's are positive 
but less than 1 

Could I reach this conclusion in a more definite way?

-- 
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: Accessing group generators in libgap

2018-10-01 Thread Dima Pasechnik
On Mon, Oct 1, 2018 at 8:58 AM Simon King  wrote:
>
> Hi Dima,
>
> On 2018-09-30, Dima Pasechnik  wrote:
> > it was written before optional parameters era in GAP, as far as I know.
> > Anyhow, you can use GAP's PushOptions() and PopOptions() to achieve more or 
> > less
> > the same effect, with a big uglier syntax.
>
> "Uglier" only internally. I think it shouldn't be too difficult to
> modify libgap's functions so that optional parameters (passed in the
> usual pythonic way) are first pushed and eventually popped from GAP's
> global optional value stack.

Right,  this can all be hidden, and perhaps even implemented with
a decorator (or in some other way?), to avoid manual coding of Push/Pop calls.
Thanks for pointing this out.

>
> When I first saw your work-around, I though it would have ugly side-effects.
> But I just realise that it wouldn't change GAP's behaviour. For instance:
>
>  gap> test := function()
>  >local foo;
>  >foo := ValueOption("foo");
>  >Print(foo);
>  > end;
>  function(  ) ... end
>  gap> f := function()
>  >local foo;
>  >foo := ValueOption("foo");
>  >Print("Original value ",foo);
>  >test();
>  > end;
>  function(  ) ... end
>  gap> f();
>  Original value failfail
>  gap> f(:foo:=5);
>  Original value 55
>
> Note that the option set when calling the outer function is also present
> in the inner function, and that's the same when directly pushing to the
> global option stack:
>
>  gap> PushOptions(rec(foo:=5));
>  gap> f();
>  Original value 55
>  gap> PopOptions();
>  gap> f();
>  Original value failfail
>
> So, that would work as desired.

Indeed, GAP manual says in its Sect 4.11-2 "Function Call With Options"
that the options syntax is exactly equivalent to using Push/Pop explicitly.

Best,
Dima

>
> Best regards,
> Simon
>
> --
> 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.


[sage-support] Re: Accessing group generators in libgap

2018-10-01 Thread Simon King
Hi Dima,

On 2018-09-30, Dima Pasechnik  wrote:
> it was written before optional parameters era in GAP, as far as I know.
> Anyhow, you can use GAP's PushOptions() and PopOptions() to achieve more or 
> less
> the same effect, with a big uglier syntax.

"Uglier" only internally. I think it shouldn't be too difficult to
modify libgap's functions so that optional parameters (passed in the
usual pythonic way) are first pushed and eventually popped from GAP's
global optional value stack.

When I first saw your work-around, I though it would have ugly side-effects. 
But I just realise that it wouldn't change GAP's behaviour. For instance:

 gap> test := function()
 >local foo;
 >foo := ValueOption("foo");
 >Print(foo);
 > end;
 function(  ) ... end
 gap> f := function()
 >local foo;
 >foo := ValueOption("foo");
 >Print("Original value ",foo);
 >test();
 > end;
 function(  ) ... end
 gap> f();
 Original value failfail
 gap> f(:foo:=5);
 Original value 55

Note that the option set when calling the outer function is also present
in the inner function, and that's the same when directly pushing to the
global option stack:

 gap> PushOptions(rec(foo:=5));
 gap> f();
 Original value 55
 gap> PopOptions();
 gap> f();
 Original value failfail

So, that would work as desired.

Best regards,
Simon

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