[sage-devel] Re: VOTE: move Sage development to Github

2022-10-03 Thread Simon Brandhorst
+1 GitHub

On Sunday, October 2, 2022 at 6:51:39 PM UTC+2 kesha...@gmail.com wrote:

> +1 for GitHub (hi folks )
>
> -Keshav
>
> On Wednesday, September 21, 2022 at 10:23:36 AM UTC-7 David Roe wrote:
>
>> Dear Sage developers,
>> Following extensive discussion, both recently 
>>  
>> (prompted 
>> by issues upgrading the trac server) and over 
>>  the 
>>  
>> last 
>>  
>> decade 
>> , 
>> we are calling a vote on switching Sage development from Trac 
>>  to Github .  We've 
>> created a summary of the pros and cons of each system 
>> , a 
>> description 
>> of the development model to be used on github 
>> , 
>> and a trac ticket  for 
>> coordinating work on the transition.  More work will need to be done to 
>> carry out the actual transition once voting is complete.
>>
>> The voting will last until noon Eastern time (16:00 UTC) on Wednesday, 
>> October 5.  Please use this thread only for sending votes, to make it 
>> easier to count them afterward; there is a parallel thread where you can 
>> make arguments in favor of either system.
>>
>> Finally, I will close with a plea to be involved in this vote and 
>> discussion even if you are not a core Sage developer.  By definition, core 
>> Sage developers have become comfortable with trac, and I think that one of 
>> the major arguments in favor of github is that it will help bring in new 
>> contributors who are not familiar with Sage's development workfow 
>> .  Anyone who has 
>> ever contributed to the Sage code base or who maintains a Sage user package 
>> is welcome to vote.
>> David
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/a3c9ea2b-143c-428a-a433-a7915dc55f74n%40googlegroups.com.


Re: [sage-devel] any([magma(True),magma(True)]) produces stack overflow

2022-02-18 Thread Simon Brandhorst
Indeed it was on 9.4. Sorry I forgot to mention that. Thank you.

On Friday, February 18, 2022 at 9:31:06 PM UTC+1 jus...@mac.com wrote:

>
>
> > On Feb 18, 2022, at 12:23 , David Roe  wrote:
> > 
> > This should have been fixed in https://trac.sagemath.org/ticket/32602.
>
> It was reported fixed for 9.5, and Volker’s release message for 9.5.beta6 
> indicates it was included then. And it does not fail for sage 9.5 on my 
> system.
>
> Simon may let us know what config he’s using.
>
> Justin
>
> > On Fri, Feb 18, 2022 at 2:58 PM 'Justin C. Walker' via sage-devel <
> sage-...@googlegroups.com> wrote:
> > 
> > 
> > > On Feb 18, 2022, at 08:09 , Simon Brandhorst  wrote:
> > > 
> > > ```
> > > sage: any([magma(True),magma(True)]) 
> > > Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack 
> overflow.
> > > Python runtime state: initialized
> > > 
> > > Thread 0x7f7b15e34700 (most recent call first):
> > > ```
> > > Can anyone reproduce?
> > 
> > This works for me with Sage 9.5 on macOS 10.13.6 (built from scratch). 
> By “works”, I mean I get “True” as a result.
> > The same holds for sage 8.[3-9].
> > 
> > However, with 9.[0-4], I get the same error you report: a stack 
> explosion, ending with SIGABRT.
> > 
> > HTH
> > 
> > Justin
>
> --
> Justin C. Walker, Curmudgeon at Large
> Director
> Institute for the Enhancement of the Director's Income
> --
> In mathematics you don't understand
> things. You just get used to them. 
> --John von Neumann
> --
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/d1b99696-db5e-443b-a7ec-10e3c69fa4afn%40googlegroups.com.


[sage-devel] any([magma(True),magma(True)]) produces stack overflow

2022-02-18 Thread Simon Brandhorst
```
sage: any([magma(True),magma(True)])   


Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack 
overflow.
Python runtime state: initialized

Thread 0x7f7b15e34700 (most recent call first):
```
Can anyone reproduce?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/782a6a23-126d-4e33-bd9e-870bdd9f7256n%40googlegroups.com.


[sage-devel] [SageTerminalApp] ERROR | Failed to create history session

2020-06-19 Thread Simon Brandhorst
When working with multiple terminals I frequently get the following Error. 
Usually when the other terminal is busy.


[SageTerminalApp] ERROR | Failed to create history session in /home/simon/.
sage/ipython-5.0.0/profile_default/history.sqlite. History will not be saved
.Traceback (most recent call last):
  File 
"/home/simon/sage/local/lib/python3.7/site-packages/IPython/core/history.py"
, line 549, in __init__
self.new_session()
  File 
""
, line 2, in new_session
  File 
"/home/simon/sage/local/lib/python3.7/site-packages/IPython/core/history.py"
, line 60, in needs_sqlite
return f(self, *a, **kw)
  File 
"/home/simon/sage/local/lib/python3.7/site-packages/IPython/core/history.py"
, line 575, in new_session
NULL, "") """, (datetime.datetime.now(),))
sqlite3.OperationalError: database is locked




-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/0dce3d13-56e3-45f3-bd73-9fa9042b9522o%40googlegroups.com.


[sage-devel] Re: quadratic forms signature_vector() gives different results for real cyclotomics and for reals

2019-10-21 Thread Simon Brandhorst
A quadratic form is a map F^n ---> F. The signature is supposed to be 
independent of the choice of basis. 
So the number of positve/negative eigenvalues makes sense only for F = the 
reals.
For instance in the complex numbers you can always find an orthogonal basis 
with gram matrix diag(1,,1,0,...0). 
So here the invariant would be the rank.
If you want a signature over another field, you have to fix an embedding 
F--> RR and consider the quadratic form as a real quadratic form.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/6a4409d6-a831-470f-9136-978a1880ad5a%40googlegroups.com.


[sage-devel] Re: quadratic forms signature_vector() gives different results for real cyclotomics and for reals

2019-10-20 Thread Simon Brandhorst
Dear Ignat Soroko,

the quadratic forms code was written with quadratic forms over QQ and over 
ZZ in mind. So I would be very sceptic about any functionality over number 
fields. 
For instance the signature vector you mention does not make sense of the 
F. =CyclotomicField(8). Instead of a single signature vector, over a 
number field you should 
obtain a signature for each real embedding F. Since F has no real places it 
does not really have signatures. All infinite places are complex and all 
regular quadratic forms over CC are equivalent. So basically 

sage: 
Q=QuadraticForm(K,8,[1/2,-a/2,0,0,0,0,0,0,1/2,-a/2,0,0,0,0,0,1/2,-1/2,0,0,
: 0,0,1/2,-1/2,0,0,0,1/2,-1/2,0,0,1/2,-a/2,0,1/2,-a/2,1/2])
sage: Q.signature_vector()

should either raise a value error, or 
be called signature_vectors() and return a dictionary of real places and 
signature vectors. 

Best,
Simon

On Friday, October 18, 2019 at 2:12:02 AM UTC+2, Ignat Soroko wrote:
>
> I am computing the signature of a quadratic form having entries 0, 1, 
> -1/2, -sqrt(2)/2. I noticed that the result of signature_vector() is 
> different if we treat the number sqrt(2) as a cyclotomic or as a real 
> number. Please look at the example:
>
> sage: K.=CyclotomicField(8)
> sage: a=z-z^3  # a is a square root of 2
> sage: a-sqrt(2)
> 0
> sage: 
> Q=QuadraticForm(K,8,[1/2,-a/2,0,0,0,0,0,0,1/2,-a/2,0,0,0,0,0,1/2,-1/2,0,0,
> : 0,0,1/2,-1/2,0,0,0,1/2,-1/2,0,0,1/2,-a/2,0,1/2,-a/2,1/2])
> sage: Q.signature_vector()
> (8, 0, 0)
>
> this cannot be true since there exists an isotropic vector:
>
> sage: v=vector([1,a,1,0,0,0,0,0])
> sage: v*Q.matrix()*v
> 0
>
> Let's try it over reals:
>
> sage: a=sqrt(2)
> sage: 
> Q=QuadraticForm(RR,8,[1/2,-a/2,0,0,0,0,0,0,1/2,-a/2,0,0,0,0,0,1/2,-1/2,0,0
> : ,0,0,1/2,-1/2,0,0,0,1/2,-1/2,0,0,1/2,-a/2,0,1/2,-a/2,1/2])
> sage: Q.signature_vector()
> (6, 2, 0)
>
> however, the isotropic vector above is not isotropic anymore:
>
> sage: v=vector([1,a,1,0,0,0,0,0])
> sage: v*Q.matrix()*v
> sqrt(2)*(1.00*sqrt(2) - 1.41421356237310) - 
> 1.41421356237310*sqrt(2) + 2.00
>
> I also tried to define 
>
> sage: a=sqrt(AA(2))
> sage: 
> Q=QuadraticForm(AA,8,[1/2,-a/2,0,0,0,0,0,0,1/2,-a/2,0,0,0,0,0,1/2,-1/2,0,0
> : ,0,0,1/2,-1/2,0,0,0,1/2,-1/2,0,0,1/2,-a/2,0,1/2,-a/2,1/2])
>
> but Q.signature_vector() gives a runtime error with many lines of code 
> ending in:
>
> RuntimeError: maximum recursion depth exceeded
>
>
> Questions:
> 1) is Q.signature_vector() over cyclotomic field is interpreted in some 
> other way than for reals, thus making the result (8,0,0) somehow correct?
>
> 2) Which setting would guarantee both the correct result for 
> signature_vector() using the exact arithmetic and at the same time show 
> that v is actually an isotropic vector?
>
> Thank you!
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/edce4769-1ca3-4400-bd50-ef01f0a11d5c%40googlegroups.com.


[sage-devel] Re: direct sums, products and other categorical constructions

2019-05-27 Thread Simon Brandhorst
Hi Simon,

I would agree that I want unique representation with simple "ambient" 
objects (usually constructed from an integer and maybe a ring). Then with 
complicated objects I am not so sure anymore. Say subgroups of a group and 
submodules of a module. There it might cause more trouble than benefit. 
Plus it is quite common to create 
(hundred) thousands of subgroups/submodules during a computation.

Anyways that is a bit off topic. 

In the example case of a direct sum of modules one could give the 
construction functor the input of 
the two ambient spaces and the respective basis matrix of the modules. 
If one calls projections/co projections it would create the objects again. 
That could solve the memory leak issue? (but recreating the objects feels 
like a weird workaround.)


On Friday, May 24, 2019 at 2:14:04 PM UTC+2, Simon King wrote:
>
> Hi Simon, 
>
> On 2019-05-23, Simon Brandhorst > wrote: 
> > I can live with (V, projections, coprojections) 
> > but I dislike hiding everything in lists (or lists of lists, or lists of 
> > lists of lists..). 
> > Being able to type VW.projections(1) would just be so much nicer. 
>
> +1. 
>
> But how? I think we do want unique parents. How do we want to 
> distinguish between "the same" object that was constructed in two 
> different 
> universal ways? 
>
> There would be one possibility that would work without creating a 
> wrapper: An object X that was constructed by some construction functor F 
> applied to some more basic objects B1,...,Bn should be able to tell its 
> construction (there is X.construction()). So, if we want to distinguish, 
> say, $Q^4$ from $Q^3\oplus Q$, then we could simply use the pair 
>   (CoproductFunctor, (Q^3,Q)) 
> as key in the UniqueRepresentation cache. 
>
> Best regards, 
> Simon 
>
> Best regards, 
> Simon 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/b13ea13e-de03-4cc2-8c26-9850bf30f0b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] direct sums, products and other categorical constructions

2019-05-23 Thread Simon Brandhorst
I can live with (V, projections, coprojections) 
but I dislike hiding everything in lists (or lists of lists, or lists of 
lists of lists..).
Being able to type VW.projections(1) would just be so much nicer.



-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/d6af3ab6-fc60-4a4e-bf6d-b97fc178d2c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] direct sums, products and other categorical constructions

2019-05-22 Thread Simon Brandhorst
Right now I can do
sage: V = ZZ^2
sage: D = V.direct_sum(V)
sage: D
Free module of degree 4 and rank 4 over Integer Ring
Echelon basis matrix:
[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
[0 0 0 1]

But the result has forgotten that it is a direct sum.

Of a direct sum I expect, that it has a projection and a co-projection. 
(this is how it is done in gap)
So I want to be able to type
sage: D.projection(0)
sage: D.coprojection(0)

Then there could also be appropriate coercions.
The same holds for other direct sums in groups, vector spaces 
Or for other constructions like a direct product, inverse limit ... 

Maybe this is something for the category framework?
How would one implement it?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/06759b84-6026-47f2-911f-5de2503c3e1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Quadratic Form is_globally_equivalent_to Bug

2019-04-29 Thread Simon Brandhorst
This is now 

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

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


[sage-devel] Re: Quadratic Form is_globally_equivalent_to Bug

2019-04-26 Thread Simon Brandhorst
Thanks a lot for reporting. This is certainly a bug. 
It seems to originate in pari (confirm with qfisom in 
https://pari.math.u-bordeaux.fr/dochtml/html/Vectors__matrices__linear_algebra_and_sets.html
 
) 

On Thursday, April 25, 2019 at 11:49:23 AM UTC+2, Ethan Yang wrote:
>
> is_globally_equivalent_to is not symmetric, which it definitely should be 
> by virtue of being an equivalence relation. Glancing through the code, this 
> seems to be because is_equivalent_to checks whether there is some integral 
> transformation from one form to the other, but does not check whether the 
> transformation is invertible.
>
> *Steps to reproduce:*
>
> Pick two quadratic forms (many others produce the same bug, but these are 
> one example)
> Q = QuadraticForm(ZZ, 2, [2,3,5])
> P = QuadraticForm(ZZ, 2, [8,6,5])
> Q.is_globally_equivalent_to(P) returns True
> P.is_globally_equivalent_to(Q) return False
>
> Version: 8.7
> OS: macOS High Sierra 10.13.6, 64 Bit
>
>

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


[sage-devel] Re: Smith Normal Form over ZZ seriously slow

2019-04-01 Thread Simon Brandhorst
Is there a ticket for this?

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


Re: [sage-devel] Reporting bug:the errors about method "is_trivial() in module sage.rings.ideal"

2019-03-10 Thread Simon Brandhorst
Hi Simon,

I can see your reasons. They seem to be from the perspective of someone
who knows about computer algebra. But a mathematician and casual user of 
sage
will think of an ideal as a subset of a ring. He/she will be oblivious of 
the implementation details
and expect x in J to be a containment test. Better innocently type x in J 
and wait a long time (or press ctrl + x)
than misinterpreting a result.
Experts in computer algebra can still use I.gens(). Else we should rename 
the class to 
something like IdealWithGens.

On Sunday, March 10, 2019 at 10:55:17 AM UTC+1, Simon King wrote:

> The problem is that ideal containment and equality tests can be very 
> expensive 
> (involving Gröbner basis computations), and thus it would be hardly 
> feasible 
> to use ideals as, say, keys in dictionaries. 

Maybe we should better use the generators as keys directly? 

> If you really 
> need a mathematically correct containment test and are aware that it may 
> be expensive, you can explicitly request it. But for many cases, a quick 
> and dirty mathematically wrong but computationally sound containment 
> test (or equality test for ideals) suffices.
>
>From a computer algebra system (written largely by mathematicians) 
I would expect to do the mathematically correct thing and otherwise warn
me that a computational perspective is taken.

So +1 for mathematical behavior.

Best
Simon

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


Re: [sage-devel] ValueError: filedescriptor out of range in select()

2019-03-03 Thread Simon Brandhorst


On Sunday, March 3, 2019 at 1:09:45 PM UTC+1, Jeroen Demeyer wrote:

> What is it that you're *actually* trying to do? 
>

Use the gp code by Denis Simon in  
/src/ext/pari/simon

didnt know how to feed that to pari, so I used gp. And that is what I saw in
schemes/elliptic_curves/gp_simon.py:gp.read("resultant3.gp")
as well.

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


Re: [sage-devel] ValueError: filedescriptor out of range in select()

2019-03-03 Thread Simon Brandhorst
On Sunday, March 3, 2019 at 12:50:42 PM UTC+1, Jeroen Demeyer wrote:

> But maybe it's not closed *immediately*. It would be interesting to do 
> the same experiment with a time.sleep(0.1) or a gc.collect() in the loop. 
>

I tried that 

sage: for k in range(1):
: gp = Gp()
: gp.read(SAGE_EXTCODE + "/pari/simon/qfsolve.gp")
: k
: if k % 1000 == 0:
: gc.collect()

And indeed this time it worked for the first 3266 loops (instead of just 
1800) and then sage crashes with 


OSError Traceback (most recent call last)
 in ()
  1 for k in range(Integer(1)):
  2 gp = Gp()
> 3 gp.read(SAGE_EXTCODE + "/pari/simon/qfsolve.gp")
  4 k
  5 if k % Integer(1000) == Integer(0):

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/interface
.pyc in read(self, filename)
222 sage: os.unlink(filename)
223 """
--> 224 self.eval(self._read_in_file_command(filename))
225 
226 def _read_in_file_command(self, filename):

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc 
in eval(self, code, strip, synchronize, locals, allow_use_file, 
split_lines, **kwds)
   1349 elif split_lines:
   1350 return '\n'.join([self._eval_line(L, 
allow_use_file=allow_use_file, **kwds)
-> 1351 for L in code.split('\n') 
if L != ''])
   1352 else:
   1353 return self._eval_line(code, 
allow_use_file=allow_use_file, **kwds)

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/gp.pyc 
in _eval_line(self, line, allow_use_file, wait_for_prompt, 
restart_if_needed)
443 a = Expect._eval_line(self, line,
444   allow_use_file=allow_use_file,
--> 445   wait_for_prompt=wait_for_prompt)
446 if a.find("the PARI stack overflows") != -1:
447 verbose("automatically doubling the PARI stack and 
re-executing 
current input line")

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc 
in _eval_line(self, line, allow_use_file, wait_for_prompt, 
restart_if_needed)
914 try:
915 if self._expect is None:
--> 916 self._start()
917 E = self._expect
918 try:

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/gp.pyc 
in _start(self, alt_message, block_during_init)
241 
242 def _start(self, alt_message=None, block_during_init=True):
--> 243 Expect._start(self, alt_message, block_during_init)
244 # disable memory debugging: those warnings can only confuse 
our
245 # interface

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc 
in _start(self, alt_message, block_during_init)
501 # Work around 
https://bugs.python.org/issue1652
502 preexec_fn=lambda: 
signal.signal(signal.SIGPIPE, signal.SIG_DFL),
--> 503 quit_string=self._quit_string())
504 except (ExceptionPexpect, pexpect.EOF) as e:
505 # Change pexpect errors to RuntimeError

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/sagespawn.pyx
 
in sage.interfaces.sagespawn.SageSpawn.__init__ 
(build/cythonized/sage/interfaces/sagespawn.c:1948)()
 63 kwds.setdefault("maxread", 4194304)
 64 
---> 65 with ContainChildren(silent=True):
 66 spawn.__init__(self, *args, **kwds)
 67 

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/sagespawn.pyx
 
in sage.interfaces.sagespawn.SageSpawn.__init__ 
(build/cythonized/sage/interfaces/sagespawn.c:1902)()
 64 
 65 with ContainChildren(silent=True):
---> 66 spawn.__init__(self, *args, **kwds)
 67 
 68 self.delaybeforesend = None

/home/simon/sage/local/lib/python2.7/site-packages/pexpect/pty_spawn.pyc in 
__init__(self, command, args, timeout, maxread, searchwindowsize, logfile, 
cwd, env, ignore_sighup, echo, preexec_fn, encoding, codec_errors, 
dimensions, use_poll)
202 self.name = ''
203 else:
--> 204 self._spawn(command, args, preexec_fn, dimensions)
205 self.use_poll = use_poll
206 

/home/simon/sage/local/lib/python2.7/site-packages/pexpect/pty_spawn.pyc in 
_spawn(self, command, args, preexec_fn, dimensions)
301 
302 self.ptyproc = self._spawnpty(self.args, env=self.env,
--> 303  cwd=self.cwd, **kwargs)
304 
305 self.pid = self.ptyproc.pid

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/sagespawn.pyx
 
in 

[sage-devel] Re: ValueError: filedescriptor out of range in select()

2019-03-03 Thread Simon Brandhorst
Ah I see and to answer my own question using grep:
from sage.interfaces.gp import gp
is probably what I should do.

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


Re: [sage-devel] ValueError: filedescriptor out of range in select()

2019-03-03 Thread Simon Brandhorst
Shouldn't the gp session be closed afterwards? After all it is not 
used/referenced anymore?
So that the file descriptor gets freed again?
If not what is the recommended way to start computations in gp (or 
gap/magma )? 
Say in some method in some class? give it some global gp instance as a 
parameter? Is there such a thing?


On Sunday, March 3, 2019 at 11:47:02 AM UTC+1, Jeroen Demeyer wrote:
>
> On 2019-03-03 11:43, Vincent Delecroix wrote: 
> > Could you open a trac ticket? This is definitely a bug 
> > (most probably in `interfaces/expect.py`). 
>
> I wouldn't call it a bug. You're opening 1 independent GP sessions, 
> which each need a few file descriptors. It's normal that you run out of 
> file descriptors after a while. 
>
>

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


[sage-devel] Re: ValueError: filedescriptor out of range in select()

2019-03-03 Thread Simon Brandhorst
I can consistently reproduce that error. Tried again and crashed at k = 1888
and 
k = 1871
and 
k = 1842

maybe I am hitting some preset limit?

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


Re: [sage-devel] ValueError: filedescriptor out of range in select()

2019-03-03 Thread Simon Brandhorst
Trying to provoke more errors:

sage: from sage.env import SAGE_EXTCODE
sage: for k in range(1):
: gp = Gp()
: gp.read(SAGE_EXTCODE + "/pari/simon/qfsolve.gp")
: k


breaks at k = 1922 with

-
OSError Traceback (most recent call last)
 in ()
  1 for k in range(Integer(1)):
  2 gp = Gp()
> 3 gp.read(SAGE_EXTCODE + "/pari/simon/qfsolve.gp")
  4 k
  5 

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc
 
in read(self, filename)
222 sage: os.unlink(filename)
223 """
--> 224 self.eval(self._read_in_file_command(filename))
225 
226 def _read_in_file_command(self, filename):

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc 
in eval(self, code, strip, synchronize, locals, allow_use_file, 
split_lines, **kwds)
   1349 elif split_lines:
   1350 return '\n'.join([self._eval_line(L, 
allow_use_file=allow_use_file, **kwds)
-> 1351 for L in code.split('\n') 
if L != ''])
   1352 else:
   1353 return self._eval_line(code, 
allow_use_file=allow_use_file, **kwds)

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/gp.pyc 
in _eval_line(self, line, allow_use_file, wait_for_prompt, 
restart_if_needed)
443 a = Expect._eval_line(self, line,
444   allow_use_file=allow_use_file,
--> 445   wait_for_prompt=wait_for_prompt)
446 if a.find("the PARI stack overflows") != -1:
447 verbose("automatically doubling the PARI stack and 
re-executing current input line")

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc 
in _eval_line(self, line, allow_use_file, wait_for_prompt, 
restart_if_needed)
914 try:
915 if self._expect is None:
--> 916 self._start()
917 E = self._expect
918 try:

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/gp.pyc 
in _start(self, alt_message, block_during_init)
241 
242 def _start(self, alt_message=None, block_during_init=True):
--> 243 Expect._start(self, alt_message, block_during_init)
244 # disable memory debugging: those warnings can only confuse 
our
245 # interface

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc 
in _start(self, alt_message, block_during_init)
501 # Work around 
https://bugs.python.org/issue1652
502 preexec_fn=lambda: 
signal.signal(signal.SIGPIPE, signal.SIG_DFL),
--> 503 quit_string=self._quit_string())
504 except (ExceptionPexpect, pexpect.EOF) as e:
505 # Change pexpect errors to RuntimeError

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/sagespawn.pyx
 
in sage.interfaces.sagespawn.SageSpawn.__init__ 
(build/cythonized/sage/interfaces/sagespawn.c:1948)()
 63 kwds.setdefault("maxread", 4194304)
 64 
---> 65 with ContainChildren(silent=True):
 66 spawn.__init__(self, *args, **kwds)
 67 

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/sagespawn.pyx
 
in sage.interfaces.sagespawn.SageSpawn.__init__ 
(build/cythonized/sage/interfaces/sagespawn.c:1902)()
 64 
 65 with ContainChildren(silent=True):
---> 66 spawn.__init__(self, *args, **kwds)
 67 
 68 self.delaybeforesend = None

/home/simon/sage/local/lib/python2.7/site-packages/pexpect/pty_spawn.pyc in 
__init__(self, command, args, timeout, maxread, searchwindowsize, logfile, 
cwd, env, ignore_sighup, echo, preexec_fn, encoding, codec_errors, 
dimensions, use_poll)
202 self.name = ''
203 else:
--> 204 self._spawn(command, args, preexec_fn, dimensions)
205 self.use_poll = use_poll
206 

/home/simon/sage/local/lib/python2.7/site-packages/pexpect/pty_spawn.pyc in 
_spawn(self, command, args, preexec_fn, dimensions)
301 
302 self.ptyproc = self._spawnpty(self.args, env=self.env,
--> 303  cwd=self.cwd, **kwargs)
304 
305 self.pid = self.ptyproc.pid

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/sagespawn.pyx
 
in sage.interfaces.sagespawn.SageSpawn._spawnpty 
(build/cythonized/sage/interfaces/sagespawn.c:2133)()
 80 SagePtyProcess.spawn(...)
 81 """
---> 82 ptyproc = SagePtyProcess.spawn(args, **kwds)
 83 ptyproc.quit_string = self.quit_string
 84 return ptyproc


[sage-devel] ValueError: filedescriptor out of range in select()

2019-03-03 Thread Simon Brandhorst
I am trying a medium scale computation. Unfortunately it breaks every time 
with error messages I do not know how to interpret.
They may or may not be bugs in sage. Here is a traceback

--
ValueErrorTraceback (most recent call last)
 in ()
> 1 classify_ord_pe(L,Integer(2),Integer(2),'results/order4.txt','a')

/home/simon/.sage/temp/k3/2030/K3_aut_classification.sageWSsnuG.py in 
classify_ord_pe(L, p, e, file_name, rw)
258 print(" ")
259 cofix = cofixed[k].twist(-_sage_const_1 )
--> 260 for Aa in k3_prime_power(fix.genus(), p, e):
261 A, a, Oa = Aa
262 actsg = MaximalK3surfaceAut(A, cofix, a, Oa)

/home/simon/.sage/temp/k3/2030/prime_power.sagez0p9M2.py in k3_prime_power(
genus, prime, e)
138 signatures += [[ranks_E[k]]*(weights[k]//_sage_const_2 
) for k in range(_sage_const_1 ,n)]
139 signatures[-_sage_const_1 ][_sage_const_0 ] -= _sage_const_1
--> 140 for act in prime_power_actions(genus,prime,ranks,signatures
):
141 yield act
142 

/home/simon/.sage/temp/k3/2030/prime_power.sagez0p9M2.py in 
prime_power_actions(genus, p, ranks, signatures)
278 # recurse
279 # print(R)
--> 280 for N in prime_power_actions(R, p, 
ranks[:-_sage_const_1 
], R_signatures):
281 N, fN, GN = N
282 ext = extensions(M, fM, N, fN, GM, GN, 
glue_order, p)

/home/simon/.sage/temp/k3/2030/prime_power.sagez0p9M2.py in 
prime_power_actions(genus, p, ranks, signatures)
278 # recurse
279 # print(R)
--> 280 for N in prime_power_actions(R, p, 
ranks[:-_sage_const_1 
], R_signatures):
281 N, fN, GN = N
282 ext = extensions(M, fM, N, fN, GM, GN, 
glue_order, p)

/home/simon/.sage/temp/k3/2030/prime_power.sagez0p9M2.py in 
prime_power_actions(genus, p, ranks, signatures)
196 if len(ranks) == _sage_const_1 :
197 # there is nothing to glue
--> 198 for M in genus.representatives():
199 fM = M ** _sage_const_0
200 M = IntegralLattice(M)

/home/simon/sage/local/lib/python2.7/site-packages/sage/quadratic_forms/
genera/genus.pyc in representatives(self, backend, algorithm)
   3161 if self.signature_pair()[0] == 0:
   3162 e *= ZZ(-1)
-> 3163 Q = QuadraticForm(e*self.representative())
   3164 seeds = [Q]
   3165 for p in self.spinor_generators(proper=False):

/home/simon/sage/local/lib/python2.7/site-packages/sage/quadratic_forms/
genera/genus.pyc in representative(self)
   3010 """
   3011 if self._representative is None:
-> 3012 self._compute_representative()
   3013 return self._representative
   3014 

/home/simon/sage/local/lib/python2.7/site-packages/sage/quadratic_forms/genera/genus.pyc
 
in _compute_representative(self, LLL)
   3085 gp = Gp()
   3086 m = pari(L)
-> 3087 gp.read(SAGE_EXTCODE + "/pari/simon/qfsolve.gp")
   3088 m = gp.eval('qflllgram_indefgoon(%s)'%m)
   3089 # convert the output string to sage

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc
 
in read(self, filename)
222 sage: os.unlink(filename)
223 """
--> 224 self.eval(self._read_in_file_command(filename))
225 
226 def _read_in_file_command(self, filename):

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc 
in eval(self, code, strip, synchronize, locals, allow_use_file, split_lines, 
**kwds)
   1349 elif split_lines:
   1350 return '\n'.join([self._eval_line(L, 
allow_use_file=allow_use_file, **kwds)
-> 1351 for L in code.split('\n') if 
L != ''])
   1352 else:
   1353 return self._eval_line(code, allow_use_file=
allow_use_file, **kwds)

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/gp.pyc in 
_eval_line(self, line, allow_use_file, wait_for_prompt, restart_if_needed)
443 a = Expect._eval_line(self, line,
444   allow_use_file=allow_use_file,
--> 445   wait_for_prompt=wait_for_prompt)
446 if a.find("the PARI stack overflows") != -1:
447 verbose("automatically doubling the PARI stack and 
re-executing current input line")

/home/simon/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc 
in _eval_line(self, line, allow_use_file, wait_for_prompt, restart_if_needed
)
914 try:

[sage-devel] Re: During a libgap evaluation: SystemError: calling remove_from_pari_stack() inside sig_on()

2019-02-27 Thread Simon Brandhorst
This is now 
#27374 <https://trac.sagemath.org/ticket/27374>

On Wednesday, February 27, 2019 at 9:53:35 AM UTC+1, Simon Brandhorst wrote:
>
> -
> SystemError Traceback (most recent call last)
>  in ()
> > 1 classify_ord_pe(L,Integer(2),Integer(2),"results/order4.txt","w")
>
> /home/simon/.sage/temp/k3/8598/K3_aut_classification.sageqIg9CK.py in 
> classify_ord_pe(L, p, e, file_name, rw)
> 252 print(" ")
> 253 cofix = cofixed[k].twist(-_sage_const_1 )
> --> 254 for Aa in k3_prime_power(fix.genus(), p, e):
> 255 A, a, Oa = Aa
> 256 actsg = MaximalK3surfaceAut(A, cofix, a, Oa)
>
> /home/simon/.sage/temp/k3/8598/prime_power.sage5OzLUx.py in 
> k3_prime_power(genus, prime, e)
> 138 signatures += [[ranks_E[k]]*(weights[k]//_sage_const_2 
> ) for k in range(_sage_const_1 ,n)]
> 139 signatures[-_sage_const_1 ][_sage_const_0 ] -= 
> _sage_const_1
> --> 140 for act in 
> prime_power_actions(genus,prime,ranks,signatures):
> 141 yield act
> 142 
>
> /home/simon/.sage/temp/k3/8598/prime_power.sage5OzLUx.py in 
> prime_power_actions(genus, p, ranks, signatures)
> 276 # recurse
> 277 # print(R)
> --> 278 for N in prime_power_actions(R, p, 
> ranks[:-_sage_const_1 ], R_signatures):
> 279 N, fN, GN = N
> 280 ext = extensions(M, fM, N, fN, GM, GN, 
> glue_order, p)
>
> /home/simon/.sage/temp/k3/8598/prime_power.sage5OzLUx.py in 
> prime_power_actions(genus, p, ranks, signatures)
> 240 if G.is_even() and not M.is_even():
> 241 continue
> --> 242 GM = Oq_equiv(M, fM, p**e)
> 243 DM = M.discriminant_group()
> 244 M_max_glue_group = (M.span((fM**(p**(e-_sage_const_1 
> )) - fM**_sage_const_0 ).inverse())
>
> /home/simon/.sage/temp/k3/8598/prime_power.sage5OzLUx.py in Oq_equiv(M, 
> fM, order)
> 514 """
> 515 if order==_sage_const_1  or order==_sage_const_2 :
> --> 516 return M.image_in_Oq()
> 517 elif prod(M.signature_pair()) == _sage_const_0 :
> 518 #
>
> This looks like a bug to me but I am not enough of an expert to decide.
> /home/simon/sage/local/lib/python2.7/site-packages/sage/modules/free_quadratic_module_integer_symmetric.pyc
>  
> in image_in_Oq(self)
>1443 generated by 5 elements
>1444 """
> -> 1445 Oq = self.discriminant_group().orthogonal_group()
>1446 sig = self.signature_pair()
>1447 if sig[0]*sig[1]==0 or self.rank()==2:
>
> /home/simon/sage/local/lib/python2.7/site-packages/sage/misc/cachefunc.pyx 
> in sage.misc.cachefunc.CachedMethodCaller.__call__ 
> (build/cythonized/sage/misc/cachefunc.c:10232)()
>1948 return cache[k]
>1949 except KeyError:
> -> 1950 w = self._instance_call(*args, **kwds)
>1951 cache[k] = w
>1952 return w
>
> /home/simon/sage/local/lib/python2.7/site-packages/sage/misc/cachefunc.pyx 
> in sage.misc.cachefunc.CachedMethodCaller._instance_call 
> (build/cythonized/sage/misc/cachefunc.c:9717)()
>1824 True
>1825 """
> -> 1826 return self.f(self._instance, *args, **kwds)
>1827 
>1828 cdef fix_args_kwds(self, tuple args, dict kwds):
>
> /home/simon/sage/local/lib/python2.7/site-packages/sage/modules/torsion_quadratic_module.pyc
>  
> in orthogonal_group(self, gens, check)
>1196 gens = [matrix(g) for g in _isom_fqf(self)]
>1197 ambient = AbelianGroupGap(self.invariants()).aut()
> -> 1198 gens = [ambient(g) for g in gens]
>1199 gens = tuple(g for g in gens if g != ambient.one())
>1200 return FqfOrthogonalGroup(ambient, gens, self, check=check)
>
> /home/simon/sage/local/lib/python2.7/site-packages/sage/structure/parent.pyx 
> in sage.structure.parent.Parent.__call__ 
> (build/cythonized/sage/structure/parent.c:9171)()
> 897 if mor is not None:
> 898 if no_extra_args:
> --> 899 return mor._call_(x)
> 900 else:
> 901 return mor._call_with_args(x, args, kwds)
>
> /home/simon/sage/local/lib/python2.7/site-packages/sage/structure/coerce_maps.pyx
>  
> in sage.structure.coerce_maps.De

[sage-devel] Re: During a libgap evaluation: SystemError: calling remove_from_pari_stack() inside sig_on()

2019-02-27 Thread Simon Brandhorst
Okay. But I cannot reproduce the error consistently. Post anyways?

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


[sage-devel] During a libgap evaluation: SystemError: calling remove_from_pari_stack() inside sig_on()

2019-02-27 Thread Simon Brandhorst
-
SystemError Traceback (most recent call last)
 in ()
> 1 classify_ord_pe(L,Integer(2),Integer(2),"results/order4.txt","w")

/home/simon/.sage/temp/k3/8598/K3_aut_classification.sageqIg9CK.py in 
classify_ord_pe(L, p, e, file_name, rw)
252 print(" ")
253 cofix = cofixed[k].twist(-_sage_const_1 )
--> 254 for Aa in k3_prime_power(fix.genus(), p, e):
255 A, a, Oa = Aa
256 actsg = MaximalK3surfaceAut(A, cofix, a, Oa)

/home/simon/.sage/temp/k3/8598/prime_power.sage5OzLUx.py in 
k3_prime_power(genus, prime, e)
138 signatures += [[ranks_E[k]]*(weights[k]//_sage_const_2 
) for k in range(_sage_const_1 ,n)]
139 signatures[-_sage_const_1 ][_sage_const_0 ] -= _sage_const_1
--> 140 for act in 
prime_power_actions(genus,prime,ranks,signatures):
141 yield act
142 

/home/simon/.sage/temp/k3/8598/prime_power.sage5OzLUx.py in 
prime_power_actions(genus, p, ranks, signatures)
276 # recurse
277 # print(R)
--> 278 for N in prime_power_actions(R, p, 
ranks[:-_sage_const_1 ], R_signatures):
279 N, fN, GN = N
280 ext = extensions(M, fM, N, fN, GM, GN, 
glue_order, p)

/home/simon/.sage/temp/k3/8598/prime_power.sage5OzLUx.py in 
prime_power_actions(genus, p, ranks, signatures)
240 if G.is_even() and not M.is_even():
241 continue
--> 242 GM = Oq_equiv(M, fM, p**e)
243 DM = M.discriminant_group()
244 M_max_glue_group = (M.span((fM**(p**(e-_sage_const_1 )) 
- fM**_sage_const_0 ).inverse())

/home/simon/.sage/temp/k3/8598/prime_power.sage5OzLUx.py in Oq_equiv(M, fM, 
order)
514 """
515 if order==_sage_const_1  or order==_sage_const_2 :
--> 516 return M.image_in_Oq()
517 elif prod(M.signature_pair()) == _sage_const_0 :
518 #

This looks like a bug to me but I am not enough of an expert to decide.
/home/simon/sage/local/lib/python2.7/site-packages/sage/modules/free_quadratic_module_integer_symmetric.pyc
 
in image_in_Oq(self)
   1443 generated by 5 elements
   1444 """
-> 1445 Oq = self.discriminant_group().orthogonal_group()
   1446 sig = self.signature_pair()
   1447 if sig[0]*sig[1]==0 or self.rank()==2:

/home/simon/sage/local/lib/python2.7/site-packages/sage/misc/cachefunc.pyx 
in sage.misc.cachefunc.CachedMethodCaller.__call__ 
(build/cythonized/sage/misc/cachefunc.c:10232)()
   1948 return cache[k]
   1949 except KeyError:
-> 1950 w = self._instance_call(*args, **kwds)
   1951 cache[k] = w
   1952 return w

/home/simon/sage/local/lib/python2.7/site-packages/sage/misc/cachefunc.pyx 
in sage.misc.cachefunc.CachedMethodCaller._instance_call 
(build/cythonized/sage/misc/cachefunc.c:9717)()
   1824 True
   1825 """
-> 1826 return self.f(self._instance, *args, **kwds)
   1827 
   1828 cdef fix_args_kwds(self, tuple args, dict kwds):

/home/simon/sage/local/lib/python2.7/site-packages/sage/modules/torsion_quadratic_module.pyc
 
in orthogonal_group(self, gens, check)
   1196 gens = [matrix(g) for g in _isom_fqf(self)]
   1197 ambient = AbelianGroupGap(self.invariants()).aut()
-> 1198 gens = [ambient(g) for g in gens]
   1199 gens = tuple(g for g in gens if g != ambient.one())
   1200 return FqfOrthogonalGroup(ambient, gens, self, check=check)

/home/simon/sage/local/lib/python2.7/site-packages/sage/structure/parent.pyx 
in sage.structure.parent.Parent.__call__ 
(build/cythonized/sage/structure/parent.c:9171)()
897 if mor is not None:
898 if no_extra_args:
--> 899 return mor._call_(x)
900 else:
901 return mor._call_with_args(x, args, kwds)

/home/simon/sage/local/lib/python2.7/site-packages/sage/structure/coerce_maps.pyx
 
in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
(build/cythonized/sage/structure/coerce_maps.c:4547)()
160 print(type(C), C)
161 print(type(C._element_constructor), 
C._element_constructor)
--> 162 raise
163 
164 cpdef Element _call_with_args(self, x, args=(), kwds={}):

/home/simon/sage/local/lib/python2.7/site-packages/sage/structure/coerce_maps.pyx
 
in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
(build/cythonized/sage/structure/coerce_maps.c:4439)()
155 cdef Parent C = self._codomain
156 try:
--> 157 return C._element_constructor(x)
158 except Exception:
159 if print_warnings:


[sage-devel] libgap does not free memory after hitting the memory limit

2019-02-06 Thread Simon Brandhorst
After running

sage: V = libgap.GF(3)^2000
sage: libgap(V.Subspaces(1000)).List()
---
ValueErrorTraceback (most recent call last)
.
ValueError: libGAP: Error, reached the pre-set memory limit
(change it with the -o command line option)

libgap does not free the memory after this command.
So running it a few times will eat up all the memory
How to free it?
And how can I kill the libgap session and start a new one?
Say, with a larger memory limit.


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


Re: [sage-devel] A naming question for an enumerator

2019-01-25 Thread Simon Brandhorst
The method may get lost among the many methods of a Quadratic Form. But I 
guess making it a static method of quadratic forms is a good idea.

On Thursday, January 24, 2019 at 7:53:17 PM UTC+1, David Roe wrote:
>
>
>
> On Thu, Jan 24, 2019 at 1:27 PM Simon Brandhorst  > wrote:
>
>> So here is a question which came up in #24889: 
>>
>> We have an enumerator of objects, let us call them breeds of dogs which 
>> returns all breeds with user defined properties e.g. breeds of small dogs. 
>> How would you give the user access to it in a sageish pythonic way:
>> Let us say the way to create a breed is Dog.breed()
>>
>> DogsBreeds(size=small, color=dark)
>> Dogs.breeds(size=small, color=dark)
>> all_breeds_with(size=small, color=dark)
>> Breeds
>> ?
>>
>>
>> In our specific case we have quadratic forms and to a quadratic form one 
>> can associate its genus. 
>> Now we have an enumerator which returns all genera of specified signature 
>> and determinant. How to name it?
>> QuadraticFormsGenera
>> QuadraticForms.Genera
>> Genera
>> ?
>>
>
> I don't see a QuadraticForms object in Sage (just a QuadraticForm), so 
> wouldn't the second be QuadraticForm.Genera?
>
> I would probably go with QuadraticForm.genera, since that doesn't require 
> adding something to the global namespace, but I think QuadraticFormsGenera 
> could be okay too.
> David
>
>>
>> There are examples of each kind of behaviour in the sage library. 
>>
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+...@googlegroups.com .
>> To post to this group, send email to sage-...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/sage-devel.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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


[sage-devel] A naming question for an enumerator

2019-01-24 Thread Simon Brandhorst
So here is a question which came up in #24889: 

We have an enumerator of objects, let us call them breeds of dogs which 
returns all breeds with user defined properties e.g. breeds of small dogs. 
How would you give the user access to it in a sageish pythonic way:
Let us say the way to create a breed is Dog.breed()

DogsBreeds(size=small, color=dark)
Dogs.breeds(size=small, color=dark)
all_breeds_with(size=small, color=dark)
Breeds
?


In our specific case we have quadratic forms and to a quadratic form one 
can associate its genus. 
Now we have an enumerator which returns all genera of specified signature 
and determinant. How to name it?
QuadraticFormsGenera
QuadraticForms.Genera
Genera
?

There are examples of each kind of behaviour in the sage library. 




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


[sage-devel] Re: Some Magma help

2018-10-31 Thread Simon Brandhorst
Dear Kannappan,

what is your definition of a lattice? I am working on some functionality 
for quadratic forms/lattices just search for QuadraticForm or 
IntegralLattice. However these work only over ZZ.
I have some code queued up to compute spinor genera, genus representatives, 
maximal overlattices. Your help in reviewing these tickets would be very 
much welcome.

Best
Simon

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


[sage-devel] Re: no conversion between number fields (extensions) over base rings which have conversion

2018-10-18 Thread Simon Brandhorst
I would say because there is no canonically defined embedding as one can 
send i to -i as well.

On Thursday, October 18, 2018 at 1:38:24 PM UTC+2, Daniel Krenn wrote:
>
> sage: CyclotomicField(3).extension(x^2+1, 'i')(QQ.extension(x^2+1, 
> 'i').gen()) 
>
> returns 
>
> TypeError: Cannot coerce element into this number field 
>
> Does anyone have some idea why this is not working? 
>
> (This is https://trac.sagemath.org/ticket/26443) 
>
> Best, Daniel 
>

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


[sage-devel] Re: Special values of a dirichlet L-series are needed to rescue the mass formula in sage

2018-10-03 Thread Simon Brandhorst
Just in case someone in the future wonders about similar things:
As far as I can tell Hanke uses a different L series than Conway and Sloane.
But he also uses a different definiton for the standard_p_mass.
Both seem to replace the discrimiant by the fundamental discrimiant. I 
guess both changes cancel each other out. But I have not checked it.

On Wednesday, October 3, 2018 at 3:21:16 PM UTC+2, Simon Brandhorst wrote:
>
> Apparently things are much simpler. It appears it is not a mathematical 
> error, but rather a computational. Frederic Chapoton added a 
> mass.canonicalize_radical()
> to deal with the symbolic part of the computation.
>
> I am now testing this against magma for a few thousand lattices of small 
> determinant and it seems to work so far :-)). It seems that I missed 
> something. Maybe the two L functions are the same after all - even if they 
> look slightly different.
>

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


[sage-devel] Re: Special values of a dirichlet L-series are needed to rescue the mass formula in sage

2018-10-03 Thread Simon Brandhorst
Apparently things are much simpler. It appears it is not a mathematical 
error, but rather a computational. Frederic Chapoton added a 
mass.canonicalize_radical()
to deal with the symbolic part of the computation.

I am now testing this against magma for a few thousand lattices of small 
determinant and it seems to work so far :-)). It seems that I missed 
something. Maybe the two L functions are the same after all - even if they 
look slightly different.

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


[sage-devel] Special values of a dirichlet L-series are needed to rescue the mass formula in sage

2018-10-03 Thread Simon Brandhorst
The mass of a positive definite quadratic form is defined as the 
sum over 1/#Aut(L') where L' runs over the representatives of the genus of 
L.

It can be calculated by combining informations at the different completions 
of L at all primes by analytic methods. It is a particularly beautiful and 
useful piece of mathematics. But unfortunately it is broken in sage :-(. I 
would love to fix it! *But I need your help with L functions. *#26378

I believe the reason for our bug is that Hanke used the 
quadratic_L_function__exact 
This function seems to work fine. However I believe it is the wrong 
L-function. 
It is defined as follows:

L(\chi_D, s) =\sum_{m \in \NN} \chi_D(m) / m^s
here \chi_D(m) = \left( \frac{ D }{m} \right)
Now the tricky part is what D  over m means. Hanke does not write this but 
in 
quadratic_L_function__numerical
he means by D over m the *Kronecker symbol.*

Now if one carefully reads 

Low-Dimensional Lattices. IV. The Mass Formula
Author(s): J. H. Conway and N. J. A. Sloane
Source: Proceedings of the Royal Society of London. Series A, Mathematical 
and Physical
Sciences, Vol. 419, No. 1857 (Oct. 8, 1988), pp. 259-286
Published by: Royal Society
Stable URL: http://www.jstor.org/stable/2398465

in equation (8) the authors define what they mean by D over m:
It is zero if m is even and the *jacobi symbol *else. 
( The jacobi symbol is defined only for odd integers  
https://en.wikipedia.org/wiki/Jacobi_symbol)
So the L series we really need is
\sum_{k \in \NN} (\chi_D(2k -1) /(2k-1)^s

Now we do not need the L series but infinitely many special values. 
In (13) Conway and Sloane cite a (complicated) formula for that involving 
Bernulli numbers and a Gaussian sum. Now here is where I am stuck. I am not 
an expert on Dirichlet characters
(The easy way out for me is to just use the magma interface and type 
mass(L) - that is what I am doing right now - so basically I am fixing this 
bug on my free time which is why I would appreciate help.) The formula 
involves the *conductor*
k_1 and the *modulus* k and we have to *decompose* our dirichlet character 
as \chi_1 * \psi where 
\chi_1 is the principal character modulo k and \psi is a primitive 
character modulo k_1.
Finally Conway and Sloane did their calculations probably by hand - and I 
do not know if their description of the formula is computationally friendly.

O.K. I can probably figure out the modulus and conductor, but I do not know 
how to figure out the decomposition. Well there seems to be a sage package 
about Dirichlet characters but then again I do not know how to input our 
character - probably because I do not understand enough about them.


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


Re: [sage-devel] libgap is not using the available memory

2018-09-19 Thread Simon Brandhorst
Dear Dima,

thank you so much. It works :-). I would suggest to hint at this solution 
in the error message.
As soon as gap does not take sage with it anymore when running out of 
memory.
Best
Simon

On Tuesday, September 18, 2018 at 10:10:06 PM UTC+2, Dima Pasechnik wrote:
>
> The arguments with which libgap is started are set up in 
> src/sage/libs/gap/util.pyx 
> in the function initialize() 
>  - setting various members of argv. In particular look for what `-o` is 
> set to. 
> By digging through the code, it appears that it's set by 
> set_gap_memory_pool_size() 
> from interfaces/gap.py 
>
> So if you call set_gap_memory_pool_size with a big value, before 
> starting libgap, you might get 
> more (I didn't try) 
>
> HTH, 
> Dima 
> On Tue, Sep 18, 2018 at 9:38 PM Simon Brandhorst  > wrote: 
> > 
> > sage: V = libgap.GF(13)^500 
> > sage: S = V.Subspaces(50) 
> > sage: S.List() 
> > gap: cannot extend the workspace any more! 
> > 
> > 
> > As expected the computation runs out of memory. However, there is still 
> a lot of unused memory. 
> > 
> > Before: 
> > 
> >   totalusedfree  shared 
>  buff/cache   available 
> > Mem:15G1.8G 11G290M2.3G 
> 13G 
> > Swap:   39G  0B 39G 
> > 
> > Right before termination 
> > 
> > Mem:15G5.7G7.6G287M2.3G 
>9.2G 
> > Swap:   39G  0B 39G 
> > 
> > After 
> >  totalusedfree  shared 
>  buff/cache   available 
> > Mem:15G1.6G 11G287M2.3G 
> 13G 
> > Swap:   39G  0B 39G 
> > 
> > In 
> > https://groups.google.com/forum/#!topic/sage-support/m6R8_NKepyQ 
> > it is suggested to increase the swap space. 
> > However with 40 GB of swap I can only use about 4GB. 
> > On a different machine with 64 GB of swap I can use about 8 GB. 
> > However assigning more swap is impossible as I start to run out of hard 
> disk space. 
> > Can you reproduce this behavior? Suggestions? 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "sage-devel" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to sage-devel+...@googlegroups.com . 
> > To post to this group, send email to sage-...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/sage-devel. 
> > For more options, visit https://groups.google.com/d/optout. 
>

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


[sage-devel] libgap is not using the available memory

2018-09-18 Thread Simon Brandhorst
sage: V = libgap.GF(13)^500
sage: S = V.Subspaces(50)
sage: S.List()
gap: cannot extend the workspace any more!


As expected the computation runs out of memory. However, there is still a 
lot of unused memory. 

Before:

  totalusedfree  shared  
buff/cache   available
Mem:15G1.8G 11G290M2.3G 
13G
Swap:   39G  0B 39G

Right before termination

Mem:15G5.7G7.6G287M2.3G
9.2G
Swap:   39G  0B 39G
  
After
 totalusedfree  shared  
buff/cache   available
Mem:15G1.6G 11G287M2.3G 
13G
Swap:   39G  0B 39G

In 
https://groups.google.com/forum/#!topic/sage-support/m6R8_NKepyQ
it is suggested to increase the swap space. 
However with 40 GB of swap I can only use about 4GB.
On a different machine with 64 GB of swap I can use about 8 GB.
However assigning more swap is impossible as I start to run out of hard 
disk space.
Can you reproduce this behavior? Suggestions?

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


[sage-devel] Re: Buggy doctest in sage.modules.free_module.EchelonMatrixKey

2018-09-14 Thread Simon Brandhorst


On Thursday, September 13, 2018 at 2:42:44 PM UTC+2, Erik Bray wrote:
>
> However, reading the documentation for EchelonMatrixKey and 
> echelon_matrix_richcmp gives me the impression that this nonsensical 
> comparison isn't really the right behavior in the first place, but I'm 
> not sure.  Any experts on this code want to weight in? 
>

This ordering is the historical order on modules. It is still used in the 
modular forms code to make the output of some functions deterministic.
The default ordering was changed in https://trac.sagemath.org/ticket/23978 
to inclusion.

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


Re: [sage-devel] Non-Phython Sage source code.

2018-07-04 Thread Simon Brandhorst
Thank you. That worked :-).

On Wednesday, July 4, 2018 at 12:44:54 PM UTC+2, Thierry 
(sage-googlesucks@xxx) wrote:
>
> Hi, 
>
> On Wed, Jul 04, 2018 at 02:56:23AM -0700, Simon Brandhorst wrote: 
> > Following 
> > "Non-Python Sage source code and supporting files should be placed in 
> > appropriate subdirectories of SAGE_ROOT/src/ext/. 
> > They will then be automatically copied to the corresponding 
> subdirectories 
> > of SAGE_ROOT/local/share/sage/ext/ during the build process and can be 
> > accessed at runtime using SAGE_EXTCODE." 
> > 
> > I put some file in SAGE_ROOT/src/ext/gap. Then recompiled using make. 
> But 
> > the new file does not appear in 
> > SAGE_ROOT/local/share/sage/ext/ 
> > 
> > Do I need to build from scratch i.e. make distclean & make ? 
>
> Not necessarilly, you should run 
>
> ./configure 
>
> before "make build". 
>
> Ciao, 
> Thierry 
>
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "sage-devel" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to sage-devel+...@googlegroups.com . 
> > To post to this group, send email to sage-...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/sage-devel. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>

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


[sage-devel] Non-Phython Sage source code.

2018-07-04 Thread Simon Brandhorst
Following
"Non-Python Sage source code and supporting files should be placed in 
appropriate subdirectories of SAGE_ROOT/src/ext/. 
They will then be automatically copied to the corresponding subdirectories 
of SAGE_ROOT/local/share/sage/ext/ during the build process and can be 
accessed at runtime using SAGE_EXTCODE."

I put some file in SAGE_ROOT/src/ext/gap. Then recompiled using make. But 
the new file does not appear in 
SAGE_ROOT/local/share/sage/ext/

Do I need to build from scratch i.e. make distclean & make ? 

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


[sage-devel] Re: Permutation group: faster use of stabilizer chain from gap

2018-06-08 Thread Simon Brandhorst
Use libgap:

sage: def SGS_libgap(G, gap_output=True):
: S = libgap(G).StabChain()
: libgap.eval(gap_cosets)
: cosets = S.CosetsStabChain()
: if gap_output:
: return cosets
: 

sage: %time XX = SGS_libgap(A,True)
CPU times: user 31.7 ms, sys: 59 µs, total: 31.8 ms
Wall time: 31.9 ms
sage: %time XX = SGS_libgap(A,False)
CPU times: user 31.7 ms, sys: 59 µs, total: 31.8 ms
Wall time: 31.8 ms


sage: %time XX = SGS_old(A)
CPU times: user 3.43 s, sys: 535 ms, total: 3.96 s
Wall time: 4.03 s
sage: %time XX = SGS_new(A,True)
CPU times: user 3.39 ms, sys: 2.03 ms, total: 5.41 ms
Wall time: 7.98 ms
sage: %time XX = SGS_new(A,False)
CPU times: user 2.44 s, sys: 101 ms, total: 2.54 s
Wall time: 2.59 s




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


Re: [sage-devel] Re: Matrix groups are not uniquely represented, why?

2018-06-01 Thread Simon Brandhorst
Suggestion:

(1) Use unique representation for "ambient" objects ( GL(n,k), O(n,k,e), 
QQ^n).
(2) Do not use unique representation for subobjects.
(3) Give the .subobject(self, gens) method a (weak?) cache.
(4) Modify == to test equality as subobjects/subsets.

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


[sage-devel] Re: Matrix groups are not uniquely represented, why?

2018-05-25 Thread Simon Brandhorst
Update:

sage: S = SymmetricGroup(4)
sage: S1 = S.subgroup(S.gens()[:1])
sage: S2 = S.subgroup(S.gens()[:1])
sage: S1 is S2
False

Since the same is true for subgroups of permutation groups, I wonder if 
this is intended?

The reason I am asking is that I implemented abelian groups and their 
automorphisms with gap

sage.groups.abelian_gps.abelian_group_gap sage.groups.abelian_gps.
abelian_aut


using unique representations for subgroups. I did I miss something?

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


[sage-devel] Matrix groups are not uniquely represented, why?

2018-05-25 Thread Simon Brandhorst
sage: G = MatrixGroup([Matrix(GF(17),2,[1,1,1,0])])
Matrix group over Finite Field of size 17 with 1 generators (
[1 1]
[1 0]
)
sage: H = MatrixGroup([Matrix(GF(17),2,[1,1,1,0])])
sage: G is H
False


The reason is probably that there is no unique representation in gap.
Is this intended or to be considered a bug?

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


[sage-devel] Re: trac issues

2018-02-26 Thread Simon Brandhorst
Same here.

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


[sage-devel] Re: making database_gap (starting from GAP 4.9) standard - please vote

2018-02-19 Thread Simon Brandhorst
+1

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


Re: [sage-devel] Re: libgap_wrapper.is_subgroup change behaviour

2018-02-10 Thread Simon Brandhorst
That is my motivation as well. -- a baseclass for automorphism groups. Want 
to help me with that? :)

On Friday, February 9, 2018 at 8:48:44 PM UTC+1, mathzeta2 wrote:
>
> On 09/02/18 15:07, Simon Brandhorst wrote: 
> > 
> > The application I have in mind is to create an abstract base class for 
> > group homomorphisms of libgap groups. And if we want to compute the 
> > inverse image of a subgroup, then this should be decided by the method 
> > "is_subgroup". 
> > 
>
> A bit off-topic, but after having group homomorphisms, it will be very 
> nice to have a method to compute the automorphism group of a group G 
> which better than: 
>
> G._gap_().AutomorphismGroup() or 
> libgap(G).AutomorphismGroup() 
>
> The same goes as to create methods for the inner automorphism group, the 
> outer automorphism group and the holomorph. One motivation is just 
> examples in a group theory course, but obviously there many other. 
>
> Regards, 
> TB 
>

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


Re: [sage-devel] Re: libgap_wrapper.is_subgroup change behaviour

2018-02-09 Thread Simon Brandhorst
I think 1) is the reasonable way. 

G.is_subgroup(H) should return if G is (in a natural way) a subset of H 
such that it is closed under the group operations i.e. a subset.
For example for permutation groups (of {1,...,n} ) the "natural way" Is to 
regard all of them as permutation groups of the natural numbers NN.

In the concrete situation of libgap groups I would say that the function 
should return if gap considers them as subgroups. (Which should be 
compatible with the above.)
If one wants to have more restricted behaviour in a derived class, then one 
should override is_subgroup !?

The application I have in mind is to create an abstract base class for 
group homomorphisms of libgap groups. And if we want to compute the inverse 
image of a subgroup, then this should be decided by the method 
"is_subgroup".

On Friday, February 9, 2018 at 9:58:44 AM UTC+1, vdelecroix wrote:
>
> On 09/02/2018 09:47, Simon Brandhorst wrote: 
> >  Return whether the group was defined as a subgroup of a bigger 
> >  group. 
>
> This description is very unclear anyway. See also #24535 for ambiguities 
> concerning group comparisons. 
>
> For me there are two relevant concepts 
>
>   1) whether H is a subgroup of G, for example 
>
> sage: G = PermutationGroup([ [4,3,2,1], [2,1,4,3] ]) 
> sage: H = PermutationGroup([ [4,3,2,1] ]) 
> sage: H.is_subgroup(G) 
> True 
>
>   Here I did *not* defined H as a subgroup of G (so the above description 
>   does not apply). Note that in order for this comparison to make sense, 
>   G and H must be subgroups of a same ambient group (here 
>   SymmetricGroup(4)). But there is no such thing as an .ambient_group 
>   method. 
>
>   2) whether G contains a subgroup isomorphic to H. In this situation no 
>need to have a common ambient group 
>
> I think that more generally discussing and fixing the semantic of group 
> comparisons (and more generally algebraic structures) would be a good 
> idea... and the behavior would ideally be coherent among all of Sage! 
>
> Vincent 
>

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


[sage-devel] Re: libgap_wrapper.is_subgroup change behaviour

2018-02-09 Thread Simon Brandhorst
I forgot to say this is in sage.groups.libgap_wrapper

On Friday, February 9, 2018 at 9:45:50 AM UTC+1, Simon Brandhorst wrote:
>
> Currently:
>  
>def is_subgroup(self):
> """
> Return whether the group was defined as a subgroup of a bigger
> group.
>
> You can access the containing group with :meth:`ambient`.
>
> OUTPUT:
>
> Boolean.
>
> EXAMPLES::
>
> sage: G = FreeGroup(3)
> sage: G.is_subgroup()
> False
> """
> return self._ambient is not None
>
>
> But in any sensible derived class i would expect
>
> def is_subgroup(self, other):
> """
>Returns "True" if "self" is a subgroup of "other".
>"""
>
> The suggestion is to change the name of he first method to 
> "is_defined_as_subgroup"
>

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


[sage-devel] libgap_wrapper.is_subgroup change behaviour

2018-02-09 Thread Simon Brandhorst
Currently:
 
   def is_subgroup(self):
"""
Return whether the group was defined as a subgroup of a bigger
group.

You can access the containing group with :meth:`ambient`.

OUTPUT:

Boolean.

EXAMPLES::

sage: G = FreeGroup(3)
sage: G.is_subgroup()
False
"""
return self._ambient is not None


But in any sensible derived class i would expect

def is_subgroup(self, other):
"""
   Returns "True" if "self" is a subgroup of "other".
   """

The suggestion is to change the name of he first method to 
"is_defined_as_subgroup"

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


Re: [sage-devel] Re: Inverse of a p-adic matrix fails. Is this a bug?

2018-01-31 Thread Simon Brandhorst
Thank you for your replies.

For the application I had in mind it seems that 'floating-point' numbers 
are not suitable.

I was doing computations in 
sage: R = Zp(2,type='fixed-mod')
sage: M = Matrix(R,4,[0, 0, 1, 1, 2^19, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1])
sage: M.inverse().base_ring()
2-adic Field with floating precision 20
sage: (M.adjoint()*M.det().inverse_of_unit()).base_ring()
2-adic Ring of fixed modulus 2^20


Unfortunately the syntax is a little cumbersome. Is there a shortcut to 
this?
Invert a matrix without exending the base_ring (or throw an error)

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


[sage-devel] Inverse of a p-adic matrix fails. Is this a bug?

2018-01-30 Thread Simon Brandhorst
The following may be a bug or me not understanding p-adic floating point 
computations:


sage: R = Qp(2,type='floating-point',print_mode='terse')
sage: M = Matrix(R,4,[0, 0, 1, 1, 2^20, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1])
sage: M.det()
1048575
sage: M.inverse()
---
ZeroDivisionError Traceback (most recent call last)


ZeroDivisionError: input matrix must be nonsingular

sage: M = Matrix(R,4,[0, 0, 1, 1, 2^19, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1])
sage: M.inverse()
[ 1048575201]
[274878955520   5242881  1048575]
[  524289   5242871   524287]
[274877382656   524289  1048575   524289]

Works. 

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


Re: [sage-devel] Should ZZ^2 be a submodule of CC^2?

2018-01-19 Thread Simon Brandhorst


On Friday, January 19, 2018 at 9:16:16 AM UTC+1, vdelecroix wrote:

> I think that it should be False in both situations. "is_submodule" 
> should only be used in the context where we have an ambient free 
> module, like ZZ^d and two ZZ-submodules U and V. 
>
I disagree - the question makes perfect sense if U and V do not lie in the 
same ambient module but in the same ambient vectorspace.  
(ZZ^2).span([[1,0]]).is_submodule((ZZ^2).span([[1/2,0]]))
Should definitely return True.

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


Re: [sage-devel] Should ZZ^2 be a submodule of CC^2?

2018-01-19 Thread Simon Brandhorst
Maybe the question then splits into two parts:

1) Is ZZ^2 a subset of CC^2 ? (Use this for __richcmp__)

2) Is ZZ^2 a submodule of CC^2 in the category of modules over ZZ? That is 
do we view CC^2 as a ZZ-module? 

(It is a ZZ-module in a natural way by the inclusion ZZ ---> CC) So 
basically should is_submodule test A.base_ring() is B.base_ring() or just 
A.base_ring().is_subring(B.base_ring())?

>From my point of view both possibilities are mathematically consistent. It 
is merely a question how rigid we want to be - it is a convention. Though 
at the moment we are inconsistent. (QQ vs CC)

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


[sage-devel] Should ZZ^2 be a submodule of CC^2?

2018-01-18 Thread Simon Brandhorst
Dear all,

I am working on ticket 
#23978   Rich comparison for Modules

As part of it I also rewrote the is_submodule function. 


Currently, we have


sage: (ZZ^2).is_submodule(CC^2)
False
sage: (ZZ^2).is_submodule(QQ^2)
True

Should that behavior change to 


sage: (ZZ^2).is_submodule(CC^2)
True
sage: (ZZ^2).is_submodule(QQ^2)
True
?

I would say yes:

Since
sage: (CC^2).has_coerce_map_from(ZZ^2)
True
we already view `ZZ^2` in a canonical(=coercible) way as a submodule of 
CC^2. 


Reasons against:
- Abstractly a complex vector space does not have a natural integral 
structure.
But then we are working with modules with a distinguished basis. Not sure 
about the conventions there ?

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


[sage-devel] Re: matrix group action on elements of a subspace

2017-11-27 Thread Simon Brandhorst
Thank you for your answers. I guess I will stick to an explicitly defined 
action then. Not sure if I am the right person to do a clean up. But I 
guess I can document some functions.

On Saturday, November 25, 2017 at 11:22:50 PM UTC+1, Travis Scrimshaw wrote:
>
> You do have some flexibility on how you want to implement actions. Some of 
> this might be more complicated due to the classes you are inheriting from, 
> including some older code. The easier (but can be more cumbersome and 
> restrictive) way is to implement either _rmul_ / _lmul_ or _acted_upon_ 
> (recommended). However, I do not know if that takes precedence over an 
> explicitly defined action.
>
> There's a few examples of implementations of actions scattered around Sage 
> (such as in matrix/action.pyx) if that can help providing what you need 
> too. As you may have surmised, there is some old code floating around that 
> could use some cleanup and documentation.
>
> On Saturday, November 25, 2017 at 3:42:03 AM UTC-6, Simon Brandhorst wrote:
>>
>> Dear sagers,
>>
>> I am implementing a matrix group action on a submodule of ZZ^n.
>> element*matrix does work but the result lies in the ambient space and 
>> instead I want the
>> elements parent to be the invariant subspace we started with. 
>>
>> This can be done with sage.categories.action.Action
>>
>> However, that file was created in 2007, and it is almost not documented 
>> at all.
>> Is it the way to go anyways?
>>
>> Best
>> Simon
>>
>  

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


[sage-devel] matrix group action on elements of a subspace

2017-11-25 Thread Simon Brandhorst
Dear sagers,

I am implementing a matrix group action on a submodule of ZZ^n.
element*matrix does work but the result lies in the ambient space and 
instead I want the
elements parent to be the invariant subspace we started with. 

This can be done with sage.categories.action.Action

However, that file was created in 2007, and it is almost not documented at 
all.
Is it the way to go anyways?

Best
Simon

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


Re: [sage-devel] Re: Online Sage Days

2017-11-22 Thread Simon Brandhorst
 A wiki page would help for example. I kind of lost track of things. 

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


[sage-devel] p-adic factorization/root finding bug.

2017-11-10 Thread Simon Brandhorst
{{{
sage: f=x^22 + 9*x^21 + 16*x^20 - 92*x^19 - 408*x^18 - 144*x^17 + 2080*x^16 
+ 4096*x^15 + 128*x^14 - 8192*x^13 - 12800*x^12 - 18432*x^11 - 51200*x^10 - 
131072*x^9 + 8192*x^8 + 1048576*x^7 + 2129920*x^6 - 589824*
: x^5 - 6684672*x^4 - 6029312*x^3 + 4194304*x^2 + 9437184*x + 4194304
: 
sage: f.factor()
(x - 2)^6 * (x + 2)^8 * (x^8 + 5*x^7 + 16*x^6 + 40*x^5 + 88*x^4 + 160*x^3 + 
256*x^2 + 320*x + 256)
sage: g=f.change_ring(Qp(2,200))
sage: g.roots()

[(1 + 2 + 2^3 + 2^4 + 2^5 + 2^7 + 2^8 + 2^10 + 2^11 + 2^12 + 2^15 + 2^16 + 
2^19 + 2^20 + 2^22 + 2^28 + 2^31 + 2^32 + 2^38 + 2^39 + 2^40 + 2^41 + 2^43 
+ 2^44 + 2^46 + 2^47 + 2^50 + 2^53 + 2^54 + 2^56 + 2^57 + 2^59 + 2^60 + 
2^61 + 2^68 + 2^71 + 2^74 + 2^75 + 2^76 + 2^77 + 2^84 + 2^86 + 2^89 + 2^90 
+ 2^94 + 2^95 + 2^97 + 2^100 + 2^106 + 2^107 + 2^110 + 2^112 + 2^113 + 
2^118 + 2^119 + 2^124 + 2^126 + 2^127 + 2^128 + 2^132 + 2^135 + 2^141 + 
2^143 + 2^145 + 2^146 + 2^147 + 2^148 + 2^149 + 2^150 + 2^151 + 2^152 + 
2^155 + 2^160 + 2^162 + 2^165 + 2^166 + 2^168 + 2^170 + 2^171 + 2^173 + 
2^174 + 2^176 + 2^177 + 2^180 + 2^181 + 2^183 + 2^184 + 2^185 + 2^187 + 
2^189 + 2^190 + 2^191 + 2^192 + 2^193 + 2^194 + 2^195 + 2^196 + 2^197 + 
2^198 + O(2^200),
  1),
 (2^2 + 2^3 + 2^6 + 2^7 + 2^8 + 2^10 + 2^11 + 2^12 + 2^13 + 2^14 + 2^17 + 
2^18 + 2^20 + 2^23 + 2^24 + 2^28 + 2^29 + 2^33 + 2^34 + 2^36 + 2^39 + 2^40 
+ 2^42 + 2^44 + 2^45 + 2^47 + 2^54 + 2^55 + 2^56 + 2^58 + 2^59 + 2^61 + 
2^63 + 2^69 + 2^70 + 2^71 + 2^78 + 2^81 + 2^82 + 2^84 + 2^87 + 2^88 + 2^89 
+ 2^90 + 2^91 + 2^93 + 2^95 + 2^99 + 2^100 + 2^101 + 2^102 + 2^103 + 2^104 
+ 2^108 + 2^110 + 2^113 + 2^115 + 2^116 + 2^117 + 2^118 + 2^121 + 2^122 + 
2^123 + 2^124 + 2^126 + 2^128 + 2^130 + 2^131 + 2^133 + 2^135 + 2^137 + 
2^139 + 2^140 + 2^141 + 2^142 + 2^144 + 2^145 + 2^146 + 2^148 + 2^151 + 
2^152 + 2^157 + 2^158 + 2^159 + 2^163 + 2^165 + 2^166 + 2^169 + 2^170 + 
2^171 + 2^174 + 2^175 + 2^176 + 2^177 + 2^179 + 2^181 + 2^182 + 2^184 + 
2^188 + 2^192 + 2^193 + 2^194 + 2^195 + 2^196 + 2^198 + O(2^200),
  1)]


}}}


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


[sage-devel] Re: floor division for integer matrices

2017-11-02 Thread Simon Brandhorst
Enabling // just for Euclidean rings is fine for me. 
Or let's say A//k is defined if // is defined on the entries of A? (which 
should include euclidean rings).
And if it is not then one has to do the ugly conversion by hand if one 
really wants it.

On Wednesday, November 1, 2017 at 11:30:59 PM UTC+1, Simon King wrote:
>
> On 2017-11-01, David Roe  wrote: 
> > I don't think you're missing anything, and I would support adding this 
> > feature to matrices. 
>
> I wouldn't support it. 
>
> If you have an integral domain R, then the quotient x/y for x,y in R 
> will live in the fraction field of R, whereas floor division x//y 
> (I think) is only defined if R is a euclidean ring (division x//y 
> with remainder x%y). 
>
> The situation that this thread is about is different. Here, 
> we have a module, not an integral domain nor a euclidean ring. 
> If M is a matrix and c a skalar, then M/c is just syntactical 
> sugar for (1/c)*M. 
>
> Should M//c become syntactical sugar for "conversion of (1/c)*M 
> into M.parent()"? I don't see why it should. 
>
> That said: I also don't say that I would oppose to making M//c work. 
> I just wouldn't support it... 
>
> Best regards, 
> Simon 
>
>

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


[sage-devel] floor division for integer matrices

2017-11-01 Thread Simon Brandhorst
sage: A = Matrix(ZZ,2,[3,3,3,3])
sage: A
[3 3]
[3 3]
sage: A//3
---
TypeError Traceback (most recent call last)
...

TypeError: unsupported operand parent(s) for //: 'Full MatrixSpace of 2 by 
2 dense matrices over Integer Ring' and 'Full MatrixSpace of 2 by 2 dense 
matrices over Integer Ring'
sage: A/3
[1 1]
[1 1]
sage: (A/3).base_ring()
Rational Field


What I would like is a matrix over the Integers. Not an integral matrix 
over the rationals.
This seems so elementary that I wonder if I am missing something?

(A/3).change_ring(ZZ) 

is too ugly. Ticket?

And similar for p-adic integers, polynomial rings in one variable etc.

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


Re: [sage-devel] How do I overwrite comparison for modules?

2017-10-25 Thread Simon Brandhorst
Okay I made it work with __richcmp__ as suggested. 

Please review :-) . 

On Tuesday, October 24, 2017 at 7:53:46 AM UTC+2, Simon Brandhorst wrote:
>
> Ahhh
>
> On Monday, October 23, 2017 at 6:09:02 PM UTC+2, David Roe wrote:
>>
>>
>>
>> On Mon, Oct 23, 2017 at 8:24 AM, Simon Brandhorst <sbran...@web.de> 
>> wrote:
>>
>>> I am aware of this. It is just unexpected that other.__eq__(self) calls
>>> self._eq(other)
>>>
>>> As a user of that rich cmp method I would have expected it to call
>>> other._eq(self).
>>>
>>> Raising a not implemented error seems nice. :)
>>>
>>
>> Note that it should return NotImplemented (a built in constant to be 
>> returned by rich comparisons), not raise a NotImplementedError.
>> David
>>
>

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


Re: [sage-devel] How do I overwrite comparison for modules?

2017-10-23 Thread Simon Brandhorst
Ahhh

On Monday, October 23, 2017 at 6:09:02 PM UTC+2, David Roe wrote:
>
>
>
> On Mon, Oct 23, 2017 at 8:24 AM, Simon Brandhorst <sbran...@web.de 
> > wrote:
>
>> I am aware of this. It is just unexpected that other.__eq__(self) calls
>> self._eq(other)
>>
>> As a user of that rich cmp method I would have expected it to call
>> other._eq(self).
>>
>> Raising a not implemented error seems nice. :)
>>
>
> Note that it should return NotImplemented (a built in constant to be 
> returned by rich comparisons), not raise a NotImplementedError.
> David
>

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


Re: [sage-devel] How do I overwrite comparison for modules?

2017-10-23 Thread Simon Brandhorst
I am aware of this. It is just unexpected that other.__eq__(self) calls
self._eq(other)

As a user of that rich cmp method I would have expected it to call
other._eq(self).

Raising a not implemented error seems nice. :)
Anyways I believe it should be better documented if you want people to use 
these functions. 

On Monday, October 23, 2017 at 10:51:29 AM UTC+2, Jeroen Demeyer wrote:
>
> This is an infinite loop: 
>
> : if type(other)!=type(self): 
> : #other knows how to do the comparison 
> : return other.__eq__(self) 
>
> The correct Python thing to do is to return NotImplemented in this case. 
>

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


Re: [sage-devel] How do I overwrite comparison for modules?

2017-10-23 Thread Simon Brandhorst
Mhh okay, I can see that point.

On Monday, October 23, 2017 at 6:23:50 AM UTC+2, Travis Scrimshaw wrote:
>
>
>
> On Thursday, October 19, 2017 at 8:59:17 PM UTC-5, Simon Brandhorst wrote:
>>
>> Well richcmp allows you to define just one method. But it does not save 
>> you any work at all if the order is partial. 
>> Because then you have to distinguish the cases op = op_LE , op_GE, op_LT 
>> ... etc.  so all that you save is documentation and everything is more 
>> obscure.
>>
>
> It depends. In fact, it can make the code easier to follow and maintain 
> because you can do common cases for NE or for LT and LE. In fact, I might 
> be so bold as to say that is what happens generally (how often is the first 
> thing you do is verify the object has a compatible type?).
>
> Best,
> Travis
>
>

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


Re: [sage-devel] Re: Allow quotient modules for PIDs

2017-10-22 Thread Simon Brandhorst
Before proceeding I do need some help please.
#24031   Coercion between Matrices 
over orders and over the number field

also coercion between Vectors over orders and over the quotient 
field/number field is not working.  I am somewhat lost in the coercion 
model and do not know where to start here. 


As for the FGP_Module class, or in general:


Often matrices/vectors/scalar over the order and over the quotient field 
are multiplied.

Should one try to push as much as possible into the quotient field from the 
beginning? Or is it O.K. to rely on the coercion model. It is certainly 
more convenient to rely on coercion.

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


Re: [sage-devel] How do I overwrite comparison for modules?

2017-10-21 Thread Simon Brandhorst
from sage.structure.richcmp import richcmp_by_eq_and_lt,richcmp_method


@richcmp_method
class A(object):
def __init__(self,x):
self._x = x
__richcmp__ = richcmp_by_eq_and_lt("_eq","_lt")
def _eq(self,other):
if type(other)!=type(self):
#other knows how to do the comparison
return other.__eq__(self)
return self._x == other._x
def _lt(self,other):
return self._x in ()
> 1 A(Integer(1)) == B(Integer(1),"a")

/home/simon/sage/src/sage/structure/richcmp.pyx in 
sage.structure.richcmp.slot_tp_richcompare 
(build/cythonized/sage/structure/richcmp.c:1459)()
110 Function to put in the ``tp_richcompare`` slot.
111 """
--> 112 return self.__richcmp__(other, op)
113 
114 

/home/simon/sage/src/sage/structure/richcmp.pyx in 
sage.structure.richcmp.richcmp_by_eq_and_lt.richcmp 
(build/cythonized/sage/structure/richcmp.c:2178)()
317 if equal_types:
318 other_eq = getattr(other, eq_attr)
--> 319 if other_eq(self):
320 return rich_to_bool(op, 0)
321 if op == Py_EQ:

/home/simon/sage/src/sage/modules/bug.py in _eq(self, other)
 10 if type(other)!=type(self):
 11 #other knows how to do the comparison
---> 12 return other.__eq__(self)
 13 return self._x == other._x
 14 def _lt(self,other):

... last 3 frames repeated, from the frame below ...

/home/simon/sage/src/sage/structure/richcmp.pyx in 
sage.structure.richcmp.slot_tp_richcompare 
(build/cythonized/sage/structure/richcmp.c:1459)()
110 Function to put in the ``tp_richcompare`` slot.
111 """
--> 112 return self.__richcmp__(other, op)
113 
114 

RuntimeError: maximum recursion depth exceeded while calling a Python object
Enter code here...

This is unexpected but we know what to do
from sage.structure.richcmp import richcmp_by_eq_and_lt,richcmp_method


@richcmp_method
class A(object):
def __init__(self,x):
self._x = x
__richcmp__ = richcmp_by_eq_and_lt("_eq","_lt")
def _eq(self,other):
if type(other)!=type(self):
#other knows how to do the comparison
return self.__eq__(other)
return self._x == other._x
def _lt(self,other):
return self._xhttps://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] How do I overwrite comparison for modules?

2017-10-20 Thread Simon Brandhorst
/home/simon/sage/src/sage/structure/richcmp.pyx in 
sage.structure.richcmp.richcmp_by_eq_and_lt.richcmp 
(build/cythonized/sage/structure/richcmp.c:2172)()
317 if equal_types:
318 other_eq = getattr(other, eq_attr)
--> 319 if other_eq(self):
320 return rich_to_bool(op, 0)
321 if op == Py_EQ:

TypeError: unbound method _eq_() must be called with 
FreeModule_ambient_field_with_category instance as first argument (got 
FreeModule_submodule_field_with_category instance instead)

probably there should be 
319if other.other_eq(self)
or maybe
319other.__eq__(self)

Also when having many different subclasses which have to compare this 
lt_by_eq_and_lt does not work. As it gives the comparison to the other 
element all the time. But I think that is really something that the user 
should decide in his code if he wants it. This does too much.
For me this resulted in circular references etc... so it was a pain to get 
it work.

if not equal_types:
try:
other_eq = getattr(other, eq_attr)
other_lt = getattr(other, lt_attr)


On Friday, October 20, 2017 at 3:59:17 AM UTC+2, Simon Brandhorst wrote:
>
> Well richcmp allows you to define just one method. But it does not save 
> you any work at all if the order is partial. 
> Because then you have to distinguish the cases op = op_LE , op_GE, op_LT 
> ... etc.  so all that you save is documentation and everything is more 
> obscure.
>
> I also tried the richcmp_by_eq_and_lt in principle it is a nice idea and 
> exactly what I need.
> In practice it does not work. Well I could get it to work and all doctests 
> in the free_module.py and free_quadratic_module.py passed. But when testing 
> the whole module folder everything exploded.
> With commit b59062520b9b8e99e8ee126cbf209feb241a596a
>
> TypeError: _eq_() takes exactly 2 arguments (1 given)
> TypeError: unbound method _eq_() must be called with 
> FreeModule_submodule_pid_with_category instance as first argument (got 
> FreeModule_submodule_with_basis_pid_with_category instance instead)
> TypeError: unbound method _eq_() must be called with 
> FreeModule_submodule_field_with_category instance as first argument (got 
> FreeModule_submodule_with_basis_field_with_category instance instead)
> etc. etc. 
>
> So my solution was to remove the @richcmp decorator and the richcmp_by_eq 
> method. Then implement __neq__, __geq__ __leq__ by hand. 
> You can see it in #23978.
>
> It needs review :).
>
> So I expect that the richcmp_by_eq_and_lt does not work properly?
> Also lt is harder to implement they le. That would be nice to have too?
>
> On Tuesday, October 17, 2017 at 8:13:59 PM UTC+2, Travis Scrimshaw wrote:
>>
>>
>>
>> On Tuesday, October 17, 2017 at 9:55:25 AM UTC-5, Simon Brandhorst wrote:
>>>
>>> I got that now. But at the time I thought __richcmp__ was just a fancy 
>>> new name for the old __cmp__ in python in order to make it python 3 
>>> compatible. 
>>>
>>> Anyways. It would be nice to say something like that in the 
>>> documentation. (Maybe I have just missed it and it is there already.)
>>> "
>>> @richcmp_method simply allows to define just 
>>> one comparison method __richcmp__ instead of six __eq__, __lt__, ... "
>>> "
>>> and add a reference to some working example somewhere in the sage 
>>> library.
>>> As many people will come across that file who are not programmers and do 
>>> not speak cython.
>>> And in future they will also not know about the __cmp__ method of python 
>>> 2.7
>>>
>>> In Python, those are called rich comparisons and returning 
>> NotImplemented is a Python thing for rich comparisons, including in things 
>> like __eq__. So it doesn't have to do with speaking Cython. IMO, anytime 
>> you want to find an example in the Sage library, grep is your friend and is 
>> more robust than in some place in the documentation that could (quickly) go 
>> out of date. However, I agree with you that the documentation could be 
>> improved by stating about returning NotImplemented and having a more 
>> complete example.
>>
>> Best,
>> Travis
>>
>>  
>>
>

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


Re: [sage-devel] How do I overwrite comparison for modules?

2017-10-19 Thread Simon Brandhorst
Well richcmp allows you to define just one method. But it does not save you 
any work at all if the order is partial. 
Because then you have to distinguish the cases op = op_LE , op_GE, op_LT 
... etc.  so all that you save is documentation and everything is more 
obscure.

I also tried the richcmp_by_eq_and_lt in principle it is a nice idea and 
exactly what I need.
In practice it does not work. Well I could get it to work and all doctests 
in the free_module.py and free_quadratic_module.py passed. But when testing 
the whole module folder everything exploded.
With commit b59062520b9b8e99e8ee126cbf209feb241a596a

TypeError: _eq_() takes exactly 2 arguments (1 given)
TypeError: unbound method _eq_() must be called with 
FreeModule_submodule_pid_with_category instance as first argument (got 
FreeModule_submodule_with_basis_pid_with_category instance instead)
TypeError: unbound method _eq_() must be called with 
FreeModule_submodule_field_with_category instance as first argument (got 
FreeModule_submodule_with_basis_field_with_category instance instead)
etc. etc. 

So my solution was to remove the @richcmp decorator and the richcmp_by_eq 
method. Then implement __neq__, __geq__ __leq__ by hand. 
You can see it in #23978.

It needs review :).

So I expect that the richcmp_by_eq_and_lt does not work properly?
Also lt is harder to implement they le. That would be nice to have too?

On Tuesday, October 17, 2017 at 8:13:59 PM UTC+2, Travis Scrimshaw wrote:
>
>
>
> On Tuesday, October 17, 2017 at 9:55:25 AM UTC-5, Simon Brandhorst wrote:
>>
>> I got that now. But at the time I thought __richcmp__ was just a fancy 
>> new name for the old __cmp__ in python in order to make it python 3 
>> compatible. 
>>
>> Anyways. It would be nice to say something like that in the 
>> documentation. (Maybe I have just missed it and it is there already.)
>> "
>> @richcmp_method simply allows to define just 
>> one comparison method __richcmp__ instead of six __eq__, __lt__, ... "
>> "
>> and add a reference to some working example somewhere in the sage library.
>> As many people will come across that file who are not programmers and do 
>> not speak cython.
>> And in future they will also not know about the __cmp__ method of python 
>> 2.7
>>
>> In Python, those are called rich comparisons and returning NotImplemented 
> is a Python thing for rich comparisons, including in things like __eq__. So 
> it doesn't have to do with speaking Cython. IMO, anytime you want to find 
> an example in the Sage library, grep is your friend and is more robust than 
> in some place in the documentation that could (quickly) go out of date. 
> However, I agree with you that the documentation could be improved by 
> stating about returning NotImplemented and having a more complete example.
>
> Best,
> Travis
>
>  
>

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


Re: [sage-devel] Cannot push to trac - some git issue

2017-10-18 Thread Simon Brandhorst
Thank you guys for your help. It worked :)

What confused me was that there were two merge conflicts. One between the 
two branches  and one between them and the latest beta version. 


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


Re: [sage-devel] How do I overwrite comparison for modules?

2017-10-17 Thread Simon Brandhorst
I got that now. But at the time I thought __richcmp__ was just a fancy new 
name for the old __cmp__ in python in order to make it python 3 compatible. 

Anyways. It would be nice to say something like that in the documentation. 
(Maybe I have just missed it and it is there already.)
"
@richcmp_method simply allows to define just 
one comparison method __richcmp__ instead of six __eq__, __lt__, ... "
"
and add a reference to some working example somewhere in the sage library.
As many people will come across that file who are not programmers and do 
not speak cython.
And in future they will also not know about the __cmp__ method of python 2.7

On Tuesday, October 17, 2017 at 2:11:09 PM UTC+2, Jeroen Demeyer wrote:
>
> On 2017-10-17 12:13, Simon Brandhorst wrote: 
> > Because the documentation did not tell me it was possible: 
>
> That *what* is possible? @richcmp_method simply allows to define just 
> one comparison method __richcmp__ instead of six __eq__, __lt__, ... 
>
> However, the functionality of what that comparison method can do remains 
> the same. 
>

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


[sage-devel] Cannot push to trac - some git issue

2017-10-17 Thread Simon Brandhorst
Would you please help me with this? There seems to be some conflict but I 
am lost.
Git suggest to pull. But that does not change anything. After all that is 
what I just did.

[simon@Quadrator sage]$ git pull
Already up-to-date.
[simon@Quadrator sage]$ git status
On branch t/23978/rich_comparison_for_modules
Your branch is up-to-date with 
'trac/u/pmenegat/rich_comparison_for_modules'.
Untracked files:
  (use "git add ..." to include in what will be committed)

Sage_crash_report.txt
lattices_in_sage_sd91.ipynb
my_lattice.sobj
src/sage/libs/cypari2/

nothing added to commit but untracked files present (use "git add" to track)
[simon@Quadrator sage]$ git trac push
Pushing to Trac #23978...
Guessed remote branch: u/sbrandhorst/rich_comparison_for_modules
Traceback (most recent call last):
  File "/usr/bin/git-trac", line 18, in 
cmdline.launch()
  File "/usr/lib/python2.7/site-packages/git_trac/cmdline.py", line 223, in 
launch
app.push(ticket_number, remote=args.remote, force=args.force)
  File "/usr/lib/python2.7/site-packages/git_trac/app.py", line 216, in push
self.repo.push(remote, force)
  File "/usr/lib/python2.7/site-packages/git_trac/git_repository.py", line 
197, in push
self.git.echo.push('trac', refspec)
  File "/usr/lib/python2.7/site-packages/git_trac/git_interface.py", line 
341, in meth
return self.execute(git_cmd, *args, **kwds)
  File "/usr/lib/python2.7/site-packages/git_trac/git_interface.py", line 
98, in execute
popen_stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/site-packages/git_trac/git_interface.py", line 
263, in _run
raise GitError(result)
git_trac.git_error.GitError: git returned with non-zero exit code (1) when 
executing "git push trac 
HEAD:refs/heads/u/sbrandhorst/rich_comparison_for_modules"
STDERR: To g...@trac.sagemath.org:sage.git
STDERR:  ! [rejected]HEAD -> 
u/sbrandhorst/rich_comparison_for_modules (non-fast-forward)
STDERR: error: failed to push some refs to 
'g...@trac.sagemath.org:sage.git'
STDERR: hint: Updates were rejected because a pushed branch tip is 
behind its remote
STDERR: hint: counterpart. Check out this branch and integrate the 
remote changes
STDERR: hint: (e.g. 'git pull ...') before pushing again.
STDERR: hint: See the 'Note about fast-forwards' in 'git push --help' 
for details.

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


Re: [sage-devel] How do I overwrite comparison for modules?

2017-10-17 Thread Simon Brandhorst
Because the documentation did not tell me it was possible:

http://doc.sagemath.org/html/en/reference/structure/sage/structure/richcmp.html
Can you update it?

I have interpreted it as a way to go to python3 without changing the logic 
of the code.


On Monday, October 16, 2017 at 6:13:29 PM UTC+2, Travis Scrimshaw wrote:
>
> Now the question is why are you doing this? You have rich comparison 
> behavior (i.e., a partial order) by allowing a return value of 
> NotImplemented. So I do not understand why you would do this because it 
> comes with a lot of boilerplate code and documentation unless you want to 
> remove all use of inequality comparisons. Yet, I do not think that is what 
> you are going to do.
>
> Best,
> Travis
>
>

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


Re: [sage-devel] How do I overwrite comparison for modules?

2017-10-16 Thread Simon Brandhorst
It works. Thank you :-).

On Monday, October 16, 2017 at 2:28:00 PM UTC+2, Jeroen Demeyer wrote:
>
> Remove the @richcmp_method decorator. 
>

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


[sage-devel] How do I overwrite comparison for modules?

2017-10-16 Thread Simon Brandhorst
Hi all,

I want to redefine comparison for modules by using python like comparisons
__eq__, __lt__ etc.

See #23978
https://trac.sagemath.org/ticket/23978

So I have deleted the __richcmp__ methods and added a method

def __eq__(self, other):
return type(self) == type(other)


I get the following error in sage:

See #23978
https://trac.sagemath.org/ticket/23978

sage: A = ZZ^2
sage: A == A
---
AttributeErrorTraceback (most recent call last)
 in ()
> 1 A == A

/home/agag/sbrandhorst/sage/sage/src/sage/structure/richcmp.pyx in 
sage.structure.richcmp.slot_tp_richcompare 
(build/cythonized/sage/structure/richcmp.c:1414)()
110 Function to put in the ``tp_richcompare`` slot.
111 """
--> 112 return self.__richcmp__(other, op)
113 
114 

/home/agag/sbrandhorst/sage/sage/src/sage/structure/category_object.pyx in 
sage.structure.category_object.CategoryObject.__getattr__ 
(build/cythonized/sage/structure/category_object.c:7910)()
846 AttributeError: 'PrimeNumbers_with_category' object has 
no attribute 'sadfasdf'
847 """
--> 848 return self.getattr_from_category(name)
849 
850 cdef getattr_from_category(self, name):

/home/agag/sbrandhorst/sage/sage/src/sage/structure/category_object.pyx in 
sage.structure.category_object.CategoryObject.getattr_from_category 
(build/cythonized/sage/structure/category_object.c:8073)()
861 cls = self._category.parent_class
862 
--> 863 attr = getattr_from_other_class(self, cls, name)
864 self.__cached_methods[name] = attr
865 return attr

/home/agag/sbrandhorst/sage/sage/src/sage/cpython/getattr.pyx in 
sage.cpython.getattr.getattr_from_other_class 
(build/cythonized/sage/cpython/getattr.c:1831)()
247 dummy_error_message.cls = type(self)
248 dummy_error_message.name = name
--> 249 raise dummy_attribute_error
250 cdef PyObject* attr = _PyType_Lookup(cls, name)
251 if attr is NULL:

AttributeError: 'FreeModule_ambient_pid_with_category' object has no 
attribute '__richcmp__'


So somehow it insists on using __richcmp__. How can I teach it to use the 
python style methods?

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


Re: [sage-devel] Re: Allow quotient modules for PIDs

2017-10-13 Thread Simon Brandhorst
{{{
sage: L. = CyclotomicField(5)
sage: OL= L.ring_of_integers()
sage: OL
Maximal Order in Cyclotomic Field of order 5 and degree 4
sage: M=Matrix(OL,2,[1-a,0,a,1+a])
sage: a.parent()
Cyclotomic Field of order 5 and degree 4
sage: a*M
---

TypeError: unsupported operand parent(s) for *: 'Cyclotomic Field of order 
5 and degree 4' and 'Full MatrixSpace of 2 by 2 dense matrices over Maximal 
Order in Cyclotomic Field of order 5 and degree 4'
sage: M=Matrix(L,2,[1-a,0,a,1+a])
sage: a*M
[-a^2 + a0]
[ a^2  a^2 + a]
}}}

On Friday, October 13, 2017 at 10:59:13 AM UTC+2, John Cremona wrote:
>
> On 13 October 2017 at 08:37, Simon Brandhorst <sbran...@web.de 
> > wrote: 
> > The testsuite runs now. A long list of rings would be helpful. 
> > 
> > Some Pids i care about: 
> > ZZ[\zeta_n] of degree <= 20, (they are in fact euclidean) 
> > QQ(\sqrt(d)) of class number one. 
> > F[x] for F any field. (probably these are not really working well 
> enough) 
>
> How about a PID whcih is *not* Euclidean such as Z[a] with a^2+a+5=0 
> (i.e. ring if integers in Q(sqrt(-19))? 
>
> > 
> > More ideas? 
> > 
> > 
> > 
> > On Friday, October 13, 2017 at 9:14:36 AM UTC+2, Simon Brandhorst wrote: 
> >> 
> >> https://trac.sagemath.org/ticket/24027 
> >> 
> >> In order to do good testing. Do we have a nice list of PIDs? 
> >> 
> >> On Friday, October 13, 2017 at 9:07:00 AM UTC+2, Simon Brandhorst 
> wrote: 
> >>> 
> >>> Yep, adding doc tests over other rings is the minimum requirement.  I 
> can 
> >>> do that. 
> >>> Yet I would print a warning message for some time. I would expect some 
> >>> bugs to be leftover in any case. 
> >>> -- Simon 
> >>> 
> >>> On Thursday, October 12, 2017 at 8:35:14 PM UTC+2, William wrote: 
> >>>> 
> >>>> Hi, 
> >>>> 
> >>>> I'm really happy to hear people are giving this code some attention! 
> >>>> 
> >>>> I wrote the original FGP package.  At the time, there was no support 
> for 
> >>>> computing HNF or anything else except for ZZ, so I couldn't even test 
> or try 
> >>>> the algorithms there.  I **might** have made some assumptions about 
> the base 
> >>>> ring being ZZ for simplicity due to this, but I hope I didn't.  I 
> don't 
> >>>> remember -- it was a long time ago. 
> >>>> 
> >>>> The only reason this hasn't moved forward after more support for HNF 
> was 
> >>>> added for other PIDs is that I'm busy with other things these days.   
> I hope 
> >>>> somebody else will take over.If I was working on this code, I 
> would go 
> >>>> through the module and add a ton of doctests analogous to the 
> existing tests 
> >>>> over ZZ, but over some other PID's.   I definitely, definitely would 
> NOT 
> >>>> even consider just enabling this functionality with a warning 
> message, and 
> >>>> crossing my fingers like Simon seems to be suggestion below.  I 
> strongly 
> >>>> object to that.   I endorse: 
> >>>> 
> >>>>  - enable the functionality 
> >>>>  - write a bunch of new doctests showing how (and that) it works. 
> >>>>  - then release it publicly. 
> >>>> 
> >>>> If it does work, doing the above is maybe 1 day of work.  If it 
> doesn't 
> >>>> work, so the above is much harder than 1 day of work, then we 
> shouldn't have 
> >>>> released it in the first place. 
> >>>> 
> >>>> Again, Simon, I'm really happy you're looking into this and making 
> this 
> >>>> more general functionality available.  I was pretty happy with my 
> original 
> >>>> FGP implementation, which was a lot of work one summer years ago... 
> >>>> 
> >>>>  -- William 
> >>>> 
> >>>> On Thu, Oct 12, 2017 at 8:48 AM Simon Brandhorst <sbran...@web.de> 
> >>>> wrote: 
> >>>>> 
> >>>>> O.K. I will do that. Even if we do not have enough tests. Maybe we 
> can 
> >>>>> allow it and print some 
> >>>>> "This code is still experimental" warning. After all it will only 
> get 
> >>>>> really stable is people use it a lot. 
> >>>>> 
> >>>>> On Thursday, October 

Re: [sage-devel] Re: Allow quotient modules for PIDs

2017-10-13 Thread Simon Brandhorst
The testsuite runs now. A long list of rings would be helpful. 

Some Pids i care about:
ZZ[\zeta_n] of degree <= 20, (they are in fact euclidean)
QQ(\sqrt(d)) of class number one.
F[x] for F any field. (probably these are not really working well enough)

More ideas? 



On Friday, October 13, 2017 at 9:14:36 AM UTC+2, Simon Brandhorst wrote:
>
> https://trac.sagemath.org/ticket/24027
>
> In order to do good testing. Do we have a nice list of PIDs?
>
> On Friday, October 13, 2017 at 9:07:00 AM UTC+2, Simon Brandhorst wrote:
>>
>> Yep, adding doc tests over other rings is the minimum requirement.  I can 
>> do that.
>> Yet I would print a warning message for some time. I would expect some 
>> bugs to be leftover in any case. 
>> -- Simon
>>
>> On Thursday, October 12, 2017 at 8:35:14 PM UTC+2, William wrote:
>>>
>>> Hi,
>>>
>>> I'm really happy to hear people are giving this code some attention!
>>>
>>> I wrote the original FGP package.  At the time, there was no support for 
>>> computing HNF or anything else except for ZZ, so I couldn't even test or 
>>> try the algorithms there.  I **might** have made some assumptions about the 
>>> base ring being ZZ for simplicity due to this, but I hope I didn't.  I 
>>> don't remember -- it was a long time ago.  
>>>
>>> The only reason this hasn't moved forward after more support for HNF was 
>>> added for other PIDs is that I'm busy with other things these days.   I 
>>> hope somebody else will take over.If I was working on this code, I 
>>> would go through the module and add a ton of doctests analogous to the 
>>> existing tests over ZZ, but over some other PID's.   I definitely, 
>>> definitely would NOT even consider just enabling this functionality with a 
>>> warning message, and crossing my fingers like Simon seems to be suggestion 
>>> below.  I strongly object to that.   I endorse:
>>>
>>>  - enable the functionality 
>>>  - write a bunch of new doctests showing how (and that) it works.  
>>>  - then release it publicly.
>>>
>>> If it does work, doing the above is maybe 1 day of work.  If it doesn't 
>>> work, so the above is much harder than 1 day of work, then we shouldn't 
>>> have released it in the first place.  
>>>
>>> Again, Simon, I'm really happy you're looking into this and making this 
>>> more general functionality available.  I was pretty happy with my original 
>>> FGP implementation, which was a lot of work one summer years ago...
>>>
>>>  -- William
>>>
>>> On Thu, Oct 12, 2017 at 8:48 AM Simon Brandhorst <sbran...@web.de> 
>>> wrote:
>>>
>>>> O.K. I will do that. Even if we do not have enough tests. Maybe we can 
>>>> allow it and print some
>>>> "This code is still experimental" warning. After all it will only get 
>>>> really stable is people use it a lot. 
>>>>
>>>> On Thursday, October 12, 2017 at 5:06:20 PM UTC+2, Simon Brandhorst 
>>>> wrote:
>>>>
>>>>> sage: L. = NumberField(x^2 - x + 2)
>>>>> sage: OL = L.ring_of_integers()
>>>>> sage: V = OL**3; W = V.span([[0,w,0], [1,0,1-w]], OL)
>>>>> sage: FGP_Module(V,W)
>>>>> This works
>>>>>
>>>>> sage: V.quotient(W)
>>>>> NotImplementedError: quotients of modules over rings other than fields 
>>>>> or ZZ is not fully implemented
>>>>>
>>>>>
>>>>> Well FGP looks pretty implemented to me. 
>>>>>
>>>>> Objections?
>>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "sage-devel" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to sage-devel+...@googlegroups.com.
>>>> To post to this group, send email to sage-...@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/sage-devel.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>>> -- William Stein
>>>
>>

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


Re: [sage-devel] Re: Allow quotient modules for PIDs

2017-10-13 Thread Simon Brandhorst
https://trac.sagemath.org/ticket/24027

In order to do good testing. Do we have a nice list of PIDs?

On Friday, October 13, 2017 at 9:07:00 AM UTC+2, Simon Brandhorst wrote:
>
> Yep, adding doc tests over other rings is the minimum requirement.  I can 
> do that.
> Yet I would print a warning message for some time. I would expect some 
> bugs to be leftover in any case. 
> -- Simon
>
> On Thursday, October 12, 2017 at 8:35:14 PM UTC+2, William wrote:
>>
>> Hi,
>>
>> I'm really happy to hear people are giving this code some attention!
>>
>> I wrote the original FGP package.  At the time, there was no support for 
>> computing HNF or anything else except for ZZ, so I couldn't even test or 
>> try the algorithms there.  I **might** have made some assumptions about the 
>> base ring being ZZ for simplicity due to this, but I hope I didn't.  I 
>> don't remember -- it was a long time ago.  
>>
>> The only reason this hasn't moved forward after more support for HNF was 
>> added for other PIDs is that I'm busy with other things these days.   I 
>> hope somebody else will take over.If I was working on this code, I 
>> would go through the module and add a ton of doctests analogous to the 
>> existing tests over ZZ, but over some other PID's.   I definitely, 
>> definitely would NOT even consider just enabling this functionality with a 
>> warning message, and crossing my fingers like Simon seems to be suggestion 
>> below.  I strongly object to that.   I endorse:
>>
>>  - enable the functionality 
>>  - write a bunch of new doctests showing how (and that) it works.  
>>  - then release it publicly.
>>
>> If it does work, doing the above is maybe 1 day of work.  If it doesn't 
>> work, so the above is much harder than 1 day of work, then we shouldn't 
>> have released it in the first place.  
>>
>> Again, Simon, I'm really happy you're looking into this and making this 
>> more general functionality available.  I was pretty happy with my original 
>> FGP implementation, which was a lot of work one summer years ago...
>>
>>  -- William
>>
>> On Thu, Oct 12, 2017 at 8:48 AM Simon Brandhorst <sbran...@web.de> wrote:
>>
>>> O.K. I will do that. Even if we do not have enough tests. Maybe we can 
>>> allow it and print some
>>> "This code is still experimental" warning. After all it will only get 
>>> really stable is people use it a lot. 
>>>
>>> On Thursday, October 12, 2017 at 5:06:20 PM UTC+2, Simon Brandhorst 
>>> wrote:
>>>
>>>> sage: L. = NumberField(x^2 - x + 2)
>>>> sage: OL = L.ring_of_integers()
>>>> sage: V = OL**3; W = V.span([[0,w,0], [1,0,1-w]], OL)
>>>> sage: FGP_Module(V,W)
>>>> This works
>>>>
>>>> sage: V.quotient(W)
>>>> NotImplementedError: quotients of modules over rings other than fields 
>>>> or ZZ is not fully implemented
>>>>
>>>>
>>>> Well FGP looks pretty implemented to me. 
>>>>
>>>> Objections?
>>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "sage-devel" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to sage-devel+...@googlegroups.com.
>>> To post to this group, send email to sage-...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/sage-devel.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> -- William Stein
>>
>

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


Re: [sage-devel] Re: Allow quotient modules for PIDs

2017-10-13 Thread Simon Brandhorst
Yep, adding doc tests over other rings is the minimum requirement.  I can 
do that.
Yet I would print a warning message for some time. I would expect some bugs 
to be leftover in any case. 
-- Simon

On Thursday, October 12, 2017 at 8:35:14 PM UTC+2, William wrote:
>
> Hi,
>
> I'm really happy to hear people are giving this code some attention!
>
> I wrote the original FGP package.  At the time, there was no support for 
> computing HNF or anything else except for ZZ, so I couldn't even test or 
> try the algorithms there.  I **might** have made some assumptions about the 
> base ring being ZZ for simplicity due to this, but I hope I didn't.  I 
> don't remember -- it was a long time ago.  
>
> The only reason this hasn't moved forward after more support for HNF was 
> added for other PIDs is that I'm busy with other things these days.   I 
> hope somebody else will take over.If I was working on this code, I 
> would go through the module and add a ton of doctests analogous to the 
> existing tests over ZZ, but over some other PID's.   I definitely, 
> definitely would NOT even consider just enabling this functionality with a 
> warning message, and crossing my fingers like Simon seems to be suggestion 
> below.  I strongly object to that.   I endorse:
>
>  - enable the functionality 
>  - write a bunch of new doctests showing how (and that) it works.  
>  - then release it publicly.
>
> If it does work, doing the above is maybe 1 day of work.  If it doesn't 
> work, so the above is much harder than 1 day of work, then we shouldn't 
> have released it in the first place.  
>
> Again, Simon, I'm really happy you're looking into this and making this 
> more general functionality available.  I was pretty happy with my original 
> FGP implementation, which was a lot of work one summer years ago...
>
>  -- William
>
> On Thu, Oct 12, 2017 at 8:48 AM Simon Brandhorst <sbran...@web.de 
> > wrote:
>
>> O.K. I will do that. Even if we do not have enough tests. Maybe we can 
>> allow it and print some
>> "This code is still experimental" warning. After all it will only get 
>> really stable is people use it a lot. 
>>
>> On Thursday, October 12, 2017 at 5:06:20 PM UTC+2, Simon Brandhorst wrote:
>>
>>> sage: L. = NumberField(x^2 - x + 2)
>>> sage: OL = L.ring_of_integers()
>>> sage: V = OL**3; W = V.span([[0,w,0], [1,0,1-w]], OL)
>>> sage: FGP_Module(V,W)
>>> This works
>>>
>>> sage: V.quotient(W)
>>> NotImplementedError: quotients of modules over rings other than fields 
>>> or ZZ is not fully implemented
>>>
>>>
>>> Well FGP looks pretty implemented to me. 
>>>
>>> Objections?
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+...@googlegroups.com .
>> To post to this group, send email to sage-...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/sage-devel.
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
> -- William Stein
>

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


[sage-devel] Re: Allow quotient modules for PIDs

2017-10-12 Thread Simon Brandhorst
O.K. I will do that. Even if we do not have enough tests. Maybe we can 
allow it and print some
"This code is still experimental" warning. After all it will only get 
really stable is people use it a lot. 

On Thursday, October 12, 2017 at 5:06:20 PM UTC+2, Simon Brandhorst wrote:
>
> sage: L. = NumberField(x^2 - x + 2)
> sage: OL = L.ring_of_integers()
> sage: V = OL**3; W = V.span([[0,w,0], [1,0,1-w]], OL)
> sage: FGP_Module(V,W)
> This works
>
> sage: V.quotient(W)
> NotImplementedError: quotients of modules over rings other than fields or 
> ZZ is not fully implemented
>
>
> Well FGP looks pretty implemented to me. 
>
> Objections?
>

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


[sage-devel] Re: Allow quotient modules for PIDs

2017-10-12 Thread Simon Brandhorst
If forgot to add

sage: from sage.modules.fg_pid.fgp_module import FGP_Module


On Thursday, October 12, 2017 at 5:06:20 PM UTC+2, Simon Brandhorst wrote:
>
> sage: L. = NumberField(x^2 - x + 2)
> sage: OL = L.ring_of_integers()
> sage: V = OL**3; W = V.span([[0,w,0], [1,0,1-w]], OL)
> sage: FGP_Module(V,W)
> This works
>
> sage: V.quotient(W)
> NotImplementedError: quotients of modules over rings other than fields or 
> ZZ is not fully implemented
>
>
> Well FGP looks pretty implemented to me. 
>
> Objections?
>

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


[sage-devel] Allow quotient modules for PIDs

2017-10-12 Thread Simon Brandhorst
sage: L. = NumberField(x^2 - x + 2)
sage: OL = L.ring_of_integers()
sage: V = OL**3; W = V.span([[0,w,0], [1,0,1-w]], OL)
sage: FGP_Module(V,W)
This works

sage: V.quotient(W)
NotImplementedError: quotients of modules over rings other than fields or 
ZZ is not fully implemented


Well FGP looks pretty implemented to me. 

Objections?

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


Re: [sage-devel] Re: Please help with #23967 Coercion pushout for FGP_modules

2017-10-11 Thread Simon Brandhorst
OK I have implemented the less easy version with construction functors. 
That seems to be the best practice. The ticket is ready for review.

On Monday, October 9, 2017 at 7:55:13 PM UTC+2, David Roe wrote:
>
>
>
> On Mon, Oct 9, 2017 at 1:38 PM, Simon Brandhorst <sbran...@web.de 
> > wrote:
>
>> It helps a bit. Though my problem right now is that fgp_modules do not 
>> have a construction defined in the tutorial this is the case. So I have to 
>> give fgp_modules a construction functor? Or is there an easier way to get a 
>> pushout?
>>
>
> Nope, that's how you get pushouts.  You can take a look at the 
> QuotientFunctor in sage/categories/pushout.py for inspiration.
> David
>
>
>
>> On Monday, October 9, 2017 at 12:45:17 PM UTC+2, Simon King wrote:
>>>
>>> On 2017-10-09, Simon Brandhorst <sbran...@web.de> wrote: 
>>> > Would someone please guide me through this? 
>>> > I would like to learn now to implement such a thing in sage. Yet I 
>>> wouldn't 
>>> > know where to start here. 
>>> > It is mathematically quite simple. 
>>>
>>> Does 
>>> http://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html
>>>  
>>> help? 
>>>
>>> Cheers, 
>>> Simon 
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+...@googlegroups.com .
>> To post to this group, send email to sage-...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/sage-devel.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


Re: [sage-devel] Re: Please help with #23967 Coercion pushout for FGP_modules

2017-10-09 Thread Simon Brandhorst
I see. I have found an easy solution by defining a method ._pushout_
It works. I have uploaded the branch so you can take a look. 

On Monday, October 9, 2017 at 7:55:13 PM UTC+2, David Roe wrote:
>
>
>
> On Mon, Oct 9, 2017 at 1:38 PM, Simon Brandhorst <sbran...@web.de 
> > wrote:
>
>> It helps a bit. Though my problem right now is that fgp_modules do not 
>> have a construction defined in the tutorial this is the case. So I have to 
>> give fgp_modules a construction functor? Or is there an easier way to get a 
>> pushout?
>>
>
> Nope, that's how you get pushouts.  You can take a look at the 
> QuotientFunctor in sage/categories/pushout.py for inspiration.
> David
>
>
>
>> On Monday, October 9, 2017 at 12:45:17 PM UTC+2, Simon King wrote:
>>>
>>> On 2017-10-09, Simon Brandhorst <sbran...@web.de> wrote: 
>>> > Would someone please guide me through this? 
>>> > I would like to learn now to implement such a thing in sage. Yet I 
>>> wouldn't 
>>> > know where to start here. 
>>> > It is mathematically quite simple. 
>>>
>>> Does 
>>> http://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html
>>>  
>>> help? 
>>>
>>> Cheers, 
>>> Simon 
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+...@googlegroups.com .
>> To post to this group, send email to sage-...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/sage-devel.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


[sage-devel] Re: Please help with #23967 Coercion pushout for FGP_modules

2017-10-09 Thread Simon Brandhorst
It helps a bit. Though my problem right now is that fgp_modules do not have 
a construction defined in the tutorial this is the case. So I have to give 
fgp_modules a construction functor? Or is there an easier way to get a 
pushout?

On Monday, October 9, 2017 at 12:45:17 PM UTC+2, Simon King wrote:
>
> On 2017-10-09, Simon Brandhorst <sbran...@web.de > wrote: 
> > Would someone please guide me through this? 
> > I would like to learn now to implement such a thing in sage. Yet I 
> wouldn't 
> > know where to start here. 
> > It is mathematically quite simple. 
>
> Does 
> http://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html
>  
> help? 
>
> Cheers, 
> Simon 
>
>

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


[sage-devel] Re: submodules subvectorspaces violate the unique parent condition. Why? Should we change that?

2017-10-09 Thread Simon Brandhorst
A case where this may be relevant:

A,B,C,D submodules of the same ambient vector space, e.g. QQ^n
A/B and C/D have a good pushout (A+C)/(B+D) this is where the sum of two 
elements (a+B) + (c +D) lives.

So I have to teach the coercion framework how to create (A + C) / (B + D). 
Now if this is not unique I might end up creating a xillion parents just by 
adding elements. 
Let's see how it goes. If it happens, I will post it here.

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


[sage-devel] Re: Please help with #23967 Coercion pushout for FGP_modules

2017-10-09 Thread Simon Brandhorst
Thank you Simon :).
Probably, it will take me some time to read/understand though.
Would you review the ticket when it is done?

On Monday, October 9, 2017 at 12:45:17 PM UTC+2, Simon King wrote:
>
> On 2017-10-09, Simon Brandhorst <sbran...@web.de > wrote: 
> > Would someone please guide me through this? 
> > I would like to learn now to implement such a thing in sage. Yet I 
> wouldn't 
> > know where to start here. 
> > It is mathematically quite simple. 
>
> Does 
> http://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html
>  
> help? 
>
> Cheers, 
> Simon 
>
>

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


[sage-devel] Re: submodules subvectorspaces violate the unique parent condition. Why? Should we change that?

2017-10-09 Thread Simon Brandhorst
Hi Simon,

thank you for your explanation. Given the concrete example.
Over exact PIDs/fields one can use echelonized matrices/hermite normal form 
to get
unique Hashes. As far as I can see they are computed anyways at the time of 
initalization of a submodule.

So the upshot is that unless someone notices speed problems when working 
with submodules, this is not worth to be changed?

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


[sage-devel] Please help with #23967 Coercion pushout for FGP_modules

2017-10-09 Thread Simon Brandhorst
Would someone please guide me through this? 
I would like to learn now to implement such a thing in sage. Yet I wouldn't 
know where to start here.
It is mathematically quite simple. 

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


Re: [sage-devel] submodules subvectorspaces violate the unique parent condition. Why? Should we change that?

2017-10-09 Thread Simon Brandhorst
"While *parents* are unique, equal *elements* of a parent in Sage are not 
necessarily identical. "
in
http://doc.sagemath.org/html/en/tutorial/tour_coercion.html

OK.  In the parent class it says
"...this is useful if parents are unique, or element_constructor is a bound 
method (this latter case can be detected automatically). ..."

So uniqueness is not strict. But when is a parent supposed to be unique and 
when not?


On Monday, October 9, 2017 at 9:48:29 AM UTC+2, vdelecroix wrote:
>
> It is a violation of what!? Where did you read that parents should be 
> unique? 
>
> On 09/10/2017 09:26, Simon Brandhorst wrote: 
> > {{{ 
> > sage: V = span(QQ,[(1,1),(1,0)]) 
> > sage: W = span(QQ,[(0,1),(1,0)]) 
> > sage: V 
> > 
> > Vector space of degree 2 and dimension 2 over Rational Field 
> > Basis matrix: 
> > [1 0] 
> > [0 1] 
> > sage: W 
> > 
> > Vector space of degree 2 and dimension 2 over Rational Field 
> > Basis matrix: 
> > [1 0] 
> > [0 1] 
> > sage: V is W 
> > False 
> > sage: V==W 
> > True 
> > sage: type(V) 
> >  'sage.modules.free_module.FreeModule_submodule_field_with_category'> 
> > sage: type(W) 
> >  'sage.modules.free_module.FreeModule_submodule_field_with_category'> 
> > }}} 
> > 
> > They are parents. Yet they are not unique. 
> > 
>

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


[sage-devel] submodules subvectorspaces violate the unique parent condition. Why? Should we change that?

2017-10-09 Thread Simon Brandhorst
{{{
sage: V = span(QQ,[(1,1),(1,0)])
sage: W = span(QQ,[(0,1),(1,0)])
sage: V

Vector space of degree 2 and dimension 2 over Rational Field
Basis matrix:
[1 0]
[0 1]
sage: W

Vector space of degree 2 and dimension 2 over Rational Field
Basis matrix:
[1 0]
[0 1]
sage: V is W
False
sage: V==W
True
sage: type(V)

sage: type(W)

}}}

They are parents. Yet they are not unique.

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


Re: [sage-devel] Online Sage Days

2017-10-05 Thread Simon Brandhorst
+1 Though I am a newbie. 

On Tuesday, September 26, 2017 at 7:50:59 AM UTC+2, David Roe wrote:
>
> Hi everyone,
> Sorry for the delay!
>
> I've created scheduling polls.  If you have a conflict with part of a time 
> slot, feel free to use the "maybe" option by clicking twice.  The polls are 
> for a specific week (October 7-13) but I'm hoping that we can use the same 
> time slot to meet more than once if it's productive.  So feel free to fill 
> out the poll even if you have a conflict with this week in particular, and 
> just make a comment.  Also, put your trac username in parentheses after 
> your name!
>
> * Python 3 - https://doodle.com/poll/xyituk2k3iwu7taf
> * Infrastructure - https://doodle.com/poll/zduyvyshxcfv3wz6
> * Packaging - https://doodle.com/poll/2xrezk86vpaa9x2p
> * Category cleanup - https://doodle.com/poll/tpyqzh8pska8wzu6
>
> David
>
> On Sun, Sep 10, 2017 at 12:13 PM, Vincent Delecroix <20100.d...@gmail.com 
> > wrote:
>
>> +1
>>
>> Would make sense to come up with topics (we are discussing it right now 
>> in this thread). And then, we could set up a date poll for each of them. 
>> (Might be what you were suggesting)
>>
>> For the themtaics, I will be up for
>>
>>  * Python 3
>>
>>  * (Random) testing / speed regression
>>
>> 1) the test suite should not be that long (e.g. there are some places 
>> with duplicated and long doctest). I would like
>>  - the short testsuite to run fast (e.g. "sage -tp --all" running in 
>> less than 5 minutes)
>>  - have the long testsuite one reasonably fast (i.e. no "long 
>> doctest" warning in any circumstance)
>>  - introduce a new flag for very long doctest that can not be avoided 
>> (e.g. they carefully check a bug that appear only in huge dimensions). 
>> These will be run by patchbots only in the rc release cycle.
>>
>> 2) Specify and test the random generators (random_element is now 
>> unpredictible).
>>
>> 3) In the flint testsuite they also have specific random generators 
>> to test examples (e.g. on polynomials such random generator is likely to 
>> return 0 or 1 or x or x^100 + 1). It would make sense to adapt this 
>> strategy in Sage. I would actually get rid of the methods `some_elements` 
>> and just have a hidden `_random_test_elements()`. I do not see the point of 
>> having this method public
>>
>>  * Clean and finish the categorification. That is all the mess that 
>> appear in tab completion as soon as you inherit from sage.structure.Element 
>> (like base_ring). Also get rid of the last old parent classes.
>>
>>  * And for more mathematical things I am more likely to develop/debug the 
>> parts that are related to my research at the time I need them. So I would 
>> be happy with some review sessions where people post and review tickets. 
>> But nothing dedicated to a specific area.
>>
>> Vincent
>>
>>
>>
>> On 09/09/2017 05:04, David Roe wrote:
>>
>>> Hi everyone,
>>> I'd like to organize some online Sage Days, where people gather on
>>> zulip.sagemath.org and work on Sage together.  The two things to be 
>>> decided
>>> are
>>> 1. What topics should we focus on?
>>> 2. What days/times work for the most people?
>>> Some of these may transition into in-person working groups (the IMA has
>>> funding for small groups to meet there over this coming year to work on
>>> projects)
>>>
>>> I'll send out a survey for the scheduling part, but I wanted to solicit
>>> suggestions for topics first.  Some ideas:
>>>
>>> * Python 3 Compatibility
>>> * Work on documentation tickets, discuss overall documentation structure,
>>> make docbuilding more robust
>>> * Sage Infrastructure (improving the patchbot; common login for trac,
>>> github, google, zulip using OAuth; investigate options for in-line code
>>> review)
>>> * Sage's packaging and build system
>>> * Infrastructure for more random testing, speed regression testing
>>> * Interacts and interactive mathematics
>>> * Comparing Magma and Sage
>>> * Additional interfaces (Macaulay2)
>>>
>>> And on the mathematical side:
>>> * p-adics
>>> * function fields
>>> * linear algebra
>>> * modular forms
>>> * representation theory
>>> * polyhedral geometry
>>> * Coxeter group/root systems and braid groups
>>> * Schubert polynomials
>>>
>>> If you'd like me to include other topics in the survey, chime in!
>>> David
>>>
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+...@googlegroups.com .
>> To post to this group, send email to sage-...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/sage-devel.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 

[sage-devel] Re: Sort ambient spaces by inner product as well?

2017-09-22 Thread Simon Brandhorst
Just fixing the == method is probably not good enough: 

On Thursday, September 21, 2017 at 4:10:10 PM UTC+2, Maarten Derickx wrote:
>
>
> Note that there is no distinction between the FreeModule with 
> inner_product_matrix=matrix.identity(1)*2 and FreeQuadraticModusince the 
> sage object created in both ways is the same object. Not just equal, but 
> literally the same object in memory, so any change will automatically 
> affect both.
>
> FreeQuadraticModule(ZZ,1,matrix.identity(1)*2) is 
> FreeModule(ZZ,1,inner_product_matrix=matrix.identity(1)*2) 
>
> I think it is good to open a ticket to make == also take the inner product 
> matrix into account, and I think no deprecation is needed since it fixes 
> something which is mathematically incorrect.
>
> One more subtle question is wether we want:
>
> sage: 
> FreeModule(ZZ,1)==FreeModule(ZZ,1,inner_product_matrix=matrix.identity(1))
>
> I think so. It is mathematically the same thing. But just changing the == 
operator is not good enough. Then we also need to reconsider < ,<= etc.

Currently:
"
Modules are ordered by their ambient spaces, then by dimension,
then in order by their echelon matrices. However, if
other is a sub-module or is a quotient module then its
comparison method is used instead of generic comparison.
"
Ambient spaces are ordered by rank and base ring.

So I think that ambient spaces should be ordered by
rank, inner_product_matrix, and then base ring. 

This change should  take place in 
sage.modules.free_module.FreeModule_ambient
One might need to adapt the hash function there?
Objections?



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


[sage-devel] Sort ambient spaces by inner product as well?

2017-09-21 Thread Simon Brandhorst
Currently, comparison of free_module_generic (and free_quadratic_modules) 
ignores the inner product matrix

sage: 
FreeModule(ZZ,1)==FreeModule(ZZ,1,inner_product_matrix=matrix.identity(1)*2)
True
sage: 
FreeQuadraticModule(ZZ,1,matrix.identity(1))==FreeQuadraticModule(ZZ,1,matrix.identity(1)*2)
True

Especially for FreeQuadraticModules, the inner_product_matrix is essential 
and two FreeQuadraticModules are certainly different (mathematically) if 
their inner product is different.

Is that intended behavior? If not, I would like to open a ticket. Do I need 
a deprecation warning or something for that ? 

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


[sage-devel] Re: Can I clean up this copy pasted code? #23703

2017-08-25 Thread Simon Brandhorst
Thank you I was not aware of that.
Supporting my expectation: https://trac.sagemath.org/ticket/5525 
is the same bug in free_modules which was fixed 8! years ago. 

So I guess we should really clean up free_quadratic_module.py.
Is there a reason for all this copy pasting?

On Friday, August 25, 2017 at 10:37:37 AM UTC+2, Frédéric Chapoton wrote:
>
> Sorry, I was thinking to #23646
>
> Le vendredi 25 août 2017 10:35:59 UTC+2, Frédéric Chapoton a écrit :
>>
>> Beware the comparion in the modules folder has been recently cleaned-up 
>> for py3 compatibility in https://trac.sagemath.org/ticket/23251
>>
>> Do not do anything on that until this ticket is merged in the next beta 
>> release of sage.
>>
>> Frederic
>>
>> Le vendredi 25 août 2017 09:52:32 UTC+2, Simon Brandhorst a écrit :
>>>
>>> From sage.modules.free_module.py there is some code copy pasted to
>>> sage.modules.free_quadratic_module.py.
>>>
>>> One instance is the 
>>>
>>> class FreeQuadraticModule_submodule_with_basis_pid(
>>> free_module.FreeModule_submodule_with_basis_pid, 
>>> FreeQuadraticModule_generic_pid)
>>>
>>> where the __cmp__ method is copy pasted from its super class
>>> free_module.FreeModule_submodule_with_basis_pid
>>> well except for one line (checking the base rings). This missing line 
>>> causes some bugs. trac: #23703 
>>>
>>> So I expect that 
>>> free_module.FreeModule_submodule_with_basis_pid.__cmp__ had some bug and 
>>> it got fixed but that was after it was copy pasted. 
>>>
>>> That sounds pretty horrible to me. 
>>>
>>> So here is the question:
>>> Was the method __cmp__ copy pasted for a good reason?
>>>
>>> I see 3 possible fixes for my ticked:
>>>
>>> a) copy paste the missing line too :(
>>>
>>> b) delete the __cmp__ method completely so that it is inherited instead. 
>>> Not sure if this can cause trouble?
>>>
>>> c) rewrite the __cmp__ method to call explicitly 
>>> super(FreeModule_submodule_with_basis_pid,self).__cmp__()
>>>
>>>

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


[sage-devel] Can I clean up this copy pasted code? #23703

2017-08-25 Thread Simon Brandhorst
>From sage.modules.free_module.py there is some code copy pasted to
sage.modules.free_quadratic_module.py.

One instance is the 

class FreeQuadraticModule_submodule_with_basis_pid(
free_module.FreeModule_submodule_with_basis_pid, 
FreeQuadraticModule_generic_pid)

where the __cmp__ method is copy pasted from its super class
free_module.FreeModule_submodule_with_basis_pid
well except for one line (checking the base rings). This missing line 
causes some bugs. trac: #23703 

So I expect that 
free_module.FreeModule_submodule_with_basis_pid.__cmp__ had some bug and it 
got fixed but that was after it was copy pasted. 

That sounds pretty horrible to me. 

So here is the question:
Was the method __cmp__ copy pasted for a good reason?

I see 3 possible fixes for my ticked:

a) copy paste the missing line too :(

b) delete the __cmp__ method completely so that it is inherited instead. 
Not sure if this can cause trouble?

c) rewrite the __cmp__ method to call explicitly 
super(FreeModule_submodule_with_basis_pid,self).__cmp__()

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


[sage-devel] Sort method auto completion by relevance.

2017-08-18 Thread Simon Brandhorst
What I love about Sage is the following:

I discover an interesting class of objects say a groups. Now I want to play 
with it, so I create an object foo and type "foo." + Tab and now I can 
easily explore what I can do with this object. 

However many classes have 50 something methods inherited from who know 
where, some work, some don't and some are even useful. 
It would be nice to have the most relevant ones first and not just 
alphabetical. 
Is this possible? At least if I create a new class?


  

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


[sage-devel] sage days 91?

2017-08-16 Thread Simon Brandhorst
Dear all,

Ursula, Tony, and I are organizing a weekend workshop "Open Source 
Computation and Algebraic Surfaces" at BIRS 
https://www.birs.ca/events/2017/2-day-workshops/17w2677.
Our goal is to get some functionality for point counting and indefinite 
lattices/quadratic forms into sage. This sounds pretty much like a sage 
days event.
So we where wondering if we should label it as Sage Days. Is there any 
"official procedure" or can we just put it on the wiki?

Cheers

Simon

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


[sage-devel] bug in sage.quadratic_forms.genera.genus.

2017-06-18 Thread Simon Brandhorst
D4=QuadraticForm(Matrix(ZZ,4,4,[2,0,0,-1,0,2,0,-1,0,0,2,-1,-1,-1,-1,2]))
G=D4.global_genus_symbol()

sage.quadratic_forms.genera.genus.is_GlobalGenus(G)
G==copy(G)
sage.quadratic_forms.genera.genus.is_GlobalGenus(G)

Another instance of the same problem:

D4=QuadraticForm(Matrix(ZZ,4,4,[2,0,0,-1,0,2,0,-1,0,0,2,-1,-1,-1,-1,2]))
G=D4.global_genus_symbol()

G._local_symbols[0].excess()
G==copy(G)
G._local_symbols[0].excess()

the second answer is wrong here.
The problem seems to originate somewhere in
sage.quadratic_forms.genera.genus.Genus_Symbol_p_adic_ring.canonical_symbol

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


[sage-devel] Implementing indefinite IntegerLattices a call for advice.

2017-03-24 Thread Simon Brandhorst
I would like to implement a class for (indefinite) IntegerLattices. In my 
implementation I would like to meet the sageMath standards so that one day 
it might be a part of sage. 
My first question is how I should fit this into the existing classes.

Mathematically a (indefinite) lattice is a finitely generated free abelian 
group together with a (indefinite) bilinear form $b: L x L \rightarrow QQ$.
What I want to implement is discrete subgroups of $QQ^n$ with $QQ^n$ 
equipped with some non-degenerate bilinear form. 
So our lattices should have an ambient space, a distinguished basis, and a 
gram matrix. 

Methods would include something like:
get the dual lattice $L^\vee=\{x in L\otimes \QQ | b(x,L) \in \ZZ \}$
Take (direct) sums of lattices, over and sublattices, the action of the 
orthogonal group on the lattice elements.
quotients of lattices

In the case of integral lattices (the gram matrix is integral) I would like 
to implement some non-trivial functionality:
- compute the discriminant quadratic/bilinear forms on $L^\vee / L$
- is_even/is_odd
- methods to manipulate the discriminant bilinear form - like a canonical 
form, computing the genus from the discriminant form and the signature,
taking integral overlattices, computing the action of an isometry on the 
discriminant group
- primitive extensions of a lattice
- computing all primitive embeddings of lattice $A$ into lattice $B$ using 
an algorithm of Shimada. 
- constructing lattices + isometries from Hermitian lattices over number 
fields. 


At the moment I know of 4 related classes: The quadratic form package: this 
is great it allows indefinite quadratic forms and can compute with genera. 
However there is no ambient space and thus no distinguished basis, thus 
there is no concept of discriminant group and dual lattice.


sage.modules.free_module_integer.IntegerLattice

This seems very nice. It has a distinguished basis and some non-trivial 
functionality. However the inner product is positive definite, in fact the 
standard inner product of $\ZZ^n$.

There is the  sage.modules.free_quadratic_module.FreeQuadraticModule
which allows indefinite inner products and other PIDs (anyways is there a 
list of PIDs in sage? Can I create a new PID? Like $\ZZ[\zeta_5]$.)
However, the inner product is allowed in the base ring only instead of 
$\QQ$ or the quotient field - (though that is a todo in the source). In any 
case functionality of this class is kind of trivial.

And finally there is 
sage.modules.free_module.FreeModule_submodule_with_basis_pid 

 
which is the base class of IntegerLattice. 

So where does my project fit in? My current guess is to mimic the 
IntegerLattice class and create it based on 
sage.modules.free_module.FreeModule_submodule_with_basis_pid 

 
. 
However mathematically speaking my project is a parent of IntegerLattice as 
functionality applies to positive definite lattices as well.


How would I name my class? 

What is the canonical way to start such a project? Create a TracTicket and 
start working?
Best 
Simon

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


[sage-devel] Re: Error building sage devel: package: singular-4.0.3p4

2016-11-11 Thread Simon Brandhorst
Seems I posted too fast. Sorry for the spam. They error is due to a work 
around which I forgot to delete before building. Now it seems to work. 
(still building)

On Friday, November 11, 2016 at 2:36:15 PM UTC+1, Simon Brandhorst wrote:
>
> See the log file.
>
> Best
>
> Simon
>

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


[sage-devel] Error building sage devel: package: singular-4.0.3p4

2016-11-11 Thread Simon Brandhorst
See the log file.

Best

Simon

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.
Found local metadata for singular-4.0.3p4
Attempting to download package singular-4.0.3p4.tar.bz2 from mirrors
http://ftp.riken.jp/sagemath/spkg/upstream/singular/singular-4.0.3p4.tar.bz2
[..]
singular-4.0.3p4

Setting up build directory for singular-4.0.3p4
Finished extraction

Host system:
Linux Quadrator 4.7.9-200.fc24.x86_64 #1 SMP Thu Oct 20 14:26:16 UTC 2016 
x86_64 x86_64 x86_64 GNU/Linux

C compiler: gcc
C compiler version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/6.2.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap 
--enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr 
--mandir=/usr/share/man --infodir=/usr/share/info 
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared 
--enable-threads=posix --enable-checking=release --enable-multilib 
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions 
--enable-gnu-unique-object --enable-linker-build-id 
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array 
--disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function 
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 6.2.1 20160916 (Red Hat 6.2.1-2) (GCC) 

patching file latest/factory/NTLconvert.cc
(Stripping trailing CRs from patch; use --binary to disable.)
patching file latest/configure
Hunk #1 FAILED at 2328.
1 out of 1 hunk FAILED -- saving rejects to file latest/configure.rej
Error applying '../patches/work_around_size_of_long_0.patch'

real0m0.009s
user0m0.005s
sys 0m0.004s

Error installing package singular-4.0.3p4

Please email sage-devel (http://groups.google.com/group/sage-devel)
explaining the problem and including the relevant part of the log file
  /home/simon/sage/logs/pkgs/singular-4.0.3p4.log
Describe your computer, operating system, etc.
If you want to try to fix the problem yourself, *don't* just cd to
/home/simon/sage/local/var/tmp/sage/build/singular-4.0.3p4 and type 'make' or 
whatever is appropriate.
Instead, the following commands setup all environment variables
correctly and load a subshell for you to debug the error:
  (cd '/home/simon/sage/local/var/tmp/sage/build/singular-4.0.3p4' && 
'/home/simon/sage/sage' --sh)
When you are done debugging, you can type "exit" to leave the subshell.



[sage-devel] Re: Project: LatticeWithIsometry

2016-09-09 Thread Simon Brandhorst
Dear Dima,
sorry for taking such a long time to answer your question. 
I'd say it could do a lot of stuff involving over and sublattices. But then 
it seems like Alex is counting orbits. You'd have to build on top of my 
code to achieve that. 
For my purposes it sufficed to consider a single isometry at a time.

Best
--Simon

On Tuesday, September 6, 2016 at 3:08:56 PM UTC+2, Dima Pasechnik wrote:
>
>
>
> On Tuesday, September 6, 2016 at 9:20:55 AM UTC, Simon Brandhorst wrote:
>>
>> Dear all,
>>
>> I have written some code (toy implementation) in sage. It could be useful 
>> for other people as well.
>> So now I am wondering whether I should make an effort to implement it 
>> meeting the sage-devel standards.
>> How good are the chances for such a project to be included in the sage 
>> source code?
>>
>>
>> So here is the project: LatticeWithIsometry
>> where a lattice L is a free abelian group equipped with a non-degenerate 
>> symmetric bilinear form (ZZ or QQ valued). An isometry f is a ZZ-Module 
>> automorphism preserving the bilinear form. 
>> So we want to model (L,f)
>>
>> Functionality:
>> - constructor for ideal lattices - that is lattices (+isometries) cooked 
>> up from irreducible reciprocal polynomials (think of the cyclotomic 
>> polynomials) and their trace forms
>> - gluing of lattices. That is taking a direct sum
>> (L,f) + (N,g) and getting integral overlattices compatible with (f,g).
>> - describing the action of the isometry on sub/super lattices such as the 
>> dual lattice L' or quotients such as the discriminant group L'/L
>> - a method to decide whether a given isometry of a hyperbolic lattice 
>> preserves a chamber of the positive cone cut out by the root hyperplanes 
>> (this relates to Weyl groups)
>>
>> A possible reference for this is:
>> http://www.math.harvard.edu/~ctm/papers/home/text/papers/pos/pos.pdf
>>
>> My personal aim in this is to model integral hodge isometries of K3 
>> surfaces or IHSMs.
>>
>
> Sounds like a lot of fun; my latest personal foray into this was doing 
> some computations in 
> http://arxiv.org/abs/1604.05836
> (with Lemma 2.11 attributed to me :-))
> and I'm still trying to understand whether I can publish anything 
> meaningful out of it.
>
> It would be interesting to what extent your package can do computations in 
> that paper.
>
> Just in case,
> Dima
>   
>
>>
>>
>> I also wonder how this would fit into the sage world. Should this inherit 
>> from quadratic forms ? (feels wrong) or is there some lattice class out 
>> there?
>> Since I am new in sage, writing a whole lattice class seems to be too 
>> much work for me (and well above my level of experience). 
>>
>> There seem to have been previous discussions about lattices e.g.
>>
>> Discussion in Sage devel:
>>
>>
>> https://groups.google.com/forum/#!searchin/sage-devel/lattice|sort:relevance/sage-devel/OO0ADcuraqE/mUG5_UrYFD4J
>> and
>>
>> https://groups.google.com/forum/#!searchin/sage-devel/lattice$20-poset|sort:relevance/sage-devel/KTmqIcav9e4/wWdiQ71PWVYJ
>>
>> There also seem to have been previous attempts for implementing lattices
>> such as 
>> https://trac.sagemath.org/ticket/11940
>> https://trac.sagemath.org/ticket/15976
>>
>>
>> What has happened to them?
>>
>> Or the rather incomplete FreeQuadraticModule
>>
>> http://doc.sagemath.org/html/en/reference/modules/sage/modules/free_quadratic_module.html
>> which claims to have non trivial functionality over ZZ - I couldn't find 
>> any. 
>>
>>
>>
>> Simon
>>
>

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


[sage-devel] Re: Weekend workshop BIRS: SageMath development related to K3 surfaces (March 2016)

2016-09-09 Thread Simon Brandhorst
Thank you Frédéric. I wasn't aware of that package. It seems quite 
interesting.

On Thursday, September 8, 2016 at 5:08:32 PM UTC+2, Frédéric Chapoton wrote:
>
> Maybe the authors/users of the Chow package for sage would be interested ? 
> Probably not Sorger, who is busy being currently head of mathematics in 
> CNRS.
>
> http://www.math.sciences.univ-nantes.fr/~sorger/chow_en.html
>
> Frederic
>
> Le jeudi 8 septembre 2016 16:00:37 UTC+2, Simon Brandhorst a écrit :
>>
>> Ursula Whitcher and I are planning to apply to hold a weekend workshop
>> at BIRS next March.
>> The idea is to do SageMath development related to K3 surfaces and 
>> irreducible holomorphic symplectic manifolds (IHSMs/Hyperkähler).
>> Their geometry is accessible through their second integral cohomology group 
>> which is an indefinite lattice. 
>>
>> Our (possible) goals are to implement SageMath functionality for
>> - indefinite lattices,
>> - isometries,
>> - modeling Hodge structures/Hodge isometries,
>> - elliptic fibrations on K3 surfaces,
>> - point counting.
>>
>> Ideally the date is March 11-12.
>>
>> If you are interested in attending, please let us know.
>>
>> Best
>> --Simon
>>
>>

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


  1   2   >