[sage-support] How to efficiently generate all graph isomorphism classes of a given size?

2023-01-30 Thread Shiyue Li


Hi all, 

I am hoping to generate a list of all graph isomorphism classes of a given 
size. The current code that I have first generate all the graphs on 2n, and 
then take all the isomorphism class representatives of size n. But the 
first step of generating all graphs on 2n vertices can take a really long 
time and huge amount of memory (run 10 days on my university's research 
computing cloud) and crashes. 

See the following for my code: 
def iso_graphs(n): 
'''returns all isomorphism classes of simple graphs on n edges on 2*n 
vertices''' 
L = list(graphs(2 * n, loops=False, size=n)) print("Do we ever reach 
this point?") 
L = [G.canonical_label().copy(immutable=True) for G in L if G.size() == 
n] 
return L

I wonder if what is a correct and efficient way of doing it. 

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/0acb6537-3fe9-42dc-ab1b-c5c79dd5fb5cn%40googlegroups.com.


Re: [sage-support] Cannot factor 71281426948143699070565 with ecm.factor()

2023-01-30 Thread Dima Pasechnik
On Mon, Jan 30, 2023 at 5:29 PM kcrisman  wrote:
>
> Is there any notion that the default should be changed, or is that pretty 
> unique to this example?

IMHO a small default is not expensive, as checking for smallish prime
factors should be quick.
But perhaps I'm missing something here.

Dima
>
> --
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/5272793b-69eb-4e43-8c1a-6997c2f09b16n%40googlegroups.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAAWYfq2a8eGKDzf13YnwDs9wzb0CaE1j-BkZh8wPMyt6WSoggw%40mail.gmail.com.


Re: [sage-support] Cannot factor 71281426948143699070565 with ecm.factor()

2023-01-30 Thread kcrisman
Is there any notion that the default should be changed, or is that pretty 
unique to this example?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/5272793b-69eb-4e43-8c1a-6997c2f09b16n%40googlegroups.com.


Re: [sage-support] Cannot factor 71281426948143699070565 with ecm.factor()

2023-01-30 Thread William Stein
I think everybody understands what's going on regarding ECM now,
thanks to Dima's quick answer.
Paul Zimmerman who wrote this code (and reads sage-support via a daily
digest), sent me this
note to pass on as well:

" Hi William,

please can you forward my answer below?
Thanks,
Paul

##

The default B1 value of ecm.factor() is too large. Using B1=2 works:

sage: ecm.factor(71281426948143699070565,B1=2)
[5, 53, 337, 1873, 2833, 7507, 20037791]"

On Sun, Jan 29, 2023 at 11:54 AM G. M.-S.  wrote:
>
>
> Thanks Dima, you taught me something new today.
>
> Guillermo
>
> On Sun, 29 Jan 2023 at 20:50, Dima Pasechnik  wrote:
>>
>> On Sun, Jan 29, 2023 at 3:04 PM G. M.-S.  wrote:
>> >
>> > For me, with SageMath version 9.8.beta7
>> > sage: ecm.factor(71281426948143699070565)
>> > does not return quickly either.
>> > Indeed, running
>> > sage: ecm.interact()
>> > seems to show a strange behaviour for 71281426948143699070565 when 
>> > factoring the factors found.
>> > As this is probabilistic and the output changes every time, I do not copy 
>> > it here.
>>
>> Basically, the default B1 value is too large in this case.
>>
>> sage: ecm.factor(71281426948143699070565,B1=200) # almost instant
>> [5, 53, 337, 1873, 2833, 7507, 20037791]
>> sage: ecm.factor(71281426948143699070565,B1=2000) # takes looong time
>>
>> the docs say:
>>
>>* "B1" -- initial lower bound, defaults to 2000 (15 digit factors).
>>  Used if "factor_digits" is not specified.
>>
>> > Guillermo
>> >
>> > On Sun, 29 Jan 2023 at 15:41, Bill Witzke  wrote:
>> >>
>> >> Hi,
>> >>
>> >> I have a hard time factoring the number 71281426948143699070565 using 
>> >> ecm.factor().  No result is given after a few minutes runtime.  Though, 
>> >> plain factor() happily factors the number.  Factoring smaller or larger 
>> >> numbers  work fine with ecm.factor(), too.  Just the single given number 
>> >> seems to be problematic.
>> >>
>> >> Am I doing something wrong?  Can someone confirm?
>> >>
>> >> system:
>> >> Ubuntu 22.04
>> >> sagemath 9.5-4 (via apt)
>> >> Intel Pentium N5000
>> >> (SageMath and Python beginner)
>> >>
>> >> example code factoring numbers in the range [71281426948143699070565  - 
>> >> L, 71281426948143699070565 + L]:
>> >>
>> >> # Odd number.
>> >> n = 71281426948143699070565
>> >> # Limit.
>> >> L = 2
>> >> # Iterate over interval [-L, L].
>> >> for i in range(-L, L + 1):
>> >> m = n + i
>> >> print("%d  =>  %s" % (m, ecm.factor(m)))
>
>
>
> --
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/CANnG18_HSRJZKhmC8%3DQ476x-FY9s%2BQZToXOKtk0NV1QBquUxtA%40mail.gmail.com.



-- 
William (http://wstein.org)

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CACLE5GA34GN7_7pV2ePS33warYT6By7rMiFR7iRB9dr2zhyHZA%40mail.gmail.com.


[sage-support] Re: Cannot build Sage 9.8 on Ubuntu 22.04.1 LTS

2023-01-30 Thread Matthias Koeppe
Disable Anaconda and read what "./configure" says at the end (these 
messages are for you)

On Sunday, January 29, 2023 at 2:07:52 PM UTC-8 hyunjo...@gmail.com wrote:

> Hello,
>
> I've been trying to build Sage 9.8 from source for development; I had 
> previously done so months ago, but I had not been able to do rebuild Sage 
> since pulling from the GitHub repository around late December/early 
> January. I've deleted the previous source/build directory that I had to try 
> building from source all over again to no avail.
>
> Attached is a copy of the logs subdirectory.
>
> Thank you for your help,
> Hyun Jong
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/16862f30-9744-4d43-a330-48b60cfbf4f3n%40googlegroups.com.