networkx implements in python a lot of graph theory. I don't think sympy has an
interface though.
sympy has rsolve for sequences defined by a linear recurrence relation
However, there isn't one for a vector-valued sequence (someone asked about that
the other day on the sage-support list).
>
> Also, I'm currently working on several little functions for
> computation of the Galois group of quadratic/cubic/quartic
> polynomials; I'll probably send the code in a couple of days. Maybe
> I'll be able to develop some GSoC-like ideas in this direction
> (abstract algebra) as well.
Sympy doesn't have much of that, although Sage does.
I think more abstract algebra in sympy would be very useful.
>
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
>
On Fri, Mar 16, 2012 at 2:06 PM, Aleksandar Makelov
<amak...@college.harvard.edu> wrote:
>
> I've been dealing with sympy for a couple of weeks now and was
> wondering whether it'd be a good idea for GSoC to implement some more
> complicated combinatorial functionality (e.g. graph algorithms,
> generating functions, recurrence relations, operations on sets,...) ?
I'd recommend that you take a look at
https://github.com/sympy/sympy/wiki/GSoC-2012-Ideas . Some of your
suggestions seem to be related to what is listed on that page.
Note, though, that graph theory is out of scope of SymPy, mainly
because graphs are already implemented in a couple other Python
libraries (e.g. NetworkX: http://networkx.lanl.gov/). Sorry, I cannot
find the proper source to cite; but trust me, Aaron told me that about
a month ago :-)
> Also, I'm currently working on several little functions for
> computation of the Galois group of quadratic/cubic/quartic
> polynomials; I'll probably send the code in a couple of days. Maybe
> I'll be able to develop some GSoC-like ideas in this direction
> (abstract algebra) as well.
I suppose that your contributions will be welcome :-)
Sergiu
And it would be awesome to have a group theory module. We presently
only have a Permutation class in the combinatorics module, but other
than that, we don't really have a good way to represent a group.
Obviously, to compute the Galois group of a polynomial, you need a way
to represent it, so for this idea, you would really need to implement
a group theory framework that we can build upon.
What algorithm do you use to compute the Galois group?
Aaron Meurer
http://www.maplesoft.com/support/help/Maple/view.aspx?path=galois may
also give you some inspiration.
>
> Respectively, representing groups will be just by name (not so many of
> them in degrees less than 5...) but obviously in higher degrees it'd
> be convenient to have a way of handling arbitrary groups. Galois
> groups are naturally embedded in the symmetric groups S_n, so
> permutations will probably pop up from the algorithms; as size gets
> larger (approx. n!) it'd be better to have them in cycle notation, and
> also try to extract a list of generators / generators with relations.
> Other than that, I don't know... I'm currently doing representation
> theory and it sounds tempting (eigenvals()? character tables?). But
> that's just the mathematical side of it, and I'll have to think a lot
> about implementation.
>
> Aleksandar Makelov
Well, we want to be able to do more with a group than just have its name.
How you represent the group, and its elements, depends on what the
group is (finite or infinite for one thing), and what you plan to do.
It will be useful to be able to represent them in many different ways.
If you're interested in working on group theory, you might also look
at the GAP project for some inspiration. They have the most powerful
group theory software (as far as I know).
Aaron Meurer
This seems incorrect. Zn is abelian for example and it is not
isomorphic to any permutation group. Moreover, there are all the
continuous groups.
Besides, it will be nicer to have some abstract object that is not
tied to a concrete representation, even though it will probably just
be a wrapper for all the representations supported by sympy.
As Stefan noted, this is only true for finite groups.
And anyway, the point I was trying to make was that a permutation
represents an element of a group, whereas I was talking about a way to
represent the whole group.
Aaron Meurer
>
>> Obviously, to compute the Galois group of a polynomial, you need a way
>> to represent it, so for this idea, you would really need to implement
>> a group theory framework that we can build upon.
>
> Again, most of the concrete algorithms for groups are for Permutation
> groups only. I see that the book by Seress has already been
> referenced.
>
> I think a more fruitful venture would be to extend the perm groups
> module and leverage that to implement matrix groups or galois groups
> (but then again, I am probably biased ;)
>
> Cheers
> Sapta
>
It is not correct to say Zn (I assume you mean the ring of integers
mod n) is not isomorphic to a permutation group. (Consider the
cyclic group generated by the n-cycle (1,2,...,n) in disjoint
cycle notation.)
Implementing Lie groups would be a relatively difficult undertaking
I think...
>
> Besides, it will be nicer to have some abstract object that is not
> tied to a concrete representation, even though it will probably just
> be a wrapper for all the representations supported by sympy.
>
I think difference should be made between
nZ = {n * k | k\in Z}
and
Z_n = {k mod n | k\in Z}.
Z_n is finite, while nZ is infinite. This might be the reason for the
misunderstanding.
Sergiu
Submit a pull request! This can be your patch for the patch requirement.
Aaron Meurer
>
> Aleksandar Makelov
Aaron Meurer
Aaron Meurer
http://www.4shared.com/office/LtxPTggL/Handbook_of_Computational_Grou.html
Attached is another way of implementing Lie groups
On Sat, Mar 17, 2012 at 1:42 PM, Saptarshi Mandal wrote:
>>
>> And it would be awesome to have a group theory module. We presently
>> only have a Permutation class in the combinatorics module, but other
>> than that, we don't really have a good way to represent a group.
>
> Is this necessary? All groups are isomorphic to the permutation group
> anyway. Groups for specific structures can make use of functionality
> implemented for them (matrix group -> sympy matrices, galois -> polys)
> for basic operations and can implement the mapping to the perm group
> module for group theoretic operations.As Stefan noted, this is only true for finite groups.
And anyway, the point I was trying to make was that a permutation
represents an element of a group, whereas I was talking about a way to
represent the whole group.Aaron Meurer
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/8BKF_m6cyR4J.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sympy/-/8BKF_m6cyR4J.
>
This seems good. It sounds like you plan on implementing
permutation groups, and the methods you describe, which the
user defines using a list of (permutation) generators.
Is that your question?
>
> Also, the tiny little functionality covering Galois groups for
> polynomials of degree less than 5 should come out soon, but for that I
> first need some basic Group object to work with, hence my above
> question.
>
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
For example, the other day, I was trying to figure out a way to
generate a random permutation of order roughly 2**32 (what I was
trying to do was randomize some Python hashes). There is the function
random_permutation, but this generates the whole permutation, which
would take up way too much space. What I would rather have is some
lazy evaluation, where it generates unknown permutations "on the fly".
This could be easily implemented as a dictionary.
Aaron Meurer
How could it be too late?
>
> Then, finite groups are constructed by Group(... comma separated
> generators ... ), where the generators can be permutations or matrices
> (well if you put matrices that don't generate a finite group you get
> yelled at); and finitely presented groups are constructed by first
> constructing a free group of a certain number of generators and then
> taking the "quotient" by a set of words in the generators that are
> equal to the identity element (these are the relations).
>
> So these are some ideas for a possible start on the groups module.
> What do you guys think?
Well the GAP people have obviously thought about this problem a lot
more than we have, and they have quite a bit implemented, so it is a
good place to look for references. Obviously, we will want to modify
some things to make them more Pythonic, or to make them fit better
with other parts of SymPy. For example, GAP is written in C, which is
not object oriented, so depending on how they implemented their data
structures, we may want to do it different (not to mention that Python
has its own independent set of data structures from C with their own
advantages and disadvantages).
Aaron Meurer
>
> On Mar 21, 1:05 am, Saptarshi Mandal <sapta.iit...@gmail.com> wrote:
>> Sounds good. I am just not sure if *implementing* a pure abstract
>> group class is the best way to go. From an implementation perspective,
>> it would be very convenient if the abstract group class encapsulates
>> the permutation group class. Implementing any other concrete group
>> will then require one to a) inherit the abstract class, b) map the
>> group operation to an appropriate permutation group operation and c)
>> construct an isomorphism from the concrete group to the permutation
>> group. This way we can reuse all the algorithms that have been
>> implemented for permutation groups. This strategy is useful for
>> implementation because perm group algorithms are the simplest to
>> implement.
>>
>> I have not looked at the source code of GAP but I think the abstract
>> groups that GAP allows you to create are really permutation groups
>> masquerading as abstract groups. I could be hopelessly wrong though.
>
I think you should start out implementing it separate from the core
(except where you use the core), and then later we can think about
merging the ideas. This is similar to how the polys work.
Aaron Meurer
On Sat, Mar 24, 2012 at 10:53 PM, Aleksandar Makelov
<amak...@college.harvard.edu> wrote:
>
>
> On Mar 24, 10:39 pm, Aaron Meurer <asmeu...@gmail.com> wrote:
>
>> How could it be too late?
>>
>>
>
> Well yeah I hoped it's not :) I was wondering about that because it'd
> take a massive amount of changes over different modules to put all
> abstract algebraic structures on a common setting -- but I think
> that's the right direction to treat this stuff (like, abstract algebra
> is abstract so in order to implement it we need more abstractness :) )
>
>
>>
>
>>
>> Well the GAP people have obviously thought about this problem a lot
>> more than we have, and they have quite a bit implemented, so it is a
>> good place to look for references. Obviously, we will want to modify
>> some things to make them more Pythonic, or to make them fit better
>> with other parts of SymPy. For example, GAP is written in C, which is
>> not object oriented, so depending on how they implemented their data
>> structures, we may want to do it different (not to mention that Python
>> has its own independent set of data structures from C with their own
>> advantages and disadvantages).
>>
>> Aaron Meurer
>>
>
> Yep the GAP guys appear to be solid citizens. They have a 900 page
> reference and also all the C-code is freely available. Apart from that
Sage also has a lot - in python or cython. See for example
http://hg.sagemath.org/sage-main/file/c239be1054e0/sage/groups/perm_gps/permgroup.py#l1
However, their license is GPL, not BSD, so you can't use it directly.
Hopefully, it is another good reference for you to look at though.
You can see from the author field, it seems I wrote (many years ago) a
few of those
methods. Of course, I am more than happy to relicense any of my code as BSD,
in case that helps.
> they have tables for a LOT of known finite groups. I think this is
> going to help a lot - they are referred to in Chapter 11 of The
> Handbook on Computational Group Theory and could speed up some of the
> algorithms.
>