You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Sébastien Brisard <se...@m4x.org> on 2011/10/03 16:00:39 UTC

[math] Support for Abelian Groups and Rings?

Hello,
I'm using quite extensively the Field/FieldElement interfaces, but am
sometimes feeling the need for less stringent sets like Abelian Groups
(no multiplication) and Rings (no division). This would allow me to
carry out some calculations on different types of number simply by
changing the generic type.
I was thinking of adding some interfaces along the lines of the two
above mentioned
  - AbelianGroup<T>, AbelianGroupElement<T>,
  - Ring<T>, RingElement<T>.

Do you think that would be useful?

Thank you very much,
Sébastien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] Support for Abelian Groups and Rings?

Posted by Sébastien Brisard <se...@m4x.org>.
Thanks for the link! It seems very interesting, I'll give it a try!
Sébastien

2011/10/4 Axel <ax...@gmail.com>:
> 2011/10/3 Sébastien Brisard <se...@m4x.org>:
>> Hello,
>> I'm using quite extensively the Field/FieldElement interfaces, but am
>> sometimes feeling the need for less stringent sets like Abelian Groups
>> (no multiplication) and Rings (no division). This would allow me to
>> carry out some calculations on different types of number simply by
>> changing the generic type.
>> I was thinking of adding some interfaces along the lines of the two
>> above mentioned
>>  - AbelianGroup<T>, AbelianGroupElement<T>,
>>  - Ring<T>, RingElement<T>.
> Hello
>
> You should probably take a look at the JAS type hierachy (see attached
> jas_hierarchy.png)
> http://krum.rz.uni-mannheim.de/jas/
>
> this paper gives an overview of the JAS design:
> http://krum.rz.uni-mannheim.de/kredel/ca-sem-2009.pdf
>
> --
> Axel Kramer
> http://code.google.com/p/symja/wiki/UsedLibraries (JAS and CM examples in Symja)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] Support for Abelian Groups and Rings?

Posted by Axel <ax...@gmail.com>.
2011/10/3 Sébastien Brisard <se...@m4x.org>:
> Hello,
> I'm using quite extensively the Field/FieldElement interfaces, but am
> sometimes feeling the need for less stringent sets like Abelian Groups
> (no multiplication) and Rings (no division). This would allow me to
> carry out some calculations on different types of number simply by
> changing the generic type.
> I was thinking of adding some interfaces along the lines of the two
> above mentioned
>  - AbelianGroup<T>, AbelianGroupElement<T>,
>  - Ring<T>, RingElement<T>.
Hello

You should probably take a look at the JAS type hierachy (see attached
jas_hierarchy.png)
http://krum.rz.uni-mannheim.de/jas/

this paper gives an overview of the JAS design:
http://krum.rz.uni-mannheim.de/kredel/ca-sem-2009.pdf

-- 
Axel Kramer
http://code.google.com/p/symja/wiki/UsedLibraries (JAS and CM examples in Symja)


Re: [math] Support for Abelian Groups and Rings?

Posted by Sébastien Brisard <se...@m4x.org>.
Hello everyone,
so we all agree that adding these structures to CM would be
compartively easy (reusing what has been done with
FieldElement/Field). Whether it would be useful is another issue...
>
> What is most interesting is the example use cases.  I think we all
> know that it is straightforward and easy to define the interfaces
> and classes, which basically just amount to removing structure or
> closure properties from fields.  The question is do they really get
> you anything?  You mentioned above a Taylor series example.  I did
> not follow what was going on there exactly.  Were the coefficients
> over Z, or the values?  What other rings were you considering?  What
> groups, exactly?  That is what I meant by having the use cases
> first, then introducing the abstractions as needed.  Before
> introducing the mathematical objects, we need "real world
> applications" in mind that are going to use them.  Of course, our
> "real world" can include some pretty arcane stuff; but at the end of
> the day, we need to have internal or external application use cases
> in mind for everything that we add to [math].
>
> Phil
>
This approach is indeed the most reasonable path to follow. Quite
frankly, I must work on my example before I can tell you anymore about
it. In fact, I'm not convinced these extensions are absolutely
necessary, I think aesthetics was also part of my initial motivation
(bad, bad, I must admit...). I will get back to you as soon as my mind
is clearer.

As for the numerical/non-numerical question. The application I have in
mind is very similar (but more involved on the symbolic side) to
hierarchic finite-elements (p-FEM). This is a *numerical* algorithm,
which comes down to solving a linear system. Assembly of the matrix is
the tough part, as closed-form expressions for the entries are a
nightmare. Their derivation, however, is very systematic, and involves
only taylor expansions. So I figured I would *compute* the closed-form
expression of the entries, prior to assembling the matrix. I'm a bit
afraid about floating-point errors in these preliminary computations,
so I would like to be able to use several number representations
("exact" fractions, as well as faster doubles). Also, exact
calculations would be useful per se (publication of the method). But
for the time being, fields are really what I need. As I said, I might
have been carried by a wave of mathematical abstraction... I'm in the
middle of writing the code, and need to check I *really* need groups
or rings.

Whether or not these extensions are a must do is highly questionable;
however, the over feature requests I've communicated
(opposite()/inverse()) would indeed be very useful.

If you agree, I'll keep you posted on this topic once I've reached a
conclusion. But this conclusion will probably be: I like them, but I
don't need them...

Sorry for taking your time.
Sébastien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] Support for Abelian Groups and Rings?

Posted by Phil Steitz <ph...@gmail.com>.
On 10/3/11 10:23 AM, Sébastien Brisard wrote:
>> I would be curious to see how such a class would actually help you.  I have
>> to admit that a big part of my curiosity is due to the fact that I don't
>> understand how it really would help.  It could be, as you say, beautiful but
>> useful is sometimes are more difficult goal with these things.
>>
>> I would also like to see if you are able to express enough interesting
>> structure in the Java type system so as to be useful.
>>
>> So please do create a prototype.  It will be very interesting to see it.
>>
> I had nothing fancy in mind. I wanted merely to build a Group and a
> Ring following what has been done in CM with Field/FieldElement.
> I already had the opportunity to mention this library, but Jean-Marie
> Dautelle's JScience is a good example of implementation of all these
> mathematical structures (http://jscience.org/). However, I tend to
> prefer the way Fields are implemented in CM (there are slight
> differences, most notably getZero() and getOne() which are missing in
> JScience).
> If you are still interested, I'll post (not commit, I got the
> message!!!) tentative interfaces once I've written them.

What is most interesting is the example use cases.  I think we all
know that it is straightforward and easy to define the interfaces
and classes, which basically just amount to removing structure or
closure properties from fields.  The question is do they really get
you anything?  You mentioned above a Taylor series example.  I did
not follow what was going on there exactly.  Were the coefficients
over Z, or the values?  What other rings were you considering?  What
groups, exactly?  That is what I meant by having the use cases
first, then introducing the abstractions as needed.  Before
introducing the mathematical objects, we need "real world
applications" in mind that are going to use them.  Of course, our
"real world" can include some pretty arcane stuff; but at the end of
the day, we need to have internal or external application use cases
in mind for everything that we add to [math]. 

Phil


> Sébastien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] Support for Abelian Groups and Rings?

Posted by Ted Dunning <te...@gmail.com>.
I am interested.  Not convinced, but interested.

2011/10/3 Sébastien Brisard <se...@m4x.org>

> If you are still interested, I'll post (not commit, I got the
> message!!!) tentative interfaces once I've written them.
>

Re: [math] Support for Abelian Groups and Rings?

Posted by Phil Steitz <ph...@gmail.com>.
On 10/4/11 5:42 PM, Greg Sterijevski wrote:
> Pardon my ignorance of Abelian Fields, but what would be a use of this set
> of classes? Do they simplify some calculation or make some code faster? The
> question is, "are they numerical?"

We can all look at Sebastien's use cases to assess general
usefulness.  They are not likely going to be "numerical" in the
sense of having lots of direct applications to numerical analysis,
but that is just one of the applied areas that [math] touches.  We
have both discrete and continuous components and even in dealing
with computations involving fields and real or complex function
spaces, it might be useful to have classes representing rings and
groups.  Where they might be useful is in modelling things such as
automorphism groups that have only a group (or ring, as the case may
be) structure.  I don't personally have examples where I need this
stuff, but it could be that Sebastien does.  I am open to adding
these algebraic constructs as and when the practical applications
arise that need them, or that can be expressed more simply or
naturally using them.

Phil
>
> On Tue, Oct 4, 2011 at 2:33 PM, Luc Maisonobe <Lu...@free.fr> wrote:
>
>> Le 03/10/2011 19:50, Mikkel Meyer Andersen a écrit :
>>
>>  2011/10/3 Sébastien Brisard<se...@m4x.org>
>>>> :
>>>> I would be curious to see how such a class would actually help you.  I
>>>>> have
>>>>> to admit that a big part of my curiosity is due to the fact that I don't
>>>>> understand how it really would help.  It could be, as you say, beautiful
>>>>> but
>>>>> useful is sometimes are more difficult goal with these things.
>>>>>
>>>>> I would also like to see if you are able to express enough interesting
>>>>> structure in the Java type system so as to be useful.
>>>>>
>>>>> So please do create a prototype.  It will be very interesting to see it.
>>>>>
>>>>>  I had nothing fancy in mind. I wanted merely to build a Group and a
>>>> Ring following what has been done in CM with Field/FieldElement.
>>>> I already had the opportunity to mention this library, but Jean-Marie
>>>> Dautelle's JScience is a good example of implementation of all these
>>>> mathematical structures (http://jscience.org/). However, I tend to
>>>> prefer the way Fields are implemented in CM (there are slight
>>>> differences, most notably getZero() and getOne() which are missing in
>>>> JScience).
>>>> If you are still interested, I'll post (not commit, I got the
>>>> message!!!) tentative interfaces once I've written them.
>>>> Sébastien
>>>>
>>> Me, too.
>>>
>> I'm on the fence on this. I would also like to look at some examples about
>> what you have in mind.
>>
>> Luc
>>
>>
>>
>>> ------------------------------**------------------------------**---------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.**apache.org<de...@commons.apache.org>
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>>
>>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.**apache.org<de...@commons.apache.org>
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] Support for Abelian Groups and Rings?

Posted by Greg Sterijevski <gs...@gmail.com>.
Pardon my ignorance of Abelian Fields, but what would be a use of this set
of classes? Do they simplify some calculation or make some code faster? The
question is, "are they numerical?"

On Tue, Oct 4, 2011 at 2:33 PM, Luc Maisonobe <Lu...@free.fr> wrote:

> Le 03/10/2011 19:50, Mikkel Meyer Andersen a écrit :
>
>  2011/10/3 Sébastien Brisard<se...@m4x.org>
>> >:
>>
>>> I would be curious to see how such a class would actually help you.  I
>>>> have
>>>> to admit that a big part of my curiosity is due to the fact that I don't
>>>> understand how it really would help.  It could be, as you say, beautiful
>>>> but
>>>> useful is sometimes are more difficult goal with these things.
>>>>
>>>> I would also like to see if you are able to express enough interesting
>>>> structure in the Java type system so as to be useful.
>>>>
>>>> So please do create a prototype.  It will be very interesting to see it.
>>>>
>>>>  I had nothing fancy in mind. I wanted merely to build a Group and a
>>> Ring following what has been done in CM with Field/FieldElement.
>>> I already had the opportunity to mention this library, but Jean-Marie
>>> Dautelle's JScience is a good example of implementation of all these
>>> mathematical structures (http://jscience.org/). However, I tend to
>>> prefer the way Fields are implemented in CM (there are slight
>>> differences, most notably getZero() and getOne() which are missing in
>>> JScience).
>>> If you are still interested, I'll post (not commit, I got the
>>> message!!!) tentative interfaces once I've written them.
>>> Sébastien
>>>
>> Me, too.
>>
>
> I'm on the fence on this. I would also like to look at some examples about
> what you have in mind.
>
> Luc
>
>
>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.**apache.org<de...@commons.apache.org>
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@commons.**apache.org<de...@commons.apache.org>
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: [math] Support for Abelian Groups and Rings?

Posted by Luc Maisonobe <Lu...@free.fr>.
Le 03/10/2011 19:50, Mikkel Meyer Andersen a écrit :
> 2011/10/3 Sébastien Brisard<se...@m4x.org>:
>>> I would be curious to see how such a class would actually help you.  I have
>>> to admit that a big part of my curiosity is due to the fact that I don't
>>> understand how it really would help.  It could be, as you say, beautiful but
>>> useful is sometimes are more difficult goal with these things.
>>>
>>> I would also like to see if you are able to express enough interesting
>>> structure in the Java type system so as to be useful.
>>>
>>> So please do create a prototype.  It will be very interesting to see it.
>>>
>> I had nothing fancy in mind. I wanted merely to build a Group and a
>> Ring following what has been done in CM with Field/FieldElement.
>> I already had the opportunity to mention this library, but Jean-Marie
>> Dautelle's JScience is a good example of implementation of all these
>> mathematical structures (http://jscience.org/). However, I tend to
>> prefer the way Fields are implemented in CM (there are slight
>> differences, most notably getZero() and getOne() which are missing in
>> JScience).
>> If you are still interested, I'll post (not commit, I got the
>> message!!!) tentative interfaces once I've written them.
>> Sébastien
> Me, too.

I'm on the fence on this. I would also like to look at some examples 
about what you have in mind.

Luc

>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] Support for Abelian Groups and Rings?

Posted by Mikkel Meyer Andersen <mi...@mikl.dk>.
2011/10/3 Sébastien Brisard <se...@m4x.org>:
>> I would be curious to see how such a class would actually help you.  I have
>> to admit that a big part of my curiosity is due to the fact that I don't
>> understand how it really would help.  It could be, as you say, beautiful but
>> useful is sometimes are more difficult goal with these things.
>>
>> I would also like to see if you are able to express enough interesting
>> structure in the Java type system so as to be useful.
>>
>> So please do create a prototype.  It will be very interesting to see it.
>>
> I had nothing fancy in mind. I wanted merely to build a Group and a
> Ring following what has been done in CM with Field/FieldElement.
> I already had the opportunity to mention this library, but Jean-Marie
> Dautelle's JScience is a good example of implementation of all these
> mathematical structures (http://jscience.org/). However, I tend to
> prefer the way Fields are implemented in CM (there are slight
> differences, most notably getZero() and getOne() which are missing in
> JScience).
> If you are still interested, I'll post (not commit, I got the
> message!!!) tentative interfaces once I've written them.
> Sébastien
Me, too.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] Support for Abelian Groups and Rings?

Posted by Sébastien Brisard <se...@m4x.org>.
> I would be curious to see how such a class would actually help you.  I have
> to admit that a big part of my curiosity is due to the fact that I don't
> understand how it really would help.  It could be, as you say, beautiful but
> useful is sometimes are more difficult goal with these things.
>
> I would also like to see if you are able to express enough interesting
> structure in the Java type system so as to be useful.
>
> So please do create a prototype.  It will be very interesting to see it.
>
I had nothing fancy in mind. I wanted merely to build a Group and a
Ring following what has been done in CM with Field/FieldElement.
I already had the opportunity to mention this library, but Jean-Marie
Dautelle's JScience is a good example of implementation of all these
mathematical structures (http://jscience.org/). However, I tend to
prefer the way Fields are implemented in CM (there are slight
differences, most notably getZero() and getOne() which are missing in
JScience).
If you are still interested, I'll post (not commit, I got the
message!!!) tentative interfaces once I've written them.
Sébastien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] Support for Abelian Groups and Rings?

Posted by Ted Dunning <te...@gmail.com>.
I would be curious to see how such a class would actually help you.  I have
to admit that a big part of my curiosity is due to the fact that I don't
understand how it really would help.  It could be, as you say, beautiful but
useful is sometimes are more difficult goal with these things.

I would also like to see if you are able to express enough interesting
structure in the Java type system so as to be useful.

So please do create a prototype.  It will be very interesting to see it.

2011/10/3 Sébastien Brisard <se...@m4x.org>

> OK, I could go on, but honestly Phil, I think I won't be able to
> convince you. Indeed, if this feature existed, I would use it, but I
> must admit that I proposed it because I also find such a feature
> "beautiful" (which is not a very good reason for adding it to CM).
> What I'm going to do is implement those mathematical entities on my
> side, and try and use them. If I realize they could be useful to the
> core CM library, I'll raise this issue again later.
>
> Thank you for trying to reason me...
>

Re: [math] Support for Abelian Groups and Rings?

Posted by Phil Steitz <ph...@gmail.com>.
2011/10/3 Sébastien Brisard <se...@m4x.org>:
> 2011/10/3 Phil Steitz <ph...@gmail.com>:
>> On 10/3/11 7:00 AM, Sébastien Brisard wrote:
>>> Hello,
>>> I'm using quite extensively the Field/FieldElement interfaces, but am
>>> sometimes feeling the need for less stringent sets like Abelian Groups
>>> (no multiplication) and Rings (no division). This would allow me to
>>> carry out some calculations on different types of number simply by
>>> changing the generic type.
>>> I was thinking of adding some interfaces along the lines of the two
>>> above mentioned
>>>   - AbelianGroup<T>, AbelianGroupElement<T>,
>>>   - Ring<T>, RingElement<T>.
>>>
>>> Do you think that would be useful?
>>
>> If you have practical applications, then OK; if this is just to have
>> more math abstractions, we have generally been conservative about
>> that (i.e., introduce the abstractions as we need them for practical
>> applications).  Can you describe a little the use cases?
>>
>> Phil
>>
> Hi Phil,
>
> The application I have in mind is the manipulation of Taylor
> expansions (stored as multivariate polynomials). I'm trying to use
> genericity in order to be able to work with different number
> representations (exact fractions, double values, etc...).
> From this point of view, it would be useful to be able to have a
> wrapper class for (for example) integers. However, this is not
> possible at the moment, since Z is only a ring.
>
> OK, I could go on, but honestly Phil, I think I won't be able to
> convince you. Indeed, if this feature existed, I would use it, but I
> must admit that I proposed it because I also find such a feature
> "beautiful" (which is not a very good reason for adding it to CM).
> What I'm going to do is implement those mathematical entities on my
> side, and try and use them. If I realize they could be useful to the
> core CM library, I'll raise this issue again later.

Sounds like a good plan.  Don't get me wrong - we added Field for the
same kinds of reasons (needed for some applications and code reuse).

Phil


> Thank you for trying to reason me...
> Sébastien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] Support for Abelian Groups and Rings?

Posted by Sébastien Brisard <se...@m4x.org>.
2011/10/3 Phil Steitz <ph...@gmail.com>:
> On 10/3/11 7:00 AM, Sébastien Brisard wrote:
>> Hello,
>> I'm using quite extensively the Field/FieldElement interfaces, but am
>> sometimes feeling the need for less stringent sets like Abelian Groups
>> (no multiplication) and Rings (no division). This would allow me to
>> carry out some calculations on different types of number simply by
>> changing the generic type.
>> I was thinking of adding some interfaces along the lines of the two
>> above mentioned
>>   - AbelianGroup<T>, AbelianGroupElement<T>,
>>   - Ring<T>, RingElement<T>.
>>
>> Do you think that would be useful?
>
> If you have practical applications, then OK; if this is just to have
> more math abstractions, we have generally been conservative about
> that (i.e., introduce the abstractions as we need them for practical
> applications).  Can you describe a little the use cases?
>
> Phil
>
Hi Phil,

The application I have in mind is the manipulation of Taylor
expansions (stored as multivariate polynomials). I'm trying to use
genericity in order to be able to work with different number
representations (exact fractions, double values, etc...).
>From this point of view, it would be useful to be able to have a
wrapper class for (for example) integers. However, this is not
possible at the moment, since Z is only a ring.

OK, I could go on, but honestly Phil, I think I won't be able to
convince you. Indeed, if this feature existed, I would use it, but I
must admit that I proposed it because I also find such a feature
"beautiful" (which is not a very good reason for adding it to CM).
What I'm going to do is implement those mathematical entities on my
side, and try and use them. If I realize they could be useful to the
core CM library, I'll raise this issue again later.

Thank you for trying to reason me...
Sébastien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] Support for Abelian Groups and Rings?

Posted by Phil Steitz <ph...@gmail.com>.
On 10/3/11 7:00 AM, Sébastien Brisard wrote:
> Hello,
> I'm using quite extensively the Field/FieldElement interfaces, but am
> sometimes feeling the need for less stringent sets like Abelian Groups
> (no multiplication) and Rings (no division). This would allow me to
> carry out some calculations on different types of number simply by
> changing the generic type.
> I was thinking of adding some interfaces along the lines of the two
> above mentioned
>   - AbelianGroup<T>, AbelianGroupElement<T>,
>   - Ring<T>, RingElement<T>.
>
> Do you think that would be useful?

If you have practical applications, then OK; if this is just to have
more math abstractions, we have generally been conservative about
that (i.e., introduce the abstractions as we need them for practical
applications).  Can you describe a little the use cases?

Phil
>
> Thank you very much,
> Sébastien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org