Re: [sage-combinat-devel] Combinatorica-like commands in Sage

2011-12-03 Thread Nathann Cohen
> I'm still stuck at creating my digraph from my csv file. My csv file is
essentially an adjacency matrix of 0's and 1's. I can import it, but I
can't convert it into an adjacency matrix that can then be created into a
digraph. Any more ideas? Thanks in advance for any help.

What about this ?

sage: cat "dg.csv"
0, 1, 0, 1
1, 1, 0, 1
1, 0, 0, 1
0, 0, 0, 1

sage: f = open("dg.csv",'r')
sage: # Removing '\n' and splitting into cells
sage: entries = map(lambda x:x.strip('\n').split(','), f.readlines())
sage: entries
[['0', ' 1', ' 0', ' 1'], ['1', ' 1', ' 0', ' 1'], ['1', ' 0', ' 0', ' 1'],
['0', ' 0', ' 0', ' 1']]
sage: # Casting from str to integers
sage: entries = map(lambda x:map(Integer,x), entries)
sage: entries
sage: # A matrix
sage: m = Matrix(entries)
sage: m
[0 1 0 1]
[1 1 0 1]
[1 0 0 1]
[0 0 0 1]
sage: # A Digraph
sage: D = DiGraph(m)
sage: D.edges()
[(0, 1, None), (0, 3, None), (1, 0, None), (1, 1, None), (1, 3, None), (2,
0, None), (2, 3, None), (3, 3, None)]

Nathann

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



[sage-combinat-devel] Installation problem

2011-12-03 Thread Matthieu Deneufchâtel
Hello,
I don't know if I write to the right group. Please tell me if I am
wrong.

I try to install sage-combinat but it doesn't work.

I use Sage 4.7. I tried to use the command sage -combinat install in
the sage root directory and got the following error message:

[root@localhost sage]# sage -combinat install
/bin/sh: /usr/share/sage/sage: No such file or directory
Error: Cannot determine Sage version number from

I also tried to run the same command in the directory sage/local/bin
and got the same error message. Finally, I tried the command ./sage-
combinat install in the same directory but it does not work
[root@localhost bin]# ./sage-combinat install
Creating sage-combinat branch:
  sage -b main
sage-run received unknown option: -b
usage: sage [options]
Try 'sage -h' for more information.
Abort

Could you please help me ?
Best wishes,
Matthieu

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



[sage-combinat-devel] Re: dot2tex, combinat

2011-12-03 Thread Bruce Sagan
I had the same problem as William, but I am even further back.  I
don't understand how to get sage -sh to work.  I am running sage in
notebook form via VirtualBox on a Windows 7 machine.  Typing the
command into the notebook prompt doesn't work, and I can't find a
command prompt which might indicate the shell.  Thanks for any help
you can give.

Best, Bruce

On Nov 22, 10:38 am, Anne Schilling  wrote:
> On 11/21/11 11:02 PM, William Stein wrote:
>
>
>
>
>
> > On Mon, Nov 21, 2011 at 7:01 PM, Anne Schilling  
> > wrote:
> >> On 11/21/11 8:24 AM, William Stein wrote:
> >>> On Mon, Nov 21, 2011 at 8:08 AM, Dima Pasechnik  wrote:
>  This means you have graphviz spkg installed under macosx...
>  I cannot seem to be able to accomplish this:
> http://trac.sagemath.org/sage_trac/ticket/7438
>
> >>> I installed graphviz under OS X by installing it from the Graphviz
> >>> website, instead of using the spkg.
>
> >> After installingdot2texusing
>
> >> sage -idot2tex
>
> >> does the command
>
> >> sage: CrystalOfTableaux(['A',2], shape=[1]).latex()
> >> '\n\\begin{tikzpicture}[>=latex,line join=bevel,]\n%%\n\\node (1) at 
> >> (8bp,162bp) [draw,draw=none]
> >> {${\\def\\lr#1{\\multicolumn{1}{|@{\\hspace{.6ex}}c@{\\hspace{.6ex}}|}{\\ra­isebox{-.3ex}{$#1$}}}\\raisebox{-.6ex}{$\\begin{array}[b]{c}\\cline{1-1}\\l­r{1}\\cline{1-1}\\end{array}$}}$};\n
> >>   \\node
> >> (3) at (8bp,10bp) [draw,draw=none]
> >> {${\\def\\lr#1{\\multicolumn{1}{|@{\\hspace{.6ex}}c@{\\hspace{.6ex}}|}{\\ra­isebox{-.3ex}{$#1$}}}\\raisebox{-.6ex}{$\\begin{array}[b]{c}\\cline{1-1}\\l­r{3}\\cline{1-1}\\end{array}$}}$};\n
> >>   \\node
> >> (2) at (8bp,86bp) [draw,draw=none]
> >> {${\\def\\lr#1{\\multicolumn{1}{|@{\\hspace{.6ex}}c@{\\hspace{.6ex}}|}{\\ra­isebox{-.3ex}{$#1$}}}\\raisebox{-.6ex}{$\\begin{array}[b]{c}\\cline{1-1}\\l­r{2}\\cline{1-1}\\end{array}$}}$};\n
> >>   \\draw
> >> [blue,->] (1) ..controls (8bp,140.79bp) and (8bp,121.03bp)  .. (2);\n  
> >> \\definecolor{strokecol}{rgb}{0.0,0.0,0.0};\n  
> >> \\pgfsetstrokecolor{strokecol}\n  \\draw (17bp,124bp) node {$1$};\n  \\draw
> >> [red,->] (2) ..controls (8bp,64.789bp) and (8bp,45.027bp)  .. (3);\n  
> >> \\draw (17bp,48bp) node {$2$};\n%\n\\end{tikzpicture}\n'
>
> >> work?
>
> > Yes.
>
> > When I was preparing my talk, I was evidently using sage-4.7.1.  I
> > upgraded to a newer version of Sage, and the issue is totally
> > resolved.   Sorry for the noise and thanks for the further debugging 
> > questions.
>
> > Just to confirm, doing
>
> > sage: CrystalOfTableaux(['A',2], shape=[1]).latex_file('/tmp/a.tex')
> > sage:
>
> > no longer gives an error for me, and it *does* create the file
> > /tmp/a.tex and if I go to the /tmp directory, pdflatex it, and view
> > the
> > resulting pdf, then I get the diagram.
>
> By the way, you should be able to bypass the step of pdflatex in a directory 
> by
> using the commands
>
> sage: C = CrystalOfTableaux(['A',2], shape=[1])
> sage: view(C)
>
> directly in Sage. The picture should just come up.
>
> Best,
>
> Anne- Hide quoted text -
>
> - Show quoted text -

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



Re: [sage-combinat-devel] Combinatorica-like commands in Sage

2011-12-03 Thread Raymond N. Greenwell
I'm still stuck at creating my digraph from my csv file. My csv file is
essentially an adjacency matrix of 0's and 1's. I can import it, but I
can't convert it into an adjacency matrix that can then be created into a
digraph. Any more ideas? Thanks in advance for any help.

On Tue, Nov 22, 2011 at 2:42 AM, William Stein  wrote:

> On Mon, Nov 21, 2011 at 2:54 PM, Raymond N. Greenwell
>  wrote:
> > When I try to import a csv file into Sage, Sage can't locate the file,
> indicating that it's
> > not looking in the folder where I put the file. How do I find where Sage
> is looking, so
> >  I can put the file there? Note that this is on a Mac...
>
> You could use Terminal (and the cd command) to navigate to where the
> file is and type "pwd", which means "print working directory".  You'll
> get something that looks a little like
>
> /Users/greenwell/math/stuff
>
> Use that path.
>
>  -- William
>
> >
> > Thanks!
> >
> > On Nov 11, 2011, at 4:42 PM, William Stein wrote:
> >
> >> On Wed, Nov 9, 2011 at 5:52 PM, Raymond N. Greenwell 
> wrote:
> >>> I've been having some problems with Combinatorica, and someone
> >>> suggested I try Sage. Can Sage import a csv file and then turn it into
> >>> a graph, such as with the Combinatorica commands:
> >>> m = Import["medalcomparison3.csv"]
> >>> g = FromAdjacencyMatrix[m, Type -> Directed]
> >>
> >> Python (hence Sage) can import csv files as explained here:
> >>
> >>   http://docs.python.org/library/csv.html
> >>
> >> Sage can make a graph out of an adjacency matrix A using the Graph(A)
> command.
> >> Type "Graph?" for more on making graphs from matrices etc.
> >>
> >> In Sage you can make matrices in many ways.  Type "matrix?" for more on
> how.
> >>
> >>> Also, can it give a minimum chain partition, such as with the
> >>> Combinatorica command:
> >>> MinimumChainPartition[g]
> >>
> >> As far as I can tell, this is not implemented in Sage.
> >>
> >>> I have found that this Combinatorica command does not always give what
> >>> one would expect; the results seem to violate the Dilworth Theorem.
> >>>
> >>> Thanks!
> >>>
> >>> --
> >>> You received this message because you are subscribed to the Google
> Groups "sage-combinat-devel" group.
> >>> To post to this group, send email to
> sage-combinat-devel@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> sage-combinat-devel+unsubscr...@googlegroups.com.
> >>> For more options, visit this group at
> http://groups.google.com/group/sage-combinat-devel?hl=en.
> >>>
> >>>
> >>
> >>
> >>
> >> --
> >> William Stein
> >> Professor of Mathematics
> >> University of Washington
> >> http://wstein.org
> >>
> >
> > *
> > Raymond N. Greenwell mat...@hofstra.edu
> > Professor of Mathematics (516) 463-5573
> > 103 Hofstra University
> > Hempstead, NY 11549-1030
> > http://people.hofstra.edu/rgreenwell
> >
> >
>
>
>
> --
> William Stein
> Professor of Mathematics
> University of Washington
> http://wstein.org
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-combinat-devel" group.
> To post to this group, send email to sage-combinat-devel@googlegroups.com.
> To unsubscribe from this group, send email to
> sage-combinat-devel+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sage-combinat-devel?hl=en.
>
>

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



[sage-combinat-devel] file importation in Sage on a Mac

2011-12-03 Thread Raymond N. Greenwell
When I try to import a csv file into Sage, Sage can't locate the file,
indicating that it's not looking in the folder where I put the file. How do
I find where Sage is looking, so I can put the file there? This is on a
Mac, so I can't tell it C:\\ etc.


Thanks!


*

Raymond N. Greenwell mat...@hofstra.edu

Professor of Mathematics (516) 463-5573

103 Hofstra University

Hempstead, NY 11549-1030

http://people.hofstra.edu/rgreenwell

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



[sage-combinat-devel] Re: [sage-devel] Symmetric polynomial in terms of elementary symmetric polynomials

2011-12-03 Thread Nicolas M. Thiery
On Sat, Dec 03, 2011 at 01:22:32AM -0300, Federico Lebrón wrote:
> I've written a small pair of functions which could be useful:
> 
>   1) A function is_symmetric which, given a polynomial, returns whether 
> or not the polynomial is a symmetric polynomial.
>   2) A function symmetrize which, given a symmetric polynomial, returns 
> an equivalent expression in terms of the elementary symmetric polynomials.
> 
> The code, which likely needs some cleanup (and modifications to do things 
> "the Sage way", whatever it may be), is here: http://codepad.org/gJpNRfHH
> 
> Would there be interest in adding these to Sage perhaps? I tried searching 
> for similar functionality but couldn't find it.

Please have a look at SymmetricFunctions and
http://combinat.sagemath.org/doc/thematic_tutorials/demo-symmetric-functions.html

and get back to us for more information if needed!

Cheers,
Nicolas
--
Nicolas M. Thiéry "Isil" 
http://Nicolas.Thiery.name/

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