Re: [sage-devel] Re: bug: factoring symbolic expressions containing exponentials

2019-04-10 Thread Bill Page
On Wed, Apr 10, 2019 at 5:28 PM rjf  wrote:
>
>
> I suppose this is a Sage bug; Maxima doesn't have a problem with
> its factor program.
>

Indeed.

sage: ex=exp(2*x)+exp(-2*x); ex
e^(2*x) + e^(-2*x)
sage: maxima(ex).factor().sage()
(e^(4*x) + 1)*e^(-2*x)
sage: bool(maxima(ex).factor().sage()==ex)
True

> As you know, polynomial "factoring" is a process that mathematically
> is defined in a unique factorization domain, which is broken in the
> example at least 2 ways, by have a denominator, and by having
> exponentials. for example,  e^x-1  factors many ways,  one being
> (e^(x/2)-1)*(e^(x/2)+1).
>

Withstanding, I expect

  factor(x) == x

to always be true.

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


[sage-devel] bug: factoring symbolic expressions containing exponentials

2019-04-10 Thread Bill Page
sage: sage.version.version
'8.6'
sage: ex=exp(2*x)+exp(-2*x); ex
e^(2*x) + e^(-2*x)
sage: factor(ex)
2*e^(2*x)
sage: bool(factor(ex)==ex)
False
sage: bool(factor(e^(2*x)+e^(-2*x))==e^(2*x)+e^(-2*x))
False
sage: bool(factor(2^(2*x)+2^(-2*x))==2^(2*x)+2^(-2*x))
True

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


Re: [sage-devel] matrix equality and assumptions

2019-04-09 Thread Bill Page
Thanks.

On Tue, Apr 9, 2019 at 10:41 AM Jeroen Demeyer  wrote:
>
> On 2019-04-09 16:29, Bill Page wrote:
> > Is this a known problem?
>
> Now it is: https://trac.sagemath.org/ticket/27629
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

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


[sage-devel] matrix equality and assumptions

2019-04-09 Thread Bill Page
Is this a known problem?
--
sage: sage.version.version
'8.6'
sage: assume(x,'real')
sage: assumptions()
[x is real]
sage: e1=matrix([[0,-x],[x,0]]); e1
[ 0 -x]
[ x  0]
sage: e2=transpose(e1);e2
[ 0  x]
[-x  0]
sage: e1==e2
True
sage: e1-e2
[   0 -2*x]
[ 2*x0]
sage: e1-e2==0
True
--
sage: forget(x,'real')
sage: e1=matrix([[0,-x],[x,0]]); e1
[ 0 -x]
[ x  0]
sage: e2=transpose(e1);e2
[ 0  x]
[-x  0]
sage: e1==e2
False
sage: e1-e2
[   0 -2*x]
[ 2*x0]
sage: e1-e2==0
False
--
sage: assume(x,'integer')
sage: assumptions()
[x is integer]
sage: e1=matrix([[0,-x],[x,0]]); e1
[ 0 -x]
[ x  0]
sage: e2=transpose(e1);e2
[ 0  x]
[-x  0]
sage: e1==e2
True
--

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


Re: [sage-devel] jupyter horizontal scrollbar and wrapping of long math output

2017-05-30 Thread Bill Page
On 30 May 2017 at 22:09, William Stein <wst...@gmail.com> wrote:
>
> On Tuesday, May 30, 2017, Bill Page <bill.p...@newsynthesis.org> wrote:
>>
>> Is the new CoCalc Jupyter interface available in the Docker version?
>
> Yes!
>
>>
>> If so maybe I should just switch to that. Besides the collaboration
>> functionality, this new version has several other nice things about it
>> compared to the vanilla version.
>
> Please do, and report all bugs or issues.
>

This is really a CoCalc question I guess, but is there a way to
implement a 'custom.css' in the CoCalc version of Jupyter?  I asked a
similar question early on the Sage list because I wanted to be able to
use

  https://github.com/powerpak/jupyter-dark-theme

I have become very accustomed lately to using the dark themes in atom
and now these worksheets seem entirely too bright ...  I tried some of
the CoCalc themes but they did not seem to affect the worksheets much.

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


Re: [sage-devel] jupyter horizontal scrollbar and wrapping of long math output

2017-05-30 Thread Bill Page
On 30 May 2017 at 22:11, William Stein  wrote:
> Also you can report this jupyter bug (including input to reproduce) to them
> on github.  They are good at triaging their issues right now
>

I was a bit uncertain as to where to report it since I am using
--notebook=jupyter in sage. I figured that on the github issue list
they might prefer if I was reporting on Jypyter running natively.  I
am not sufficiently familiar with this to know if this is really the
same thing.

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


[sage-devel] jupyter horizontal scrollbar and wrapping of long math output

2017-05-30 Thread Bill Page
I am not sure if this is the right place to ask this question (Perhaps
there is a more specific Jupyter developer list?) but I find the
following behavior rather annoying:

After doing

%display typeset

if do something that generates some long multi-line Sage output,
mathjax seems to do a pretty good job of wrapping the mathematics BUT
I still get a horizontal scrollbar at the bottom of the output area.
This happens regardless of how I have my browser width ans zoom set.
Note: This has nothing to do with the Cell/Current Outputs/Toggle
Scrolling setting. I have that at the default which does not result in
any vertical scrollbar.

The weird thing is that if before generating the output I first
increase the zoom on my browser (Chrome on Linux) to 125%, generate
the output, and then reduce the zoom level back to 100% the math is
wrapped and shown nicely in the output area without the need for a
horizontal scroll bar.

Does anyone know if this has been previously reported to the Jupyter
developers or if this is an artifact of the way Jupyter is
incorporated into Sage?  Is there perhaps some css option I can set to
always avoid the horizontal scrollbar (when mathjax wrapping is
possible)?  Maybe there is an output area width parameter that should
be smaller than it is by default.

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


Re: [sage-devel] Jupyter notebook themes

2017-05-30 Thread Bill Page
Great! Thank you.  On my system I get:

wspage@strix ~ $ ./sage/sage -sh -c "jupyter --paths"
config:
/home/wspage/.sage//jupyter-4.1
/home/wspage/sage/local/etc/jupyter
/usr/local/etc/jupyter
/etc/jupyter
data:
/home/wspage/.local/share/jupyter
/home/wspage/sage/local/share/jupyter
/usr/local/share/jupyter
/usr/share/jupyter
runtime:
/run/user/1000/jupyter

What's with the double // ?

Anyway, I checked the config directories

wspage@strix ~ $ ls /home/wspage/.sage//jupyter-4.1
migrated
wspage@strix ~ $ ls /home/wspage/sage/local/etc/jupyter
jupyter_notebook_config.py  nbconfig
wspage@strix ~ $ ls /usr/local/etc/jupyter
ls: cannot access '/usr/local/etc/jupyter': No such file or directory
wspage@strix ~ $ ls /etc/jupyter
ls: cannot access '/etc/jupyter': No such file or directory

--

My ~.jupyter directory has the following:

wspage@strix ~ $ ls .jupyter
custom  migrated

So I decided to try this:

wspage@strix ~ $ cp -r .jupyter/custom /home/wspage/.sage//jupyter-4.1
wspage@strix ~ $ ls /home/wspage/.sage//jupyter-4.1
custom  migrated

Now after restarting Sage with --notebook=jupyter I get the hoped for result.

This is exactly what I needed to know but could not find anywhere in the docs.


On 30 May 2017 at 15:44, Vincent Delecroix <20100.delecr...@gmail.com> wrote:
> Do the following to get the list of config paths
>
> $ sage -sh -c "jupyter --paths"
>
> Vincent
>
>
> On 30/05/2017 18:05, Bill Page wrote:
>>
>> Is it possible to use a custom Jupyter css theme in Sage? E.g.
>>
>>   https://github.com/powerpak/jupyter-dark-theme
>>
>> How and where would I put the 'custom.css' file?  My first attempts to
>> do this where in my user $HOME/.jupyter/custom directory and second
>> was in the 'sage -root' directory /.jupyter/custom/ but neither of
>> these seemed to work when I started sage with --notebook=jupyter
>>
>> Am I doing something wrong?
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

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


[sage-devel] Jupyter notebook themes

2017-05-30 Thread Bill Page
Is it possible to use a custom Jupyter css theme in Sage? E.g.

 https://github.com/powerpak/jupyter-dark-theme

How and where would I put the 'custom.css' file?  My first attempts to
do this where in my user $HOME/.jupyter/custom directory and second
was in the 'sage -root' directory /.jupyter/custom/ but neither of
these seemed to work when I started sage with --notebook=jupyter

Am I doing something wrong?

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


[sage-devel] Typeset output from external packages

2016-09-24 Thread Bill Page
Did this used to work? E.g. in a Sage notebook click the [x] Typeset
option and then execute:
---
%maxima
integrate(1/sin(x),x)
---
in a cell. My recollection is that this used to use maxima to generate
LaTeX and then display it typeset in the worksheet, i.e. the same as

---
maxima("integrate(1/(x+sin(x)^2),x)")
---

Or did this always display the output of maxima (and other external
programs) only in "text" form regardless of the setting of [ ] Typeset
and regardless of whether or not the external package provides a
'latex' mode?

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


[sage-devel] Re: SageMath ArraryFire and afnumpy

2016-09-21 Thread Bill Page
OK, thanks.  I guess what I would need is some more detailed suggestions
for how to debug the problem. Yes, starting with the actual error log is a
good idea. To that end I started over from the beginning, keeping a
detailed log, but ...

Starting with a fresh install and building everything from source works!
The failure on my first attempt may have been due to using

  cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install/dir

to change the install prefix for Sage installation, after first installing
ArrayFire in the system-level Python. But I am not sure and have not tried
to actually reproduce this yet.

In any case, for the record here is a log of a successful installation
starting from a fresh install of Sage and installing all of ArrayFire,
arrayfire-python and afnumpy into the Sage shell from git repository
sources:

http://www.sagemath.org/download-linux.html

wspage@strix ~ $ *wget
http://mirrors.mit.edu/sage/linux/64bit/sage-7.3-Ubuntu_16.04-x86_64.tar.bz2
*

wspage@strix ~ $ *tar xf sage-7.3-Ubuntu_16.04-x86_64.t*
*ar.bz2*
wspage@strix ~/SageMath $ *./sage*

Rewriting paths for your new installation directory
===

This might take a few minutes but only has to be done once.

patching /home/wspage/SageMath/src/build/cython_debug/cython_debug_in
fo_sage.rings.polynomial.real_roots
patching /home/wspage/SageMath/local/bin/linegraphg
...
patching /home/wspage/SageMath/local/lib/python2.7/lib-dynload/_codec
s_iso2022.so
┌┐
│ SageMath version 7.3, Release Date: 2016-08-04 │
│ Type "notebook()" for the browser-based notebook interface.│
│ Type "help()" for help.│
└┘
sage: 1+1
2
sage: exit
Exiting Sage (CPU time 0m0.03s, Wall time 0m9.92s).

wspage@strix ~ $ *git clone https://github.com/arrayfire/arrayfire.git
*

wspage@strix ~/SageMath $ *cd ~/arrayfire*

wspage@strix ~/arrayfire $
*~/SageMath/sage --sh*
Starting subshell with Sage environment variables set.  Don't forget
to exit when you are done.  Beware:
 * Do not do anything with other copies of Sage on your system.
 * Do not use this for installing Sage packages using "sage -i" or for
   running "make" at Sage's root directory.  These should be done
   outside the Sage shell.

Bypassing shell configuration files...

Note: SAGE_ROOT=/home/wspage/SageMath

(sage-sh) wspage@strix:arrayfire$* ls $SAGE_ROOT*
bootstrap  config.status  COPYING.txt  m4  sageVERSION.txt
build   configure  localMakefile   src
config   configure.ac   logs   README.md  upstream

(sage-sh) wspage@strix:arrayfire$ *ls $SAGE_ROOT/local*
bin  default.qepcadrc  etc  gap  include  lib  lib64  libexec  share  var

(sage-sh) wspage@strix:arrayfire$ *mkdir build*

(sage-sh) wspage@strix:arrayfire$ *cd build*

(sage-sh) wspage@strix:build$ *cmake .. -DCMAKE_INSTALL_PREFIX=$SAGE_R*
*OOT/local*
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found FREEIMAGE: /usr/include
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so
-- Found PkgConfig: /home/wspage/SageMath/local/bin/pkg-config (found
version "0.29.1")
-- Checking for module 'cblas'
--   Found cblas, version 1.0
-- Found CBLAS:
/home/wspage/SageMath/local/lib/libcblas.so;/home/wspage/SageMath/local/lib/libatlas.so

-- Found FFTW: /usr/include
-- Found LAPACKE: /usr/lib/liblapacke.so;/home/w
spage/SageMath/local/lib/liblapack.so;/home/wspage/SageMath/
local/lib/libf77blas.so;/home/wspage/SageMath/local/lib/libc
blas.so;/home/wspage/SageMath/local/lib/libatlas.so;/home/
wspage/SageMath/local/lib/libf77blas.so;/home/wspage/
SageMath/local/lib/libatlas.so
-- Found LAPACK: /usr/include
-- Found CUDA: /usr (found version "7.5")
-- Boost version: 1.58.0
-- Found NVVM: /usr/include
-- /home/wspage/arrayfire/CMakeModules/cuda_compute_capability.cpp
-- CUDA 

Re: [sage-devel] Re: How to check that something is a real number?

2016-09-20 Thread Bill Page
Admittedly, the author of this thread did not consider the case in the
list of targets but when comparing 'conjugate' to 'imag_part' in Sage
I was surprized to see the following results.

sage: Q.<i,j,k> = QuaternionAlgebra(SR, -1, -1)
sage: a,b,c=var('a,b,c')
sage: q = x + a*i + b*j + c*k
sage: conjugate(q)
x + (-a)*i + (-b)*j + (-c)*k

That's OK but

sage: SR(q).imag_part()
0
sage: bool(q/2+conjugate(q)/2==q)
True
sage: bool(x==q)
True
sage: x==q
True

It seems to me that these are all incorrect. I am not sure exactly
what the coercion to SR is supposed to do in this case. It also does
not make sense to me that the last equality returns True.


On 20 September 2016 at 16:29, Emmanuel Charpentier
<emanuel.charpent...@gmail.com> wrote:
>
>
> Le mardi 20 septembre 2016 04:02:16 UTC+2, Bill Page a écrit :
>>
>> In keeping with Richard's suggestion, in Sage I think a good
>> _algebraic_ definition of 'real' is
>>
>> bool(x/2+conjugate(x)/2 == x)
>
>
> why not bool(SR(x).imag_part()==0) ?
>>
>>
>> So
>>
>> sage: def RN(x):
>> : try:
>> : return bool(x/2+conjugate(x)/2 == x)
>> : except:
>> : return false
>>
>> which also works whenever conjugate is defined, including
>>
>> sage: assume(x,'real')
>> sage: assume(y,'real')
>> sage: RN(sqrt(x^2+y^2))
>> True
>>

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


[sage-devel] SageMath ArraryFire and afnumpy

2016-09-20 Thread Bill Page
SageMath is a computer algebra system http://www.sagemath.org/ that 
provides an interface to a large number of open source packages for both 
symbolic and numeric computations, including especially numpy.  But unlike 
a lot of open source SageMath bundles most of these software packages in a 
single distribution (including its own Python) and runs in its own 
environment. This makes installation of some external packages such as 
ArrayFire somewhat more complex.

To the best of my knowledge at this time SageMath does not include any 
GPU-accelerated packages. I have successfully installed ArrayFire, the 
Python bindings https://github.com/arrayfire/arrayfire-python and afnumpy 
https://github.com/FilipeMaia/afnumpy in the SageMath environment however 
when I attempt to import arrayfire I get a message about not being able to 
access the required libraries. I have tried following the advice at 
https://github.com/arrayfire/arrayfire-python/wiki concerning setting 
LD_LIBRARY_PATH but so far without success. On the other hand I am able to 
install and use this same combination of software in the system-level 
Python without any problems.

I am also able to install an ArrayFire alternative: CUDAmat and gnumpy, 
into the SageMath environment and use it successfully in SageMath.

Any help or suggestions on how to get ArrayFire working in SageMath would 
be most welcome.  I apologize in advance for cross-posting with the 
SageMath developer list and would be glad to continue this thread 
separately in either group.

Thanks.

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


Re: [sage-devel] Re: How to check that something is a real number?

2016-09-19 Thread Bill Page
In keeping with Richard's suggestion, in Sage I think a good
_algebraic_ definition of 'real' is

bool(x/2+conjugate(x)/2 == x)

So

sage: def RN(x):
: try:
: return bool(x/2+conjugate(x)/2 == x)
: except:
: return false

which also works whenever conjugate is defined, including

sage: assume(x,'real')
sage: assume(y,'real')
sage: RN(sqrt(x^2+y^2))
True



On 19 September 2016 at 19:51, rjf  wrote:
> If arg(x) is 0 and x is a number, then it is a real number.  Maxima calls
> this carg()  for complex arg.
>
> Carg will also work for some things that are not of numeric type, but
> symbolic in some way.
> .
>  Like sqrt(x^2+y^2)   is real  if domain=real
>
> Good luck
>

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


Re: [sage-devel] Re: ExpressionNice

2016-08-20 Thread Bill Page
On 20 August 2016 at 08:54, Bill Page <bill.p...@newsynthesis.org> wrote:
>
> If Sage supported a standard ASCII-art 2-d output format for
> expressions, then perhaps another choice would be suitable.
>

Perhaps I should have said "unicode-art" 2-d output. I noticed that in
--notebook=jupyter Sympy does thiis

import sympy
sympy.init_printing(use_unicode=True)
x,y=sympy.symbols('x y')
f=sympy.Function('f')
sympy.diff(f(x,y),x)

∂
──(f(x, y))
∂x

Why not in Sage console mode?

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


Re: [sage-devel] Re: ExpressionNice

2016-08-20 Thread Bill Page
On 19 August 2016 at 18:30, Bill Page <bill.p...@newsynthesis.org> wrote:
> ...
> Probably the only way to make a sufficient number of people happy
> enough to get a positive review on this ticket would be to implement
> several major alternative notations for derivatives and an easy way to
> switch between them. Then the only thing there is to argue about is
> which one should be the default. :)
>

BTW, personally I think that for standard text (non-LaTeX) output the
1-D format proposed by Nils and illustrated in the ticket would be a
good and mostly neutral choice as a default output format.  I like the
idea of being able in principle to cut-and-paste expressions back to
input.

If Sage supported a standard ASCII-art 2-d output format for
expressions, then perhaps another choice would be suitable.

For LaTeX format output I would be looking for "publication quality"
output, i.e. the notation most commonly seen in mathematical
publications.  Of course even then there is clearly a need to support
several alternatives.

Bill Page.

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


Re: [sage-devel] Re: ExpressionNice

2016-08-20 Thread Bill Page
On 20 August 2016 at 08:14, Eric Gourgoulhon <egourgoul...@gmail.com> wrote:
> Le jeudi 18 août 2016 07:59:15 UTC+2, Nils Bruin a écrit :
>>
>> The situation for topological manifolds is slightly different, because
>> expressions there live in the context of a chart, where a specific
>> correspondence between variable name and parameter position has been
>> imposed. That makes it plausible that in the context of charts, one can get
>> away with possible ambiguities a little easier.
>
> Yes indeed! Actually in the manifolds code, ExpressionNice is used to
> display the expression of functions M --> K (M = the manifold, K = the base
> field) in a specified coordinate chart. There is then no ambiguity regarding
> the variables, which are the coordinates.
> ...
> This is why in SageMath 7.3 ExpressionNice lies in
> src/sage/manifolds/utilities.py and not in src/sage/symbolic.

Actually I think this situation is quite common in all mathematics.
It would be tedious indeed if all formulas in all papers were written
out in full in sufficient detail to stand alone unambiguously. Every
calculation is done in some context. I do not see the need for the
output of a computer algebra systems to always be more complete than
conventional mathematical usage. I think the user should be free to
decide what level of detail they want in the output.

So my proposal would be that the functionality of ExpressionNice be
absorbed into sage/symbolic as an option along with several other
optional formats for the derivative.

Bill Page.

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


Re: [sage-devel] Re: ExpressionNice

2016-08-19 Thread Bill Page
On 19 August 2016 at 14:24, Nils Bruin <nbr...@sfu.ca> wrote:
> On Friday, August 19, 2016 at 9:45:12 AM UTC-7, Bill Page wrote:
>>
>> My main question is whether we should try to replicate what is done
>> by ExpressionNice and thereby render it obsolete or should we try
>> to reach some other compromise?
>
> Well, as is pointed out in the ExpressionNice documentation already,
> it produces some representations that just don't express the meaning
> of the underlying expression, so we definitely don't want to replicate
> that.
>

I think it is wrong to say that this notation does not express the
meaning of the underlying expression - at most you might claim that it
is ambiguous in some cases. My understanding is that this is a
notational preference (at least for the designers of SageManifolds)
and for them the meaning is clear enough as well as sufficiently
brief, although even SageManifolds provides an option to display
derivatives in Pynac form if desired.

> ...
> I think this covers the most important cases. Comments welcome on what
> styles people would prefer.
>

Probably the only way to make a sufficient number of people happy
enough to get a positive review on this ticket would be to implement
several major alternative notations for derivatives and an easy way to
switch between them. Then the only thing there is to argue about is
which one should be the default. :)

Bill.

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


Re: [sage-devel] Re: ExpressionNice

2016-08-19 Thread Bill Page
On the contrary after reading the code for ExpressionNice carefully it
is clear that it does not do post-processing as such and should be
quite general and robust. However that said,  I am very much in favor
of using the approach you demonstrated in

https://trac.sagemath.org/ticket/21286

My main question is whether we should try to replicate what is done by
ExpressionNice and thereby render it obsolete or should we try to
reach some other compromise?



On 18 August 2016 at 13:17, Nils Bruin  wrote:
>
> As far as I can tell, ExpressionNice gets its results by string-based
> regular expression post-processing. That may be good enough for the
> "manifold" setting, if they know expressions are going to be sufficiently
> simple, but it's definitely going to break when used for arbitrary
> expressions.
>

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


Re: [sage-devel] Re: ExpressionNice

2016-08-18 Thread Bill Page
ExpressionNice is a subclass of sage.symbolic.expression.Expression,
it seemed therefore that maybe I should be able to do something like:

sage: import sage.manifolds.utilities
sage: sage.symbolic.expression.Expression =
sage.manifolds.utilities.ExpressionNice

and expect all my expressions to be nice.  But this does not work.
What am I doing wrong?

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


Re: [sage-devel] Re: ExpressionNice

2016-08-18 Thread Bill Page
On 18 August 2016 at 01:59, Nils Bruin <nbr...@sfu.ca> wrote:
> On Wednesday, August 17, 2016 at 3:25:31 PM UTC-7, Bill Page wrote:
>>
>>
>> It turns out that a solution is now "hidden away" in plain sight:
>>
>> https://trac.sagemath.org/ticket/18640
>>
>> http://sagemanifolds.obspm.fr/doc/18640/reference/manifolds/sage/manifolds/utilities.html
>>
>
> And also note the warning that's in the documentation there already: (*)
> """
> Note that D[1](g)(x, f(x,y)) is rendered as d(g)/d(f(x, y)).
> """
> How is that unambiguous?
>

I think that there was no claim that it was unambiguous and therefore
it implies that some ambiguity would be tolerated. But this has
already been argued ad infinitum and apparently that has resulted in
the current stalemate. As I said, I think Sage needs a solution to
this problem, not more discussion.

> Maple internally uses the same representation for derivatives as Pynac does
> (as far as I can tell) and it has a reasonable heuristic:
>
> The expression:
>
> D[i](f)(x1,...,xn)
>
> can be rendered as (df/dxi)(x1,...,xn) if x1,...,xn are *distinct* pure
> variables or if n=1. Otherwise, render it D[i](f)(x1,...,xn). This is
> something that the standard expression renderer could do. It just requires a
> bit more work because "function application rendering" would need to inspect
> its function for the presence of an FDerivativeOperator.

Sage mantra: Open a ticket, provide some code ...  :)

> ...

Bill Page.

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


[sage-devel] ExpressionNice

2016-08-17 Thread Bill Page
I was a bit shocked to find a solution to a long standing annoyance
with Sage symbolic derivatives

https://trac.sagemath.org/ticket/5711
https://trac.sagemath.org/ticket/6344
https://trac.sagemath.org/ticket/14517
https://groups.google.com/forum/#!topic/sage-devel/LIBo8nwftkI

I still find my self having to explain what the Sage derivative
"Pynac" notation means to people reading my Sage worksheets. Yes I am
aware of the origins of this notation and it's advantages in specific
situations, but something that has been this annoying to so many
people for so long should have a better solution.

It turns out that a solution is now "hidden away" in plain sight:

https://trac.sagemath.org/ticket/18640
http://sagemanifolds.obspm.fr/doc/18640/reference/manifolds/sage/manifolds/utilities.html

Apparently ExpressionNice was quietly merged a few months ago in
release 7.3 as part of above SageManifolds ticket.

OK, it is nice to now have ExpressionNice but wouldn't it be even
nicer if it did not have such an obscure name and nicer still if it
was actually the default output format in Sage? (Of course it would be
good to still have the Pynac notation available as an option when
needed.)

Bill Page.

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


Re: [sage-devel] sage_mode for emacs has display problem in sage 7.4 beta0

2016-08-14 Thread Bill Page
On Aug 14, 2016 11:26 AM, "'Martin R' via sage-devel" <
sage-devel@googlegroups.com> wrote:
>
> Can't we undo the ipython 5 thing?  It's a major nuisance on the command
line, too.
>

+1

I find the new coloration in the Sage command line in the beta release
quite extreme and nearly unreadable in some cases (at least in default Mint
terminal).

> Am Sonntag, 14. August 2016 07:45:12 UTC+2 schrieb Ivan Andrus:
>>
>> It looks like ipython is printing invalid ...

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


Re: [sage-devel] Re: checkout from trac

2016-08-13 Thread Bill Page
BTW, is it normal to run 'make' after 'git trac checkout'? I just did
that and 'make' seems to be re-building almost everything.

On 13 August 2016 at 17:07, Bill Page <bill.p...@newsynthesis.org> wrote:
> Yes indeed it does! Much appreciated.
>
> On 13 August 2016 at 17:05, Volker Braun <vbraun.n...@gmail.com> wrote:
>> I removed the leading slash from the branch name on that ticket, works now.
>>
>> On Saturday, August 13, 2016 at 10:22:55 PM UTC+2, Bill Page wrote:
>>>
>>> OK, I thought that might be it (although all I really wanted was
>>> read-only access), so I ran 'git trac config', see below. But it still
>>> fails.
>>>
>>> I guess it's just not my day ...
>>>
>>> On 13 August 2016 at 16:13, Volker Braun <vbrau...@gmail.com> wrote:
>>> > You missed "git trac config"
>>> >

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


Re: [sage-devel] Re: checkout from trac

2016-08-13 Thread Bill Page
Yes indeed it does! Much appreciated.

On 13 August 2016 at 17:05, Volker Braun <vbraun.n...@gmail.com> wrote:
> I removed the leading slash from the branch name on that ticket, works now.
>
> On Saturday, August 13, 2016 at 10:22:55 PM UTC+2, Bill Page wrote:
>>
>> OK, I thought that might be it (although all I really wanted was
>> read-only access), so I ran 'git trac config', see below. But it still
>> fails.
>>
>> I guess it's just not my day ...
>>
>> On 13 August 2016 at 16:13, Volker Braun <vbrau...@gmail.com> wrote:
>> > You missed "git trac config"
>> >

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


Re: [sage-devel] Re: checkout from trac

2016-08-13 Thread Bill Page
OK, I thought that might be it (although all I really wanted was
read-only access), so I ran 'git trac config', see below. But it still
fails.

I guess it's just not my day ...

On 13 August 2016 at 16:13, Volker Braun  wrote:
> You missed "git trac config"
>


wspage@sarah ~/sage $ git trac config --user bpage --pass 'xxx'
Saved trac username.
Saved trac password.
Trac xmlrpc URL:
https://trac.sagemath.org/xmlrpc (anonymous)
https://trac.sagemath.org/login/xmlrpc (authenticated)
realm sage.math.washington.edu
Username: bpage
Password: xxx
Retrieving SSH keys...
4096 SHA256:tZKL8qzKXq37V4c0MR7KwpA8OZRjNsXyWama8cN6KOs
bill.p...@newsynthesis.org (RSA)
2048 SHA256:LKhC6fbZQyINK+kBMbeGjNAJ+FR+4qHmo264OcdBkR0
b04b5777e2694c8fa4b8b21dbe1c93c6@compute4-us (RSA)
wspage@sarah ~/sage $ git remote -v
origingit://github.com/sagemath/sage.git (fetch)
origingit://github.com/sagemath/sage.git (push)
tracgit://trac.sagemath.org/sage.git (fetch)
tracg...@trac.sagemath.org:sage.git (push)
wspage@sarah ~/sage $ git trac checkout 21231
Loading ticket #21231...

Checking out Trac #21231 remote branch /u/mantepse/21231 -> local
branch t/21231//u/mantepse/21231...
Traceback (most recent call last):
  File "/home/wspage/git-trac-command/bin/git-trac", line 18, in 
cmdline.launch()
  File "/home/wspage/git-trac-command/git_trac/cmdline.py", line 215, in launch
app.checkout(args.ticket_or_branch, args.branch_name)
  File "/home/wspage/git-trac-command/git_trac/app.py", line 116, in checkout
self._checkout_ticket(int(ticket_or_branch), branch_name)
  File "/home/wspage/git-trac-command/git_trac/app.py", line 144, in
_checkout_ticket
self.repo.checkout_new_branch(ticket.branch, branch)
  File "/home/wspage/git-trac-command/git_trac/git_repository.py",
line 136, in checkout_new_branch
self.git.fetch('trac', remote)
  File "/home/wspage/git-trac-command/git_trac/git_interface.py", line
341, in meth
return self.execute(git_cmd, *args, **kwds)
  File "/home/wspage/git-trac-command/git_trac/git_interface.py", line
328, in execute
popen_stderr=subprocess.PIPE)
  File "/home/wspage/git-trac-command/git_trac/git_interface.py", line
263, in _run
raise GitError(result)
git_trac.git_error.GitError: git returned with non-zero exit code
(128) when executing "git fetch trac /u/mantepse/21231"
STDERR: fatal: Invalid refspec '/u/mantepse/21231'

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


Re: [sage-devel] Re: checkout from trac

2016-08-13 Thread Bill Page
:( :{ :[

wspage@sarah ~ $ git clone https://github.com/sagemath/git-trac-command.git
Cloning into 'git-trac-command'...
remote: Counting objects: 776, done.
remote: Total 776 (delta 0), reused 0 (delta 0), pack-reused 776
Receiving objects: 100% (776/776), 380.53 KiB | 174.00 KiB/s, done.
Resolving deltas: 100% (556/556), done.
Checking connectivity... done.
wspage@sarah ~ $ source git-trac-command/enable.sh
Prepending the git-trac command to your search PATH
wspage@sarah ~ $ cd sage
wspage@sarah ~/sage $ git trac checkout 21231
Loading ticket #21231...
Checking out Trac #21231 remote branch /u/mantepse/21231 -> local
branch t/21231//u/mantepse/21231...
Traceback (most recent call last):
  File "/home/wspage/git-trac-command/bin/git-trac", line 18, in 
cmdline.launch()
  File "/home/wspage/git-trac-command/git_trac/cmdline.py", line 215, in launch
app.checkout(args.ticket_or_branch, args.branch_name)
  File "/home/wspage/git-trac-command/git_trac/app.py", line 116, in checkout
self._checkout_ticket(int(ticket_or_branch), branch_name)
  File "/home/wspage/git-trac-command/git_trac/app.py", line 144, in
_checkout_ticket
self.repo.checkout_new_branch(ticket.branch, branch)
  File "/home/wspage/git-trac-command/git_trac/git_repository.py",
line 136, in checkout_new_branch
self.git.fetch('trac', remote)
  File "/home/wspage/git-trac-command/git_trac/git_interface.py", line
341, in meth
return self.execute(git_cmd, *args, **kwds)
  File "/home/wspage/git-trac-command/git_trac/git_interface.py", line
328, in execute
popen_stderr=subprocess.PIPE)
  File "/home/wspage/git-trac-command/git_trac/git_interface.py", line
263, in _run
raise GitError(result)
git_trac.git_error.GitError: git returned with non-zero exit code
(128) when executing "git fetch trac /u/mantepse/21231"
STDERR: fatal: Invalid refspec '/u/mantepse/21231'

???

On 13 August 2016 at 13:37, leif <not.rea...@online.de> wrote:
> Volker Braun wrote:
>> http://combinat.sagemath.org/doc/developer/git_trac.html
>
> [Hello Google,]
>
> Canonical URLs: ;-)
>
>  *
> http://doc.sagemath.org/html/en/developer/git_trac.html#installing-the-git-trac-command
>
>  *
> http://doc.sagemath.org/html/en/developer/git_trac.html#check-out-an-existing-ticket
>
>
> -leif
>
>> In particular check out the sections on "Installing the Git-Trac
>> Command" and then "Check out an Existing Ticket"
>>
>>
>>
>> On Saturday, August 13, 2016 at 6:55:10 PM UTC+2, Bill Page wrote:
>>
>> Sorry, I'm still confused. What exactly do I have to do to checkout
>> a trac ticket for testing and where is it documented? Google
>> searches only seem to mention --dev.
>>
>>
>> On Aug 13, 2016 12:19 PM, "leif" <not.r...@online.de >
>> wrote:
>>
>> Bill Page wrote:
>> > It seems like I am always confused when I try to use sagetrac,
>> but I
>> > did not expect this:
>> >
>> > wspage@sarah ~/sage $ ./sage --dev checkout --ticket=21231
>> > sage-run received unknown option: --dev
>> > usage: sage [options]
>> > Try 'sage -h' for more information.
>>
>> The "devscripts" had been deprecated and have now been removed (in
>> favour of Volker's "git-trac" command), since 7.0 IIRC.
>>
>> You can install it independently (outside a Sage installation),
>> but it's
>> meanwhile also an optional Sage package (named 'git_trac').
>>
>> I'd have to dig where it's documented, but
>>
>> git help trac
>>
>> should give you an overview (after installation of course).
>>
>> The source code is on GitHub (vbraun or sagemath, not sure).
>>
>>
>> You can otherwise of course use plain git (cf. "Git the hard way" in
>> Sage's Developer Guide).
>>
>>
>> -leif
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [sage-devel] Re: checkout from trac

2016-08-13 Thread Bill Page
Sorry, I'm still confused. What exactly do I have to do to checkout a trac
ticket for testing and where is it documented? Google searches only seem to
mention --dev.

On Aug 13, 2016 12:19 PM, "leif" <not.rea...@online.de> wrote:

Bill Page wrote:
> It seems like I am always confused when I try to use sagetrac, but I
> did not expect this:
>
> wspage@sarah ~/sage $ ./sage --dev checkout --ticket=21231
> sage-run received unknown option: --dev
> usage: sage [options]
> Try 'sage -h' for more information.

The "devscripts" had been deprecated and have now been removed (in
favour of Volker's "git-trac" command), since 7.0 IIRC.

You can install it independently (outside a Sage installation), but it's
meanwhile also an optional Sage package (named 'git_trac').

I'd have to dig where it's documented, but

git help trac

should give you an overview (after installation of course).

The source code is on GitHub (vbraun or sagemath, not sure).


You can otherwise of course use plain git (cf. "Git the hard way" in
Sage's Developer Guide).


-leif


> What am I doing wrong?
>
> I just did
>
> wspage@sarah ~ $ git clone git://github.com/sagemath/sage.git
> wspage@sarah ~ $ cd sage
> wspage@sarah ~/sage $ make
>
> Build completed without errors.
>
> wspage@sarah ~/sage $ ./sage
>
> seems to work as expected.


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

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


[sage-devel] checkout from trac

2016-08-13 Thread Bill Page
It seems like I am always confused when I try to use sagetrac, but I
did not expect this:

wspage@sarah ~/sage $ ./sage --dev checkout --ticket=21231
sage-run received unknown option: --dev
usage: sage [options]
Try 'sage -h' for more information.

--

What am I doing wrong?

I just did

wspage@sarah ~ $ git clone git://github.com/sagemath/sage.git
wspage@sarah ~ $ cd sage
wspage@sarah ~/sage $ make

Build completed without errors.

wspage@sarah ~/sage $ ./sage

seems to work as expected.

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


[sage-devel] Equations in jupyter notebook jump from centered to left aligned upon rendering

2016-08-11 Thread Bill Page
See this issue:

https://github.com/ipython/ipython/issues/7827

I have this annoying behavior in a newly install instance of SageMath 7.2.
I would like it to remain centered as in  normal "display math" style.

In the file:

/usr/lib/sagemath/local/lib/python2.7/site-packages/
notebook/static/style/style.min.css

line 9956:

div.output_area .MathJax_Display {
  text-align: left !important;
}

This seems to override any attempt to customize this behavior using for
example

~/.jupyter/custom/custom.css

Getting rid of "!important" seems to resolve the problem.

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


Re: [sage-devel] incremental migration to github?

2016-01-11 Thread Bill Page
On 11 January 2016 at 11:26, William Stein  wrote:
>
> For what it is worth I'm highly supportive of Sage development moving to
> github.
>...
> Anyway what github have accomplished in the last few years is very
> impressive.
>

+1

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


Re: [sage-devel] is_constant in the SymbolicRing

2016-01-08 Thread Bill Page
On 8 January 2016 at 12:16, Daniel Krenn <kr...@aon.at> wrote:
> PPS: At the moment (not having answers to this posting), my favourite
> implementation would be something like
>def is_constant(self):
>return not self.variables()
>

To give an obvious counter-example:

   SR(random()).is_constant()

but perhaps easily remedied.

Bill Page.

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


[sage-devel] sage octave interface

2016-01-06 Thread Bill Page
I am interested in comments and criticism concerning the following work in
progress:

https://pypi.python.org/pypi/sage_octave

Bill Page

-- Forwarded message --
From: Bill Page <bill.p...@newsynthesis.org>
Date: 6 January 2016 at 00:54
Subject: Re: [smc] %octave mode in sage worksheets is flaky simply because
Sage's own octave.eval is flaky (#355)
To: sagemathinc/smc <
reply+004c2a40318c8c0b1fbe82885f3e4a89c6cb80196b0bea9792cf000112a3c55492a169ce076e1...@reply.github.com
>
Cc: sagemathinc/smc <s...@noreply.github.com>


William,

I know absolutely nothing about packaging in Python but I did find another
tutorial:

  http://python-packaging.readthedocs.org/en/latest/minimal.html

that got me, in only a few steps, to something that seems to work. See:

  http://github.com/billpage/sage-octave

I uploaded this to PyPI and can now run

  pip install sage-octave

This works on SMC and creates

  .local/lib/python2.7/site-packages/octave.py

which produces the expected results when I run Sage and do

  sage: from octave import octave

e.g. recovers syntax errors without losing synchronization.

~$ sage
┌┐
│ SageMath Version 6.10, Release Date: 2015-12-18│
│ Enhanced for SageMathCloud.│
└┘
sage: from octave import octave
sage: octave("1+1")
 2
sage: octave("x-1=3")
---
TypeError Traceback (most recent call last)
 in ()
> 1 octave("x-1=3")

/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc
 in __call__(self, x, name)
241
242 if isinstance(x, six.string_types):
--> 243 return cls(self, x, name=name)
244 try:
245 return self._coerce_from_special_method(x)

/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/expect.pyc in __init__
(self, parent, value, is_name, name)
   1303 else:
   1304 try:
-> 1305 self._name = parent._create(value, name=name)
   1306 # Convert ValueError and RuntimeError to TypeError for
   1307 # coercion to work properly.

/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc
 in _create(self, value, name)
431 def _create(self, value, name=None):
432 name = self._next_var_name() if name is None else name
--> 433 self.set(name, value)
434 return name
435

/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/.local/lib/python2.7/site-packages/octave.pyc
 in set(self, var, value)
404 out = self.eval(cmd)
405 if out.find("error") != -1 or out.find("Error") != -1:
--> 406 raise TypeError
("Error executing code in Octave\nCODE:\n\t%s\nOctave ERROR:\n\t%s"%(cmd,
 out))
407
408 def get(self, var):

TypeError: Error executing code in Octave
CODE:
sage1=x-1=3;
Octave ERROR:
parse error:

  invalid left hand side of assignment

>>> sage1=x-1=3;
 ^

sage: octave("1+1")
 2
sage:

--

This also works in a Sage SMC worksheet


https://cloud.sagemath.com/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/files/test%20octave.sagews

Is this more or less what you had in mind?

Bill Page.


On 5 January 2016 at 16:29, Bill Page <bill.p...@newsynthesis.org> wrote:

> Well, this sounds interesting but with only the referenced generic
> documentation and example, it still seems daunting when the intention is
> just to make a single python file easily available.  Would you happen to
> have a more specific example for something similar that "depends on sage"?
> If I could just copy it, substitute the file and a tweak a few
> configuration parameters I think I could manage that.
>
> On 5 January 2016 at 12:54, William Stein <notificati...@github.com>
> wrote:
>
>> Bill, you could make your octave interface into a Pip package (which you
>> say "this depends on sage", for now):
>>
>> http://python-packaging-user-guide.readthedocs.org/en/latest/distributing/
>>
>> Then I could just do "pip install sage-octave" (say), and it would get
>> installed. I would also make it so in a sage worksheet your package would
>> be imported and provide the %octave mode for worksheets by defaults.
>>
>> (All of Sage should be rewritten to be a bunch of pip packages (and
>> semantic versioning), which we assemble regularly together for testing. But
>> that's a battle for another lifetime.)
>>
>> —
>> Reply to this email directly or view it on GitHub
>> &l

Re: [sage-devel] sage octave interface

2016-01-06 Thread Bill Page
On 6 January 2016 at 13:12, Vincent Delecroix <20100.delecr...@gmail.com> wrote:
> Why making it a python package?!

Yes, that is a very good question.  The original motivation came as a
result of a comment by William Stien on an SMC issue concerning Ocatve
in Sage worksheets on SMC. See emails below. I indicated that on SMC I
used a locally modified version of 'octave.py' to avoid some errors
that bugged me but that I was not sufficiently strongly motivated
(i.e. "too lazy") to go through the process of trying to get the
changes into Sage itself.

> If it was a git branch it would be much easier to see the difference with the
> actual sage/interfaces/octave.py and test it...

Yes that is true but that would only be interesting to developers.

https://cloud.sagemath.com/projects/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/files/octave.py.patch

The advance of pip is that any Sage user can try these changes without
worrying about all that.

> You can have a look at
>
>http://doc.sagemath.org/html/en/developer/index.html
>

I am fairly familiar with but certainly not fluent in the development
process in the Sage.  Every time I look at it, it seems like a
significant uphill learning curve and (mostly) I really do not want to
be a Sage developer. I just want something to work when I discover I
need it for something else that I am doing and (sometimes) I have the
time to spend fixing a few problems.  Sometimes this might also
benefit other users. So I was interested in William's seemingly "light
weight" suggestion for how to make that possible.

In other words: at this point it is still an experiment and maybe as
William says: "a battle for another lifetime".

> 1. You should get rid of the following commented lines
>
>   # debug
>   # print debugging_message
>

Thanks. I don't see a specific case of this is the source code but I
have deleted '# debug' and some superfluous commented-out code.

> 2. The following is very inefficient to get rid of the first line
>
> out = "\n".join(out.splitlines()[1:])
>

I do not recall the original intention - maybe related to

https://docs.python.org/2/glossary.html#term-universal-newlines

I doubt that efficiency is an issue here, but do you have a suggestion?

> 3. The following is not a syntax error but is considered as such
>
> sage: octave.octave("\"syntax error\"")
>   File "", line unknown
> SyntaxError: sage2="syntax error";
>
> (this is just a string containing syntax error)
>

Yes. I am not sure what is the best way to determine that Octave has
returned an error message rather than a result.  Maybe looking for

  >>>

would be more reliable?

> 4. What is EOF at line 302?
>

I think this is a possible exception returned by 'expect'.

Regards,
Bill Page.

-- Forwarded message --
From: William Stein <notificati...@github.com>
Date: 5 January 2016 at 12:54
Subject: Re: [smc] %octave mode in sage worksheets is flaky simply
because Sage's own octave.eval is flaky (#355)
To: sagemathinc/smc <s...@noreply.github.com>
Cc: Bill Page <bill.p...@newsynthesis.org>


Bill, you could make your octave interface into a Pip package (which
you say "this depends on sage", for now):

http://python-packaging-user-guide.readthedocs.org/en/latest/distributing/

Then I could just do "pip install sage-octave" (say), and it would get
installed. I would also make it so in a sage worksheet your package
would be imported and provide the %octave mode for worksheets by
defaults.

(All of Sage should be rewritten to be a bunch of pip packages (and
semantic versioning), which we assemble regularly together for
testing. But that's a battle for another lifetime.)

—
Reply to this email directly or view it on GitHub.


-- Forwarded message --
From: Bill Page <bill.p...@newsynthesis.org>
Date: 5 January 2016 at 12:22
Subject: Re: [smc] %octave mode in sage worksheets is flaky simply
because Sage's own octave.eval is flaky (#355)
To: sagemathinc/smc
<reply+004c2a401335a612a5ff68302df88315ed52974d1e46e8e192cf000112a25ce692a169ce076e1...@reply.github.com>
Cc: sagemathinc/smc <s...@noreply.github.com>


I think there are good reasons to want to continue to use Octave from
a Sage worksheet - the primary one being interoperability with other
parts of Sage and in particular Sage graphics. There have been some
recent improvements to the Sage octave interface although some
problems remain in the most recent development version of Sage. On SMC
I use an improved version of octave.py locally:

https://cloud.sagemath.com/projects/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/files/octave.py
https://cloud.sagemath.com/projects/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/files/octave.py.patch

A brief demonstration:

https://cloud.sagemath.com/projects/b04b5777-e269-4c8f-a4b

Re: [sage-devel] Re: [SPAM: 9.600] Fwd: [sage-trac] #10295: Upgrading pexpect

2015-10-15 Thread Bill Page
The version of pexpect with the new option is still a branch called

https://github.com/pexpect/pexpect/tree/superfluous-sleep

I think they are waiting for us to say that it works with Sage.

Sorry, I really dont understand what is required in order to update a
branch on git.sagemath.org




On 15 October 2015 at 21:32, François Bissey <
francois.bis...@canterbury.ac.nz> wrote:

> On 10/16/15 14:29, kcrisman wrote:
>
>> Though I guess one would have to upgrade sagenb and pexpect
>> simultaneously?
>>
>  You got that part right, it will have to be simultaneous.
> Bill can you update the branch for a version with the commit in
> question included? Is it even released yet?
>
> Francois
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>

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


[sage-devel] Fwd: [sage-trac] #10295: Upgrading pexpect

2015-10-15 Thread Bill Page
Is anyone interested in helping to resolve this old pexpect issue? Dealing
with the Sage development process and in particular Sage package management
is a bit beyond me but François Bissey created a branch almost 5 months ago
with an updated version of pexpect that worked with the version of Sage
available at that time.

http://git.sagemath.org/sage.git/commit/?id=80cd29cee620bb62b53a389cff5f7db4aa65b2d6

Recently one of the pexpect developers expressed an interest in helping to
resolve the issue and to that end committed a patch to pexpect to make the
wait in the read loop optional.  This would avoid having to apply a patch
for that purpose since Sage can now just call the new version of pexpect
with that option.

What steps would be necessary to get this ticket closer to the top of the
pile?

-- Forwarded message --
From: sage-trac 
Date: 14 October 2015 at 20:18
Subject: Re: [sage-trac] #10295: Upgrading pexpect
To:


#10295: Upgrading pexpect
-+-
   Reporter:  SimonKing  |Owner:  was
   Type:  enhancement|   Status:  new
   Priority:  major  |Milestone:  sage-6.7
  Component:  interfaces |   Resolution:
   Keywords:  pexpect upgrade|Merged in:
Authors: |Reviewers:
Report Upstream:  N/A|  Work issues:
 Branch: |   Commit:
  u/fbissey/pexpect3.3   |
80cd29cee620bb62b53a389cff5f7db4aa65b2d6
   Dependencies: | Stopgaps:
-+-

Comment (by bpage):

 See commit to pexpect


https://github.com/pexpect/pexpect/commit/40ce421051c0a54f3b3849424491882cf1339801

 by Jeff Quast.  Some discussion at

 https://gitter.im/pexpect/pexpect

 The proposal is to make it possible for Sage to stop bundling an obsolete
 version of pexpect and to take advantage of recent improvements to pexpect
 including unicode support and support for Python 3.

--
Ticket URL: 
Sage 
Sage: Creating a Viable Open Source Alternative to Magma, Maple,
Mathematica, and MATLAB

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


Re: [sage-devel] Sources of funding - perhaps computer manufacturers?

2015-10-01 Thread Bill Page
On 1 October 2015 at 05:47, Juan Luis Cano  wrote:
> ...
> The situation got better over the years (the IPython notebook was born, then
> Anaconda came to scene so I never ever had to recompile NumPy again) and
> it's been ages since I last used (and recommended) Sage for any real work.
> Perhaps Sage symbolics are better than SymPy - but what's the cost? I do not
> know a single classmate who would find in Sage a key functionality missing
> in the "SciPy stack". Let me stress again that we are engineers - most of
> what we do is solving ODEs, plotting and reading from files.
>

+1

There is one original feature unique to Sage however that originally
attracted me to Sage in the very early years and which continues to
motivate my interest. This originally was summed up in a seemingly
trite slogan like: "Building the car, not re-inventing the wheel" but
which no longer seems very evident. That is the Python-based "glue"
that makes it possible for very different "external" packages such as
Maxima, Gap, Singular, Octave and many others (including especially in
my case FriCAS) to appear as objects within a universal interface in
Sage.  I have been disappointed about the apparent shift in Sage away
from this goal.

On the other hand I am very encouraged by the continued development of
SMC which makes exactly the kind of transition that Juan describes
very easy while retaining the "glue" implemented in Sage.

> I have been reading very closely all William posts about the topic and am
> honestly worried about Sage's future, because it's a project I still love.
> Its developers have poured a tremendously big amount of top-quality, unpaid
> work. But I agree with others that the project diversified too much and
> maybe should start *dropping* things instead of *adding* things. What about
> "Being a viable alternative to Magma" - and leave the rest of the Ma's out?

As a core developmental strategy for Sage this seems like a reasonable
goal to me (although I do not anticipate any immediate need for this
kind of functionality in my own work).  Maybe this is a logical
extension of the combinat work on the "category framework" in Sage.
Unfortunately while I am very much in favor of the category/domain
approach of Axiom and related systems, I find the Sage implementation
of this idea almost entirely indigestible.  Perhaps this is not the
case for a sufficiently large number of potential Sage developers.

I am sorry, but I do not think an emphasis on STEM-oriented features
in Sage is likely to have a big impact on it's use or development.  It
could however it could potentially contribute a lot to the wider
adoption of SMC and I agree that that would be a good thing.
Unfortunately there are already a number of both open and proprietary
competitors in this highly commercialized and commercializable field.

> What about removing something of those 800 Mb? Splitting core functionality
> and making it available through pip and conda on PyPI? Stating it as a
> federation of projects? Focus on its strengths and its present community
> (that is: pure mathematics) rather than pleasing everybody?
>

+1

To me "federation" is exactly what Sage was *originally* about.

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


[sage-devel] categories

2015-10-01 Thread Bill Page
[Changed thread subject from: Sources of funding - perhaps computer
manufacturers? ]

What I find hard to swallow is the peculiar mix of "parent",
"category", and Python data types (class system and inheritance). In
spite of the available documentation in the category system in Sage, I
really don't know what to use when and how to map it properly to
abstract mathematics in such a way as to gain as much as possible from
the existing Sage libraries.  The situation is very different in
Axiom/Aldor.

It is good that you mention Aldor because it was designed specifically
as the "next generation" of Axiom library compiler but for entirely
non-technical reasons never achieved this status. On the other hand
the Aldor documentation is still the best available documentation of
the Axiom type system.

http://www.aldor.org/docs/aldorug.pdf

Aldor is currently supported only by the FriCAS fork of Axiom. Aldor
development itself is not dead, merely sleeping, and apparently a low
priority for the several people involved.

https://github.com/pippijn/aldor

To the best of my knowledge the Sage-combinat development of the
category system in Sage was motivated largely by the experience of
some of the developers with the Axiom-like category system that was
implemented in MuPad. MuPad was originally modeled after an early
version of Maple and so far as I know has a syntactic/symbolic
orientation at it's core (like Maple, Mathematica and Maxima) rather
than a more "algebraic" one. The MuPad developers borrowed from Axiom
in developing a more static type-oriented architecture for the
library.  Maple itself as you might know has taken a rather different
approach. But in any case, compared to Axiom, the MuPad category
systems seems to me to be more or less grafted-on.  And the Sage
category system seems much more so.

The little that I know about the Julia type system, mostly from
discussions about Axiom and Aldor on that mailing list about a year
ago, is that it has a more malleable design that one might expect to
enable a more integrated implementation of the central ideas of the
Axiom category system.  So far as I know however no one is working on
this specifically.

---

I am happy to continue the discussion of Axiom, Aldor and FriCAS but I
am not sure if this discussion is entirely appropriate the the
sage-devel list.  Is there a Julia/Nemo list where this should be
continued?

Regards,
Bill Page.


On 1 October 2015 at 10:56, Bill Hart <goodwillh...@googlemail.com> wrote:
>
> On Thursday, 1 October 2015 16:35:20 UTC+2, Bill Page wrote:
> 
>>
>> Unfortunately while I am very much in favor of the category/domain
>> approach of Axiom and related systems, I find the Sage implementation
>> of this idea almost entirely indigestible.  Perhaps this is not the
>> case for a sufficiently large number of potential Sage developers.
>
>  Bill, I would be very interested if you could elaborate on this point in
> more detail (assume I don't know anything about Aldor/Spad because it is so
> long ago that I read the manual for Aldor that I really have forgotten how
> this works over there).
>
> I'm currently implementing a system in Julia which really follows the design
> of Sage's parent/element setup quite closely (we tried another approach, but
> it failed). Since the project I'm working on is yet very young, I'd like to
> understand what is unpalatable about the Sage approach, since I'm
> essentially using it.
>

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


Re: [fricas-devel] Re: [sage-devel] categories

2015-10-01 Thread Bill Page
On 1 October 2015 at 14:23, William Stein  wrote:
> ...
> One other impression you have is that categories were just bolted on
> by combinatorics people at the end.  However, David Kohel and I
> actually implemented the first round of category-related stuff in Sage
> right at the very, very beginning -- it was one of the first things we
> did, motivated by what David had wished Magma had.

The concept of "parent" is adopted from Magma, right?  I am not sure I
really understand it, either relative to the usual inheritance rules
in Python or category theory.  Clearly the related? concept of
"element" is borrowed from category theory - maybe even topos theory?

Is there a reasonably short description of categories in Sage "for
category theorists"?

>  And it is has
> just been iteratively refined over the users, with Nicolas Thiéry
> doing by far the most work on it during his sabbatical a few years
> ago.   There was also a lot of input coming from the multiple rounds
> of rewriting of the coercion model, by me, David Roe, Robert Bradshaw
> (especially), and others.
>

Do you consider the coercion model as part of or motivated by category
theory in Sage?

There was some early work on this in Axiom, e.g.

http://dl.acm.org/citation.cfm?doid=309831.309944
Automated coercion for axiom
by Nicolas J. Doye

also his thesis:
http://axiom-wiki.newsynthesis.org/public/refs/doye-aldor-phd.pdf

but for the most part I would say that Axiom does not actually
implement coercion in this way.

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


Re: [fricas-devel] Re: [sage-devel] categories

2015-10-01 Thread Bill Page
On 1 October 2015 at 13:07, William Stein <wst...@gmail.com> wrote:
> On Thu, Oct 1, 2015 at 9:38 AM, Bill Page <bill.p...@newsynthesis.org> wrote:
>> [Changed thread subject from: Sources of funding - perhaps computer
>> manufacturers? ]
>>
>> What I find hard to swallow is the peculiar mix of "parent",
>> "category", and Python data types (class system and inheritance). In
>> spite of the available documentation in the category system in Sage, I
>
> Just curious -- Bill Page, did you ever take a graduate mathematics
> course in "category theory", or at least a course that had a
> significant portion devoted to it, or at least carefully read (and did
> exercises!) from a textbook on category theory?

Yes, yes, and yes.

> Because despite
> being called "abstract nonsense" by some, category is a serious,
> highly technical, and nontrivial area of mathematics, with interesting
> theorems, a long development, etc., just like other areas of math.
>

Yes, certainly.  I consider category theory an appropriate foundation
for a very large part of mathematics.

> I would expect that somebody who doesn't know category theory (the
> mathematical area) would find the category framework in Sage very
> confusing, just like somebody who doesn't know calculus might find the
> symbolic functionality confusing.

No, I find the Sage implementation of these ideas confusing, or at the
very least overly complicated.  I am sure that if I had a good reason
and enough energy to want to overcome this impression
(pre-conception?) then I would probably find categories in Sage very
useful.  It certainly seems to be useful to at least a small core of
developers in Sage.

It is important also to keep in mind what are called "categories" in
Axiom have a best only an indirect connection to mathematical category
theory.  To my knowledge there has been only a bit of work done in
trying to actually implement some form of category theory in
Axiom/Aldor.

http://axiom-wiki.newsynthesis.org/CategoryTheoryAndAxiom

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


Re: [fricas-devel] Re: [sage-devel] categories

2015-10-01 Thread Bill Page
On 1 October 2015 at 15:10, William Stein <wst...@gmail.com> wrote:
> On Thu, Oct 1, 2015 at 12:00 PM, Bill Page <bill.p...@newsynthesis.org> wrote:
>> ...  Clearly the related? concept of
>> "element" is borrowed from category theory - maybe even topos theory?
>
> Yes, parents and elements are from Magma.  To me they have nothing to
> do with category theory.  Category theory is one level up, and is
> about abstracting away from thinking about parents and elements (and
> instead thinking about objects, morphisms, and functors).Just as
> Bill Hart said, the parent/element approach in magma is very useful,
> and inspired Sage and Nemo, but isn't category theory.
>

Thanks. I was thinking of elements as morphisms, as in that branch of
category theory.

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


Re: [fricas-devel] Re: [sage-devel] categories

2015-10-01 Thread Bill Page
In FriCAS

(1) -> x:Polynomial(Integer)
   Type: Void
(2) -> x + 1/2

1
   (2)  x + -
2
  Type: Polynomial(Fraction(Integer))

On 1 October 2015 at 15:28, 'Bill Hart' via sage-devel
 wrote:
>
>
> On 1 October 2015 at 20:23, William Stein  wrote:
> 
>
>> By the way, look at how coercion "works" in Magma:
>>
>> $ magma
>> Magma V2.18-5 Thu Oct  1 2015 16:59:12 on compute3-us [Seed =
>> 629019987]
>> Type ? for help.  Type -D to quit.
>> > R := PolynomialRing(IntegerRing());
>> > x + 1/2;
>>
>> >> x + 1/2;
>>  ^
>> Runtime error in '+': Bad argument types
>> Argument types given: RngUPolElt[RngInt], FldRatElt
>
>
> We are call this "complex coercion" in our Nemo discussions
>
> [...as opposed to simple coercion:
>
>  R, x = PolynomialRing(QQ, "x")
>  K, a = NumberField(x^3 + 3x + 1,"a")
>
>  a + 1/2 # simple coercion since the result lives in K
> ]
>
> It's definitely quite easy to add complex coercion in Nemo/Julia (via Julia
> generic catchall functions), but I'm resisting it quite obstinately for the
> time being.
>
> One reason is that it easily leads to functions that are not
> type-consistent. You can quite easily write functions whose output type
> depends on the values, rather than the types of the inputs. This completely
> screws with type inference and Jit compilation, though Julia does allow it.
>
> Since Nemo focuses on highly performant generics for the time being, I'm
> trying to avoid introducing complex coercions, at least until we have a very
> fast core. (Though naturally, mathematicians are keen to introduce this
> feature as soon as possible, since it is basically germane to any real
> mathematics.)
>

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


Re: [sage-devel] Re: [fricas-devel] Re: categories

2015-10-01 Thread Bill Page
On 1 October 2015 at 17:38, Simon King <simon.k...@uni-jena.de> wrote:
> ...
> When I first encountered Sage's category framework, I expected to see
> something similar to what we now have in CAP, but it has in fact a rather
> different flavour and purpose.
>

Understood.  I am not arguing against the way this was done in Sage
but I continue to wish for something both simpler and more ambitious.
:)

I am very interested in the use of adjunction in programming languages
and the definition of types by construction of universals. Perhaps CAP
is relevant? Can you provide a reference to a relevant paper?

Cheers,
Bill Page.

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


Re: [sage-devel] Re: [fricas-devel] Re: categories

2015-10-01 Thread Bill Page
Thanks.

https://github.com/homalg-project/CAP_project

https://github.com/homalg-project/CAP_project/blob/master/CAPManual.pdf

On 1 October 2015 at 18:43, Simon King <simon.k...@uni-jena.de> wrote:
> PS:
>
> On 2015-10-01, Bill Page <bill.p...@newsynthesis.org> wrote:
>> I am very interested in the use of adjunction in programming languages
>> and the definition of types by construction of universals. Perhaps CAP
>> is relevant? Can you provide a reference to a relevant paper?
>
> The talk on CAP here was presented by Sebastian Gutsche from
> Kaiserslautern and Sebastian Posur from Aachen.
>
> Best regards,
> Simon
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [sage-devel] Sources of funding - perhaps computer manufacturers?

2015-09-29 Thread Bill Page
Given the serious situation in Sage funding I suppose that there is
still a good reason for continuing this thread.

On 28 September 2015 at 13:37, William Stein <wst...@gmail.com> wrote:
>
> On Mon, Sep 28, 2015 at 10:25 AM, Francesco Biscani
> <bluesca...@gmail.com> wrote:
> >> Exactly.  And also the mission statement: viable alternative to the Ma's -
> >> that is tricky!
> >
> > I have always felt a tad confused and mislead by this statement.
> >
> > As someone who has interacted over the years with physicists and engineers
> > using daily Mathematica, Maple and Matlab, I see very little overlap between
> > their typical use of these tools and the typical usages of SAGE, at least
> > from the point of view of a lurker on this list.
> ...
> 1. Magma is also an Ma.   Magma's incredibly good at pure mathematics.
> You seem to be leaving out Magma above.
>

With emphasis on "physicists and engineers" I completely agree with
Francesco. I am not aware of any physicists or engineers who use
Magma. I never heard of Magma before Sage and I still find Magma of
little interest - for physics or engineering.  Perhaps I just do not
know what I am are missing? Meanwhile I admit that I do know something
about Axiom, another system that might be accused of catering to pure
mathematics, and I have used it in theoretical physics. And I have
also used Sage, or more specifically "Numpy/SciPy/SymPy/Matplotlib"
(not to forget also Maxima and probably several other packages
transparently wrapped up in Sage) on SMC.

Because my collaborator has less tolerance for the current
idiosyncrasies of SMC and Sage and a greater familiarity with Maple, I
recently back ported one of my more complicated Sage worksheets to
Maple.  I found it a bit challenging. I have also used Maple for a
long time but it turned out that I had used some features in Sage and
Numpy for which I did not immediately know the Maple counterpart.
However the final result was just fine and convinced me that in many
ways Sage is definitely an alternative to Maple even though it may
seem more viable to some people than others.

> > It seems like SAGE caters
> > to (and is run mostly by) researchers in pure mathematics, and that is
> > little interest on other use cases. Pragmatically, it seems to me that a
> > sizeable chunk of people "doing mathematics on a computer" is today
> > better served in the Python space by the Numpy/SciPy/SymPy/Matplotlib
> > stack as an alternative to the Ma's rather than SAGE.
> >
> 2. You say "... better served in the Python space by the
> Numpy/SciPy/SymPy/Matplotlib stack as an alternative to the Ma's
> rather than SAGE."  Sage includes "Numpy/SciPy/SymPy/Matplotlib",
> so we don't have to worry about that chunk of people with respect to
> our mission statement.
>

This seems odd from the point of view of marketing strategy.  If
"Numpy/SciPy/SymPy/Matplotlib" is already an alternative to the Ma's
(minus Magma), then is the only point of Sage to add the missing
features of Magma?  In terms of attracting funding for Sage, I would
be worried about showing that Sage provides some obvious added value
over just "Numpy/SciPy/SymPy/Matplotlib" for those users.

In this regard it is kind of interesting to read:

https://github.com/sympy/sympy/wiki/SymPy-vs.-Magma

Of course it is a kind of advertisement for Sympy, but something like
this might be appropriate for Sage.

SMC as a platform on the other hand seems much more agnostic and
hopefully is attract some of these users, although there does seem to
be some significant competition using a similar tool set.

> > This is of course completely fine! I am not questioning anyone's motives,
> > inclinations or desires. But IMO continuing to push the idea that SAGE
> > aims to be a viable alternative to the Ma's tout-court risks of being a
> > source of confusion.
>
> 3. There is a lot more to mathematics than just what Magma does and
> *also* much more to it than just what Numpy/SciPy/SymPy/Matplotlib
> do. There's a huge amount of interesting things that could be
> systematically computed with in mathematics that no existing package
> does yet.
>

The point being that this is not explicitly part of the Sage  "mission
statement". Of course there are quite a few people who seem to be
trying to do this with Sage but I am not sure whether Sage is more or
less an viable alternative for this purpose than an of the Ma's.  When
it comes to doing new mathematics the flexibility of Python and the
complexity of the Sage development infrastructure both seem daunting
compared to the tightly integrated mathematics library in a system
like Axiom (FriCAS).

Bill Page.

-- 
You received this message because you are subscribed to the Goo

Re: [sage-devel] Sources of funding - perhaps computer manufacturers?

2015-09-29 Thread Bill Page
On 29 September 2015 at 19:41, Dima Pasechnik  wrote:
>
> cryptographers (some of them can certainly qualify as engineers) use Magma a 
> lot.
>

OK. Would you say that Sage is a viable alternative for them?

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


Re: [sage-devel] how should the expression relation test be named?

2015-09-25 Thread Bill Page
In Maple 'is' is part of the assume mechanism

http://www.maplesoft.com/support/help/maple/view.aspx?path=assume

and returns True, False or FAIL (if it cannot determine whether the
property is always satisfied).  Maple also has 'evalb' and 'testeq'
with somewhat different semantics.

Are you proposing a similar "tristate" logic in Sage?

Is there somewhere that I can find "Truth(tm)"?


On 25 September 2015 at 02:09, Ralf Stephan <gtrw...@gmail.com> wrote:
> On Thursday, September 24, 2015 at 8:22:53 PM UTC+2, Bill Page wrote:
>>
>> What answer should be expected when it is not possible to show that an
>> expression is zero?  Would you expect that
>>
>>ex.is_zero() = not(ex.is_nonzero()) ?
>
>
> Yes, for constant expressions (i.e. not containing symbols) at the moment.
> With new code, yes for all expressions.
>
>>
>> I suppose that I should expect True or False from
>>
>>   bool(ex=0)
>>
>> and False in the case that it cannot be shown to be true.
>
> (assuming you meant bool(ex==0))
> If you expect that then don't be surprised when innocent code
> behaves wrongly and uses unnecessary time, because the
> function that gets called will also get called with e.g. if (ex):...
>
> Having an explicit function for showing Truth(tm) will prevent
> this.
>
>>
>> But I am not
>> so sure about is_...  Do you expect only two possible outcomes and an
>> runtime error in the case of a failure to decide one or the other?
>
>
> Having an explicit function for showing Truth(tm) will allow it
> to have three results: Yes/No/NotImplemented
> (Exceptions for things like complex x > 0).
>
> Ticket #17700 proposes tristate logic, SymPy has it too.
>
> The question is if we should call it is().
> I just found that Maple too uses that name, so please voice any
> final objections.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [sage-devel] how should the expression relation test be named?

2015-09-24 Thread Bill Page
What answer should be expected when it is not possible to show that an
expression is zero?  Would you expect that

   ex.is_zero() = not(ex.is_nonzero()) ?

I suppose that I should expect True or False from

  bool(ex=0)

and False in the case that it cannot be shown to be true. But I am not
so sure about is_...  Do you expect only two possible outcomes and an
runtime error in the case of a failure to decide one or the other?

On 24 September 2015 at 02:47, Ralf Stephan  wrote:
>>   ex.is_zero(simplify=False)
>>   ex.is_zero(simplify=True)
>
>
> This fits if ex is an equality. But what about: if x>0 ?
> Two functions are necessary for inequalities because (x>0).__nonzero__
> is called by (x>0)._cmp_ in case of eg. uniq(list of exes) and
> here print or alphabetical order is called for, not proof.
>
> So there is still a need for hold/truth() etc it seems.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [sage-devel] Re: Extremely broad bug in Sage Integral Computations

2015-06-04 Thread Bill Page
On 4 June 2015 at 14:14, Emmanuel Charpentier
emanuel.charpent...@gmail.com wrote:
 Bill, Sagemath cloud complains that your worksheet does not exist.


Sorry. I was cleaning up and deleted it by mistake.  Here it is again,
thanks to SMC snapshots..


 https://cloud.sagemath.com/projects/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/files/integral.sagews


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


Re: [sage-devel] Re: Extremely broad bug in Sage Integral Computations

2015-06-04 Thread Bill Page
On 4 June 2015 at 09:21, kcrisman kcris...@gmail.com wrote:

 1.  anyone who believes that sqrt(x^2)  is |x|  is mistaken. As Bill Page
 says, there are two values.

 Ah, the old 'function versus expression' debate.  I really missed that.


It is not clear to me what this has to do with 'function versus expression'.

But I do think that the proper treatment of multi-valued functions
with a clear and precise definition of the meaning of 'sqrt' and 'log'
are very important.  If 'sqrt' is intended to mean only a specific,
i.e. non-negative, branch then this should be made obvious.  And of
course one would have to evaluate very carefully how this function is
handled.  C.f. a previous long thread on a closely related subject:
https://groups.google.com/forum/#!searchin/sage-devel/sqrt$20conjugate/sage-devel/6j-LcC6tpkE/qejhD-p8UFUJ

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


Re: [sage-devel] Re: Extremely broad bug in Sage Integral Computations

2015-06-04 Thread Bill Page
Just for fun, here is a prettier version of this worksheet on SMC

https://cloud.sagemath.com/projects/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/files/integral2.sagews

On 4 June 2015 at 14:29, Bill Page bill.p...@newsynthesis.org wrote:
 On 4 June 2015 at 14:14, Emmanuel Charpentier
 emanuel.charpent...@gmail.com wrote:
 Bill, Sagemath cloud complains that your worksheet does not exist.


 Sorry. I was cleaning up and deleted it by mistake.  Here it is again,
 thanks to SMC snapshots..


 https://cloud.sagemath.com/projects/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/files/integral.sagews


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


Re: [sage-devel] Re: Extremely broad bug in Sage Integral Computations

2015-06-03 Thread Bill Page
Yes.

https://cloud.sagemath.com/projects/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/files/integral.sagews

On 3 June 2015 at 13:31, Samuel Lelievre samuel.lelie...@gmail.com wrote:
 Can fricas do this integral?

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

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


Re: [sage-devel] Extremely broad bug in Sage Integral Computations

2015-06-03 Thread Bill Page
On 2 June 2015 at 13:26, Gregory Bard gregory.bard1...@gmail.com wrote:

 Consider the integral of sqrt( cot(x)^2 ). I think we can all agree that

 sqrt( cot(x)^2 ) = abs( cot (x) ) =/= cot(x)

 ...

That is probably exactly where the disagreement starts since sqrt can
be considered a multi-valued function and one can choose branch cuts
so that the equality holds.

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


[sage-devel] fricas.eval() in Sage Notebook tries to start Axiom instead of FriCAS

2015-05-16 Thread Bill Page
In SageMath verison 6.6 command line it works as expected:

wspage@suse:~/sage ./sage
┌┐
│ SageMath Version 6.6, Release Date: 2015-04-14 │
│ Type notebook() for the browser-based notebook interface.│
│ Type help() for help.│
└┘
sage: fricas.eval('sin(x)')
'  sin(x)\r\r\n


Type: Expression(Integer)\r\r\n'
sage: exit

And a Sage Notebook cell with contents:

%fricas
sin(x)

also produces the expected result but a cell with contents:

%sage
fricas.eval('sin(x)')

produces the following error:

Traceback (most recent call last):
  File stdin, line 1, in module
  File _sage_input_3.py, line 10, in module
exec compile(u'print _support_.syseval(axiom,
ufricas.eval(\'sin(x)\'), __SAGE_TMP_DIR__)
  File , line 1, in module

  File 
/home/wspage/sage/local/lib/python2.7/site-packages/sagenb-0.11.4-py2.7.egg/sagenb/misc/support.py,
line 438, in syseval
return system.eval(cmd, sage_globals, locals = sage_globals)
  File 
/home/wspage/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.py,
line 1222, in eval
for L in code.split('\n') if L != ''])
  File 
/home/wspage/sage/local/lib/python2.7/site-packages/sage/interfaces/axiom.py,
line 445, in _eval_line
self._start()
  File 
/home/wspage/sage/local/lib/python2.7/site-packages/sage/interfaces/axiom.py,
line 239, in _start
Expect._start(self)
  File 
/home/wspage/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.py,
line 429, in _start
(self.name(), cmd, e, self._install_hints()))
RuntimeError: unable to start axiom because the command 'axiom -nox
-noclef' failed: The command was not found or was not executable:
axiom.

--

I do not understand why it does not work in the Notebook.  Why is it
different than the command line?  Any ideas what to look for?

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


[sage-devel] password reset at http://trac.sagemath.org/

2015-05-08 Thread Bill Page
Is it working?  I tried to reset my password.  sage-trac sent me an
email with a new one but it does seem to work. Anybody try this
lately?

-- Forwarded message --
From: sage-trac t...@sagemath.org
Date: 8 May 2015 at 17:30
Subject: [Sage] Trac password reset for user: bpage
To: bill.p...@newsynthesis.org


Your Trac password has been reset.

Here is your account information:

Login URL: http://trac.sagemath.org/login
Username: bpage
Password: ...

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


Re: [sage-devel] Unicode in Sage Worksheets

2015-05-07 Thread Bill Page
On 7 May 2015 at 22:29, François Bissey
francois.bis...@canterbury.ac.nz wrote:
 Pushed a branch at http://trac.sagemath.org/ticket/10295 we can continue
 the work there.


OK, thanks.


 On 05/08/15 14:22, François Bissey wrote:

 Unfortunately, the notebook is still broken with newer pexpect. If you
 try:
 g=sin(x); plot(g,(x,-pi,3*pi/2))
 You get this:
 Python 2.7.8 (default, Apr 22 2015, 10:15:06)
 [GCC 4.9.2] on linux2
 Type help, copyright, credits or license for more information.
  
   import os;os.chdir(/tmp/tmplVMYJZ);
   execfile(_sage_input_1.py)
 START1

 import os;os.chdir(/tmp/tmp1r7_z0);
 execfile(_sage_input_2.py)
 Traceback (most recent call last):
File stdin, line 1, in module
File _sage_input_1.py, line 25, in module
  load(os.path.join(os.environ['DOT_SAGE'], 'init.sage'),
 globals(),attach=True)
File sage/structure/sage_object.pyx, line 838, in
 sage.structure.sage_object.load
 (build/cythonized/sage/structure/sage_object.c:10243)
 TypeError: load() got an unexpected keyword argument 'attach'
 __SAGE__
 __SAGE__import os;os.chdir(/tmp/tmp1r7_z0);
 __SAGE__execfile(_sage_input_2.py)
 START2
 __SAGE__
 __SAGE__import os;os.chdir(/tmp/tmp4CwfGS);

 This is a deal breaker. We need to fix this before the upgrade
 is acceptable. This is done with vanilla sage not sage-on-gentoo.
 The only difference in sage-on-gentoo is the version of python.


I have no idea what is going on here or why it seems to involve
cython?  Any clues?

One thing I did notice is that you get a different result of you put

g=sin(x)

and

plot(g,(x,-pi,3*pi/2))

in different cells.

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


Re: [sage-devel] Unicode in Sage Worksheets

2015-05-07 Thread Bill Page
On 7 May 2015 at 21:37, François Bissey
francois.bis...@canterbury.ac.nz wrote:
 Looks like I would want this single commit.
 https://github.com/pexpect/pexpect/commit/aac5897aa12daf056b8fe08f1b6512d9f60c2d27
 The branch seems otherwise strangely stale (210 commits
 behind master).

Yes. I suppose that branch 3.x is (more or less) release 3.4  But
there is already announced a version 4.0

https://github.com/pexpect/pexpect/blob/master/doc/history.rst

But there is no branch specific to 4.x.  I suppose that is in fact the
master branch.  Although they use the word release it is not obvious
to me where to find the source or installable for a specific release.

I have not tried 4.0 yet but if it is released and a significant
number of fixes ahead of 3.4 then perhaps we should try to skip
right to it?

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


Re: [sage-devel] Unicode in Sage Worksheets

2015-05-07 Thread Bill Page
Maybe this patch solves the problem:

https://github.com/pexpect/pexpect/pull/109/files

I pulled pexpect 3.x from github which as I understand it is quite a
few patches ahead of 3.3.

$ git clone https://github.com/pexpect/pexpect.git
$ cd pexpect
$ git checkout 3.x

then installed it into my sage 6.6 the hard way (maybe there is an easier way?)

$ $HOME/sage/sage -python setup.py install --prefix $HOME/sage/local
$ rm /home/wspage/sage/local/lib/python2.7/site-packages/pexpect.*
$ rm 
/home/wspage/sage/local/lib/python2.7/site-packages/pexpect-2.0-py2.7.egg-info

and rebuilt the sage library

$ cd $HOME/sage
$ ./sage -b

Now I get only one failure in

$ ./sage -t --long src/sage/interfaces/expect.py



On 7 May 2015 at 08:34, Francois Bissey
francois.bis...@canterbury.ac.nz wrote:
 If you want doctests failures here is a sample (6.7.beta4):
 sage -t --long /usr/lib64/python2.7/site-packages/sage/interfaces/expect.py
 **
 File /usr/lib64/python2.7/site-packages/sage/interfaces/expect.py, line 
 285, in sage.interfaces.expect.Expect.pid
 Failed example:
 pid = gap.pid()
 Exception raised:
 Traceback (most recent call last):
   File /usr/lib64/python2.7/site-packages/sage/doctest/forker.py, line 
 496, in _run
 self.compile_and_execute(example, compiler, test.globs)
   File /usr/lib64/python2.7/site-packages/sage/doctest/forker.py, line 
 858, in compile_and_execute
 exec(compiled, globs)
   File doctest sage.interfaces.expect.Expect.pid[0], line 1, in 
 module
 pid = gap.pid()
   File /usr/lib64/python2.7/site-packages/sage/interfaces/expect.py, 
 line 296, in pid
 self._start()
   File /usr/lib64/python2.7/site-packages/sage/interfaces/gap.py, line 
 1168, in _start
 gap_reset_workspace(verbose=False)
   File /usr/lib64/python2.7/site-packages/sage/interfaces/gap.py, line 
 1507, in gap_reset_workspace
 g.eval('SetUserPreference(HistoryMaxLines, 30)')
   File /usr/lib64/python2.7/site-packages/sage/interfaces/gap.py, line 
 570, in eval
 result = Expect.eval(self, input_line, **kwds)
   File /usr/lib64/python2.7/site-packages/sage/interfaces/expect.py, 
 line 1222, in eval
 for L in code.split('\n') if L != ''])
   File /usr/lib64/python2.7/site-packages/sage/interfaces/gap.py, line 
 727, in _eval_line
 self._start()
   File /usr/lib64/python2.7/site-packages/sage/interfaces/gap.py, line 
 1163, in _start
 Expect._start(self, Failed to start GAP.)
   File /usr/lib64/python2.7/site-packages/sage/interfaces/expect.py, 
 line 425, in _start
 self._expect = pexpect.spawn(cmd, logfile=self.__logfile, 
 env=pexpect_env)
   File /usr/lib64/python2.7/site-packages/pexpect/__init__.py, line 
 493, in __init__
 fd = sys.__stdin__.fileno()
 ValueError: I/O operation on closed file

 this particular failure is all over the place with pexpect 3.3 so there is
 something that is in need of updating on expect.py side before going ahead.

 François

 On 7/05/2015, at 14:59, Bill Page bill.p...@newsynthesis.org wrote:

 Is there a possibility of creating an experimental package to install
 pexpect 3.3 ?

 I see references to doctests failing but no details.  It would be
 good to make this easier to test.

 On 6 May 2015 at 22:41, leif not.rea...@online.de wrote:
 Bill Page wrote:
 After reading the docs:

 http://pexpect.readthedocs.org/en/latest/index.html

 It seems that version 3 and later are supposed to handler unicode
 properly.  Version 3.3 requires Python 2.6 or later.  Since Sage is
 already at Python 2.7 is there a good reason why Sage is still using
 an older version of pexpect?

 http://trac.sagemath.org/ticket/502 (!)

 http://trac.sagemath.org/ticket/10295


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

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

-- 
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http

[sage-devel] Fwd: Unicode in Sage Worksheets

2015-05-06 Thread Bill Page
Perhaps this is more specifically related to Sage. Anyone have any
suggestions or comments?  Has the issue of sending unicode to external
programs been discussed before?

Is there a better way to implement this without having to modify a
common python site package?

Is there a good way to make this specific to just those interfaces
that can support unicode?


-- Forwarded message --
From: Bill Page bill.p...@newsynthesis.org
Date: 5 May 2015 at 23:02
Subject: Re: Unicode in Sage Worksheets
To: sage-cl...@googlegroups.com


As suggested here:

  http://sourceforge.net/p/pexpect/bugs/28/

the following patch to the sage python site package pexpect.py

~$ diff -au 
/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/pexpect.py
pexpectu.py
--- /usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/pexpect.py
  2015-02-23 23:01:50.0 +
+++ pexpectu.py 2015-05-06 02:26:19.798935537 +
@@ -666,7 +666,7 @@
 if self.logfile != None:
 self.logfile.write (str)
 self.logfile.flush()
-c = os.write(self.child_fd, str)
+c = os.write(self.child_fd, str.encode(utf-8))
 return c

 def sendline(self, str=''):

--

and calling it from sage 'expect.py' like this:

~$ diff -au expect.py.orig expect.py
--- expect.py.orig  2015-05-06 02:53:17.150953375 +
+++ expect.py   2015-05-06 02:50:25.410955076 +
@@ -55,8 +55,8 @@
 # For reasons I don't understand, pexpect2.1 is much
 # worse than pexpect 2.0 for everything Sage does.
 
-import pexpect
-from pexpect import ExceptionPexpect
+import pexpectu as pexpect
+from pexpectu import ExceptionPexpect
 from sage.interfaces.interface import Interface, InterfaceElement,
InterfaceFunction, InterfaceFunctionElement, AsciiArtString

 from sage.structure.element import RingElement

--

enables sending unicode characters to FriCAS from a Sage worksheet as
shown here:

https://cloud.sagemath.com/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/files/fricas-CR%20Examples.sagews

Does anyone have a suggestion for how to package this for Sage and or
Sage Math Cloud?  Is

  str.encode(utf-8)

likely to cause errors in interfaces to other programs?

Bill Page.


On 5 May 2015 at 17:40, Bill Page bill.p...@newsynthesis.org wrote:
 I tried to use a unicode character in the following worksheet:

 https://cloud.sagemath.com/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/files/fricas-CR%20Examples.sagews

 The cell input is

   axialratio(expr,z)==(1-Abs(μ(expr,z)))/(1+Abs(μ(expr,z)))

 i.e. containing the Greek letter \mu

 This is being sent to FriCAS to execute. FriCAS support the use of
 unicode like this and in fact I can use it in a SMC terminal with
 FriCAS.  But in a Sage Worksheet in SMC I get the following error:

 Error in lines 1-1
 Traceback (most recent call last):
   File 
 /projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/.sagemathcloud/sage_server.py,
 line 879, in execute
 exec compile(block+'\n', '', 'single') in namespace, locals
   File , line 1, in module
   File 
 /projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/.sagemathcloud/sage_server.py,
 line 920, in execute_with_code_decorators
 code = code_decorator(code)
   File , line 3, in fricas_md
   File ./expect.py, line 1224, in eval
 for L in code.split('\n') if L != ''])
   File ./axiom.py, line 440, in _eval_line
 E.sendline(line)
   File 
 /usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/pexpect.py,
 line 676, in sendline
 n = self.send(str)
   File 
 /usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/pexpect.py,
 line 669, in send
 c = os.write(self.child_fd, str)
 UnicodeEncodeError: 'ascii' codec can't encode character u'\u03bc' in
 position 27: ordinal not in range(128)

 --

 Is this a limitation of the pexpect interface? Is there some way around this?

 Bill.

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


Re: [sage-devel] Re: Unicode in Sage Worksheets

2015-05-06 Thread Bill Page
After reading the docs:

http://pexpect.readthedocs.org/en/latest/index.html

It seems that version 3 and later are supposed to handler unicode
properly.  Version 3.3 requires Python 2.6 or later.  Since Sage is
already at Python 2.7 is there a good reason why Sage is still using
an older version of pexpect?

On 6 May 2015 at 15:27, Volker Braun vbraun.n...@gmail.com wrote:
 There are some unicode typesetting enhancements coming down the road:

 #18357: Unicode Art
 #18270: Print matrices using unicode large delimiters (on demand)



This is interesting but I suppose that neither of these directly
affect external programs like %fricas.

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


Re: [sage-devel] Re: Unicode in Sage Worksheets

2015-05-06 Thread Bill Page
Is there a possibility of creating an experimental package to install
pexpect 3.3 ?

I see references to doctests failing but no details.  It would be
good to make this easier to test.

On 6 May 2015 at 22:41, leif not.rea...@online.de wrote:
 Bill Page wrote:
 After reading the docs:

 http://pexpect.readthedocs.org/en/latest/index.html

 It seems that version 3 and later are supposed to handler unicode
 properly.  Version 3.3 requires Python 2.6 or later.  Since Sage is
 already at Python 2.7 is there a good reason why Sage is still using
 an older version of pexpect?

 http://trac.sagemath.org/ticket/502 (!)

 http://trac.sagemath.org/ticket/10295


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


Re: [sage-devel] Unicode in Sage Worksheets

2015-05-06 Thread Bill Page
http://trac.sagemath.org/ticket/10295

Looks like no one is interested any more.

On 6 May 2015 at 22:03, Francois Bissey
francois.bis...@canterbury.ac.nz wrote:
 Haven’t checked recently but the notebook has been broken each
 time someone has tried to update pexpect. There is a pexpect upgrade
 ticket where there should be more details.

 François

 On 7/05/2015, at 13:55, Bill Page bill.p...@newsynthesis.org wrote:

 After reading the docs:

 http://pexpect.readthedocs.org/en/latest/index.html

 It seems that version 3 and later are supposed to handler unicode
 properly.  Version 3.3 requires Python 2.6 or later.  Since Sage is
 already at Python 2.7 is there a good reason why Sage is still using
 an older version of pexpect?

 On 6 May 2015 at 15:27, Volker Braun vbraun.n...@gmail.com wrote:
 There are some unicode typesetting enhancements coming down the road:

 #18357: Unicode Art
 #18270: Print matrices using unicode large delimiters (on demand)



 This is interesting but I suppose that neither of these directly
 affect external programs like %fricas.

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

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

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


Re: [sage-devel] Re: Unicode in Sage Worksheets

2015-05-06 Thread Bill Page
On 6 May 2015 at 23:28, leif not.rea...@online.de wrote:
 Bill Page wrote:
 Is there a possibility of creating an experimental package to install
 pexpect 3.3 ?

 mkdir foo-1.0

 echo 'print Installing foo..'  foo-1.0/setup.py

 tar czf foo-1.0.spkg foo-1.0/

 ./sage -i foo-1.0.spkg


OK but I was bit worried about a package that actually replaces part
of Sage itself.

Here is an example of a Sage worksheet that does it dynamically using reload():

https://cloud.sagemath.com/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/files/Sage%20Worksheets/pexpect.sagews

This shows proof in principle at least that replacing pexpect with the
new version 3.3 does not negatively impact the fricas interface and
that it does solve the problem with unicode.

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-30 Thread Bill Page
I just tested the patch and now I get the following in a Sage worksheet on SMC:

axiom.eval()version)

'alue = Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17 \r\n'

%sage
from axiom import axiom

axiom.eval()version)

'Value = Axiom Axiom (May 2012) built on Friday July 25, 2014 at
23:34:17 \r\n'

%axiom
)version

Value = Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17 

--

This looks correct with the patch.


On 30 April 2015 at 11:59, Bill Page bill.p...@newsynthesis.org wrote:
 On 30 April 2015 at 05:29, Dima Pasechnik dimp...@gmail.com wrote:
 ...

 I thought that on SMC in a Sage worksheet you can do %axiom
 and this will call a system-wide Axiom. Currently SMC is hanging for me,
 so I can't check.


 OK, one can start axiom in an SMC  terminal, by typing axiom
 it is
 (1) - )version

 Value = Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17 

 My understanding is that %axiom invokes this instance of Axiom.


 Yes I think you are right however when I try

 %axiom
 )version

 in a Sage worksheet on SMC I get the following Python error message:

 UnboundLocalError: local variable 'out' referenced before assignment

 So I guess this has not been tested for a while.

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-30 Thread Bill Page
On 30 April 2015 at 13:34, Dima Pasechnik dimp...@gmail.com wrote:
 On Thursday, 30 April 2015 17:11:39 UTC+1, Bill Page wrote:
 ...
 well, for rants we have a special newsgroup called sage-flame.


Yes, although I consider what I wrote more of an inconvenient
statement of fact so maybe I used the wrong tag.

 sorry for teaching you a part of sage development process against your
 will :-)

Not at all.  In fact you already offered to do it for me - what could
be easier for me than that!

Cheers,
Bill.

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-30 Thread Bill Page
On 30 April 2015 at 13:29, Dima Pasechnik dimp...@gmail.com wrote:
 On Thursday, 30 April 2015 18:12:00 UTC+1, Bill Page wrote:

 I just tested the patch and now I get the following in a Sage worksheet on
 SMC:

 axiom.eval()version)

 'alue = Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17
 \r\n'

 %sage
 from axiom import axiom

 axiom.eval()version)

 'Value = Axiom Axiom (May 2012) built on Friday July 25, 2014 at
 23:34:17 \r\n'

 %axiom
 )version

 Value = Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17
 

 How about


Not withstanding that in several attempts just to use Axiom, both with
and without the patch, I got error messages like:

Axiom crashed -- automatically restarting.

...

See for example:
https://cloud.sagemath.com/projects/16529ab7-418b-4e51-b7db-bfa3dc760a1b/files/Testing%20Axiom%20Interface.sagews

The commands

 %axiom
 f:=x/(x^3-1)

 %sage
 show(axiom('f'))


produced the expected results.  If there is anyone out there who has
used Axiom on SMC or under Sage Notebook it would be interested in to
hear about their experience so far.  I would be glad to add anyone's
name to the list of collaborators on this project.

In any case I think this shows that the patch does not make things worse.

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-30 Thread Bill Page
On 30 April 2015 at 21:45, kcrisman kcris...@gmail.com wrote:

 Bill Page wrote:
 It just occurred to me that for such
 simple things there should be simple solutions.  And I guess there is:

 Well, that has been discussed a lot.  There *is* one possibility now - you
 can open a pull request at https://github.com/sagemath/sage using the
 GUI, I believe, at least for simple patches.


OK, I have created a pull request.  (At least I think I did, this is
the first time I have tried this.)


 find some else to do it. I am serious that perhaps this is not such a
 bad thing provided of course that there are enough people willing to
 do this.


 I think that for someone with a drive-by patch you are right that it is
 onerous.


If pull requests in github work then that is not too bad.  I guess
there is some way for people to comment on the pull requests?  That
seems to duplicate at least some of what was good about trac.

Bill.

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-30 Thread Bill Page
On 30 April 2015 at 16:06, William Stein wst...@gmail.com wrote:
 On Thu, Apr 30, 2015 at 12:34 PM, Bill Page bill.p...@newsynthesis.org 
 wrote:
 ...
 You stated 'that the Sage developer emphasis on doc  tests has
 resulted in any fewer errors or problems in Sage in comparison to
 other systems.'   I'm not sure if I should respond to this, but I'm
 going to.

Yes, I guess we do so at our own risk. :) My intention was not to
flame but rather just expressing my reaction after reading

http://sagemath.org/doc/developer/git_trac.html#chapter-git-trac

and considering the possible fate of my 3 line patch if I don't find
the time to do things this way.  It just occurred to me that for such
simple things there should be simple solutions.  And I guess there is:
find some else to do it. I am serious that perhaps this is not such a
bad thing provided of course that there are enough people willing to
do this.

 Note that Sage is mostly *interpreted* so having extensive
 doctests is critical to maintain any possibility of sanity over time
 and with a large number of developers (512 people listed at
 http://trac.sagemath.org/ right now).

I am (or at least once was) one of these people registered trac but I
was never comfortable with the workflow and review process.  As a
system for reporting bugs and submitting patches it seemed OK but now
things seem more complicated.  It is a good thing that Sage has
attracted enough developers who are fluent in this process.

 I won't claim that Sage's
 doctests make Sage have fewer errors or problems than the other
 systems you use (they surely have their own approaches to testing).
 However, I absolutely claim -- and I'm sure anybody with nontrivial
 Sage development experience will agree -- that the Sage testing
 standards are critical to Sage having any chance of survival and
 usability at all.   It's entirely an internal issue.

OK. I don't doubt your sincerity but like a lot of things in software
development I find it hard to imagine how your claim could be
evaluated objectively.

 Please also note that Sage is mostly interpreted and not statically compiled 
 like
 some software, which further increases the need for extensive testing.

 Also, the testing in Sage serves an important dual purpose -- it makes
 it easier for people to actually use Sage -- instead of trying to read
 documentation and deduce via logic how to compute something, you
 have the option to try an example that does work, and adapt it to
 your problem.  In contrast, I just tried browsing the FRICAS api
 documentation [1], and couldn't find a single example.

That's true however this web site is only the result of one FriCAS
developers effort to make FriCAS documentation more accessible.  To
really learn to use FriCAS I think it is important to learn to use the
built-in FriCAS browser (hyperdoc) and of course to read the book.

 If I wanted to just play around a little to see how things work
 following [1], it would be incredibly difficult for me.

Sure but I still experience exactly the same feeling when I sit down
to try to do something in Sage.


 There are also many people who have contributed massively to Sage by
 working on porting, valgrinding, etc., who simply wouldn't have been
 able to contribute anything of value without the test suite existing.

I am certainly not arguing against the concept of testing or the
importance of a test suite.  My reaction was just in how it is treated
as an integral part of the sage-trac process.


 [1] http://fricas.github.io/api/genindex.html


Bill.

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-30 Thread Bill Page
On 30 April 2015 at 05:29, Dima Pasechnik dimp...@gmail.com wrote:
 ...

 I thought that on SMC in a Sage worksheet you can do %axiom
 and this will call a system-wide Axiom. Currently SMC is hanging for me,
 so I can't check.


 OK, one can start axiom in an SMC  terminal, by typing axiom
 it is
 (1) - )version

 Value = Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17 

 My understanding is that %axiom invokes this instance of Axiom.


Yes I think you are right however when I try

%axiom
)version

in a Sage worksheet on SMC I get the following Python error message:

UnboundLocalError: local variable 'out' referenced before assignment

So I guess this has not been tested for a while.

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-30 Thread Bill Page
On 30 April 2015 at 05:29, Dima Pasechnik dimp...@gmail.com wrote:
 On Thursday, 30 April 2015 10:09:55 UTC+1, Dima Pasechnik wrote:
 On Wednesday, 29 April 2015 23:17:19 UTC+1, Bill Page wrote:

  PPS. if you really are pressed for time, I can submit this patch
  instead...
 

 Thanks I would really appreciate that.

 a proper patch would include a doctest for the issue, you know, that's why
 sage-trac is not too a hammer :-)
 Did you check that your patch doesn't break things like SMC's
 show(axiom('...')) ?


No I did not check.  I still think that sage-trac is a very heavy and
complex solution to a simple problem.

rant
This is just a personal opinion but contrary to common intuition I do
not see any real evidence that the Sage developer emphasis on doc
tests has resulted in any fewer errors or problems in Sage in
comparison to other systems.  I am not sure why this is, but my
personal experience is that Sage is just as hard to use and just as
likely to return an obscure error message as any of the other open
source computer algebra systems that I have used.  My prior experience
with commercial systems is not that much better,

Anyway, in spite of being very happy to use Sage and to try to fix
problems I encounter if/when I have sufficient time, I am very
reluctant to invest the extra amount of time to learn and over come my
distaste for the Sage development model in general.
/rant

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-29 Thread Bill Page
On Apr 29, 2015 7:30 AM, Dima Pasechnik dimp...@gmail.com wrote:

 
  this patch should go into Sage proper, as it also fixes the same as
with SMC
  issue with Sage's notebook.
 

 Sure.  What is the best way to make that happen?

 the usual way is via trac.sagemath.org
 (for instance using git trac extension:
http://sagemath.org/doc/developer/git_trac.html#chapter-git-trac,
 but bare git would do, too; you need an account on trac.sagemath.org for
this, anyway)

 there is also an experimental github way, but I don't really know how it
works.


Sorry but sage-trac looks like a big hammer for a small nut :)


 PS. I can only speak about fricas mode, as I don't have other axiom(s)
installed, and cannot test there.
 Can you?


No I only have FriCAS installed.

 PPS. if you really are pressed for time, I can submit this patch
instead...


Thanks I would really appreciate that.

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-28 Thread Bill Page
On 27 April 2015 at 23:52, Dima Pasechnik dimp...@gmail.com wrote:

 On Tuesday, 28 April 2015 02:27:21 UTC+1, Bill Page wrote:

 Yes you are right. The problem was in the original axiom.py. Here is a
 patch that corrects the problem:

 https://github.com/billpage/sage/commit/237df92ef4e6b5117654f3a3ff71b4aa10b0aa36#diff-60c84efff9cc620d4d8bbd8110321ffd


 this patch should go into Sage proper, as it also fixes the same as with SMC
 issue with Sage's notebook.


Sure.  What is the best way to make that happen?

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-27 Thread Bill Page
On 27 April 2015 at 00:20, William Stein wst...@sagemath.com wrote:
 On Sun, Apr 26, 2015 at 7:49 PM, Bill Page bill.p...@newsynthesis.org wrote:

 OK, thanks.  Any pointers to documentation of modes in the Sage
 worksheet would be fine too.

 There's no documentation yet.  However, you might find this example
 worksheet useful:

   
 https://cloud.sagemath.com/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/files/support/2015-04-26-211601-fricas.sagews


# a mode in SageMathCloud is just a function that takes as input a
string.  That's pretty much it (there's more, but).
# For example, this takes whatever the cells input is, executes the
code in Fricas,
# then takes the output and displays it using Markdown.
def fricas2(s):
t = fricas.eval(s)
md(t, hide=False)

Thanks. Yes that is very useful, in particular the part about how to
display something in markdown (or other format?) from a program.  Are
there several functions similar to 'md' ?

# it seems that the fricas mode itself is not outputing two $$'s.  I
don't know...
)set output algebra off
)set output tex on
fricas.eval(sqrt(2))

'$\r\r\nsqrt {2} \r\r\nleqno(15)\r\r\n$\r\r\n\r\n

Actually the first character of each line of FriCAS output is missing.
Also I am not sure what is up with the extra carriage return \r
characters.  It looks like 'eval' in the fricas interface is broken.

What's a good way to debug the fricas interface in SageMathCloud?  Can
I just copy and then import the code into a worksheet?  I.e. avoid
having to rebuild Sage just to test?

Bill.

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-27 Thread Bill Page
On 27 April 2015 at 10:23, Dima Pasechnik dimp...@gmail.com wrote:

 On Monday, 27 April 2015 15:00:30 UTC+1, Bill Page wrote:
 ...
 What's a good way to debug the fricas interface in SageMathCloud?  Can
 I just copy and then import the code into a worksheet?  I.e. avoid
 having to rebuild Sage just to test?


 fricas interface is in Python, so you would just have to run 'sage -b', in a
 normal
 Sage setting; and this is almost instant. (E.g. if you use your own copy of
 Sage in an SMC project).


Oh.  Is it easy to use my own copy of Sage in SMC?  Brief how-to?

Bill.

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-27 Thread Bill Page
On 27 April 2015 at 10:31, Bill Page bill.p...@newsynthesis.org wrote:
 On 27 April 2015 at 10:23, Dima Pasechnik dimp...@gmail.com wrote:

 On Monday, 27 April 2015 15:00:30 UTC+1, Bill Page wrote:
 ...
 What's a good way to debug the fricas interface in SageMathCloud?  Can
 I just copy and then import the code into a worksheet?  I.e. avoid
 having to rebuild Sage just to test?


 fricas interface is in Python, so you would just have to run 'sage -b', in a
 normal
 Sage setting; and this is almost instant. (E.g. if you use your own copy of
 Sage in an SMC project).


 Oh.  Is it easy to use my own copy of Sage in SMC?  Brief how-to?


OK, from a teminal session I know. But how to use my own copy of Sage
from a Sage Notebook in SMC?

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-27 Thread Bill Page
On 27 April 2015 at 12:31, Dima Pasechnik dimp...@gmail.com wrote:
 ...
 On Monday, 27 April 2015 17:23:50 UTC+1, Bill Page wrote:

 On the original point of this thread:  Is there anything wrong with
 just grabbing the 'fricas.py' source from somewhere, changing it,
 and then importing it into an SMC/Sage worksheet?

 IMHO the problem is actually in axiom.py, where eval stuff is defined.
 fricas interface inherits from there.
 So you'll have to modify the corresponding function from axiom.py,
 so that it overwrites the one inherited.


Yes you are right. The problem was in the original axiom.py. Here is a
patch that corrects the problem:

https://github.com/billpage/sage/commit/237df92ef4e6b5117654f3a3ff71b4aa10b0aa36#diff-60c84efff9cc620d4d8bbd8110321ffd


 Presumably you can overwrite the any Python function/class in an
 SMC worksheet, but I never tried this. Seems error-prone to me :-)


This worked fine for me.  In addition to fricas.py and axiom.py I also
had to copy expect.py, cleaner.py and quit.py (imports of axiom.py)
into the same directory.

See:

https://cloud.sagemath.com/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/files/2015-04-23-150720.sagews

Bill.

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-27 Thread Bill Page
On 27 April 2015 at 12:00, William Stein wst...@sagemath.com wrote:
 ...
 SMC won't be able to provide that sort of hosting for free, that's for sure.

 I think new projects will have enough room.

 As of right now they do.  However, I have to move everything out of
 UW asap, so I can't promise anything at all regarding quotas of
 free projects, since even free projects will cost the company
 significantly.I can't even promise SMC will be around in a year.
 It all depends on whether I am good enough at programming, and
 enough people are willing to pay.  This remains to be seen.


The topic has drifted a little ... but obviously it would be great
pity of all of your hard work on Sage Math Cloud comes to naught.  I
assume that your main paying target market would be universities
interested in the compute platform for research and easy availability
of Sage for classroom use? I suppose that you can't really get as much
advantage from free accounts as Google gets for gmail, for example,
but still it does amount to some form of marketing expense.

  --
  William (http://wstein.org)
 
 --
 William Stein
 Founder/CEO of SageMath, Inc. (http://sagemath.com)
 206-419-0925

On the original point of this thread:  Is there anything wrong with
just grabbing the 'fricas.py' source from somewhere, changing it, and
then importing it into an SMC/Sage worksheet?

Bill.

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


[sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-26 Thread Bill Page
For example, if I start a cell with

%fricas

or

%maxima

the result is formatted by the external program and displayed as
preformatted ascii text.  Some external programs can generate LaTeX or
MathML code.  Is there a way to tell the worksheet to render code
between $$ ... $$ as MathJax or have MathML markup rendered by the
browser instead of being treated simply as text?

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


Re: [sage-cloud] Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

2015-04-26 Thread Bill Page
On 26 April 2015 at 20:49, William Stein wst...@gmail.com wrote:
 On Sun, Apr 26, 2015 at 5:40 PM, Bill Page bill.p...@newsynthesis.org wrote:
 ...
  Is there a way to tell the worksheet to render code
 between $$ ... $$ as MathJax or have MathML markup rendered by
 the browser instead of being treated simply as text?

 You'll have to write a new mode called something like

 %fricas2

 say.  Then you can do pretty much anything.   I could explain, but I
 don't have the time right now (I will later).


OK, thanks.  Any pointers to documentation of modes in the Sage
worksheet would be fine too.

 Can you provide a very simple example of input to provide to fricas to
 get latex output, at least?


Sure. A worksheet cell with the contents

%fricas
)set output algebra off
)set output tex on
sqrt(2)

currently displays following output

$
sqrt {2}
leqno(10)
$

algebra is what FriCAS calls it's ascii output mode.  tex is
actually the LaTeX mode (at least it is mostly LaTeX mod a few custom
commands). The actual output generated by Fricas is

$$
\sqrt {2}
\leqno(10)
$$

I do not know why the first character of each line is not shown in the
worksheet.  Perhaps the current %fricas mode is trimming this first
character?

)set output tex off
)set output mathml on
sqrt(2)

produces the following MathML code

math xmlns=http://www.w3.org/1998/Math/MathML; mathsize=big display=block
msqrtmrowmn2/mn/mrow/msqrt
/math

Getting MathJax to process FriCAS's LaTeX dialect might require some
extra work on the part of a new %fricas-latex mode, so I guess what I
would like most is a mode such as

%fricas-mml

that allows me to inject FriCAS-generated MathML into the worksheet output.

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


Re: [sage-devel] Re: Bug in abs(I*x).diff(x)

2015-03-24 Thread Bill Page
I am still working on this in FriCAS and currently have an operational
version 0.2. Although this is the Sage list, I would be glad to
continue the discussion and especially with someone willing to review
what I have developed so far in FriCAS. I think I now understand all
this a bit better than I did in December. From my point of view the
issue really is: What is a real variable from an algebraic
perspective?  The usual treatment is more topological or at least
geometric than it is algebraic. It seems to me that this is ultimately
what has lead to radical differences and ad hoc solutions in most
computer algebra systems to date. In short, to define what we mean by
real algebraically I think it is first necessary to define conjugate,
or more specifically involutive (star)-algebra.

On 24 March 2015 at 21:08, kcrisman kcris...@gmail.com wrote:
 A related question just popped up on ask.sagemath:

 http://ask.sagemath.org/question/26279/complex-analysis-compute-bar-derivative

 Not exactly the same but I think it gets at the same underlying issues of
 is it a complex variable or isn't it.

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

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-26 Thread Bill Page
On 25 November 2014 at 14:51, Ondřej Čertík ondrej.cer...@gmail.com wrote:
 On Tue, Nov 25, 2014 at 11:30 AM, Bill Page bill.p...@newsynthesis.org 
 wrote:
...
 Try it this way:

   a*b = exp(?1)
   a = exp(?2)
   b = exp(?3)

 I think 'normalize' is saying that there is a solution that makes

   ?1 - ?2 - ?3  = 0.

 Ok, but why wouldn't normalize return 2*pi*i instead? Or 4*pi*i?

 These are equivalent in the sense of having the same number of
 algebraically independent transcendental kernels, i.e. none.

 I don't understand that. Is the result of normalize() multivalued?

No.

 Or how else could 0 be equivalent to 2*pi*i or 4*pi*i?

It is not equality it is an equivalence relation i.e. modulo
constants.  To dig deeper on this I think would need to consult the
source code and someone who is much more of an expert in this subject:
Waldek Hebisch.

 In other words, how exactly are the operations on the multivalued
 sets log(x) defined?

 FriCAS does not perform operations on multivalued sets to determine
 the above.

 Ok. Though my question stands, how are the operations defined in your
 approach?


Does it help if a say the operations are defined symbolically?
Maybe we need to define exactly what operations we are talking about.

 ...
 Essentially the [derivative] formula with theta is equivalent to just
 returning a tuple of the two Wirtinger derivatives. So what holds for
 one approach holds for the other one.


Yes, so we agree that in general more than one derivative operator is necessary.

 ...
 My current best solution is to define a function `diff(x, theta=0)`,
 where the theta argument is 0 by default, but you can pass any
 angle into it, or a symbol theta if you want. That way you won't get
 the theta factors by default, but if in doubt, you can always get them.


It seems that you prefer an infinite number of derivative operators
while I still think it is best to define only two.

 Let me know if you have a better proposal.


After continued thinking about this and my current experiments in
FriCAS I am still of the opinion that the best option is to implement
just the Wirtinger derivative (only one since the other can be
obtained by 'conjugate'). This has the affect of making the derivative
of non-analytic functions subtly different than what you call the
conventional real derivative (e.g. factor of 1/2 in derivative of
'abs').  I have decided that I would prefer to explain this difference
to a less experienced user, rather than to get into a discussion of
theta and directional derivatives.

Bill.

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-26 Thread Bill Page
On 25 November 2014 at 15:14, Erik Massop e.mas...@hccnet.nl wrote:
 On Tue, 25 Nov 2014 13:30:33 -0500
 Bill Page bill.p...@newsynthesis.org wrote:

 On 25 November 2014 at 01:11, Ondřej Čertík ondrej.cer...@gmail.com wrote:
  On Mon, Nov 24, 2014 at 10:23 PM, Bill Page bill.p...@newsynthesis.org 
  wrote:
 ...
  But I don't want to be forced to make a choice of branch until
  I actually need to evaluate an expression numerically.
 
  I understand that's what you want. I am just trying to understand how
  exactly this works.

 OK.

 Without a choice of branch for sqrt, I cannot answer this question:
 * Is there complex number x such that x*conjugate(x) equals sqrt(2)?
 This seems a non-numerical question to me. It seems to me that
 sqrt without a choice of branch is ill-defined, but perhaps it is
 sufficiently well-defined if you restrict to a certain kind of
 questions? If so, what questions can I ask? I think I know too
 little about the subject of this thread and of FriCAS.


It seems to me that you comment and example are quite appropriate
although for discussion of FriCAS I do recommend the fricas-devel
email list.  I think you are right that one must restrict the kind of
questions. In particular I think one needs to be very careful to
define what one means by equal.  Usually this means that we can only
answer questions up to some equivalence relation.

 ... I want this to be algebraic, not some theorem of
 predicate calculus.  That is what I meant by taking

   x + conjugate(x)

 as the definition of a real valued variable.

 Do you mean that z is considered real-valued when there is x such that x
 + conjugate(x) is z? I got lost in this part of the thread.


Yes exactly.

  ...
  Try it this way:
 
a*b = exp(?1)
a = exp(?2)
b = exp(?3)
 
  I think 'normalize' is saying that there is a solution that makes
 
?1 - ?2 - ?3  = 0.
 
  Ok, but why wouldn't normalize return 2*pi*i instead? Or 4*pi*i?

 These are equivalent in the sense of having the same number of
 algebraically independent transcendental kernels, i.e. none.

 Am I understanding correctly that normalize picks some arbitrary
 representative of an equivalence class of answers? That seems scary
 to me, but perhaps it is sufficiently well-defined for some questions?


Yes.  More specifically FriCAS 'normalize' is an important part of the
machinery for integration but has other uses.

 ...
  This discussion is about how a CAS should handle (complex)
  differentiation. Since it started here, I would finish it here, so
  that the whole thread is in one mailinglist for future reference.

 OK.  It would be nice to know if other sage-devel subscribers actually
 remain interested...

 Yes, I find this thread casually interesting. However, I know little of
 the subject of or FriCAS, which is also the reason I did not write
 before.

No problem. I am happy to continue this discussion in whatever
direction and where ever (fricas-devel?)  you like.

 ...
 The Wikipedia page suggests that df/d conjugate(z) is
 conjugate(conjugate(f).diff(z)). If that is indeed the case, then it
 seems that df/d conjugate(z) might be handled without implementing
 a second diff-method.


You are right. In fact that is exactly the proposal with which I
initial continued Ondřej's original thread.  The main sticking point I
think is that the resulting derivative is subtly different for
non-holomorphic functions and that in this case using both Wirtinger
derivatives (or just one and 'conjugate') is necessary.

Bill.

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-26 Thread Bill Page
On 26 November 2014 at 12:58, Ondřej Čertík ondrej.cer...@gmail.com wrote:
 On Wed, Nov 26, 2014 at 10:17 AM, Bill Page bill.p...@newsynthesis.org 
 wrote:

 Does it help if a say the operations are defined symbolically?

 All I want is if you can give me an algorithm of your approach
 in sufficient detail, so that it can be implemented by me on a
 computer.  And by your approach, I mean an approach, where
 conjugate(log(x)) = log(conjugate(x)) for all x.


I am sorry, we seem to be having some trouble communicating. Is that
something infecting this email list? :)

Making  conjugate(log(x)) = log(conjugate(x)) for all x is trivial
so long as it is treated symbolically: the 'conjugate' operation is
just defined to rewrite itself (auto-simplify) when applied to any
operand of the form log(_), so 'conjugate(log(_))' is evaluated as
'log(conjugate(_))', where _ stands for any element of the domain
Expression.  This is what I meant when I said it was considered true
by definition, i.e. by definition of the symbolic 'conjugate'
operation.  Exactly the same sort of thing happens when the
'conjugate' operation acts on 'conjugate'  so that
'conjugate(conjugate(x))' is simply rewritten as 'x'.

 I have provided all the details of the algorithm (B). In approach (B),
 it is not true that
 conjugate(log(x)) = log(conjugate(x)) for all x.

 This equation (when conjugate(log(x)) = log(conjugate(x)) holds)
 started this whole discussion.

That

  log(a*b) = log(a) + log(b)

is considerably less trivial that the case of 'conjugate'.  From my
point of view that is what actually started this branch of the
fabric of this discussion.  That is where 'normalize' comes in.

 So I was trying to understand your approach how to make this hold
 for all x, and I suggested various ways how maybe it could be
 implemented, and to most of it you said that's not how FriCAS does
 it. At this point I don't have any more ideas how it could be done,
 so I don't know how to implement your approach. Which is sad --
 even though I am not advocating for your approach, I wanted to
 really understand it, so that I can make my own opinion on the pros
 and cons.

Thank you for attempting to understand.

I think I only used the phrase that's not how FriCAS does it in the
context of multi-valued functions.  My point is that FriCAS makes no
attempt to evaluate a multi-valued function symbolically. But FriCAS
does rewrite expressions involving mutli-valued functions in some
cases automatically and in others when asked to do so by operators
like 'normalize'.


 Maybe we need to define exactly what operations we are talking about.

 Sure. Let's just stick to one example, let me just copy  paste it
 from my previous email:

 from cmath import log
 a = -1
 b = -1
 log(a*b)
 0j
 log(a)+log(b)
 6.283185307179586j

 def arg(x): return log(x).imag
 ...
 from math import floor, pi
 I = 1j
 log(a)+log(b)+2*pi*I*floor((
 pi-arg(a)-arg(b))/(2*pi))
 0j

 As you confirmed, even if you evaluate this in FriCAS, log(a*b) is not
 equal to log(a) + log(b), when a=b=-1.

Yes, I showed that as expected this was not equal when 'log' is
evaluated in a numeric domain but I am talking about a domain
constructed by 'Expression' which is a symbolic domain.

 However, you claim that symbolically it is true that log(a*b) =
 log(a) - log(b) for all a and b and you provided a FriCAS function
 normalize that does it,

No not exactly.  I am sorry that I did not express myself more
clearly.  Actually if I evaluate

  test ( log(a*b) = log(a)+log(b) )

FriCAS returns 'false' since no automatic simplifications apply here
and these are obviously to different expressions.  What I showed was
that

  normalize(log(a*b)-log(a)-log(b))

returns 0.

 but you said that for deeper understanding you would need to consult
 Waldek Hebisch. Can you explain the discrepancy/inconsistency?

Well, um, what I tried to say was that for a deeper understanding of
'normalize' we would have to either read the source code of
'normalize' or talk with Waldek who as studied the source code more
carefully and throughly than I have. 'normalize' was written by Manuel
Bronstein.  There is no specific documentation except for that
contained in the source code:

https://github.com/fricas/fricas/blob/master/src/algebra/efstruc.spad#L83

and unfortunately Manuel Bronstein is dead. Bronstein did however
publish several books and numerous articles. In particular 'normalize'
is part of his implementation of the Risch structure theorem.  E.g.
http://dl.acm.org/citation.cfm?id=74566  As I recall there was some
Google Summer of Code work on sympy related to this.

But Waldek has made a number if important recent changes to this package.


 How exactly are the operations in log(a*b) = log(a) - log(b) defined,
 so that this equation holds, even though when you put in a=b=-1, you
 get a different number on the LHS and RHS, as confirmed by FriCAS?


My admittedly primitive understanding of how 'normalize'  operates in
this case

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-25 Thread Bill Page
On 25 November 2014 at 01:11, Ondřej Čertík ondrej.cer...@gmail.com wrote:
 On Mon, Nov 24, 2014 at 10:23 PM, Bill Page bill.p...@newsynthesis.org 
 wrote:
 ...
 I am not very interested in real numbers.  I am interested in the
 algebra.  Would you say that

   sqrt(x^2).diff(x) = sqrt(x^2)/x

 is OK?

 I think so, using the following calculation:

 sqrt(x^2).diff(x) = exp(1/2*log(x^2)).diff(x) = exp(1/2*log(x^2)) *
 1/2 * 1/x^2 * 2*x = sqrt(x^2)/x

 The function exp(1/2*log(x^2)) that we differentiate is analytic, so I
 don't see any issue here.


I did not ask whether it was technically correct or not.  What I meant
was is this expression what you would expect given the rest of the
machinery of differentiation in any given computer algebra system?


 But I don't want to be forced to make a choice of branch until
 I actually need to evaluate an expression numerically.

 I understand that's what you want. I am just trying to understand how
 exactly this works.


OK.

 ...
 I think what you are trying to say is

  (A) log(exp(z)) = { z + 2*pi*i*n | for all n in Integer}

 Exactly, that's what I meant.
 ...

 Although it may seem simple in this case, in general implementing
 sets with comprehension like this requires logic and takes us
 outside of algebra as such into the realm of theorem proving.

 Sure. But that's what you want, correct?


No, not at all.  I want this to be algebraic, not some theorem of
predicate calculus.  That is what I meant by taking

  x + conjugate(x)

as the definition of a real valued variable.

 ...


 This is precisely the part that I don't understand with the approach
 (A). log(a*b), log(a) and log(b) are all multivalued, so you would
 naively think, that log(a*b)-log(a)-log(b) = 0 + 2*pi*i*n, for all
 n. But I think this is not the case, I think the n in log(a*b) is
 coupled to the implicit n in log(a) and log(b) in such a way, that
 the result is exactly 0. Can you clarify exactly how this works?

 Try it this way:

   a*b = exp(?1)
   a = exp(?2)
   b = exp(?3)

 I think 'normalize' is saying that there is a solution that makes

   ?1 - ?2 - ?3  = 0.

 Ok, but why wouldn't normalize return 2*pi*i instead? Or 4*pi*i?

These are equivalent in the sense of having the same number of
algebraically independent transcendental kernels, i.e. none.


 In other words, how exactly are the operations on the multivalued
 sets log(x) defined?

FriCAS does not perform operations on multivalued sets to determine the above.


 I meant that I did not understand what you are proposing for how to
 represent the value of 'log(z)' symbolically, i.e. when the value of z
 is unknown.

 Ah ok. I would represent it by the approach (B). But then, as we
 talked about, it's not true that conjugate(log(z)) = log(conjugate(z)).
 Since you want this property to hold, then the approach (B) does
 not work for you, obviously. So I am trying to understand how
 exactly are all the operations defined in your approach. You said
 your approach is not (A) exactly. So I am just trying to understand.


OK.


 This discussion is about how a CAS should handle (complex)
 differentiation. Since it started here, I would finish it here, so
 that the whole thread is in one mailinglist for future reference.


OK.  It would be nice to know if other sage-devel subscribers actually
remain interested...

Let's return to differentiation for a moment.  Using your definitions
what would you say is the correct result for

  log(exp(z-conjugate(z))).diff(z)

My patched version of FriCAS based your definition in this thread
currently returns 0. Do you get the same result?

Since the derivative is 0 would we want to say therefore that

  log(exp(z-conjugate(z)))

is a constant? If not, isn't this an argument for needing another
derivative? The result of this test currently causes a problem during
manipulations of expressions of this form.  Check the two Wirtinger
derivatives for this case. If we have both derivatives we can avoid
this problem quite easily as my previous version of the patch showed.

Bill.

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-24 Thread Bill Page
On 22 November 2014 at 12:34, Ondřej Čertík ondrej.cer...@gmail.com wrote:
 On Sat, Nov 22, 2014 at 7:23 AM, Bill Page bill.p...@newsynthesis.org wrote:
 ...
 FriCAS currently does not implement a symbolic 'conjugate' operator.
 The issue concerns whether adding 'conjugate' is a good idea and only
 secondly how to differentiate it.

 Ah, I had no idea that FriCAS does not implement conjugate(x).
 How do you handle complex numbers then?

Sorry, I gave you the wrong impression. I specifically referred to the
lack of symbolic 'conjugate operator.  By that I meant that the
'Expression' functor does not export a 'conjugate' operator.  My patch
adds such an operator to Expression.  But FriCAS has many domains of
computation besides those constructed by 'Expression' and some of them
do include 'conjugate'. For example the 'Complex' functor includes
'conjugate' so we can write:

(1) - x:Complex Expression Integer := a + %i*b

   (1)  a + b %i
   Type: Complex(Expression(Integer))
(2) - conjugate(x)

   (2)  a - b %i
   Type: Complex(Expression(Integer))

This effectively and implicitly treats symbols as real valued.

(3) - D(x,a)

   (3)  1
   Type: Complex(Expression(Integer))
(4) - D(x,b)

   (4)  %i
   Type: Complex(Expression(Integer))
(5) - y:=log(x)

 22
log(b  + a )b
   (5)   + 2atan(--)%i
  2   +---+
  | 22
 \|b  + a   + a
   Type: Complex(Expression(Integer))
(6) - conjugate(y)

 22
log(b  + a )b
   (6)   - 2atan(--)%i
  2   +---+
  | 22
 \|b  + a   + a
   Type: Complex(Expression(Integer))

But not this:

(7) - D(y,x)
...
   Cannot find a definition or applicable library operation named D
  with argument type(s)
Complex(Expression(Integer))
Complex(Expression(Integer))

So there is no complex derivative as such.

We can also define things this way:

(8) - z:Expression Complex Integer := a + %i*b

   (8)  %i b + a
   Type: Expression(Complex(Integer))
(9) - D(z,a)

   (9)  1
   Type: Expression(Complex(Integer))
(10) - D(z,b)

   (10)  %i
   Type: Expression(Complex(Integer))
(11) - w:=log(z)

   (11)  log(%i b + a)
   Type: Expression(Complex(Integer))

But now we get:

(12) - conjugate(z)
 ...
   Cannot find a definition or applicable library operation named
  conjugate with argument type(s)
Expression(Complex(Integer))

  Perhaps you should use @ to indicate the required return type,
  or $ to specify which version of the function you need.

(13) - D(w,z)
...
   Cannot find a definition or applicable library operation named D
  with argument type(s)
Expression(Complex(Integer))
Expression(Complex(Integer))

The FriCAS 'Expression' functor extends multivariate rational
functions over a specified domain with a large number of
transcendental kernels (symbolic functions) as well as differentiation
and integration operators.  No explicit assumption is made about the
domain of the variables.  My proposed patch to FriCAS adds 'conjugate'
as another kernel function and provides a 'conjugate' as an operator.

 In SymPy and Sage, conjugate(x) is in it, so then adding a derivative
 of abs(x) does not make things worse.


In FriCAS 'abs' is already a kernel function and it implemented the
derivative of 'abs' even before my proposed patch but I think the
current definition is wrong:

(14) - D(abs(x),x)

 abs(x)
   (14)  --
x
Type: Expression(Integer)



 In FriCAS with my patch functions defined by

   f := operator 'f

 are currently assume to be holomorphic and log is holomorphic by definition 
 so

 conjugate(log(x)) = log(conjugate(x))

 Perhaps you are considering the wrong branch.
 ...
 Complex 'log' is a multi-valued like 'sqrt' so you need to consider
 more than one branch.

 Well, you are right that in theory you define log(z) as
 log(z)=log|z|+i*arg(z), and you define arg(z) as multivalued,
 i.e. you can add 2*pi*n to it, then you can add 2*pi*i*n to log(z).
 Since [6] and [7] differs by 2*pi*i, they are indeed the same number.

I would not say that they are the same number.  Also I don't want to
define log(z) the way to suggest.  Rather, I think the correct
definition of 'log(z)' is the solution

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-24 Thread Bill Page
On 24 November 2014 at 17:43, Ondřej Čertík ondrej.cer...@gmail.com wrote:
 On Mon, Nov 24, 2014 at 1:57 PM, Bill Page bill.p...@newsynthesis.org wrote:
 ...

 In FriCAS 'abs' is already a kernel function and it implemented the
 derivative of 'abs' even before my proposed patch but I think the
 current definition is wrong:

 (14) - D(abs(x),x)

  abs(x)
(14)  --
 x
 Type: Expression(Integer)

 I think that's correct for real numbers, i.e. x/abs(x) = abs(x) / x.


I am not very interested in real numbers.  I am interested in the
algebra.  Would you say that

  sqrt(x^2).diff(x) = sqrt(x^2)/x

is OK?

 Rather, I think the correct definition of 'log(z)' is the solution of

   z = exp(?)

 So we can write z=exp(log(z)) by definition.

 Indeed, exp(log(z))=z always,

Not just true always. It is the definition of 'log(z)'.


 In both (A) and (B),
 it is true that z = exp(log(z)). However, these are different:

 (A) log(exp(z)) = z + 2*pi*i*n
 (B) log(exp(z)) = z + 2*pi*i*floor((pi-Im z) / 2*pi)

 In (B), you get a single value, but in (A) you get multiple values,
 one for each n.


Better to say (A) is true \forall n \in Integer

 I am very familiar with the approach (B) and I think I understand
 exactly what follows from what and how to derive all the formulas.

(B) is about choosing a particular branch of 'log' - the principal
value. But I don't want to be forced to make a choice of branch until
I actually need to evaluate an expression numerically.

 But I am not 100% sure with (A), I was hoping you can help, since
 that's the approach that you want to use in FriCAS.

(A) is not quite the approach I want to use for 'Expression' in
FriCAS.  I want 'log(exp(z))' to be the solution of

  exp(z) = exp(?)

The best way to say that algebraically (symbolically) is just
'log(exp(z))', i.e. without evaluation.  This is what FriCAS already
does in the case of

(1) - z:Expression Complex Integer
   Type: Void
(2) - exp(log(z))

   (2)  z
   Type: Expression(Complex(Integer))
(3) - log(exp(z))

  z
   (3)  log(%e )
   Type: Expression(Complex(Integer))

but unfortunately not in the case of 'Expression Integer'.

(4) - z:Expression Integer
   Type: Void
(5) - log(exp(z))

   (5)  z
Type: Expression(Integer)

I think that what it currently does for 'Expression Integer' should be
considered a bug.

 I think what I wrote is correct for (A), but please correct me if I am wrong.

 This is exactly analogous
 to the treatment of 'sqrt(z)' as the solution to

   z = ? * ?


We have

  sqrt(z)^2 = z

but

  sqrt(z^2) = sqrt(z^2)

 However, this definition quickly becomes impractical, because you
 need to be able to numerically evaluate symbolic expressions, and
 you would need to carry the symbolic term 2*pi*i*n around.

 We do not need an extra term.  We only need axioms for the correct
 behavior of the expression 'log(z)'. But 'log(z)' does not denote a
 function in the sense of a many-to-one mapping.  The inverse of a
 function is only a function (possibly partial) if the function is
 injective (one-to-one).

 Sure, that's why you have n in the formula for log(z) in (A), and
 the function is multivalued over all n.


No.  As you have written it, it is a function of two variables with
one value for each z and n.

  f(z,n) = z + 2*pi*i*n

I think what you are trying to say is

 (A) log(exp(z)) = { z + 2*pi*i*n | for all n in Integer}

and

  sqrt(z) = {  x | x^2 =z }

Although it may seem simple in this case, in general implementing sets
with comprehension like this requires logic and takes us outside of
algebra as such into the realm of theorem proving.


 The Riemann surface is an important tool in complex analysis but I
 have yet to see it used explicitly in any computer algebra system as
 a representation of complex functions.

 I thought the Riemann surface gives you a way to couple n in
 log(a*b), log(a) and log(b) in such a way that you get exactly
 log(a*b)-log(a)-log(b)=0. I.e. that the Riemann surface is (A).
 I agree that I haven't seen it used in CAS. But I think it must be
 implicitly used in FriCAS somehow. Maybe you can clarify that.

I don't think it is used in FriCAS at all.  A Riemann surface is a
manifold. At each point in the manifold we need to evaluate a
function, but how would you propose to represent this surface
algebraically?  For example, the surface of a sphere is a manifold.
For that we need a co-ordinate system that labels each point on the
surface.  In a sense the important thing about a Riemann surface is
its global topology and this is different for each complex holomorphic
function.  For 'exp' it might make sense to include 'n' as one of
these co

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-22 Thread Bill Page
On 21 November 2014 at 20:18, Ondřej Čertík ondrej.cer...@gmail.com wrote:

 I am still confused about one thing: is this issue is already
 present in FriCAS before your changes? Because you can
 already use conjugate, sin, +, *, ..., even without defining the
 derivative for abs(x). I fail to see how defining the abs(x).diff(x)
 in the way you did it  can introduce issues that weren't present
 in the first place.


FriCAS currently does not implement a symbolic 'conjugate' operator.
The issue concerns whether adding 'conjugate' is a good idea and only
secondly how to differentiate it.

 -

 I have finished the writeup, it starts here (you might want to refresh
 your browser to see the latest changes):

 http://www.theoretical-physics.net/dev/math/complex.html#complex-conjugate

 and it was implemented with these two PRs:

 https://github.com/certik/theoretical-physics/pull/39
 https://github.com/certik/theoretical-physics/pull/40


Thanks.

 I must say one thing that I like about the theta is that it tells
 you immediately if the function is analytic or not (if theta is
 present it is not, if it is not present, then the expression does not
 depend on theta, and thus is analytic). For example, for log(z),
 the theta cancels, and so the result 1/z is analytic.


Still looks ugly to me.

 I found a bug in these results from FriCAS:

 (4) - D(abs(f(x)),x)

  , _  _  ,
 f(x)f (x) + f(x)f (x)

(4)  -
   2abs(f(x))
 Type:
 Expression(Integer)
 (5) - D(abs(log(x)),x)

 __
 xlog(x) + x log(x)
(5)  --
 _
   2xxabs(log(x))
 Type:
 Expression(Integer)

 The bar must be over the whole f(x) as well as log(x), because
 conjugate(log(x)) is only equal log(conjugate(x)) if x is not
 negative real number.

In FriCAS with my patch functions defined by

  f := operator 'f

are currently assume to be holomorphic and log is holomorphic by definition so

conjugate(log(x)) = log(conjugate(x))

Perhaps you are considering the wrong branch.

 See the example here:
 http://www.theoretical-physics.net/dev/math/complex.html#id1 where I
 have it explicitly worked out. You can also check that easily in
 Python:

 In [1]: from cmath import log

 In [2]: x = -1+1j

 In [3]: log(x).conjugate()
 Out[3]: (0.34657359027997264-2.356194490192345j)

 In [4]: log(x.conjugate())
 Out[4]: (0.34657359027997264-2.356194490192345j)

 In [5]: x = -1

 In [6]: log(x).conjugate()
 Out[6]: -3.141592653589793j

 In [7]: log(x.conjugate())
 Out[7]: 3.141592653589793j

 In [8]: log(x.conjugate()) - 2*pi*1j
 Out[8]: -3.141592653589793j


 Where [3] and [4] are equal, but [6] and [7] are not (you need to
 subtract 2*pi*i from [7], as in [8], in order to recover [6],
 consistent with the formula in the writeup).


Complex 'log' is a multi-valued like 'sqrt' so you need to consider
more than one branch.

Bill.

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-22 Thread Bill Page
On 21 November 2014 at 20:18, Ondřej Čertík ondrej.cer...@gmail.com wrote:
 On Fri, Nov 21, 2014 at 9:37 AM, Bill Page bill.p...@newsynthesis.org wrote:

 You are right about the derivative.  But my limited understanding
 is that the strategy is not to avoid 'abs(x)' but rather to avoid 'sin'.
 We cannot similarly avoid 'conjugate' and in general the effect
 of including 'conjugate' is apparently unknown.  But one effect
 of including 'conjugate' is that we can have expressions like

   x+conjugate(x)

 which is necessarily real-valued, rather like 'abs(x)' for x
 real-valued is non-negative.
 ...

On reconsidering my limited understanding I see that contrary to
what I said, rewriting

  sin(x) = 2*tan(x/2)/(tan(x/2)^2+1)

does not avoid Richardson's theorem.  Rather I think what is really
going on in FriCAS is rewriting

  abs(x) = sqrt(x^2)

or in my case

  abs(x) = sqrt(x*conjugate(x))

taking 'sqrt' as algebraic, i.e. the solution to y^2 = x, without
selecting a specific branch.

Bill.

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-21 Thread Bill Page
On 20 November 2014 22:08, Ondřej Čertík ondrej.cer...@gmail.com wrote:
 On Thu, Nov 20, 2014 at 7:53 PM, Bill Page bill.p...@newsynthesis.org wrote:
 ...
 This problem can be reduced to finding an algorithm to determine
 if f(x) is everywhere non-negative. Richardson proves that no such
 algorithm exists.

 I see. But what does this have to do with the derivative of |f(x)| that
 we are trying to figure out?


This has to do with 'conjugate' in general, not just derivatives of
expressions containing 'conjugate'.  The problem is that 'conjugate'
is transcendental but it cannot be written in terms of log and exp.

 As you pointed out, the challenge is that if you include conjugate(x),
 then you might be out of luck. But aren't you out of luck already if
 you have abs(x) in the expression in the first place? I.e. taking a
 derivative is not going to change anything, you are still out of luck.


You are right about the derivative.  But my limited understanding is
that the strategy is not to avoid 'abs(x)' but rather to avoid 'sin'.
We cannot similarly avoid 'conjugate' and in general the effect of
including 'conjugate' is apparently unknown.  But one effect of
including 'conjugate' is that we can have expressions like

  x+conjugate(x)

which is necessarily real-valued, rather like 'abs(x)' for x
real-valued is non-negative.  So it would be nice to know, for example
for any expression composed of x, integers, +, *, sin, and conjugate,
if there is an algorithm to determine if this expression is everywhere
real-valued.

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-20 Thread Bill Page
On 20 November 2014 01:54, Ondřej Čertík ondrej.cer...@gmail.com wrote:

 What you posted looks good. But we need to test it for arg(z), re(z),
 im(z) and any other non-analytic function that we can find.


(1) - re(x)==(conjugate(x)+x)/2
   Type:
Void
(2) - im(x)==%i*(conjugate(x)-x)/2
   Type:
Void
(3) - arg(x)==log(x/abs(x))/%i
   Type:
Void
(4) - re %i
   Compiling function re with type Complex(Integer) - Fraction(Complex
  (Integer))

   (4)  0
 Type:
Fraction(Complex(Integer))
(5) - im %i
   Compiling function im with type Complex(Integer) - Fraction(Complex
  (Integer))

   (5)  1
 Type:
Fraction(Complex(Integer))
(6) - arg %i
   Compiling function arg with type Complex(Integer) - Expression(
  Complex(Integer))

   (6)  - %i log(%i)
   Type:
Expression(Complex(Integer))
(7) - complexNumeric %

   (7)  1.5707963267_948966192
 Type:
Complex(Float)
(8) - D(re(x),x)
   Compiling function re with type Variable(x) - Expression(Integer)

   (8)  1
Type:
Expression(Integer)
(9) - D(im(x),x)
   Compiling function im with type Variable(x) - Expression(Complex(
  Integer))

   (9)  0
   Type:
Expression(Complex(Integer))
(10) - D(arg(x),x)
   Compiling function arg with type Variable(x) - Expression(Complex(
  Integer))

 _ 2   2
 %i xx - 2%i abs(x)  + %i x
   (10)  ---
   2
  2x abs(x)
   Type:
Expression(Complex(Integer))


I had a thought. I suppose that all non-analytic (nonholomorphic) functions
of interest can be written in terms of conjugate and some analytic
functions, e.g.

  abs(x)=sqrt(x*conjugate(x))

so perhaps all we really need is to know how to differentiate conjugate
properly?

Bill

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-20 Thread Bill Page
So here (20) is a simpler expression for derivative of arg:

(16) - abs(x)==sqrt(x*conjugate(x))
   Compiled code for abs has been cleared.
   Compiled code for arg has been cleared.
   1 old definition(s) deleted for function or rule abs
   Type:
Void
(17) - arg(x)==log(x/abs(x))/%i
   1 old definition(s) deleted for function or rule arg
   Type:
Void
(18) - arg %i
   Compiling function abs with type Complex(Integer) - Expression(
  Complex(Integer))
   Compiling function arg with type Complex(Integer) - Expression(
  Complex(Integer))

   (18)  - %i log(%i)
   Type:
Expression(Complex(Integer))
(19) - complexNumeric %

   (19)  1.5707963267_948966192
 Type:
Complex(Float)
(20) - D(arg(x),x)
   Compiling function abs with type Variable(x) - Expression(Integer)
   Compiling function arg with type Variable(x) - Expression(Complex(
  Integer))

 _
 - %ix + %i x
   (20)  
_
  2xx
   Type:
Expression(Complex(Integer))


In general I am a little uncertain if, how and when to deal with
simplifications of expressions like abs that can be expressed in terms of
more fundamental/elementary functions.  What do you think?

Bill.

On 20 November 2014 09:41, Bill Page bill.p...@newsynthesis.org wrote:
 ...

 I had a thought. I suppose that all non-analytic (nonholomorphic)
functions of interest can be written in terms of conjugate and some
analytic functions, e.g.

   abs(x)=sqrt(x*conjugate(x))

 so perhaps all we really need is to know how to differentiate conjugate
properly?

 Bill

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-20 Thread Bill Page
Perhaps this is more or less where Richardson's theorem enters.

http://en.wikipedia.org/wiki/Richardson%27s_theorem

We badly want a reliable way to determine when an expression is
identically zero. In general this is not possible, but if we restrict
our selves to a subset of elementary functions, in particular if we
can avoid 'abs', then it is in principle decidable (not withstanding
the possible undecidability of equality of constants). As I understand
it FriCAS effectively relies on this as part of the machinery for
integration, e.g. in 'rischNormalize'.  Waldek's challenge to me on
the FriCAS list in regards to my proposals related to conjugate and
this thread was to show that it is possible to include 'conjugate' and
still have a decidable system given the complex equivalent of
Richardson's theorem.

So far I have not been able to meet this challenge or even to find any
specific relevant related publications.  Perhaps it is obvious that
this is not possible given the definition of abs in terms of conjugate
and sqrt. I would be interested in anyone here has considered this
issue or might suggest some leads.  Of course this is likely not of
too much interest in computer algebra systems that take a more
pragmatic approach than FriCAS/Axiom.

Bill.

On 20 November 2014 11:20, Ondřej Čertík ondrej.cer...@gmail.com wrote:

 
  In general, my approach is that I try to define the derivative of
  abs(x) in the simplest possible way, which seems to be in terms of
  abs(x) as well, instead of sqrt(x*conjugate(x)). But the CAS needs to
  be able to rewrite it later if needed, because sometimes things can
  simplify.

 Or to say it with different words, the reason we even have functions
 like exp(x), csc(x), sinh(x), asin(x), asinh(x) is that things are
 simpler if you use those as opposed to their more elementary function
 definition. Perhaps with the exception of csc(x) = 1/sin(x), where I
 personally don't see an advantage of introducing a new function for
 just 1/sin(x). But with all the other ones, they simplify things,
 sometimes. And so the art is to use those in  a way to create the most
 simple expression at the end. I think that's all there is to it.

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-20 Thread Bill Page
On 20 November 2014 12:56, Ondřej Čertík ondrej.cer...@gmail.com wrote:
 ...
 Can you give an example of an expression that cannot be decided by
 the Richardson's theorem?

Well, no not exactly.  Richardson's theorem is not about individual
expressions, it is about decidability, i.e. computability, in general.
Consider an expression of the form

  f(x) - | f(x) |

where f(x) is composed from integers, the variable x, +, * and sin.
The question that Richardson's theorem answers is whether or not there
exists a program that can determine if f(x) - |f(x)| = 0 for all x.
This problem can be reduced to finding an algorithm to determine if
f(x) is everywhere non-negative. Richardson proves that no such
algorithm exists.

 How does FriCAS do the zero testing? I.e. if you
 give it

 f(x) = sin(x)^2 + cos(x)^2-1

 how does it decide that it is equal to 0?

This can be done by the function 'normalize' which first uses
'realElementary' to rewrite the expression using just 4 fundamental
real-valued elementary transcendental functions (kernels): log, exp,
tan, and arctan. E.g.

  sin(x) = 2*tan(x/2)/(tan(x/2)^2+1)
  cos(x) = (1-tan(x/2)^2)/(1+tan(x/2)^2)

For your example this suffices but if necessary it next rewrites the
result again using the minimum number of algebraically independent
kernels.

There is also a complex-valued version called 'complexElementary'
which uses only log and exp but may introduce the constant sqrt(-1).


 Are we talking about functions of just one variable (f(x)) or more
 (f(x, y, z, ...))?

In general more than one variable.


 Why cannot you just use the probabilistic testing, where you plug in
 various (complex) numbers into f(x) and test that it is equal to zero,
 numerically.


I suppose that might be pragmatic but I would not call it computer
algebra in the mathematical sense.

Bill.

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Bill Page
On 18 November 2014 21:22, Ondřej Čertík ondrej.cer...@gmail.com wrote:
 On Tue, Nov 18, 2014 at 6:51 PM, Bill Page bill.p...@newsynthesis.org
wrote:
 On 18 November 2014 17:40, Ondřej Čertík ondrej.cer...@gmail.com wrote:

 In my notation, the Wirtinger derivative is d f(z) / d z and d f(z) /
 d conjugate(z). The Df(z) / Dz is the complex derivative taking in
 direction theta (where it could be theta=0). Given the chain rule, as
 I derived above using chain rules for the Wirtinger derivative:

 D f(g) / D z = df/dg Dg/Dz + df/d conjugate(g) D conjugate(g) / Dz


 abs(f).diff(z) = (conjugate(f)*f.diff(z) + f*conjugate(f).diff(z)) /
(2*abs(f))



 Let me know if you found any issue with this.


I implemented this in FriCAS and tried a few examples, e.g.

(4) - D(abs(f(z,conjugate(z))),z)

_ __ _
f(z,z)f  (z,z) + f(z,z)f  (z,z)
   ,2   ,1
   (4)  ---
   _
  2abs(f(z,z))
Type:
Expression(Integer)


where the ,1 and ,2 notation represents the derivative with respect the the
first and second variable of f, respectively.

Then I noticed that if we have f=z we get

  conjugate(z).diff(z)

which is 0.  So the 2nd term is 0 and the result is just the first
Wirtinger derivative.

Perhaps I am misinterpreting something?

Bill.

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Bill Page
On 2014-11-19 9:36 AM, Bill Page bill.p...@newsynthesis.org wrote:
 ...
 Then I noticed that if we have f=z we get

   conjugate(z).diff(z)

 which is 0.  So the 2nd term is 0 and the result is just the first
Wirtinger derivative.

 Perhaps I am misinterpreting something?


Oops, my fault.  According to your definition

  conjugate(z).diff(z) = 1

Bill.

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Bill Page
OK, this looks better!

(1) - D(abs(x),x)

 _
 x + x
   (1)  ---
2abs(x)
Type:
Expression(Integer)
(2) - D(conjugate(x),y)

   (2)  0
Type:
Expression(Integer)
(3) - D(conjugate(x),x)

   (3)  1
Type:
Expression(Integer)
(4) - f:=operator 'f

   (4)  f
  Type:
BasicOperator
(5) - D(abs(f(x)),x)

 , _  _  ,
f(x)f (x) + f(x)f (x)

   (5)  -
  2abs(f(x))
Type:
Expression(Integer)
(6) - D(abs(log(x)),x)

__
xlog(x) + x log(x)
   (6)  --
_
  2xxabs(log(x))
Type:
Expression(Integer)


On 19 November 2014 10:19, Bill Page bill.p...@newsynthesis.org wrote:


 On 2014-11-19 9:36 AM, Bill Page bill.p...@newsynthesis.org wrote:
  ...
  Then I noticed that if we have f=z we get
 
conjugate(z).diff(z)
 
  which is 0.  So the 2nd term is 0 and the result is just the first
 Wirtinger derivative.
 
  Perhaps I am misinterpreting something?
 

 Oops, my fault.  According to your definition

   conjugate(z).diff(z) = 1

 Bill.


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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Bill Page
Since this mostly concerns FriCAS I am cross posting to that group.  I will
also post the patch there.  For FriCAS list reference the original email
thread is here:

https://groups.google.com/forum/#!topic/sage-devel/6j-LcC6tpkE

Here is the result of compiling the patch against the current SourceForge
svn trunk:

wspage@opensuse:~ fricas
The directory for FriCAS, /usr/local/lib/fricas/target/x86_64-suse-linux,
does not exist.
Goodbye.
wspage@opensuse:~ fricas
Checking for foreign routines
AXIOM=/usr/local/lib64/fricas/target/x86_64-suse-linux
spad-lib=/usr/local/lib64/fricas/target/x86_64-suse-linux/lib/libspad.so
foreign routines found
openServer result 0
   FriCAS Computer Algebra System
 Version: FriCAS 2014-11-14
   Timestamp: Wed Nov 19 11:57:49 EST 2014
-
   Issue )copyright to view copyright notices.
   Issue )summary for a summary of useful system commands.
   Issue )quit to leave FriCAS and return to shell.
-


(1) - D(abs(x),x)

 _
 x + x
   (1)  ---
2abs(x)
Type:
Expression(Integer)
(2) - D(conjugate(x),x)

   (2)  1
Type:
Expression(Integer)
(3) - f:=operator 'f

   (3)  f
  Type:
BasicOperator
(4) - D(abs(f(x)),x)

 , _  _  ,
f(x)f (x) + f(x)f (x)

   (4)  -
  2abs(f(x))
Type:
Expression(Integer)
(5) - D(abs(log(x)),x)

__
xlog(x) + x log(x)
   (5)  --
_
  2xxabs(log(x))
Type:
Expression(Integer)
(6) - D(log(abs(x)),x)

  _
  x + x
   (6)  
   2
2abs(x)
Type:
Expression(Integer)
(7) - D(abs(%i*x),x)

   _
   x + x
   (7)  --
2abs(%i x)
   Type:
Expression(Complex(Integer))
(8) - D(1/abs(x),x)

   _
 - x - x
   (8)  
   3
2abs(x)
Type:
Expression(Integer)
(9) - D(1/abs(x)^2,x)

  _
- x - x
   (9)  ---
  4
abs(x)
Type:
Expression(Integer)
(10) - D(x/abs(x)^3,x)

 _  2 2
 - 3xx + 2abs(x)  - 3x
   (10)  --
   5
2abs(x)
Type:
Expression(Integer)
(11) - D(abs(x)^2,x)

 _
   (11)  x + x
Type:
Expression(Integer)

Bill.


On 19 November 2014 11:51, Ondřej Čertík ondrej.cer...@gmail.com wrote:

 On Wed, Nov 19, 2014 at 9:42 AM, Ondřej Čertík ondrej.cer...@gmail.com
wrote:
  On Wed, Nov 19, 2014 at 9:32 AM, Bill Page bill.p...@newsynthesis.org
wrote:
  OK, this looks better!
 
  (1) - D(abs(x),x)
 
   _
   x + x
 (1)  ---
  2abs(x)
  Type:
  Expression(Integer)
  (2) - D(conjugate(x),y)
 
 (2)  0
  Type:
  Expression(Integer)
  (3) - D(conjugate(x),x)
 
 (3)  1
  Type:
  Expression(Integer)
  (4) - f:=operator 'f
 
 (4)  f
Type:
  BasicOperator
  (5) - D(abs(f(x)),x)
 
   , _  _  ,
  f(x)f (x) + f(x)f (x)
 
 (5)  -
2abs(f(x))
  Type:
  Expression(Integer)
  (6) - D(abs(log(x)),x)
 
  __
  xlog(x) + x log(x)
 (6)  --
  _
2xxabs(log(x))
  Type:
  Expression(Integer)
 
  That looks good, right? What about arg(z). What are the Wirtinger
  derivatives of arg(z)? Do you have other examples of non-analytic
  functions?
 
  Would you mind posting your patch to FriCAS somewhere? I would be
  interested in how you implemented it.

 I'll try to compile FriCAS myself and apply your patch, so that I can
 play with it. Can you also try:

 abs(I*x)

 1/abs(x)
 1/abs(x)^2
 x/abs(x)^3
 abs(x)^2

 The x/abs(x)^3 is a Coulomb's law in 1D.

 Ondrej


-- 
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Bill Page
On 19 November 2014 21:23, kcrisman kcris...@gmail.com wrote:


 Since this mostly concerns FriCAS I am cross posting to that group.  I will 
 also post the patch there.  For FriCAS list reference the original email 
 thread is here:


 But if you come up with a solution Sage (or Ginac, or whatever) can implement 
 too, please let us know!


Right now Ondrej's proposed definition is looking pretty good to me
but I think it needs more extensive testing.  Apparently Ginac with
Vladimir V. Kisil's patch is able to compute at least some of the
results I showed with FriCAS.  If someone has used Ginac and is able
to compile it with the patch, it would be good to have these results
for comparison.

Yes, certainly.  We can also continue this thread.

Bill.

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Bill Page
On 17 November 2014 23:16, Ondřej Čertík ondrej.cer...@gmail.com wrote:
 Hi Bill,

 Thanks for the clarification. So your point is that 2) is not
 sufficient, that we really need two Wirtinger derivatives --- it's
 just that one can be expressed using the other and a conjugate,
 so perhaps CAS can only return one, but a chain rule needs
 modification and probably some other derivatives handling as
 well. I need to think about this harder.


Yes, that is a good summary.  My tentative conclusion was that we
could implement just one (Wirtinger) derivative, a modified chain rule
and a sufficiently strong conjugate operation.  This derivative is the
same as the usual derivative in the case of analytic functions but we
would have to live with the fact that it is slightly different (factor
of 1/2) for the case of common real derivatives of non-analytic
functions such as abs.  Introducing a factor of 2, such as in the case
of the definition of the sign function seems like a small price to
pay.

 Here is a relation that I found today in [1] (see also the references
 there), I don't know if you are aware of it:

 D f / D z = df/dz + df/d conjugate(z) * e^{-2*i*theta}

 Where Df/Dz is the derivative in a complex plane along the direction
 theta (the angle between the direction and the x-axis) and df/dz and
 df/d conjugate(z) are the two Wirtinger derivatives. This formula
 holds for any function. So all the derivatives no matter which
 direction lie on a circle of radius df/d conjugate(z) and center
 df/dz.

 [1] Pyle, H. R.,  Barker, B. M. (1946). A Vector Interpretation of
 the Derivative Circle. The American Mathematical Monthly, 53(2), 79.
 doi:10.2307/2305454

http://phdtree.org/pdf/36421281-a-vector-interpretation-of-the-derivative-circle/

Thank you.  I was not aware of that specific publication.  I think
their geometric interpretation is useful.


 For CAS, one could probably just say that theta=0 in our definition,
 and then everything is consistent, and we only have one derivative,
 2). The other option is to return both derivatives and make the
 derivative Df/Dz of non-analytic function equal to the above formula,
 i.e. depending on df/dz, df/d conjugate(z) and theta.

I think you are overly focused on trying to define a derivative that
reduces to the conventional derivative of non-analytic functions over
the reals.


 I need to think about the chain rule. I would simply introduce the
 theta dependence into all formulas, as that gives all possible
 derivatives and gives the exact functional dependence of all
 possibilities. And then see whether we need to keep all formulas
 in terms of theta, or perhaps if we can set theta = 0 for everything.


It is not clear to me how to use such as generic derivative in the
application of the chain rule.

Bill.

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


Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Bill Page
On 18 November 2014 09:02, David Roe roed.m...@gmail.com wrote:
 On Tue, Nov 18, 2014 at 5:57 AM, Bill Page bill.p...@newsynthesis.org wrote:

  I think you are overly focused on trying to define a derivative that
  reduces to the conventional derivative of non-analytic functions
  over the reals.

 I've just been casually following this conversation, but I think it's
 important that the derivative of abs(x) be sign(x) not 2*sign(x) or
 1/2*sign(x).


What makes it important that the derivative of abs(x) be sign(x)?
An important point here is that there is no one single unique
derivative of non-analytic functions like abs, but rather than all of
their derivatives can be expressed in terms of just two.  I am
seriously interested in reasons for retaining the status quo.

 If you use a different function, like f.wirtinger_derivative(), then
 it doesn't matter so much.
 David


On 18 November 2014 10:11, kcrisman kcris...@gmail.com wrote:

 +1


Although I guess this would be consistent with the over all
assimilation philosophy adopted by Sage, I am rather strongly
against this in general.  In my opinion it is in part what has lead to
the rather confusing situation in most other computer algebra systems.
I think rather that one should strive for the most general solution
consistent with the mathematics.  I suppose that to some extent this
is conditioned by how the subject is taught.  It came as a surprise to
me that a solution of this problem (Wirtinger calculus or CR-calculus)
was apparently well-known is some circles but considered only a
marginal curiosity in others (if at all).

 That notwithstanding, this conversation is really great to see and I hope
 we get something that works for the usual cases in the original post
 too!


Provided that one realizes its limitations I think the solution
proposed by Vladimir V. Kisil for ginac and in more generality by
Ondrej is quite good.  I don't think a new name for this is desirable.

Bill.

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


  1   2   3   4   >