[sage-support] FInd all paths of given length n

2017-07-26 Thread Selvaraja S
Let $G$ be a finite simple graph. 
Can we find all paths(induced ) of given length?


Thanks in advance.

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


[sage-support] Re: numerical semigroup in sagemath

2017-07-26 Thread John H Palmieri


On Tuesday, July 25, 2017 at 5:53:37 AM UTC-7, springfield .gion wrote:
>
> Hi, I need to create and manipulate the additive semigroups generated by 
> integers (such as those generated by tuples of coprime integers), but I am 
> struggling with the syntax; is there an easy way to create something along 
> the line of:
>
> S = ZZ.Semigroup([2,3])   
> S = {0,2,3,4,}
>
> Thanks in advance
>

You can try this:

S = NN.subsemigroup([2,3])   # or ZZ.subsemigroup([2,3])

although (a) it is not clear to me that this the right thing (it looks like 
the multiplicative subsemigroup, not the additive one) and (b) I can't do 
anything sensible with it.

So I tried to use multiplicative semigroups instead. If A is the 
multiplicative semigroup consisting of powers of 2, then we could ask for 
the multiplicative subsemigroup generated by 2**2 and 2**3, which should be 
analogous to what you want. Unfortunately, it is broken:

sage: A = NN.subsemigroup([2])
sage: S = A.subsemigroup([2**2, 2**3])

Listing some elements and their base 2 logs is promising:

sage: list(S.some_elements())  # output omitted since it is a little 
lengthy
sage: [log_b(ZZ(_),2) for _ in list(S.some_elements())]   # output 
omitted

but this is surprising:

sage: S.cardinality()
11441

I certainly didn't know that this semigroup was finite, let alone precisely 
what its cardinality is.

-- 
John

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


[sage-support] Re: numerical semigroup in sagemath

2017-07-26 Thread Kwankyu
There is a nice GAP package for numerical semigroups. You can use that via 
sage interface once you install it into the GAP under Sage (which could be 
tricky). Check

https://www.gap-system.org/Packages/numericalsgps.html 

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


Re: [sage-support] phc interface not working in Sage version 8.0

2017-07-26 Thread 'Peter Mueller' via sage-support
Thanks, that solved the problem. (I wasn't aware that the actual phc binary 
isn't included in sage while the interface to it is.)

Am Mittwoch, 26. Juli 2017 19:19:10 UTC+2 schrieb vdelecroix:
>
> Do you have phc installed on your computer? The error message says that 
> there is no 'phc' command available... 
>
>

-- 
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] phc interface not working in Sage version 8.0

2017-07-26 Thread Vincent Delecroix
Do you have phc installed on your computer? The error message says that 
there is no 'phc' command available...


(I was not able to install phcpack so I can not properly test the interface)

On 26/07/2017 17:15, 'Peter Mueller' via sage-support wrote:

Trying the example from the doc of phc results in:

sage: from sage.interfaces.phc import phc
sage: R. = PolynomialRing(CDF,2)
sage: testsys = [x^2 + 1, x*y - 1]
sage: phc.mixed_volume(testsys)
---
ExceptionPexpect  Traceback (most recent call last)
 in ()
> 1 phc.mixed_volume(testsys)

/home/mueller/local/sage-8.0/local/lib/python2.7/site-packages/sage/interfaces/phc.pyc
in mixed_volume(self, polys, verbose)
 758 4
 759 """
--> 760 output_filename = self._output_from_command_list(['phc
-m','4','n','n','n'], polys, verbose = verbose)
  
 761

 762 out = open(output_filename).read()

/home/mueller/local/sage-8.0/local/lib/python2.7/site-packages/sage/interfaces/phc.pyc
in _output_from_command_list(self, command_list, polys, verbose)
 452
 453 # Create a phc process
--> 454 child_phc = pexpect.spawn(command_list[0])
 455 # feed it the commands
 456 child_phc.sendline('y')

/home/mueller/local/sage-8.0/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)
   
 196 self.name = ''

 197 else:
--> 198 self._spawn(command, args, preexec_fn, dimensions)
 199
 200 def __str__(self):

/home/mueller/local/sage-8.0/local/lib/python2.7/site-packages/pexpect/pty_spawn.pyc
in _spawn(self, command, args, preexec_fn, dimensions)
 269 if command_with_path is None:
 270 raise ExceptionPexpect('The command was not found or
was not ' +
--> 271 'executable: %s.' % self.command)
 272 self.command = command_with_path
  
 273 self.args[0] = self.command


ExceptionPexpect: The command was not found or was not executable: phc.
sage:



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


[sage-support] phc interface not working in Sage version 8.0

2017-07-26 Thread 'Peter Mueller' via sage-support
Trying the example from the doc of phc results in:

sage: from sage.interfaces.phc import phc
sage: R. = PolynomialRing(CDF,2)
sage: testsys = [x^2 + 1, x*y - 1]
sage: phc.mixed_volume(testsys)
---
ExceptionPexpect  Traceback (most recent call last)
 in ()
> 1 phc.mixed_volume(testsys)

/home/mueller/local/sage-8.0/local/lib/python2.7/site-packages/sage/interfaces/phc.pyc
 
in mixed_volume(self, polys, verbose)
758 4
759 """
--> 760 output_filename = self._output_from_command_list(['phc 
-m','4','n','n','n'], polys, verbose = verbose) 
 
761 
762 out = open(output_filename).read()

/home/mueller/local/sage-8.0/local/lib/python2.7/site-packages/sage/interfaces/phc.pyc
 
in _output_from_command_list(self, command_list, polys, verbose) 
452 
453 # Create a phc process
--> 454 child_phc = pexpect.spawn(command_list[0])
455 # feed it the commands
456 child_phc.sendline('y')

/home/mueller/local/sage-8.0/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) 
  
196 self.name = ''
197 else:
--> 198 self._spawn(command, args, preexec_fn, dimensions)
199 
200 def __str__(self):

/home/mueller/local/sage-8.0/local/lib/python2.7/site-packages/pexpect/pty_spawn.pyc
 
in _spawn(self, command, args, preexec_fn, dimensions) 
269 if command_with_path is None:
270 raise ExceptionPexpect('The command was not found or 
was not ' +
--> 271 'executable: %s.' % self.command)
272 self.command = command_with_path   
 
273 self.args[0] = self.command

ExceptionPexpect: The command was not found or was not executable: phc.
sage: 

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