[sage-support] dividing polynomials without ending up in quotient field

2017-10-18 Thread Robin van der veer
Hello,

If I have, say,

 R = PolynomialRing(QQ, 'x', 5) 

And I have two polynomials, one of which divides the other. Then I can do
f/g
but the result will be an element of the fraction field of R, even though 
it actually lives in R. I can write
(f/g).numerator()
to get back to R, but I feel that this shouldn't be necessary. Is there 
some way to perform this division and stay in R?




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


Re: [sage-support] Computation just stops, no output or error message

2017-06-07 Thread Robin van der veer
Thank you!
this oom-killer did indeed kill my processes.
This solve my problem:)
thanks again

Op woensdag 7 juni 2017 17:49:13 UTC+2 schreef Jan Groenewald:
>
> Hi
>
> On 7 June 2017 at 17:33, Robin van der veer <robin...@gmail.com 
> > wrote:
>
>> Hi,
>>
>> I'm running a windows 10 host, and I have sage running in virtualbox; I 
>> just downloaded the .ova file from the website.
>> I have virutalbox set up so it uses 6/8 of my cores, and 5GB of mem. 
>> It could be the case the 6 processes combined exceed this 5GB. Would this 
>> explain Sage quitting in the way I described?
>>
>
> Try 
> https://serverfault.com/questions/548736/how-to-read-oom-killer-syslog-messages
>
> Regards,
> Jan\
>
>
> -- 
>   .~. 
>   /V\ Jan Groenewald
>  /( )\www.aims.ac.za
>  ^^-^^ 
>

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


Re: [sage-support] Computation just stops, no output or error message

2017-06-07 Thread Robin van der veer
Dear John,

I am already flushing after every file.write(), so this cannot be the 
problem. (this was the first thing I tried when I noticed the problem, and 
after another 2 hour wait I concluded that it did not solve my problem)

Robin

Op woensdag 7 juni 2017 17:37:32 UTC+2 schreef John Cremona:
>
> My guess is that the output is buffered, i.e. it does not get actually 
> written out unti lthe buffer reaches some size.  You can get python to 
> flush the output after every output statement and then see what is 
> happening a bit better. 
>
> John 
>
> On 7 June 2017 at 16:33, Robin van der veer <robin...@gmail.com 
> > wrote: 
> > Hi, 
> > 
> > I'm running a windows 10 host, and I have sage running in virtualbox; I 
> just 
> > downloaded the .ova file from the website. 
> > I have virutalbox set up so it uses 6/8 of my cores, and 5GB of mem. 
> > It could be the case the 6 processes combined exceed this 5GB. Would 
> this 
> > explain Sage quitting in the way I described? 
> > 
> > Op woensdag 7 juni 2017 17:30:37 UTC+2 schreef Jan Groenewald: 
> >> 
> >> Hi 
> >> 
> >> 
> >> On 7 June 2017 at 17:24, Robin van der veer <robin...@gmail.com> 
> wrote: 
> >>> 
> >>> I'm running Sage on my local machine (so not the sage math cloud), and 
> >>> some of my computations just stop with no output or error message. 
> >>> My code looks essentially like this: 
> >>> 
> >>> @parallel 
> >>> def compute(revLex): 
> >>> long computations 
> >>> print some stuff 
> >>> write some stuff to files 
> >>> return 
> >>> 
> >>> r = compute(L) 
> >>> for x in r: 
> >>> x 
> >>> 
> >>> When I work with small cases, everything is fine. However for bigger 
> >>> cases the computations tend to take upwards of 2 hours, and then just 
> stop. 
> >>> The only reason why I know one of the computations even stopped is 
> >>> because I'm staring at TOP in a console window and see the uptime jump 
> from 
> >>> 110 orso minutes to 0 minutes, meaning that one job was finished, and 
> it 
> >>> started working on the next. 
> >>> When this happens no output is printen, and the file to which some 
> stuff 
> >>> should have been written is empty. 
> >>> 
> >>> What could cause this (besides a programming error on my part)? Is 
> there 
> >>> some timeout even when running on your local machine? Or some resource 
> >>> limitations that just quit Sage if its using too much memory orso? 
> >>> 
> >>> I really hope that someone has an idea here, because each of these 
> >>> computations takes around 2 hours, so its very impracticle to just 
> keep 
> >>> trying to see what works. 
> >> 
> >> 
> >> What is your OS and where can you check for out of memory messages? 
> >> 
> >> Regards, 
> >> Jan 
> >> 
> >> 
> >> -- 
> >>   .~. 
> >>   /V\ Jan Groenewald 
> >>  /( )\www.aims.ac.za 
> >>  ^^-^^ 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sage-support" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to sage-support...@googlegroups.com . 
> > To post to this group, send email to sage-s...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/sage-support. 
> > For more options, visit https://groups.google.com/d/optout. 
>

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


Re: [sage-support] Computation just stops, no output or error message

2017-06-07 Thread Robin van der veer
Hi,

I'm running a windows 10 host, and I have sage running in virtualbox; I 
just downloaded the .ova file from the website.
I have virutalbox set up so it uses 6/8 of my cores, and 5GB of mem. 
It could be the case the 6 processes combined exceed this 5GB. Would this 
explain Sage quitting in the way I described?

Op woensdag 7 juni 2017 17:30:37 UTC+2 schreef Jan Groenewald:
>
> Hi
>
> On 7 June 2017 at 17:24, Robin van der veer <robin...@gmail.com 
> > wrote:
>
>> I'm running Sage on my local machine (so not the sage math cloud), and 
>> some of my computations just stop with no output or error message.
>> My code looks essentially like this:
>>
>> @parallel
>> def compute(revLex):
>> long computations
>> print some stuff
>> write some stuff to files
>> return
>>
>> r = compute(L)
>> for x in r:
>> x
>>
>> When I work with small cases, everything is fine. However for bigger 
>> cases the computations tend to take upwards of 2 hours, and then just stop. 
>> The only reason why I know one of the computations even stopped is 
>> because I'm staring at TOP in a console window and see the uptime jump from 
>> 110 orso minutes to 0 minutes, meaning that one job was finished, and it 
>> started working on the next.
>> When this happens no output is printen, and the file to which some stuff 
>> should have been written is empty.
>>
>> What could cause this (besides a programming error on my part)? Is there 
>> some timeout even when running on your local machine? Or some resource 
>> limitations that just quit Sage if its using too much memory orso?
>>
>> I really hope that someone has an idea here, because each of these 
>> computations takes around 2 hours, so its very impracticle to just keep 
>> trying to see what works.
>>
>
> What is your OS and where can you check for out of memory messages? 
>
> Regards,
> Jan
>
>
> -- 
>   .~. 
>   /V\ Jan Groenewald
>  /( )\www.aims.ac.za
>  ^^-^^ 
>

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


[sage-support] Computation just stops, no output or error message

2017-06-07 Thread Robin van der veer
I'm running Sage on my local machine (so not the sage math cloud), and some 
of my computations just stop with no output or error message.
My code looks essentially like this:

@parallel
def compute(revLex):
long computations
print some stuff
write some stuff to files
return

r = compute(L)
for x in r:
x

When I work with small cases, everything is fine. However for bigger cases 
the computations tend to take upwards of 2 hours, and then just stop. 
The only reason why I know one of the computations even stopped is because 
I'm staring at TOP in a console window and see the uptime jump from 110 
orso minutes to 0 minutes, meaning that one job was finished, and it 
started working on the next.
When this happens no output is printen, and the file to which some stuff 
should have been written is empty.

What could cause this (besides a programming error on my part)? Is there 
some timeout even when running on your local machine? Or some resource 
limitations that just quit Sage if its using too much memory orso?

I really hope that someone has an idea here, because each of these 
computations takes around 2 hours, so its very impracticle to just keep 
trying to see what works.

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


[sage-support] Re: Join operation in arbitrary poset

2017-04-04 Thread Robin van der veer
I similar "problem": atoms() is not implemented for the MeetSemilattice, 
while it certainly makes sense there.

Op maandag 3 april 2017 23:57:44 UTC+2 schreef Robin van der veer:
>
> Hello,
>
> I wonder if there is any way to use the join or meet operations in 
> arbitrary posets? 
> It seems that these methods are only exposed in the classes of join- resp. 
> meet semilattices.
> However, it would be very convenient if these methods were available in 
> general posets somehow, and would just raise an exception if the join/meet 
> does not exist.
> The problem that I'm facing now is that the posets I'm working with are 
> not join semilattices, but it is essential for me to compute joins of 
> certain subsets anyway (these join do exist).
> Since the join semilattice constructor verifies that the poset is actually 
> a join semilattice (and from what I see this validation cannot be 
> disabled), I cannot construct my posets as join semilattices and use the 
> join method.
> Any suggestions on how to go about it? Or is the only solution to just 
> implement a join operation myself?
>
> Thanks
>

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


Re: [sage-support] Join operation in arbitrary poset

2017-04-04 Thread Robin van der veer
Thanks for your reply.
To me the essence of the definition of join and meetsemilattice is about 
joins/meets existing for ALL pairs, as opposed to some pairs. Hence having 
a join/meet operation on any poset is not that unnatural, because almost 
all posets have at least some pairs of element for which the join/meet 
exists (e.g. trivial pairs x<= y). 
I am actually porting some code that I wrote in Macaulay2 to Sage, because 
of Sage's way better support for matroids. In Macaulay2 joins/meets are 
implemented for all posets. I think what I'll do is just use Sage for its 
matroid library, and output the posets I need to Macaulay2 for further 
processing.

As for your code, I think you want to return j.bottom(), not just the first 
element of j, correct? Either way I'm not sure that this is efficient 
enough to be workable, but I will try it. 


Op dinsdag 4 april 2017 06:01:48 UTC+2 schreef jori.ma...@uta.fi:
>
> On Mon, 3 Apr 2017, Robin van der veer wrote: 
>
> > I wonder if there is any way to use the join or meet operations in 
> arbitrary 
> > posets?  
>
> How fast that should be? The trivial implementation is just 4 lines long, 
> here with monkey patch: 
>
> def join2(self, a, b): 
>  j = self.subposet([e for e in self.principal_upper_set(a) if e in 
> self.principal_upper_set(b)]) 
>  if len(j) > 1: 
>  raise ValueError("no join for %s and %s" % (a, b)) 
>  return j[0] 
> type(Poset()).join = join2 
>
> P = Poset({1:[3, 4], 2:[3, 4], 3:[5], 4:[5]}) 
> P.join(3, 4) 
>
> It sounds a little unnatural to have join or meet for all posets. Other 
> users might except L.join() to return an error if L is not a 
> join-semilattice. 
>
> -- 
> Jori Mäntysalo

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


[sage-support] Join operation in arbitrary poset

2017-04-03 Thread Robin van der veer
Hello,

I wonder if there is any way to use the join or meet operations in 
arbitrary posets? 
It seems that these methods are only exposed in the classes of join- resp. 
meet semilattices.
However, it would be very convenient if these methods were available in 
general posets somehow, and would just raise an exception if the join/meet 
does not exist.
The problem that I'm facing now is that the posets I'm working with are not 
join semilattices, but it is essential for me to compute joins of certain 
subsets anyway (these join do exist).
Since the join semilattice constructor verifies that the poset is actually 
a join semilattice (and from what I see this validation cannot be 
disabled), I cannot construct my posets as join semilattices and use the 
join method.
Any suggestions on how to go about it? Or is the only solution to just 
implement a join operation myself?

Thanks

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