Re: [sage-support] Re: How to cancel alarm() IN BOTH 5.12 AND 5.13

2014-01-29 Thread Georgi Guninski
On Tue, Jan 28, 2014 at 11:58:19AM +0100, Jeroen Demeyer wrote:
 On 2014-01-28 07:25, John H Palmieri wrote:
 
 
 On Monday, January 27, 2014 10:13:28 PM UTC-8, Georgi Guninski wrote:
 
 Dear sir or madam,
 
 How to cancel alarm in BOTH sage 5.12 AND 5.13?
 
 cancel_alarm() works only in 5.13
 alarm(0) works only in 5.12 (and maybe earlier)
 
 
 I believe that
 
  from sage.misc.misc import cancel_alarm
  cancel_alarm()
 
 should work in all versions of Sage dating back to at least version
 4.1.2 (that's the oldest version I have easily accessible to test with).
 Or use Python's signal.alarm(n) to set an alarm for n seconds and
 signal.alarm(0) to cancel it.


Dear sir or madam,

I agree that one should avoid using code written
by intoxicated sage developers.

Appears to me on 5.13 alarm(RR(10)^(-300)) cancels
a pending alarm as per the documentation of
setitimer(2).

sage: alarm(0.5);alarm(RR(10)^(-300));sleep(1);print fuck
fuck


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


[sage-support] How to cancel a pending alarm() ? (Why did you kill alarm(0)?)

2014-01-27 Thread Georgi Guninski
I am running code in a loop and certain function might take
long or short time. I don't want to wait long and
want to continue with the fast cases.

Up to sage 5.12 I used:

alarm(5)
try:
F=mightbelong(n)
alarm(0) #to not fire later
except KeyboardInterrupt: #alarm
alarm(0)
continue
#alarm free code

On 5.13 alarm(0) fails.

If I do 
alarm(0.1);fa=factor(2)
I get KeyboardInterrupt which breaks later code
though the critical stuff passed.

How to cancel a pending alarm()?

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


Re: [sage-support] How to cancel a pending alarm() ? (Why did you kill alarm(0)?)

2014-01-27 Thread Georgi Guninski
On Mon, Jan 27, 2014 at 02:35:55PM +0100, Jeroen Demeyer wrote:
 On 2014-01-27 10:57, Georgi Guninski wrote:
 How to cancel a pending alarm()?
 Use cancel_alarm(). I agree this should be documented in alarm().


Thanks.

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


Re: [sage-support] How to cancel a pending alarm() ? (Why did you kill alarm(0)?)

2014-01-27 Thread Georgi Guninski
On Mon, Jan 27, 2014 at 03:07:00PM +0100, Jeroen Demeyer wrote:
 On 2014-01-27 14:35, Jeroen Demeyer wrote:
 Use cancel_alarm(). I agree this should be documented in alarm().
 
 This is now http://trac.sagemath.org/ticket/15743 and needs review.


May I ask you to allow alarm(0) again since other people
might use it too?

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


Re: [sage-support] Re: Bug in genus of an ideal

2014-01-27 Thread Georgi Guninski
On Mon, Jan 27, 2014 at 05:29:37AM -0800, kroe...@uni-math.gwdg.de wrote:
 This is probably a late comment,
 
 but genus() in Singular is also known for containing bugs,
 see tickets
 http://www.singular.uni-kl.de:8002/trac/ticket/259,
 http://www.singular.uni-kl.de:8002/trac/ticket/469
 


geometric genus in Singular is known to be quite broken.

especially in number fields and not counting crashes.


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


Re: [sage-support] How to cancel a pending alarm() ? (Why did you kill alarm(0)?)

2014-01-27 Thread Georgi Guninski
On Mon, Jan 27, 2014 at 06:19:34PM +0100, Jeroen Demeyer wrote:
 On 2014-01-27 15:13, Georgi Guninski wrote:
 On Mon, Jan 27, 2014 at 03:07:00PM +0100, Jeroen Demeyer wrote:
 On 2014-01-27 14:35, Jeroen Demeyer wrote:
 Use cancel_alarm(). I agree this should be documented in alarm().
 
 This is now http://trac.sagemath.org/ticket/15743 and needs review.
 
 
 May I ask you to allow alarm(0) again since other people
 might use it too?
 
 The problem is that I didn't want to define alarm(x) for small
 values of x.  The question becomes more difficult if you need to
 think about what
 
 alarm(0.0)
 
 and
 
 alarm(1e-300)
 
 should do.



I see.

You have a problem and you broke my code, 
f.cking backward compatibility, make me
fix it.

On linux:
$man alarm

If seconds is zero, no new alarm() is scheduled.
In any event any previously set alarm() is canceled.


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


Re: [sage-support] Re: How to cancel a pending alarm() ? (Why did you kill alarm(0)?)

2014-01-27 Thread Georgi Guninski
On Mon, Jan 27, 2014 at 10:53:10PM +0100, Jeroen Demeyer wrote:
 On 2014-01-27 22:47, Simon King wrote:
 Has there
 been a deprecation warning when using alarm() with an argument that is
 equal to zero?
 No. But as John says, alarm(0) was never documented, nor did it
 appear in any doctest.
 
 Would it be a problem to allow alarm(0) but disallow alarm(0.0)?


I don't give a sh.t about this anymore.

For the record, I feel sorry for the genuine bugs
I reported to sage. Will try to fix this in the
future.


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


Re: [sage-support] How to cancel a pending alarm() ? (Why did you kill alarm(0)?)

2014-01-27 Thread Georgi Guninski
On Mon, Jan 27, 2014 at 11:17:50AM -0800, John H Palmieri wrote:
 
 First, please try to be more polite.
 

Dear sir or madam,

Observe that in sage 5.12 there is no cancel_alarm().


 Second, the old alarm code happened to work the way you wanted, but it 
 wasn't documented that way, and it's not clear (to me, at least) that that 
 use was ever intended. Had it been documented, or had it been commonly 
 known that alarm(0) was used that way, backwards-compatibility would have 
 been preserved.
 
 -- 
 John
 

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


[sage-support] How to cancel alarm() IN BOTH 5.12 AND 5.13

2014-01-27 Thread Georgi Guninski
Dear sir or madam,

How to cancel alarm in BOTH sage 5.12 AND 5.13?

cancel_alarm() works only in 5.13
alarm(0) works only in 5.12 (and maybe earlier)

My client needs portable code on linux.

Thanks in advance.

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


[sage-support] Strange mpmath result in $\sum_{ n 0} \pi^n$

2014-01-20 Thread Georgi Guninski
Perhaps someone should forward this upstream.

$\sum_{ n  0} \pi^n$ certainly diverges though
mpmath claims it equals -pi/(pi-1)

sage: import mpmath
sage: mpmath.mp.pretty=True;mpmath.mp.dps=40
sage: r1=mpmath.nsum(lambda n:  mpmath.pi**n,[ 1, mpmath.inf])
sage: r1
-1.466942206924259859983394813233667573143
sage: 
sage: r2=-mpmath.pi/(mpmath.pi - 1)
sage: r1-r2
0.0

sage: r3=mpmath.nsum(lambda n:  mpmath.mpf('2')**n,[ 1, mpmath.inf]);r3
-2.0

Computing zeta(2) appears OK:

sage: z2=mpmath.nsum(lambda n:  1/n**2,[ 1, mpmath.inf]);z2
1.644934066848226436472415166646025189219
sage: z2 - mpmath.zeta(2)
0.0

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


Re: [sage-support] Re: Strange results with subgroups of automorphism group of graphs

2014-01-11 Thread Georgi Guninski
On Thu, Jan 09, 2014 at 08:02:34AM -0800, kcrisman wrote:
 This is now http://trac.sagemath.org/ticket/15656
 
 On Thursday, January 9, 2014 11:00:03 AM UTC-5, kcrisman wrote:
 
 
 


Temporary workaround with relabel():

sage: G1=Graph(':H`ECw@HGXGAGUG`e');G1.relabel();G1.relabel(lambda x: 
x+1);G=G1.automorphism_group();sg=G.subgroups()
sage: (G.gens(),sg[1].gens(),G.gens()==sg[1].gens())
([(1,8)(2,5)(3,4)(7,9)], [(1,8)(2,5)(3,4)(7,9)], True)

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


[sage-support] Strange results with subgroups of automorphism group of graphs

2014-01-09 Thread Georgi Guninski
Strange results with subgroups of automorphism group of graphs

There is an element in the automorphism group of graph
which is in no subgroup (though the full group is a subgroup).

I suspect the problem is the usage of zero.

G1=Graph(':H`ECw@HGXGAGUG`e');G=G1.automorphism_group();sg=G.subgroups()
print G.gens()
  [(0,7)(1,4)(2,3)(6,8)]
print sg
  [Permutation Group with generators [()], Permutation Group with generators 
[(1,8)(2,5)(3,4)(7,9)]]
for i in G:
co=len([i for j in sg if i in j])
if co==0:  print i,co
  (0,7)(1,4)(2,3)(6,8) 0

sage: [G.is_isomorphic(i) for i in sg]

  [False, True]

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


Re: [sage-support] Re: Is there Integer Program Solver for arbitrary large integers?

2014-01-01 Thread Georgi Guninski
On Tue, Dec 31, 2013 at 06:08:20AM +, Dima Pasechnik wrote:
 On 2013-12-31, Dima Pasechnik dimp...@gmail.com wrote:
  On 2013-12-16, Georgi Guninski gunin...@guninski.com wrote:
  I am trying to solve a linear integer program with
  only 3 integer variables, but numbers are large,  2^64.
 
  Couldn't do it with the sage backends, though
  PPL might support it (get an error set a var int.).
 
  Is there such a free solver (probably not in sage)?
 
  Is there another option?
 
  gp.lindep() doesn't give optimal solutions.
  offhand, one can solve ILP via Groebner bases (there was an algorithm by
  Conti and Traverso). That is, you can code this in Sage, presumably...
 
 another option might be to use LattE 
 http://boxen.math.washington.edu/home/sagemath/sage-mirror/spkg/experimental/latte_int-1.6.spkg
 Sage has next to no interface to LattE at the moment, one can better
 run it in Sage shell...
 

Happy new year!

Thanks for LattE.

Another arbitrary precision solver I found
is isl. It works for me.

There are sample applications and constraints look like:

$./isl_polyhedron_sample 
 { [A,B] : 1 = A and A = 808711 and 1 = B and 1 = 654013667618 * A - 
654013667619 * B = 808711 }

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


Re: [sage-support] Re: Edge coloring multigraphs raises exception

2013-12-23 Thread Georgi Guninski
On Mon, Dec 23, 2013 at 05:17:37AM -0800, Nathann Cohen wrote:
 Hell !!
 
 Here is a more responsible answer : I just created ticket #15572 to raise 
 exceptions when a function is called which isn't supposed to deal with 
 multiple edges and/or loops. I hope I found them all, but in any case now 
 protecting such functions will just take one line. Aaaand of 
 course, if a function isn't supported for non-simple graphs even though it 
 would have a meaning to do so, it will have to be implemented eventually :-)
 
 But in the meantime, no more wrong answers :-P
 
 http://trac.sagemath.org/ticket/15572
 
 Nathann



lol, thanks.

I liked your answers in this thread :)

Is .eulerian_circuit() expected to work on multigraphs?

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


Re: [sage-support] Re: Edge coloring multigraphs raises exception

2013-12-23 Thread Georgi Guninski
On Mon, Dec 23, 2013 at 04:31:46PM +0100, Nathann Cohen wrote:
 Yoo !!
 
  lol, thanks.
 
  I liked your answers in this thread :)
 
 Cool ! :-D
 
 To be honest, I really believed that they had made you angry ^^;
 


No, I wasn't angry at all.

I am pretty sure sage has A LOT OF bugs,
why bother?

Probably a lot of them never will be fixed,
never mind.


  Is .eulerian_circuit() expected to work on multigraphs?
 
 Yes I believe so. The implementation of this function is really
 elegant and calls edge_iterator, not the list of neighbors, so it
 should be fine :-)
 
 Nathann

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


[sage-support] Edge coloring multigraphs raises exception

2013-12-17 Thread Georgi Guninski
Edge coloring multigraphs raises exception

sage: 
P=graphs.PetersenGraph();ep=P.edges(labels=0);P2=Graph(ep+ep,multiedges=1) 
sage: graph_coloring.edge_coloring(P2,value_only=1)
7 # not sure this is correct

sage: graph_coloring.edge_coloring(P2,value_only=0)

RuntimeError: maximum recursion depth exceeded while calling a Python object

How to get explicit edge coloring of multigraph?

In addition the line graphs of P and P2 are isomorphic:

sage: Pl=P.line_graph();P2l=P2.line_graph();Pl.is_isomorphic(P2l)
True
sage: Pl==P2l
True

sage: P2.degree()
[6, 6, 6, 6, 6, 6, 6, 6, 6, 6]

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


Re: [sage-support] Re: Edge coloring multigraphs raises exception

2013-12-17 Thread Georgi Guninski
I don't care much about this.


On Tue, Dec 17, 2013 at 11:22:12AM +0100, Nathann Cohen wrote:
 Yooo !!
 
  Edge coloring multigraphs raises exception
 
 Ahahaha. That's possible.
 
  sage: 
  P=graphs.PetersenGraph();ep=P.edges(labels=0);P2=Graph(ep+ep,multiedges=1)
  sage: graph_coloring.edge_coloring(P2,value_only=1)
  7 # not sure this is correct
 
 It most probably isn't. Really, most of Sage's graph functions are
 written without multigraphs in mind. I hate those things. Implementing
 something for multigraphs instead of graphs just makes you add mostly
 useless code (which, besides, is a pure loss of computational time for
 normal graphs), and does not add anything interesting to the
 algorithm.
 
 Actually, it's pretty clear from the documentation that edge coloring
 has not been thought for multigraphs, as one of the parameters is
 vizing, and Vizing's theorem does not apply to multigraphs :-P
 
  sage: graph_coloring.edge_coloring(P2,value_only=0)
 
  RuntimeError: maximum recursion depth exceeded while calling a Python object
 
  How to get explicit edge coloring of multigraph?
 
 Well, I would say compute their line graph, and the chromatic numbers
 of those. Which is what you do next :
 
  In addition the line graphs of P and P2 are isomorphic:
 
  sage: Pl=P.line_graph();P2l=P2.line_graph();Pl.is_isomorphic(P2l)
  True
  sage: Pl==P2l
  True
 
  sage: P2.degree()
  [6, 6, 6, 6, 6, 6, 6, 6, 6, 6]
 
 Oh. Right. Same explanation there I guess. Though it looks like the
 function works if you have different labels on your different edges.
 
 Now, for the fix : I personally cannot care less about multigraphs,
 and I actually don't like the fact that making these functions return
 meaningful results on normal graps will make all computations slower
 on normal graphs, wit no value added. Besides, the code will be
 longer, and unclear because it will be polluted with things which have
 nothing to do with the smart part of the algorithm itself. I mean,
 just think of a shortest path algorithm on a multigraph !
 
 I would personally sleep better if I just added a exception to all
 those functions, saying that You gave an multigraph as input, and
 this function has not been checked to work for multigraphs. Which
 would mean that you wouldn't be able to use any of those functions
 which multigraphs, which is fair as we expect them to return wrong
 results.
 This being said, if you need this feature and if you are willing to
 help it's a different story. It's pretty hard to have patches reviewed
 in Sage these days, and unless the patches are reviewed I would just
 be working to make your own code work, to only see my work being
 forgotten on our trac server, never merged into Sage. S well.
 What do you think ? :-P
 
 As fun as it is to implement graph algorithms in Sage, really
 multigraphs are nothing but pain and boring bugs. And waste of
 computational time :-P
 
 See youuu !
 
 Nathann
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/groups/opt_out.

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


Re: [sage-support] Re: Edge coloring multigraphs raises exception

2013-12-17 Thread Georgi Guninski
if i understand correctly, Nathann is implying that
if one works will multigraphs they shouldn't use sage
for this task.

agree with this and do so.

On Tue, Dec 17, 2013 at 12:59:31PM +0100, Nathann Cohen wrote:
 Yooo !!
 
  Why isn't are multigraphs (labelled graphs, graphs with loops etc)
  implemented as a  separate class(es) which inherit from a stripped down
  version of graphs? This way graphs would not incur any speed penalty
 because
  of all of these extra checks that are needed for these more exotic
 graphs?
 
 Ahahah. No idea. Graphs were implemented long before I first installed Sage
 :-P
 
 Plus... Well, doing this isn't always the right option. I mean, I have no
 idea what we should do with those awful things, having a different graph
 class means that you will either
 1) Implement some algorithms twice with very minor changes
 2) Create a simple graph from a multigraph, THEN call the graph function
 (and copying graphs is not free, and that's unaffordable fo linear things
 like distance computations)
 3) You write once a function that supports both, and well, you will waste
 some time on normal graphs too, and have the graph algorithms polluted
 
 It's not an answer to your question, for I really have no idea how we could
 find a cool way out of this thing. I really HATE multigraphs.
 
 Look, Georgi tried to create the line graph of a multigraph. The line graph
 is, by the book, a graph whose vertices are the edges of your first graph.
 That's cool.
 But what happens if you have multiple edges ? Now the vertices of your new
 graph cannot be identified by pairs of vertices only, you need more
 information. Well, you could add an integer to the pairs of vertices to
 number the labels, but really that is an ugly wy out.
 
 And multigraphs yield infinitely many problems like that. Things that can't
 be solved cleanly and naturally. Bad work :-/
 
 Nathann

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


[sage-support] Is there Integer Program Solver for arbitrary large integers?

2013-12-16 Thread Georgi Guninski
I am trying to solve a linear integer program with
only 3 integer variables, but numbers are large,  2^64.

Couldn't do it with the sage backends, though
PPL might support it (get an error set a var int.).

Is there such a free solver (probably not in sage)?

Is there another option?

gp.lindep() doesn't give optimal solutions.

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


[sage-support] Can I change QQ[sqrt(a),sqrt(b)] to QQ[\alpha] ?

2013-12-12 Thread Georgi Guninski
Suppose I work in QQ[sqrt(a),sqrt(b)]
where a and b are integer non-squares.

Can I change it to something isomorphic to QQ[\alpha]
where \alpha is algebraic, i.e., work with a conventional
NumberField with a single defining polynomial
without extending the NumberField?

Suspect this is impossible.


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


Re: [sage-support] Can I change QQ[sqrt(a),sqrt(b)] to QQ[\alpha] ?

2013-12-12 Thread Georgi Guninski
On Thu, Dec 12, 2013 at 12:21:14PM +, John Cremona wrote:
 On 12 December 2013 12:12, Georgi Guninski gunin...@guninski.com wrote:
  Suppose I work in QQ[sqrt(a),sqrt(b)]
  where a and b are integer non-squares.
 
  Can I change it to something isomorphic to QQ[\alpha]
  where \alpha is algebraic, i.e., work with a conventional
  NumberField with a single defining polynomial
  without extending the NumberField?
 
 
 Is this what you want?
 
 sage: K = QQ[sqrt(2),sqrt(3)]
 sage: K.absolute_field('a')
 Number Field in a with defining polynomial x^4 - 10*x^2 + 1


Thanks, exactly this.

How to get maps between the two fields, coercion
doesn't appear to work.


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


Re: [sage-support] Can I change QQ[sqrt(a),sqrt(b)] to QQ[\alpha] ?

2013-12-12 Thread Georgi Guninski
On Thu, Dec 12, 2013 at 03:06:46PM +0200, Georgi Guninski wrote:
 On Thu, Dec 12, 2013 at 12:21:14PM +, John Cremona wrote:
  On 12 December 2013 12:12, Georgi Guninski gunin...@guninski.com wrote:
   Suppose I work in QQ[sqrt(a),sqrt(b)]
   where a and b are integer non-squares.
  
   Can I change it to something isomorphic to QQ[\alpha]
   where \alpha is algebraic, i.e., work with a conventional
   NumberField with a single defining polynomial
   without extending the NumberField?
  
  
  Is this what you want?
  
  sage: K = QQ[sqrt(2),sqrt(3)]
  sage: K.absolute_field('a')
  Number Field in a with defining polynomial x^4 - 10*x^2 + 1
 
 
 Thanks, exactly this.
 
 How to get maps between the two fields, coercion
 doesn't appear to work.
 


Nevermind, I found it.

Call K2.structure() for the maps.

Thank you!

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


Re: [sage-support] Re: Easiest way to use cloud.sagemath in a terminal?

2013-11-28 Thread Georgi Guninski
On Thu, Nov 28, 2013 at 06:01:05AM -0600, Jason Grout wrote:
 On 11/27/13 9:31 AM, Georgi Guninski wrote:
 A minor disadvantage of this solution is cloud.sagemath
 sees the password/ssh key of...@foo.edu, so I wouldn't
 use this if I care about the account.
 
 Not if you use passwordless logins (i.e., copy your sagemath public
 key to your personal server's authorized login file).
 
 Thanks,
 
 Jason


I am still paranoid about this solution.

I don't want to allow cloud. to login to y...@foo.edu for 
a single moment.

To login to y...@foo.edu I must know something secret -
password or a private key and in both cases the
ssh process on cloud. (browser term.) knows them too, so it can login
on my behalf.

If I add a key on y...@foo.edu, cloud. can login too
(or manipulate my ssh session) and I don't want this
if I care about the account y...@foo.edu.



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


Re: [sage-support] Re: Easiest way to use cloud.sagemath in a terminal?

2013-11-28 Thread Georgi Guninski
On Thu, Nov 28, 2013 at 04:36:47AM -0800, Volker Braun wrote:
 It would be just as easy for a compromised cloud ssh to download your 
 personal private key than to log your password. The only solution is to 
 make a different account on your own machine to log into, assuming that 
 your university allows remote logins to personal machines at all (e.g. 
 Oxford doesn't).
 


Here is a ssh free soluion, vim and readline work.

Needs socat(1) and optionally openssl

Plaintext:

On client: socat -,raw,echo=0 tcp-l:5556
On cloud webterm:  socat tcp:CLIENT:5556 exec:/bin/bash -l,pty,ctty,stderr


Encrypted with key authorization:

On client: socat -,raw,echo=0 
ssl-l:1443,cert=server.pem,cafile=client.crt,verify=1 
On cloud webterm: socat ssl:CLIENT:1443,cert=client.pem,cafile=server.crt 
exec:'/bin/bash',pty,ctty,stderr

In the openssl case one need to easily generate some stuff.

5556 and 1443 are the ports.


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


Re: [sage-support] Re: Easiest way to use cloud.sagemath in a terminal?

2013-11-28 Thread Georgi Guninski
On Thu, Nov 28, 2013 at 07:48:24AM -0800, William Stein wrote:
 On Nov 28, 2013 4:36 AM, Volker Braun vbraun.n...@gmail.com wrote:
 
  It would be just as easy for a compromised cloud ssh to download your
 personal private key than to log your password.
 
 I always protect my ssh keys by passphrase protecting them, so just
 downloading the private key does not trivially give access.  Instead the
 attacker would have to setup some sort of logger to get the passphrase,
 which is harder.  I also sometimes use ssh-agent.


sorry, this doesn't make sense at all.
ssh(1) uses your private key, so it knows it.

please don't spread disinformation and don't
suggest __cloud.__ to login to m...@me.com.

10x.


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


Re: [sage-support] Re: Easiest way to use cloud.sagemath in a terminal?

2013-11-28 Thread Georgi Guninski
On Thu, Nov 28, 2013 at 10:45:39AM -0800, William Stein wrote:
 On Thu, Nov 28, 2013 at 10:27 AM, Georgi Guninski gunin...@guninski.com 
 wrote:
  On Thu, Nov 28, 2013 at 07:48:24AM -0800, William Stein wrote:
  On Nov 28, 2013 4:36 AM, Volker Braun vbraun.n...@gmail.com wrote:
  
   It would be just as easy for a compromised cloud ssh to download your
  personal private key than to log your password.
 
  I always protect my ssh keys by passphrase protecting them, so just
  downloading the private key does not trivially give access.  Instead the
  attacker would have to setup some sort of logger to get the passphrase,
  which is harder.  I also sometimes use ssh-agent.
 
 
  sorry, this doesn't make sense at all.
  ssh(1) uses your private key, so it knows it.
  please don't spread disinformation and don't
 
 Ugh.   If you properly passphrase protect your private key then
 somebody who *copies* the private key file ~/.ssh/id_rsa gains
 nothing. I did not claim anything other than this, and I am not
 spreading disinformation.
 I should have added the word file emphasized in my post above: just
 downloading the private key [file!] does not
 I thought it was so obvious that if you log into a remote linux
 machine and somebody else has also logged into the same machine as the
 same user, then anything you do is not secure.   I thought it would go
 without saying.   I'm sorry if there is any confusion.
 
  -- William



OK, I agree with this explanation.
Appears to me it is offtopic for the thread, so
I misunderstood it is part of your original
solution (someone already tried to patch it).

Sorry for the confusion.


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


Re: [sage-support] Easiest way to use cloud.sagemath in a terminal?

2013-11-27 Thread Georgi Guninski
On Mon, Nov 25, 2013 at 08:19:10AM -0800, William Stein wrote:
 On Mon, Nov 25, 2013 at 1:59 AM, Georgi Guninski gunin...@guninski.com 
 wrote:
  I prefer working in a terminal instead of a browser.
 
  What is the easiest way to use cloud.sagemath in a terminal?
 
  AFAICT ssh(1) isn't allowed, is it really so?
 
 The virtual machines do not have external addresses on the internet,
 so there is no easy way to directly ssh into them yet.
 
  Using a small package got it working with simple commands,
  (connect back) but there might be easier way.
 
 I plan to setup a machine specifically devoted to port forwarding for
 them, but I just haven't got to it yet.  In the meantime,  if you have
 an account on any Linux (or OS X?) machine foo.edu (say) anywhere, you
 should be able to do the following:
 
 (1) in your cloud.sagemath terminal, type
 
 ssh -R 8022:localhost:22 yourn...@foo.edu
 
  (2) Now login to yourn...@foo.edu and type
 
 ssh localhost -p 8022
 
 You can change 8022 to any free port.
 
  -- William


Thanks.

A minor disadvantage of this solution is cloud.sagemath
sees the password/ssh key of y...@foo.edu, so I wouldn't
use this if I care about the account.

Similar solution is possible with socat + openssl.


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


[sage-support] Easiest way to use cloud.sagemath in a terminal?

2013-11-25 Thread Georgi Guninski
I prefer working in a terminal instead of a browser.

What is the easiest way to use cloud.sagemath in a terminal?

AFAICT ssh(1) isn't allowed, is it really so?

Using a small package got it working with simple commands,
(connect back) but there might be easier way.

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


[sage-support] Calling gp.F(n) in a loop about 2^16 times raises exception

2013-11-17 Thread Georgi Guninski
Is there something wrong or a workaround for this.
Simplified testcase:

sage: gp({T(n)=n+1})
sage: for n in [ 1 .. 2**20]:
a=gp.T(n)
print n

#wait some time..
...
65535
65536
---
TypeError

TypeError: Error executing code in GP:
CODE:
sage[131074]=65537;
PARI/GP ERROR:
  ***   at top-level: sage[131074]=65537
  *** ^--
  ***   array index (131074) out of allowed range [1-131073].

after this trying:
sage: gp.T(1)

again raises exception.

The constants near 2^16 might indicate some wrong C/C++ type
(just a guess).

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


Re: [sage-support] Inverting multiplication over elliptic curves

2013-11-17 Thread Georgi Guninski
On Sun, Nov 17, 2013 at 05:25:10AM -0800, absinthe wrote:
 Hi everyone,
 
 I'd like to know if there is any implementation in Sage for inverting 
 multiplication over elliptic curves. To clarify the question as many might 
 misunderstand the problem with discrete log... 
 Let's assume that we have a curve E, but we don't know the number of points 
 of E. Moreover, for given k, P we know that P=kQ and we want to find Q. If 
 k=2 then we have the point halving problem which can be done efficiently (I 
 don't know though if there is a Sage implementation for that). Are you aware 
 of any algorithm for general k?
 
 Thanks


Have tried point.division_points(k) ?

e.g:

sage: E=EllipticCurve(QQ,[1,1,13,0,0]);P=E([0,0]);k=3;Q= k * 
P;pts=Q.division_points(k);pts
[(0 : 0 : 1)]

Type P.division_points? for help.

Note that you can get more than one point.

In this case over QQ P.height() might give you the correct solution,
over GF(p) many points are discrete log IMHO.

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


Re: [sage-support] Re: Possible memory leak involving IntegerModRing()

2013-11-16 Thread Georgi Guninski
On Sat, Nov 16, 2013 at 08:05:44PM +, Simon King wrote:
 Hi!
 
 On 2013-11-16, Simon King simon.k...@uni-jena.de wrote:
  For your information: This bug is tracked at 
  http://trac.sagemath.org/ticket/15424
 
 I did not run the full doc tests yet, but I think I have fixed the leak.
 If you like to test it: I think you don't need a trac account to test
 the fix that I have posted on the trac ticket.
 Otherwise, I hope the work-around works for you.
 
 Best regards,
 Simon


Thanks.

If there isn't a ticket for this almost year old bug
would you file one:
http://comments.gmane.org/gmane.comp.mathematics.sage.support/30229

Factoring polynomial in QQ['x,y'] gives floating point exception
(I get hurt by this often and wrap |factor| in |try|).


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


Re: [sage-support] Bug in polynomia roots in Qp()

2013-11-15 Thread Georgi Guninski
On Fri, Nov 15, 2013 at 10:58:58AM +0100, Jeroen Demeyer wrote:
 On 2013-11-15 10:07, John Cremona wrote:
 I would not like to recommend to any mathematician to use a piece of
 software which, when asked to give the roots of (t-1)^2 over a field
 My whole point was that the original poster *did not ask that question*.
 
 He asked for the roots of the polynomial
 (1 + O(3^5))*t^2 + (1 + 2*3 + 2*3^2 + 2*3^3 + 2*3^4 + O(3^5))*t + (1
 + O(3^5))
 which is not the same as asking for the roots of the polynomial
 t^2 - 2*t + 1


Sorry but are you smoking bad stuff, sage
claims your polynomial have zeros, which appears to
contradict your claims:

sage: Kz.t=Qp(3,5)[];pol=(1 + O(3^5))*t^2 + (1 + 2*3 + 2*3^2 + 2*3^3 + 2*3^4 
+ O(3^5))*t + (1 + O(3^5))
sage: (pol(1),pol(1).is_zero())
(O(3^5), True)

sage: pol.roots()
[]

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


Re: [sage-support] Bug in polynomia roots in Qp()

2013-11-15 Thread Georgi Guninski
On Fri, Nov 15, 2013 at 09:23:53AM +0100, Jeroen Demeyer wrote:
 
 I created the bug report at http://trac.sagemath.org/ticket/15422


Usually sound open source vendors cite sources for bugs.

After reading this list I am not surprised this doesn't apply
to sage.


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


[sage-support] Possible memory leak involving IntegerModRing()

2013-11-15 Thread Georgi Guninski
Everyone knows sage has no bugs.

Appears to me the following program should use
O(1) memory.

Watching memory usage in top(1), the proggie uses
3GB ram in less than a minute and memory usage
increases constantly.

Is there something wrong with the program?

While I am still using sage, is there a workaround
for this ``feature''?

Program:

def wief():

2^(n-1) \equiv 1 \mod n^2
not necessarily prime

n=2
while n10**20:
K=IntegerModRing(n**2)
if K(2)**(n-1)==1:
print n
n += 1

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


Re: [sage-support] Re: Possible memory leak involving IntegerModRing()

2013-11-15 Thread Georgi Guninski
Thanks for the workaround :)

Another workaround is | == K(1) |.

Don't have a trac account.

Note that modification of your workaround still
leaks (probably this known/the same):

if K(2)**(n-1)== 2 *K.one(): #leaks


On Fri, Nov 15, 2013 at 02:42:36PM +, Simon King wrote:
 Hi Georgi,
 
 On 2013-11-15, Georgi Guninski gunin...@guninski.com wrote:
  Everyone knows sage has no bugs.
 
 OMG, this means I lost my main occupation!
 
  Appears to me the following program should use
  O(1) memory.
 
  Watching memory usage in top(1), the proggie uses
  3GB ram in less than a minute and memory usage
  increases constantly.
 
 There is supposed to be a slow increase, because the memory consumption
 of IntegerModRing(n**2) depends on the size of n, if I am not mistaken.
 
 However, it seems that you are right, there is a leak. Even with the git
 branch of trac ticket #15367 (that is supposed to fix some memory leak),
 I obtain:
 
  sage: def wief():
  : n=2
  : while n10**20:
  : K=IntegerModRing(n**2)
  : if K(2)**(n-1)==1:
  : print n
  : print n, get_memory_usage()
  : n += 1
  sage: get_memory_usage()
  189.44140625
  sage: import gc
  sage: _ = gc.collect()
  sage: len(gc.get_objects())
  9
  sage: wief()
  ...
  60275 563.58203125
  ^C---
  KeyboardInterrupt Traceback (most recent call last)
  ...
  sage: _ = gc.collect()
  sage: len(gc.get_objects())
  3775157
 
  While I am still using sage, is there a workaround
  for this ``feature''?
 
 If you do not do computations in your function wief, but only create
 the IntegerModRing, then the memory consumption is rather steady. Hence,
 the fact that the memory consumption increases when doing computations
 indicates that Sage's coercion framework is responsible for the leak.
 
 Do you have a trac account? Then please create a ticket and put me as
 Cc. Otherwise I'll open a ticket myself.
 
 As a work-around, try this (I tested vanilla sage-5.13.beta2):
 
  sage: import gc
  sage: _ = gc.collect()
  sage: len(gc.get_objects())
  114412
  sage: def wief():
  : n=2
  : while n10**20:
  : K=IntegerModRing(n**2)
  : if K(2)**(n-1)==K.one():
  : print n
  : print n, get_memory_usage()
  : n += 1
  # Ctrl-C after more than 300,000 rounds
  sage: _ = gc.collect()
  sage: len(gc.get_objects())
  115199 
 
 The difference is as follows: If you compare an element of K with the
 integer 1, then Sage needs to compute a homomorphism from ZZ to K.
 This homomorphism is cached for later use. We try to make the caching
 that does not prevent unused rings from garbage collection. But it seems
 you've hit an example where Sage fails.
 
 With the new version of the function, the memory consumption first
 increases and then remains steady even for n300,000.
 
 Best regards,
 Simon
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/groups/opt_out.

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


[sage-support] Bug in polynomia roots in Qp()

2013-11-14 Thread Georgi Guninski
This appears a bug to me:

sage: Kz.t=Qp(3,5)[];pol=t**2-2*t+1;ro=pol.roots(multiplicities=0);ro
[]
sage: pol(1)
O(3^5)



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


Re: [sage-support] Bug in polynomia roots in Qp()

2013-11-14 Thread Georgi Guninski
On Thu, Nov 14, 2013 at 09:39:58AM +, John Cremona wrote:
 On 14 November 2013 09:28, Georgi Guninski gunin...@guninski.com wrote:
  This appears a bug to me:
 
  sage: Kz.t=Qp(3,5)[];pol=t**2-2*t+1;ro=pol.roots(multiplicities=0);ro
  []
  sage: pol(1)
  O(3^5)
 
 I agree -- even I can solve (t-1)^2=0.  Perhaps the code does not
 correctly do an initial squarefree division?
 
 John Cremona


The factorization doesn't appear correct too:

sage: Kz.t=Qp(3,5)[];pol=(t-1)**2;factor(pol)
(1 + O(3^5))*t^2 + (1 + 2*3 + 2*3^2 + 2*3^3 + 2*3^4 + O(3^5))*t + (1 +
O(3^5))

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


Re: [sage-support] Bug in polynomia roots in Qp()

2013-11-14 Thread Georgi Guninski
On Thu, Nov 14, 2013 at 01:44:02PM +0100, Jeroen Demeyer wrote:
 On 2013-11-14 10:28, Georgi Guninski wrote:
 This appears a bug to me:
 I would say it's not a bug. The problem is that your question does
 pol have a zero near 1? depends on what's hidden in the O(3^5).
 
 For example: (t-1)^2 - 3^6 does have a zero near 1, but (t-1)^2 -
 3^7 does not have a zero. So the question you asked is not
 mathematically well defined.
 
 And indeed, PARI/GP's documentation ??factorpadic states that the
 discriminant of the polynomial should be non-zero modulo the
 requested modulus p^r.
 
 Of course, there is a bug here: Sage should raise an exception
 whenever this condition is not satisfied.
 
 Jeroen.



FYI your factorization fails, while pari/gp's works:

? pol=(x-1)^2+O(3^5);
? pol
%2 = x^2 - 2*x + (1 + O(3^5))
? factor(pol)
%3 = 
[(1 + O(3^5))*x + (2 + 2*3 + 2*3^2 + 2*3^3 + 2*3^4 + O(3^5)) 2]

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


Re: [sage-support] Bug in polynomia roots in Qp()

2013-11-14 Thread Georgi Guninski
On Thu, Nov 14, 2013 at 05:36:29PM +0100, Jeroen Demeyer wrote:
 On 2013-11-14 12:40, Julian Rüth wrote:
 
 So this is a bug indeed.


Cremona already confirmed it is a bug, are you an ultrafinitarist
about Qp() ?

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


[sage-support] Is it normal to get negative canonical height of a point on EC over NF ?

2013-11-08 Thread Georgi Guninski
I am not an expert, but is it normal to get negative canonical
height of a point on elliptic curve over number field?

sage: Z1.Z=ZZ[];Nf.v=NumberField(Z**16-2);E=EllipticCurve(Nf,[-87, 504, 
-40320, 0, 0]);P=E(0,0)
sage: P.height() #not very fast
-0.150688795814905
sage: P.height(precision=2000)
-0.15068879581490624...snip

Works on cloud.sagemath too.

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


Re: [sage-support] How to compute the quality of $abc$ triple over number fields?

2013-11-05 Thread Georgi Guninski
On Mon, Nov 04, 2013 at 07:30:43AM -0800, Nils Bruin wrote:
 On Monday, November 4, 2013 1:29:10 AM UTC-8, Georgi Guninski wrote:
 
  Isn't it possible to define the quality only in 
  terms of the norm and the integer radical, 
  something like this: 
 
  q(a,b,c) = max( norm(a),norm(b),norm(c) ) / 
 (log(Delta(K)) + degree(K) * log(radical(norm(a*b*c))) ) 
 
  with the restriction the norms of a,b,c to be coprime ?
 
 
 Assuming you mean to take log(max(...))):
 
 With this definition you don't get a quantity that's invariant under 
 scaling: you want to have that
 
 q(a,b,c)=q(t*a,t*b,t*c)
 
 If a,b,c,t are integers you can accomplish this by dividing by doing 
 something like:
 
 log ( max(norm(a),norm(b),norm(c))/norm(ideal(a,b,c)) )
 
 [in case you're not familiar with ideals in rings of integers: think of it  
 as an analogue to gcd(a,b,c)]

Thanks.

I meant log(max()), sorry for the typo.

Since abc for integers doesn't allow scaling (coprimality),
I tried to avoid scaling too with coprimality of the norms,
but didn't do it properly.

I meant:  If the norms of a,b,c are not coprime integers,
q(a,b,c)=0

otherwise q(a,b,c)=log(max()) / 


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


Re: [sage-support] How to compute the quality of $abc$ triple over number fields?

2013-11-04 Thread Georgi Guninski
On Sun, Nov 03, 2013 at 09:51:15AM -0800, Nils Bruin wrote:
 On Sunday, November 3, 2013 6:36:35 AM UTC-8, John Cremona wrote:
 
  The function is called global_height(): 
 
  sage: K.a = NumberField(x^3-2) 
  sage: b = a+1 
  sage: b.global_height() 
  0.366204096222703 
 
  John Cremona
 
  
 That doesn't quite do the trick, though. For ABC, you'd need the height of 
 the triple (a:b:c), not of the individual points. I think there are some 
 tickets about heights for arithmetic dynamics? I'd think they would need 
 naive height on projective space somewhere as well.
 
 It should be pretty straightforward to write something yourself:
  - clear denominators on your triple (a,b,c) [not necessarily minimally - 
 if your ring of integers isn't a PID you might not be able to]
  - compute the archimedean contribution by taking max abs of the complex 
 (and real) embeddings (take complex places twice)
  - divide by Norm (ideal generated by integral representatives)



Thank you for the replies.

Isn't it possible to define the quality only in
terms of the norm and the integer radical,
something like this:

q(a,b,c) = max( norm(a),norm(b),norm(c) ) /
   (log(Delta(K)) + degree(K) * log(radical(norm(a*b*c))) ) 

with the restriction the norms of a,b,c to be coprime ?

Probably this needs some patching.

Is the ABC for this type of quality known and
does it make sense at all ?

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


[sage-support] How to compute the quality of $abc$ triple over number fields?

2013-11-03 Thread Georgi Guninski
I am trying to compute the quality of $abc$ triples over
number fields.

This is basically $l_K(x)$ from [1] p. 1 with x,1-x,1 replaced by
a,b,c.

My main pain is the definition of height in [1], 
is there a sage method for it - maybe global_height() or
local_height()?

The conductor N_K(a,b,c) is not clear to me too.

Implementation of the quality over number fields will be appreciated
(I suppose it will be one-liner if you have height() ).

Thanks.


[1] 
http://www.ams.org/mcom/2000-69-232/S0025-5718-99-01153-9/S0025-5718-99-01153-9.pdf
SOME EXAMPLES RELATED TO THE abc–CONJECTURE FOR ALGEBRAIC NUMBER FIELDS


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


[sage-support] In E.sha().an_padic() ValueError: max() arg is an empty sequence

2013-10-17 Thread Georgi Guninski
E=EllipticCurve(QQ,[-100,0])
sha=E.sha()
sha.an_padic(13)

 padic_prec = max(bounds[1:]) + 5
ValueError: max() arg is an empty sequence

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


[sage-support] Why E.sha().an() = 0 and E.sha().an_numerical() = 1.0 ?

2013-10-16 Thread Georgi Guninski
Why E.sha().an() = 0 and E.sha().an_numerical() = 1.0 ?

On 5.11 on linux and on cloud.sagemath.com:

sage: E=EllipticCurve(QQ,[0, 0, 1, -79, 
342]);E.sha().an(),E.sha().an_numerical()
(0, 1.00)
#^ why different and 0 is integer ?
sage: E.sha().bound()
(0, 0)

sage: type(E.sha().an())
type 'sage.rings.integer.Integer'
sage: E.rank(),E.analytic_rank()
(5, 5)

sage: E.conductor()
19047851

E.sha().an_padic(3) # stopped this at about 7G of RAM

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


Re: [sage-support] Why E.sha().an() = 0 and E.sha().an_numerical() = 1.0 ?

2013-10-16 Thread Georgi Guninski
After debugging this I saw the problem.
In sha_tate.py:410
you consider the first derivative non-zero and use it
in computations, while in practice it is zero
(e-15 vs error_bound=e-25).

On Wed, Oct 16, 2013 at 10:56:27AM +0100, John Cremona wrote:
 We have theory that tells us that for curves of analytic rank 0 or 1,
 Sha is finite and while BSD is not completely proved for such curves,
 the formula it claims for #Sha is certainly rational -- and Sage does
 compute this exactly.  But for analytic rank 1 the analytic Sha is
 just the value predicted by BSD which is not known theoretically to be
 rational and can only be computed as a floating point approximation,
 for which it is most honest to leave as such.
 
 John Cremona
 
 On 16 October 2013 10:39, Georgi Guninski gunin...@guninski.com wrote:
  Why E.sha().an() = 0 and E.sha().an_numerical() = 1.0 ?
 
  On 5.11 on linux and on cloud.sagemath.com:
 
  sage: E=EllipticCurve(QQ,[0, 0, 1, -79, 
  342]);E.sha().an(),E.sha().an_numerical()
  (0, 1.00)
  #^ why different and 0 is integer ?
  sage: E.sha().bound()
  (0, 0)
 
  sage: type(E.sha().an())
  type 'sage.rings.integer.Integer'
  sage: E.rank(),E.analytic_rank()
  (5, 5)
 
  sage: E.conductor()
  19047851
 
  E.sha().an_padic(3) # stopped this at about 7G of RAM
 
  --
  You received this message because you are subscribed to the Google Groups 
  sage-support group.
  To unsubscribe from this group and stop receiving emails from it, send an 
  email to sage-support+unsubscr...@googlegroups.com.
  To post to this group, send email to sage-support@googlegroups.com.
  Visit this group at http://groups.google.com/group/sage-support.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/groups/opt_out.

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


Re: [sage-support] The results of some integration test.

2013-09-10 Thread Georgi Guninski
Appears to me diffs back: False not necessarily 
means wrong result.

For:
[23] diffs back: False
integrand: x*log(x + sqrt(x^2 + 1))*arctan(x)/sqrt(x^2 + 1)
antideriv: sqrt(x^2 + 1)*log(x + sqrt(x^2 + 1))*arctan(x) - x*arctan(x) - 
1/2*log(x + sqrt(x^2 + 1))^2 + 1/2*log(x^2 + 1)
maxima   : (sqrt(x^2 + 1)*log(x + sqrt(x^2 + 1)) - x)*arctan(x) + 1/2*log(x + 
sqrt(x^2 + 1))^2 - log(x + sqrt(x^2 + 1))*arcsinh(x) + 1/2*log(x^2 + 1)

Test:

sage: ex=x*log(x + sqrt(x^2 + 1))*arctan(x)/sqrt(x^2 + 
1);inte=integrate(ex,x);back=inte.derivative(x)
sage: t1=(ex-back).full_simplify()
sage: t1
((2*x^2 + 1)*arcsinh(x) - (2*x^2 + 1)*log(x + sqrt(x^2 + 1)) + 2*sqrt(x^2 + 
1)*(x*arcsinh(x) - x*log(x + sqrt(x^2 + 1/(2*x^3 + (2*x^2 + 1)*sqrt(x^2 + 
1) + 2*x)

sage: CC(t1(x=5))
-1.09303758073658e-16
sage: CC(t1(x=14.13))
0.000

According to Wolfram Alpha |t1| simplifies to 0:

http://www.wolframalpha.com/input/?i=%28%282*x^2+%2B+1%29*arcsinh%28x%29+-+%282*x^2+%2B+1%29*log%28x+%2B+sqrt%28x^2+%2B+1%29%29+%2B+2*sqrt%28x^2+%2B+1%29*%28x*arcsinh%28x%29+-+x*log%28x+%2B+sqrt%28x^2+%2B+1%29%29%29%29%2F%282*x^3+%2B+%282*x^2+%2B+1%29*sqrt%28x^2+%2B+1%29+%2B+2*x%29

Result:  0

This is modulo bugs in .full_simplify().


On Wed, Sep 04, 2013 at 10:01:07AM -0700, Peter Luschny wrote:
 Recently two integration test suites were discussed at sci.math.symbolic 
 [1], [2].
 
 I executed the tests with Sage and put the results on my webpage [3].
 Not all results are favorable for Sage. Maybe this is worth to be
 noted by some Sage developers.
 
 Peter
 
 [1] 
 https://groups.google.com/d/msg/sci.math.symbolic/UB0udwILOSw/msxc57stRM8J
 [2] 
 https://groups.google.com/d/msg/sci.math.symbolic/D9W45zQTY3U/nIxsBZ-4RasJ
 [3] http://luschny.de/math/quad/IntegralTestsSage.html
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/groups/opt_out.

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


Re: [sage-support] The results of some integration test.

2013-09-07 Thread Georgi Guninski
Interesting experiment.

Your methodology for diffs back assumes
correctly computing the derivative and correctly
comparing symbolic expressions and for the latter
counterexamples are known [1]

bool( sqrt((a+b)^2) == sqrt(a^2) + sqrt(b^2) )
True

btw, I get:
'sage.rings.complex_interval.ComplexIntervalFieldElement' object has no 
attribute 'cot'

when trying your |check| on this:

-arctan(cot(pi*x))/pi + 1/2 #fractional part of x

[1] http://comments.gmane.org/gmane.comp.mathematics.sage.support/32115

On Wed, Sep 04, 2013 at 10:01:07AM -0700, Peter Luschny wrote:
 Recently two integration test suites were discussed at sci.math.symbolic 
 [1], [2].
 
 I executed the tests with Sage and put the results on my webpage [3].
 Not all results are favorable for Sage. Maybe this is worth to be
 noted by some Sage developers.
 
 Peter
 
 [1] 
 https://groups.google.com/d/msg/sci.math.symbolic/UB0udwILOSw/msxc57stRM8J
 [2] 
 https://groups.google.com/d/msg/sci.math.symbolic/D9W45zQTY3U/nIxsBZ-4RasJ
 [3] http://luschny.de/math/quad/IntegralTestsSage.html
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/groups/opt_out.

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


[sage-support] Re: Definite integral disagrees with Maple and mathworld

2013-08-26 Thread Georgi Guninski
Thank you for the note.

You claim: For \int_{1/3}^1 fra(1/x) dx Maple returns ln 3 - 1/3.

I can't reproduce this on Maple 13 on linux,
here is a session:

 fra1:=x-1/2+I/(2*Pi)*log(-exp(-2*Pi*I*x)):
 ii:=int(fra1(1/x),x=1/3..1);
  ii := - 5/6 + ln(3)



What about this:

 i2:=int(cos(x)*fra1(1/x),x=1 .. infinity);
 i2 := -Ci(1)

Wolfram Alpha (and possibly Mathematice) return the same:
http://www.wolframalpha.com/input/?i=integral+from+1+to+infinity+of+cos%28x%29*frac%281%2Fx%29

 i3:=int(sin(x)*fra1(1/x),x=1 .. infinity);
i3 := -1/2 I Ei(1, -I) + 1/2 I Ei(1, I)

On Mon, Aug 26, 2013 at 09:56:41PM +0100, James Davenport wrote:
 On Sun, 25 Aug 2013, Georgi Guninski wrote:
 
 Well, after full simplification fra1() no longer equals {x}:
 Like Maple's simplify(,symbolic).
 See attached for some thoughts.
 
 James Davenport


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


[sage-support] Re: Definite integral disagrees with Maple and mathworld

2013-08-25 Thread Georgi Guninski
Well, after full simplification fra1() no longer equals {x}:

sage: ex=fra1(x).full_simplify()
sage: ex
x

It is more interesting to me how Maple finds the correct integral with {x}.

Played with int_a^b f(x,{x}) =? int_a^b f(x,fra1(x))

Whenever Maple could compute the definite integral, it equals
Wolfram alpha integral of f(x,frac(x)) [there are similar other
definitions of {x}]

Is it sound to expect that this approach for integrals of {x} works?
(Possibly $\mod 1$).

This can be generalized to converting sums to definite integrals:

floor(x) = int1(x) = x - fra1(x).

Modulo branches, \sum_{x=a}^b f(x) = \int_a^b f(int1(x)) dx

Maple again computed correctly several infinite complicated sums via
\int.

So far have only one failing? testcase in Maple - can't find the
definite integral, found the indefinite integral but the
limits are undefined.

--
Georgi


On Sat, Aug 24, 2013 at 03:07:14PM -0700, JamesHDavenport wrote:
 Well, the derivative of the fractional part is indeed 1 where it is 
 defined, as 
 lim((fra(x+eps)-fra(x))/eps)=lim(eps/eps)=1 unless adding eps crosses a 
 boundary,
 which it won't do for eps small enough.
 Maxima (5.29) returns (4 pi log 2 + i log(-1) +pi)/(4 pi).
 Depending on the value of log(-1), this is either  log(2) or log(2)+1/2,
 which I must confess I don't understand.
 I conjecture Sage is getting log(2) from taking the conventional  
 log(-1)=i pi in Maxima's result.
 
 On Saturday, 24 August 2013 12:59:41 UTC+1, Georgi Guninski wrote:
 
  Don't claim this is a bug, but don't understand this. 
 
  Define {x} the fractional part of x by (source mathworld): 
 
  def fra1(x):   
   
  fractional part 
   
  return 1/2+I/(2*pi)*log(-exp(-2*pi*I*x)) 
 
 
  sage: var('x') 
  x 
  sage: ii=integrate(fra1(1/x),x,1/2,1);ii 
  log(2) 
 
  According to Maple and mathworld this integral equals 
  -1/2 + ln(2) 
 
  Part of the problem is log() is multivalued, but I suppose 
  for all branches of log(), fra1() should be correct $\mod 1$, 
  yet the result is not correct $\mod 1$. 
 
  Probably this is related: 
  sage: diff(fra1(x),x) 
  1 
 
  Why so? 
 
  

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


[sage-support] Definite integral disagrees with Maple and mathworld

2013-08-24 Thread Georgi Guninski
Don't claim this is a bug, but don't understand this.

Define {x} the fractional part of x by (source mathworld):

def fra1(x):  

fractional part

return 1/2+I/(2*pi)*log(-exp(-2*pi*I*x))


sage: var('x')
x
sage: ii=integrate(fra1(1/x),x,1/2,1);ii
log(2)

According to Maple and mathworld this integral equals
-1/2 + ln(2)

Part of the problem is log() is multivalued, but I suppose
for all branches of log(), fra1() should be correct $\mod 1$,
yet the result is not correct $\mod 1$.

Probably this is related:
sage: diff(fra1(x),x)
1

Why so?

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


Re: [sage-support] An error occurred while running Simon's 2-descent program

2013-08-05 Thread Georgi Guninski
The same curve is strange over QQ[sqrt(5)]:

sage: 
Z1.Z=ZZ[];Nf.v=NumberField(Z**2-5);E=EllipticCurve(Nf,[-256,0]);ge=E.gens();[i.order()
 for i in ge]
[+Infinity, +Infinity]
sage: ge
[(1600*v + 3200 : -128000*v - 256000 : 1),
 (-1600*v + 3200 : -128000*v + 256000 : 1)]
sage: (ge[0]-ge[1]).order()
2
E.rank()
ValueError: There is insufficient data to determine the rank - 2-descent gave 
lower bound 1 and upper bound 3

Is it true that the rank is at least 2 since there at least two gens of
infinite order?


Another one:

sage: 
Z1.Z=ZZ[];Nf.v=NumberField(Z**2-5);E=EllipticCurve(Nf,[-256,0]);ge=E.gens();[i.order()
 for i in ge]
[+Infinity, +Infinity, +Infinity, +Infinity]
sage: E.rank()
ValueError: There is insufficient data to determine the rank - 2-descent gave 
lower bound 1 and upper bound 3
sage: ge

[(8*v + 8 : -32*v - 32 : 1),
 (16*v + 32 : -128*v - 256 : 1),
 (-8*v + 8 : -32*v + 32 : 1),
 (-16*v + 32 : -128*v + 256 : 1)]
sage: (ge[0]+ge[1]).order()
2




On Sun, Aug 04, 2013 at 02:54:32PM +0100, John Cremona wrote:
 On 4 August 2013 13:43, Georgi Guninski gunin...@guninski.com wrote:
  Not sure what exactly deprecated is, but IMO don't ditch it.
 
  Maybe warn once or every time.
 
 
 What I meant was this.  For a long time E.gens() was NotImplemented
 over number fields, and the only way to get information about possible
 generators was to (know what youwere doing and) run
 E.simon_two_descent().  Then someone observed that in cases where
 E.simon_two_descent() does actually return equal lower and upper
 bounds for the rank, with that number of generators, then E.gens()
 should be able to return an actually correct set of generators.
 Instead, it seems to return whatever generators E.simon_two_descent()
 has been able to find (possibly none) even if the number of generators
 thus returned is strictly less than the rank upper bound computed. And
 *that* is misleading, even if documented.
 
 Another little feature is that simon_two_descent (or at least the
 underlying script) can increase the lower rank bound by 1 in line with
 the (in general not proved) parity conjecture, so the number of
 generators returned is then 1 less than the rank lower bound.  I think
 that the wrapping code undoes this.
 
 John
 

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




Re: [sage-support] An error occurred while running Simon's 2-descent program

2013-08-04 Thread Georgi Guninski
Not sure what exactly deprecated is, but IMO don't ditch it.

Maybe warn once or every time.


On Sat, Aug 03, 2013 at 03:54:04PM +0100, John Cremona wrote:
 This looks like a bug to me, but note that if you replace the defining
 polynomial for the field by Z**2+2 then it works fine: it finds lower
 and upper bounds for the rank of 0 and 2, using E.simon_two_descent()
 directly, so E.gens() returns [].  Please note that the documentation
 here is suitable cautious and only says that E.gens() returns some
 generators of E, and in this case some=none.
 
 I can confirm that using the gp directly also results in this error,
 so it is not a problem with the Sage interface.
 
 There are at least 5 open tickets on trac concerning this gp script.
 I personally think that the function E.gens() (for elliptic curves
 over number fields) should be deprecated until some of these things
 are fixed.  I'm sure that in many cases people run that functions
 without reading the docstring carefully and assume that (when it works
 without crashing) the output is proved to be a full set of generators,
 of size equal to the proved rank and this is *not the case*.
 
 John Cremona
 

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




[sage-support] An error occurred while running Simon's 2-descent program

2013-08-03 Thread Georgi Guninski
Is this normal in 5.10?

sage: 
Z1.Z=ZZ[];Nf.v=NumberField(Z**2+800);E=EllipticCurve(Nf,[-256,0]);E.gens()

RuntimeError
...
  *** _*=_: impossible inverse modulo: Mod(0, 5).
An error occurred while running Simon's 2-descent program

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




Re: [sage-support] Re: Disturbing Equality (from askSAGE)

2013-08-01 Thread Georgi Guninski
probably this is the same:
(rhs - lhs).full_simplify()
returns zero for wrong stuff.


On Thu, Aug 01, 2013 at 12:11:06PM +0100, John Cremona wrote:
 On 1 August 2013 11:10, chris wuthrich christian.wuthr...@gmail.com wrote:
 
 
  No - because sqrt is multivalued, the answer can be, and in this case is,
  multivalued: sometimes true and sometimes false. This isn't desperately
  helpful, or course, and can be cast in other ways in terms of the defect
 
  If a boolean is sometimes true and sometimes false it is false and that is
  what I want sage to give back. Sage does not have multi-valued booleans I
  believe.
 
 I mostly agree, but in the following:
 
 sage: var('a b')
 (a, b)
 sage: bool(a==a)
 True
 sage: bool(a==a+1)
 False
 sage: bool(a==a*a)
 False  # bad?  it is True for a=0,1
 sage: bool(b*a==a*b)
 True
 sage: bool((a+b)^2==a^2+2*a*b+b^2)
 True
 sage: bool(sqrt(a)^2==a)
 True #bad? is is False for all a0
 
 I don't like seeing True unless the expression is a tautology, i.e. an
 identity, and I don't like seeing False unless it is always false (the
 negation of a tautology.  This is a different questions from the one
 about branches of sqrt.
 
 I try to avoid using symbolic expressions at all costs because of
 things like this.  After setting x = a==a+1   os that x has type
 sage.symbolic.expression.Expression we have bool(x) is False, but I
 don't know how bool(x) is evaluated.  The documentation says that
 bool(x) returns False because x is not always True, but
 bool(x.negation()) is True even though x.negation() is 'a != a^2'
 which is *not* always True.  So that is surely a bug, anyway.
 
 John
 
 
 
  --
  You received this message because you are subscribed to the Google Groups
  sage-support group.
  To unsubscribe from this group and stop receiving emails from it, send an
  email to sage-support+unsubscr...@googlegroups.com.
  To post to this group, send email to sage-support@googlegroups.com.
  Visit this group at http://groups.google.com/group/sage-support.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/groups/opt_out.

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




Re: [sage-support] Re: Disturbing Equality (from askSAGE)

2013-08-01 Thread Georgi Guninski
On Thu, Aug 01, 2013 at 05:32:29PM +0300, Georgi Guninski wrote:
 probably this is the same:
 (rhs - lhs).full_simplify()
 returns zero for wrong stuff.
 


.full_simplify() appears better than bool:
sage: ex=a*a-a
sage: ex.full_simplify()
a^2 - a
sage: (sqrt(a)^2-a).full_simplify()
0

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




[sage-support] Why in number fields |a.gcd(a) = 1|?

2013-07-31 Thread Georgi Guninski
Is this normal?

sage: Z1.Z=ZZ[];Nf.W=NumberField(Z**2+1);a=W+4;a.gcd(a)
1

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




[sage-support] Some scary gcc/g++ warnings after building from source

2013-07-05 Thread Georgi Guninski
$find . -iname *.log -exec egrep 'may be used uninitialized|referenced 
before|array bounds' {} \; | grep -v '\-W' /tmp/log1
$wc -l /tmp/log1
2180 /tmp/log1

Typical warnings:
m4ri/ple_russian.c:74: warning: array subscript is above array bounds

warning: sage/schemes/elliptic_curves/descent_two_isogeny.pyx:1212:24: local 
variable 'd_prime_mpz' referenced before assignment

lib/matplotlib/delaunay/VoronoiDiagramGenerator.cpp:923: warning: 
‘newintstar.Point::y’ may be used uninitialized in this function

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




Re: [sage-support] How to define L-series?

2013-07-04 Thread Georgi Guninski
Currently you need to load eulerprod.py (search for it), maybe from here:

http://purplesage.googlecode.com/hg-history/6bac823fb2ef13c9c602203591587049acfe3863/psage/lseries/eulerprod.py

This works for me:

sage: load eulerprod.py
sage: Z1.Z=ZZ[]
sage: Nf.v=NumberField(Z**2+1)
sage: L=LSeries(Nf)
sage: L
Dedekind Zeta function of Number Field in v with defining polynomial Z^2 + 1
sage: L(1/2+I)
0.30267579065793677996494810309568478883734318314751678434144802974897426353244279452499
 - 
0.517840900734412719155534258211294840216830050895051536044014429256591893818783220651514849*I

On Sat, Jun 29, 2013 at 04:47:06PM -0700, Adrián Barquero wrote:
 Dear All,
 
 I was trying to define Dirichlet L-functions in SAGE, and while looking 
 online for how to actually do it, I found the following tutorial from SAGE 
 Days 33 
 
 http://wiki.sagemath.org/days33/lfunction/tutorial
 
 In that tutorial it is described how to define different types of L-series, 
 for example Dedekind zeta functions, Dirichlet L-functions and L-functions 
 of Elliptic Curves by using the method LSeries().
 
 Nevertheless, when I try to run the method, for example to define the 
 Dirichlet L-function attached to some Dirichlet character, I get the error 
 message 
 
 NameError: name 'LSeries' is not defined
 
 Thus, I would like to ask if you can help me identify what it is that I'm 
 doing wrong, or how to define Dirichlet L-functions in SAGE.
 
 PS: The version of SAGE that I have installed in my computer is Version 
 5.3-OSX-64bit-10.6  (5.3-OSX-64bit-10.6), but I also tried running the same 
 code online and it didn't work either.
 
 Thank you very much for your help.
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/groups/opt_out.
 
 

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




[sage-support] Trick for solving differential equation with real()?

2013-07-04 Thread Georgi Guninski
For $x$ real I have a real function $F(x)$ (equal to a function I know) 
and a differential
equation $G$ with some complex functions for which $\Re(G)=0$
and the imaginary part doesn't necessarily vanish.

desolve (even with contrib_ode=True) fails to solve real(G),F(x),
though it solves  G,F(x) and when substituted the solution vanishes
(including the imaginary part). The solution has indefinite integrals
which I suppose are hopeless to solve.
Using assumptions, the solution has realpart and imagpart.

1. Is there some trick/other CAS to solve only for real()?
2. Can I numerically verify that the real part of the solution 
equals the known F(x) (this might not hold)?

Maple 13 claims to solve it with real(), but I don't get numerical
support for the solution (assuming have done it correctly).

Have numerical support that the differential equation holds for
the known function.

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




[sage-support] Can I display |implicit_plot| as a square no matter of the ranges?

2013-06-15 Thread Georgi Guninski
Basically I am doing:

P=implicit_plot(F,(0,1),(0,1000))

The result is a very thin rectangle extremely hard to interpret
and I want it displayed as a square or close to square.
P.show(figsize=[10,5]) doesn't seem to work?

Can I display the above example as a square plot?

Know that can use  x=(0,1000) and compute F(x/1000,y), 
but this screws the labelling of x.

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




Re: [sage-support] Re: Can I display |implicit_plot| as a square no matter of the ranges?

2013-06-15 Thread Georgi Guninski
On Sat, Jun 15, 2013 at 04:19:04AM -0700, P Purkayastha wrote:
 Depending on your plot you might have to use aspect_ratio=1/1000. You may 
 also try aspect_ratio='automatic'.


This works, thank you.

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




[sage-support] Why in .sage |try: Nf.v=NumberField(Z**2 -D)| fails with syntax error but works on new line ?

2013-06-08 Thread Georgi Guninski
This fails with syntax error, but works if Nf.v is on new line:

K.Z=ZZ[]
for D in [ 1 .. 20]:
try:  Nf.v=NumberField(Z**2-D)
except Exception,e:
print e


Basically |try:  stuff()| appears to work.

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




Re: [sage-support] Segmentation fault in Matrix(QQ).rank()

2013-04-12 Thread Georgi Guninski
i have SEGV with some matrices, so you are not the only one.

On Thu, Apr 11, 2013 at 10:42:36AM -0700, Sure wrote:
 Got sigsegv calculating rank of 80 x 79 dense matrix over Rational Field.
 
   File matrix_rational_dense.pyx, line 2353, in 
 sage.matrix.matrix_rational_dense.Matrix_rational_dense.rank 
 (sage/matrix/matrix_rational_dense.c:22283)
   File matrix_integer_dense.pyx, line 3216, in 
 sage.matrix.matrix_integer_dense.Matrix_integer_dense.rank 
 (sage/matrix/matrix_integer_dense.c:25776)
   File matrix_integer_dense.pyx, line 3238, in 
 sage.matrix.matrix_integer_dense.Matrix_integer_dense._rank_modp 
 (sage/matrix/matrix_integer_dense.c:26097)
   File matrix_modn_dense_template.pxi, line 2257, in 
 sage.matrix.matrix_modn_dense_double.Matrix_modn_dense_template.rank 
 (sage/matrix/matrix_modn_dense_double.cpp:12948)
   File matrix_modn_dense_template.pxi, line 244, in 
 sage.matrix.matrix_modn_dense_double.linbox_rank 
 (sage/matrix/matrix_modn_dense_double.cpp:4446)
 RuntimeError: Segmentation fault
 
 
 System: debian x64 testing/unstable
 CPU: 2.4 GHz Intel E6600 (2 cores), 2GB RAM, 64GB swap
 Version: 'Sage Version 5.8, Release Date: 2013-03-15' from binary
 
 Sorry, don't know how to put save file m.sobj here, cannot paste the whole 
 matrix itself from m.str() here, so posting link to logfile:
   http://yadi.sk/d/1igWnkOr3zBiS
 
 To reproduce bug, after creating matrix m, call m.rank()
 
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.

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




Re: [sage-support] Potential Bug in show() for graphs.

2013-04-01 Thread Georgi Guninski
Don't know if this is a bug, looks like edges overlap.

H.show(layout=circular)

displays two triangles.


On Sun, Mar 31, 2013 at 07:29:47PM -0700, pong wrote:
 Sage 5.8
 
 G = graphs.CompleteBipartiteGraph(3,3); H=G.complement(); H.show()
 
 instead of two triangles, one sees two chains each of length 2. However, 
 H.edges() shows
 
 [(0, 1, None), (0, 2, None), (1, 2, None), (3, 4, None), (3, 5, None),
 (4, 5, None)]
 
 which is the correct graph so perhaps something wrong with show()? If 
 someone can confirm that, I will open a ticket.
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.
 
 

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




[sage-support] Very large error in |mpmath.secondzeta|

2013-03-29 Thread Georgi Guninski
would prefer exception to error larger than the result.

5.8 binary download.

sage: mpmath.mp.dps=80
sage: vv=mpmath.secondzeta(1.1 + 500 * mpmath.j , error=True, verbose=True);vv

((-6.7963605095409261064637293521016145345650205370133415176537666347625097842878348e+93
 + 
1.292309138826356433310945238433264546437877717569122942321973238752773459840567e+94j),
 
1.668739871813211001871110707944962589533362908091134976521126256091607661254e+188)

e+188 is the error.

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




[sage-support] limit() causes Stack overflow. Jumping to the outermost toplevel prompt

2013-01-18 Thread Georgi Guninski
n=var('n')
a=log(-1/3125*((-1/2*sqrt(5) + 1/2)^n - (1/2*sqrt(5) + 
1/2)^n)^9*sqrt(5))/log(-1/5*((-1/2*sqrt(5) + 1/2)^(8*n) - (1/2*sqrt(5) + 
1/2)^(8*n))*((-1/2*sqrt(5) + 1/2)^n - (1/2*sqrt(5) + 1/2)^n) - 
1/5*((-1/2*sqrt(5) + 1/2)^(9*n) - (1/2*sqrt(5) + 1/2)^(9*n))*sqrt(5))
limit(a,n=oo)

many
;;; Stack overflow.
;;; Jumping to the outermost toplevel prompt
;;;
Segmentation fault  sage-ipython $@ -i

sagenb.org doesn't return anything for the limit

sage 5.5 binary download on ubuntu 10.04

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Why 5*x*(x+3*y) is not squarefree?

2012-12-13 Thread Georgi Guninski
Why 5*x*(x+3*y) is not squarefree?

sage: Kxy.x,y=QQ[]
sage: p=5*x*(x+3*y)
sage: p.is_squarefree()
False
sage: factor(p)
(5) * x * (x + 3*y)

Why it is isn't squarefree?

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] solving Diophantine equations in Sage

2012-12-08 Thread Georgi Guninski
On Sat, Dec 08, 2012 at 05:46:00PM +, Robert Dodier wrote:
 Hello, is there a way to solve Diophantine equations in Sage? If not a
 general method, perhaps at least some special cases.
 
 There is some interest in solving such equations in Maxima -- I am
 daydreaming about porting whatever implementation Sage has. Is there a
 generally-accepted more-or-less best method these days? (Whether it is
 implemented in Sage or not.)
 
 There is this web page, http://www.alpertron.com.ar/METHODS.HTM, which
 describes a method, and this one, http://www.alpertron.com.ar/JQUAD.HTM,
 which has a calculator. Would anyone care to comment on the suitability
 of either one as the basis for an implementation? Pointers to any other
 resources would be interesting.
 
 best
 
 Robert Dodier



pari/gp which is included in sage can solve the special case
of Thue equations.

In pari console:
th=thueinit(x^5-2,1);\\x^5-2*y^5, ,1 is for unconditional result
t=thue(th,65)\\x^5-2*y^5=65
%7 = [[1, -2]]


If you want to work from sage the above example is:
sage: AA.x=QQ[]
sage: th=gp.thueinit(x^5-2,1)
sage: gp.thue(th,65)
[[1, -2]]

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Solve system of non linear equations

2012-12-08 Thread Georgi Guninski
On Sat, Dec 08, 2012 at 11:44:19AM +0530, Santanu Sarkar wrote:
 Dear all,
   I have a system of non linear equations over GF(2). How to solve
 them in Sage?


If you need to solve large nonlinear systems over GF(2) and don't
insist on using sage I suspect a better choice is to convert
them to conjunctive normal form (CNF) and then use state of the
art SAT solver like lingeling/cryptominisat.

There are sage programs for converting ANF to CNF, don't know if
they are in vanilla sage.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: sage disagrees with a paper about strong product of graphs

2012-12-05 Thread Georgi Guninski
On Wed, Dec 05, 2012 at 10:45:28AM +0100, Nathann Cohen wrote:
 Hellooo !!!
 
  Don't know if this is a bug, but sage numerically disagrees with
  a paper about strong product of graphs.
 
 I would trust Sage in that case :-D
 
  I implemented |strong_product| and don't get the same products as sage
  (C_4 bound passed, the Kneser one didn't pass with my code).
 
  What is the drama?
 
  (Didn't audit sage's strong_product).
 
 Well, did you try Sage's strong_product method, or did you write your own ?
 

The sage session i gave was on vanilla sage, didn't include results from
my implementation.

sage is contradicting at least one more paper on strong products FYI.

 Anyway, Sage can compute chromatic numbers in many different ways (see
 g.chromatic_number? ). I would say that if they all answer the same
 result then the problem lies in the product, otherwise it (obviously)
 lies in the coloring functions :-)
 
 Good luck !
 
 Nathann

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Re: sage disagrees with a paper about strong product of graphs

2012-12-05 Thread Georgi Guninski
On Wed, Dec 05, 2012 at 11:27:21AM +0100, Nathann Cohen wrote:
  The sage session i gave was on vanilla sage, didn't include results from
  my implementation.
 
 Good. There's been a patch on this function very recently :
 
 http://trac.sagemath.org/sage_trac/ticket/13699
 
 Is your version of Sage more recent than that ?
 

I am using sage 5.4 binary download so i suppose I don't have this patch.

 If so, as it looks like there's still a bug, could you attempt to identify
 what exactly the bug is (and possibly write the patch too) ? :-P
 
 Have fn !!!
 
 Nathann
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To post to this group, send email to sage-support@googlegroups.com.
 To unsubscribe from this group, send email to 
 sage-support+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support?hl=en.
 
 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Re: SIGABRT in Graph.clique_number() and assertion in cliquer

2012-12-04 Thread Georgi Guninski
On Mon, Dec 03, 2012 at 08:49:10AM -0800, Nathann Cohen wrote:
 http://trac.sagemath.org/sage_trac/ticket/10756
 
 T_T
 
 Of course I only did it for clique_maximum() T_T
 
 Well, Georgi... Weren't you looking for an easy patch to write ? :-P
 
 Nathann
 

I can write the patch, it is oneliner.

What is the procedure?

 On Monday, December 3, 2012 3:16:09 PM UTC+1, Jason Grout wrote:
 
  On 12/1/12 8:30 AM, Georgi Guninski wrote: 
   On sagenb.org don't get any output, don't know how to interpret this. 
 
  That happens a lot of times when there was a crash, so it's consistent 
  with the error you saw. 
 
  Thanks, 
 
  Jason 
 
 
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To post to this group, send email to sage-support@googlegroups.com.
 To unsubscribe from this group, send email to 
 sage-support+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support?hl=en.
 
 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] sage disagrees with a paper about strong product of graphs

2012-12-04 Thread Georgi Guninski
Don't know if this is a bug, but sage numerically disagrees with
a paper about strong product of graphs.

The paper is:
Strong products of Kneser graphs, Sandi Klavˇar and Uroˇ Milutinovi ́ 
at: http://www.fmf.uni-lj.si/~klavzar/preprints/Kneser.pdf

Let * denote the strong product.
p.4 theorem 1:
If G has at least one edge then
\chi (G * K_n) = \chi(G) + 2n - 2

for G= C_4 and n = 3 the lower bound is 6.
In sage 5.4:
sage: C4=graphs.CycleGraph(4);K=graphs.CompleteGraph(3)
sage: G=C4.strong_product(K)
sage: G.chromatic_number()
5
sage: F=K.strong_product(C4)
sage: F.chromatic_number()
5

So sage's \chi is lower than the lower bound.

There is exact bound involving Kneser graph.

I implemented |strong_product| and don't get the same products as sage
(C_4 bound passed, the Kneser one didn't pass with my code).

What is the drama?

(Didn't audit sage's strong_product).

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] SIGABRT in Graph.clique_number() and assertion in cliquer

2012-12-01 Thread Georgi Guninski
for g in graphs(4):  g.complement().line_graph().complement().clique_number()


cliquer file graph.c: line 31: assertion failed: (n0)

Unhandled SIGABRT: An abort() occurred in Sage.
This probably occurred because a *compiled* component of Sage has a bug

On sagenb.org don't get any output, don't know how to interpret this.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Floating point exception when factoring over QQ['x,y']

2012-11-28 Thread Georgi Guninski
Probably the problem is in Singular.

There are at least 3 issues with Singular i reported, won't someone
contact them?

i tried to register on their forum but didn't get approved.

On Wed, Nov 28, 2012 at 02:59:53AM -0800, luisfe wrote:
 I can confirm the problem with sage 5.4, I cannot reproduce it with sage 5.3

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Floating point exception when factoring over QQ['x,y']

2012-11-26 Thread Georgi Guninski
Floating point exception when factoring over QQ['x,y']

Can reproduce this on sagenb.org so probably this time
the fault are not my cpus:


sage: K.x,y=QQ[]
sage: pp=6*x^5*y + 15*x^4*y^2 + 20*x^3*y^3 + 15*x^2*y^4 + 6*x*y^5 - 12*x^5 - 
60*x^4*y - 120*x^3*y^2 - 120*x^2*y^3 - 60*x*y^4 - 12*y^5 + 60*x^4 + 240*x^3*y + 
360*x^2*y^2 + 240*x*y^3 + 60*y^4 - 160*x^3 - 480*x^2*y - 480*x*y^2 - 160*y^3 + 
240*x^2 + 480*x*y + 240*y^2 - 192*x - 192*y + 64
sage: factor(pp)

...multi_polynomial_libsingular.so in 
sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.factor
 (sage/rings/polynomial/multi_polynomial_libsingular.cpp:25414)()

RuntimeError: Floating point exception

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Wrong comparision Integer mpmath.mpf

2012-11-13 Thread Georgi Guninski
This works on sagenb.org too.

Integer  mpmath.mpf returns True 
while
Integer - mpmath.mpf is negative



sage: import mpmath
sage: mpmath.mp.pretty=True
sage: n=100
sage: a,b=prime_pi(n),mpmath.li(n)
sage: (a,b,type(a),type(b))
(25, 30.1261415840796, type 'sage.rings.integer.Integer', type 
'sage.libs.mpmath.ext_main.mpf')
sage: (a  b, a == b, a  b)
(False, False, True)
sage: a-b
-5.12614158407963
sage: a=RR(a)
sage: (a  b, a == b, a  b)
(False, False, True)
sage: a=mpmath.mpf(a)
sage: (a  b, a == b, a  b)
(True, False, False)
sage:
sage: a,b
(25.0, 30.1261415840796)

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] SEGV in libatlas.so

2012-11-12 Thread Georgi Guninski
Today tried binary sage 5.4 on ubuntu 10.04.

Both testcases don't SEGV on it.

If you fixed it, thanks :)


On Fri, Oct 12, 2012 at 05:21:20PM +0300, Georgi Guninski wrote:
 Simpler testcase:
 
 g=graphs.CycleGraph(44);m=g.adjacency_matrix()
 m^7
 
 On Fri, Oct 12, 2012 at 05:03:49PM +0300, Georgi Guninski wrote:
  g=DiGraph('kO??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???W???')
  m=g.adjacency_matrix()
  m
  m^7
  
  Unhandled SIGSEGV:
  local/lib/libatlas.so(+0x87d4d)[0x7fdb41c8ed4d]
  
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To post to this group, send email to sage-support@googlegroups.com.
 To unsubscribe from this group, send email to 
 sage-support+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] RuntimeError: Error in Singular function call 'genus'

2012-11-10 Thread Georgi Guninski
5.3 on ubuntu 10.04 and 12.04 (sagenb.org doesn't appear to work to
test it there).

sage: pr.v,u=QQ[]
sage: q= 625*v^12*u^2 + 625*v^10*u^4 - 50*v^10*u^2 + 2450*v^8*u^4 - 100*v^9*u^2 
- 100*v^7*u^4 + 625*v^10 - 5974*v^8*u^2 + 3601*v^6*u^4 - 596*v^7*u^2 - 
196*v^5*u^4 + 2450*v^8 - 10798*v^6*u^2 + 2356*v^4*u^4 - 100*v^7 - 1012*v^5*u^2 
- 96*v^3*u^4 + 3601*v^6 - 6447*v^4*u^2 + 576*v^2*u^4 - 196*v^5 - 612*v^3*u^2 + 
2356*v^4 - 348*v^2*u^2 - 96*v^3 - 96*v*u^2 + 576*v^2 + 576*u^2
sage: C=Curve(q);C.genus()


RuntimeError: Error in Singular function call 'genus':
 exponent must be non-negative
 error occurred in or before normal.lib::deltaLoc line 2705: `  poly 
g=f+var(1)^mu+var(2)^mu;  //to obtain a convenient Newton-polygon`
 expected poly-expression. type 'help poly;'
 leaving normal.lib::deltaLoc
 leaving normal.lib::deltaLoc

sage: C
Affine Curve over Rational Field defined by 625*v^12*u^2 + 625*v^10*u^4 - 
50*v^10*u^2 + 2450*v^8*u^4 - 100*v^9*u^2 - 100*v^7*u^4 + 625*v^10 - 
5974*v^8*u^2 + 3601*v^6*u^4 - 596*v^7*u^2 - 196*v^5*u^4 + 2450*v^8 - 
10798*v^6*u^2 + 2356*v^4*u^4 - 100*v^7 - 1012*v^5*u^2 - 96*v^3*u^4 + 3601*v^6 - 
6447*v^4*u^2 + 576*v^2*u^4 - 196*v^5 - 612*v^3*u^2 + 2356*v^4 - 348*v^2*u^2 - 
96*v^3 - 96*v*u^2 + 576*v^2 + 576*u^2 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Re: Strange results in DiGraph.girth()

2012-10-31 Thread Georgi Guninski
If you want to play with digraphs attached is program for generating
digraph diregular cages of any girth and degree.


On Wed, Oct 31, 2012 at 10:53:56AM +0100, Nathann Cohen wrote:
  Some benchmarks on moderate cages (4324 vertices, girth 19) suggest i
   probably will lose if you implement it correctly ;)
 
 Well, for those things we may be happy to have a good C implementation. I
 will try to do that quickly. How long is it, if I may ask, for such graphs
 ? Could you also give me one such instance, so that I may compare ?
 
 Nathann
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To post to this group, send email to sage-support@googlegroups.com.
 To unsubscribe from this group, send email to 
 sage-support+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support?hl=en.
 
 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.


def cycgr(n,r):
	
	cyclic digraph
	
	ed=[]
	for v in xrange(n):
		ed += [(v,(v+i)%n) for i in xrange(1,r+1)]
	g=DiGraph(ed)
	return g

def dicage(g,d):
	
	diregular cage of girth $g$ and in- and out-degrees $d$
	
	v=d*(g-1)+1 #this is minimal under a conjecture may safely be increased
	return cycgr(v,d)


gi=8
d=5
g=dicage(gi,d)
m=g.adjacency_matrix()
for i in range(2,gi+1):
	print i,(m**i).trace()

print uniq(g.out_degree()),uniq(g.in_degree())


Re: [sage-support] Re: Strange results in DiGraph.girth()

2012-10-29 Thread Georgi Guninski
On Sun, Oct 28, 2012 at 07:17:59AM -0700, Nathann Cohen wrote:
 
 
  Well, the documentation says 
  Computes the girth of the graph. For directed graphs, computes the 
  girth of the undirected graph. 
 
  So, that's what you are getting. :) 
 
 
 By the way, perhaps it is a bad idea to have this behaviour... What do you 
 think ?? 
 
 Nathann


I can't argue with the documentation :)

Looks to me this is easy to fix if this is correct:

For girth digraphs appear much easier than undirected graphs to me.
If M is the adjacency matrix of G, the girth is the smallest k
s.t. (M^k).trace != 0. 1 is a loop, 2 is a two cycle which appears
a valid girth for a digraph.

If this is sane I can code it.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Re: Strange results in DiGraph.girth()

2012-10-29 Thread Georgi Guninski
On Mon, Oct 29, 2012 at 02:35:47AM -0700, P Purkayastha wrote:
 
 I wonder if it is less computationally demanding to walk around the graph 
 than take powers of M, especially for large, but sparsely connected graphs.


May be you are right. Powers of the matrix appear easier to implement
IMHO. After some reading I don't think you can do better than
O(n^(3-epsilon)) because of odd cycles.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Re: Strange results in DiGraph.girth()

2012-10-29 Thread Georgi Guninski
On Mon, Oct 29, 2012 at 01:29:43PM +0100, Nathann Cohen wrote:
  May be you are right. Powers of the matrix appear easier to implement
  IMHO. After some reading I don't think you can do better than
  O(n^(3-epsilon)) because of odd cycles.
 
 Ahahaahah. Well, implement the Matrix version and I will implement the
 graph thing. We could be checking the results instead of thinking
 about them :-)
 
 Nathann


Some benchmarks on moderate cages (4324 vertices, girth 19) suggest i
 probably will lose if you implement it correctly ;)

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Strange results in DiGraph.girth()

2012-10-27 Thread Georgi Guninski
Got results with DiGraph.girth() which appear inconsistent to
me. girth() returns 3 and powers of the adjacency matrix suggest
there are no directed triangle cycles and couldn't s see a directed
triangle cycle on the plot of the digraph.

sage: GR=DiGraph('FWE@_WF@o?');M=GR.adjacency_matrix()
sage: GR.girth()
3
sage: (M^3).trace()
0
sage: GR
Digraph on 7 vertices

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] RuntimeError: Segmentation fault in Graph.subgraph_search()

2012-10-16 Thread Georgi Guninski
On Mon, Oct 15, 2012 at 10:20:14AM -0700, Nathann Cohen wrote:
 What is strange to me the SEGV is non-deterministic (different graphs 
 
  each time), which might be a sign of a deeper problem maybe not in your 
  code :) 
 
 
 Ahahaah. I do not doubt that the problem is in my code :-) 
 
 Nathann

I would recommend not continuing execution after SEGV.
If the memory is sufficiently screwed you might crash later...

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] SEGV in libatlas.so

2012-10-15 Thread Georgi Guninski
Here is some debug info.
(if i change 44 to 43 don't crash).

Searching for the top of stack returns this:
http://projects.scipy.org/scipy/ticket/1611
interp1d gives a Segmentation fault when 1. using kind='cubic' and if the 
original data-set is greater than 119 


g=graphs.CycleGraph(44);m=g.adjacency_matrix();m^7

Program received signal SIGSEGV, Segmentation fault.
0x7fffec15dd4d in ATL_dupMBmm0_8_0_b0 ()
   from 
/opt/sage/sage-5.3-linux-64bit-ubuntu_10.04.4_lts-x86_64-Linux/local/lib/libatlas.so
(gdb) x/i $pc
= 0x7fffec15dd4d ATL_dupMBmm0_8_0_b0+13: ldmxcsr -0x4(%rsp)
(gdb) p/x $rsp
$1 = 0x7fffb848
(gdb) bt
#0  0x7fffec15dd4d in ATL_dupMBmm0_8_0_b0 ()
   from 
/opt/sage/sage-5.3-linux-64bit-ubuntu_10.04.4_lts-x86_64-Linux/local/lib/libatlas.so
#1  0x7fffec1a8dac in ATL_dIBNBmm ()
   from 
/opt/sage/sage-5.3-linux-64bit-ubuntu_10.04.4_lts-x86_64-Linux/local/lib/libatlas.so
#2  0x7fffec1b2035 in ATL_dmmJIK2 ()
   from 
/opt/sage/sage-5.3-linux-64bit-ubuntu_10.04.4_lts-x86_64-Linux/local/lib/libatlas.so
#3  0x7fffec1b28ea in ATL_dmmJIK ()
   from 
/opt/sage/sage-5.3-linux-64bit-ubuntu_10.04.4_lts-x86_64-Linux/local/lib/libatlas.so
#4  0x7fffec1aa1a5 in ATL_dgemm ()


(gdb) info reg
rax0x7fffec15dd40   140737154243904
rbx0x2c 44
rcx0x4fdad0083733760
rdx0x24 36
rsi0x24 36
rdi0x8  8
rbp0x4fd4a000x4fd4a00
rsp0x7fffb848   0x7fffb848
r8 0x24 36
r9 0x4fd4a0083708416
r100x8  8
r110x24 36
r120x4fdad0083733760
r130x4fd0e8083693184
r140x8  8
r150x4fd0e8083693184
rip0x7fffec15dd4d   0x7fffec15dd4d ATL_dupMBmm0_8_0_b0+13
eflags 0x10206  [ PF IF RF ]
cs 0x33 51
ss 0x2b 43
ds 0x0  0
es 0x0  0
fs 0x0  0


$grep flags /proc/cpuinfo 
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov 
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm 
constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor 
ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm tpr_shadow vnmi 
flexpriority

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] SEGV in libatlas.so

2012-10-14 Thread Georgi Guninski
I am pretty sure all modern CPUs have a lot of bugs.

Don't have time to debug this bug.

Checked it on ubuntu 12.04 with binary sage and didn't crash,
so it is probably a feature. 12.04 made me install libgfortran3
and it is a different version from 10.04.

On Sat, Oct 13, 2012 at 06:25:16AM -0700, Dima Pasechnik wrote:
 
 
 On Saturday, 13 October 2012 20:58:46 UTC+8, Georgi Guninski wrote:
 
  On Sat, Oct 13, 2012 at 05:45:29AM -0700, Dima Pasechnik wrote: 
   
   
   On Saturday, 13 October 2012 19:26:17 UTC+8, Georgi Guninski wrote: 

On Fri, Oct 12, 2012 at 10:17:29AM -0700, kcrisman wrote: 
 What is the name of the binary (i.e., is it 64 or 32 bit, and so 
  forth)? 
 

It easy is to check if the problem is in my boxen - install ubuntu 
  10.04 
in 
a virtual machine, download the 64 bit binary from sagemath and 
run the testcases. 


   Not all x86_64 boxes are equal. Different models of x86_64 processors 
  have 
   different sets of commands, and VMs are even worse in this case, as we 
  saw 
   situations where not all the processor capabilities are allowed by the 
  VM, 
   but for the software it looks as if these capabilities are allowed... 
   
   
 
  So you are implying my two boxen (intel and amd) are all buggy so i 
  should compile from source on both? 
 
 
 buggy? I never said that. It just so happened that the binary you run on 
 them was built for 
 a slightly different architecture.
  
 
 
  I should have be warned before downloading the binary, please make 
  this statement explicit on the binary download page :))) 
 
 
 Well, Sage keeps shooting itself in the foot here. Few releases ago there 
 was a similar problem with OSX binaries :-(.
 
 It would help if you post specifications of your processors.
 That is, the output of 
 cat /proc/cpuinfo
 
  
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To post to this group, send email to sage-support@googlegroups.com.
 To unsubscribe from this group, send email to 
 sage-support+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support?hl=en.
 
 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Re: SEGV in libatlas.so

2012-10-14 Thread Georgi Guninski
i mean did anyone beside me tested the disputed testcases on any ubuntu
10.04?


On Sun, Oct 14, 2012 at 10:11:41PM +0800, P Purkayastha wrote:

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Re: SEGV in libatlas.so

2012-10-14 Thread Georgi Guninski
On Sun, Oct 14, 2012 at 05:11:54PM +0200, Jeroen Demeyer wrote:
 On 2012-10-14 15:54, Georgi Guninski wrote:
  I didn't understand did someone try it on 10.04 probably in VM?
 Yes, it was tested in Ubuntu 10.04, not in a VM.
 
 I just tested that binary again on that machine and both your testcases
 work.


ok, thank you.

the problem might be indeed in my boxen.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] SEGV in libatlas.so

2012-10-13 Thread Georgi Guninski
On Fri, Oct 12, 2012 at 10:17:29AM -0700, kcrisman wrote:
 What is the name of the binary (i.e., is it 64 or 32 bit, and so forth)?


The name of the directory is:

sage-5.3-linux-64bit-ubuntu_10.04.4_lts-x86_64-Linux

Tested it on a second box with the same binary and Ubuntu 10.04
and crashed again.

Doubt this is a hardware problem.

On both machines don't crash on sage 4.3.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] RuntimeError: Segmentation fault in Graph.subgraph_search()

2012-10-13 Thread Georgi Guninski
RuntimeError: Segmentation fault in Graph.subgraph_search()

Tested on binary 5.3 from sagemath on Ubuntu 10.04 and on
sagenb.org:  http://sagenb.org/home/pub/5036.

Many calls to Graph.subgraph_search() give Segmentation fault,
though on different graphst.

Here is a program that gives SEGV on usually different graphs:

def gra1():
f=[graphs.CompleteGraph(2),graphs.CompleteGraph(1), 2 * 
graphs.CompleteGraph(1)]
for k in xrange(1,8):
for g in graphs.nauty_geng(%s%k):
for h in f:
print 
'h=Graph(%s);g=Graph(%s)'%(h.sparse6_string(),g.sparse6_string())
aa=g.subgraph_search(h)


gra1()
...
h=Graph(:@);g=Graph(:DoN)
RuntimeError: Segmentation fault

On different runs $h$ and $g$ might be different.

On sagenb.org:
h=Graph(:@);g=Graph(:CwN)
Traceback (click to the left of this block for traceback)
...
RuntimeError: Segmentation fault




-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] RuntimeError: Segmentation fault in Graph.subgraph_search()

2012-10-13 Thread Georgi Guninski
Package nauty is not needed, attached is gra2() |for g in graphs(k)|


On Sat, Oct 13, 2012 at 09:59:56AM +0300, Georgi Guninski wrote:
 RuntimeError: Segmentation fault in Graph.subgraph_search()
 
 Tested on binary 5.3 from sagemath on Ubuntu 10.04 and on
 sagenb.org:  http://sagenb.org/home/pub/5036.
 
 Many calls to Graph.subgraph_search() give Segmentation fault,
 though on different graphst.
 
 Here is a program that gives SEGV on usually different graphs:
 
 def gra1():
   f=[graphs.CompleteGraph(2),graphs.CompleteGraph(1), 2 * 
 graphs.CompleteGraph(1)]
   for k in xrange(1,8):
   for g in graphs.nauty_geng(%s%k):
   for h in f:
   print 
 'h=Graph(%s);g=Graph(%s)'%(h.sparse6_string(),g.sparse6_string())
   aa=g.subgraph_search(h)
 
 
 gra1()
 ...
 h=Graph(:@);g=Graph(:DoN)
 RuntimeError: Segmentation fault
 
 On different runs $h$ and $g$ might be different.
 
 On sagenb.org:
 h=Graph(:@);g=Graph(:CwN)
 Traceback (click to the left of this block for traceback)
 ...
 RuntimeError: Segmentation fault
 
 
 
 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.


def gra1():
f=[graphs.CompleteGraph(2),graphs.CompleteGraph(1), 2 * 
graphs.CompleteGraph(1)]
for k in xrange(1,8):
for g in graphs.nauty_geng(%s%k):
for h in f:
print 
'h=Graph(%s);g=Graph(%s)'%(h.sparse6_string(),g.sparse6_string())
aa=g.subgraph_search(h)


def gra2():
f=[graphs.CompleteGraph(2),graphs.CompleteGraph(1), 2 * 
graphs.CompleteGraph(1)]
for k in xrange(1,8):
for g in graphs(k):
for h in f:
print 
'h=Graph(%s);g=Graph(%s)'%(h.sparse6_string(),g.sparse6_string())
aa=g.subgraph_search(h) 


Re: [sage-support] SEGV in libatlas.so

2012-10-13 Thread Georgi Guninski
On Fri, Oct 12, 2012 at 10:17:29AM -0700, kcrisman wrote:
 What is the name of the binary (i.e., is it 64 or 32 bit, and so forth)?


It easy is to check if the problem is in my boxen - install ubuntu 10.04 in
a virtual machine, download the 64 bit binary from sagemath and 
run the testcases.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] SEGV in libatlas.so

2012-10-13 Thread Georgi Guninski
On Sat, Oct 13, 2012 at 05:45:29AM -0700, Dima Pasechnik wrote:
 
 
 On Saturday, 13 October 2012 19:26:17 UTC+8, Georgi Guninski wrote:
 
  On Fri, Oct 12, 2012 at 10:17:29AM -0700, kcrisman wrote: 
   What is the name of the binary (i.e., is it 64 or 32 bit, and so forth)? 
   
 
  It easy is to check if the problem is in my boxen - install ubuntu 10.04 
  in 
  a virtual machine, download the 64 bit binary from sagemath and 
  run the testcases. 
 
 
 Not all x86_64 boxes are equal. Different models of x86_64 processors have 
 different sets of commands, and VMs are even worse in this case, as we saw 
 situations where not all the processor capabilities are allowed by the VM, 
 but for the software it looks as if these capabilities are allowed...
 
 

So you are implying my two boxen (intel and amd) are all buggy so i
should compile from source on both?

I should have be warned before downloading the binary, please make
this statement explicit on the binary download page :)))

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] SEGV in libatlas.so

2012-10-12 Thread Georgi Guninski
g=DiGraph('kO??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???W???')
m=g.adjacency_matrix()
m
m^7

Unhandled SIGSEGV:
local/lib/libatlas.so(+0x87d4d)[0x7fdb41c8ed4d]

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] SEGV in libatlas.so

2012-10-12 Thread Georgi Guninski
Simpler testcase:

g=graphs.CycleGraph(44);m=g.adjacency_matrix()
m^7

On Fri, Oct 12, 2012 at 05:03:49PM +0300, Georgi Guninski wrote:
 g=DiGraph('kO??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???O??A???W???')
 m=g.adjacency_matrix()
 m
 m^7
 
 Unhandled SIGSEGV:
 local/lib/libatlas.so(+0x87d4d)[0x7fdb41c8ed4d]
 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Re: SEGV in libatlas.so

2012-10-12 Thread Georgi Guninski
On Fri, Oct 12, 2012 at 10:29:52PM +0800, P Purkayastha wrote:
 Both the examples work here in sage-5.2 and sage-5.4beta1. What
 version of Sage are you using?


5.3 on ubuntu 10.04 x86_64.
5.2 crashes too for me.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] SEGV in libatlas.so

2012-10-12 Thread Georgi Guninski
On Fri, Oct 12, 2012 at 07:42:04AM -0700, Dan Drake wrote:
 This works for me. You'll need to give more information before anyone
 can help you -- platform, whether you compiled yourself or use a binary,
 etc.


i don't expect anyone to help me...

sage 5.3 on ubuntu 10.04 x86_64 downloaded from sagemath.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] __contains__ and general/special linear

2012-10-08 Thread Georgi Guninski
This is not very intuitive:

sage: sqrt(3) in QQ[sqrt(3)]
False
sage: QQ[sqrt(3)]
Number Field in sqrt3 with defining polynomial x^2 - 3


On Sun, Oct 07, 2012 at 08:23:20AM -0700, Greg Laun wrote:
 __contains__ is broken in general and special linear groups. For example:
 
 sage: identity_matrix(GF(2),2) in GL(2,CC)
 True
 
 The base field of the matrix is characteristic 2, but it's reported as being 
 a matrix over C.
 
 I reported this to sage-devel here: 
 https://groups.google.com/forum/?fromgroups=#!searchin/sage-devel/laun/sage-devel/WwovHNaUldE/lt2pFK6BeJsJ
 It contains some discussion, including why using the boilerplate __contains__ 
 probably won't work.
 
 I was about to submit a bug report, when I noticed the wiki telling me to 
 email sage-support first.  I already emailed sage-devel, so I hope I'm not 
 spamming too much by also emailing here.
 
 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




  1   2   >