ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 15 Oct 2012 08:47:41 -0500- is a parent like a set?http://ask.sagemath.org/question/9424/is-a-parent-like-a-set/Does a parent function like a set? I would like to create a ring with elements which are sets and then place those elements into a matrix so that I can perform certain assigned operations on those elements. Sun, 14 Oct 2012 20:51:39 -0500http://ask.sagemath.org/question/9424/is-a-parent-like-a-set/
- Answer by Nicolas M ThiĆ©ry for <p>Does a parent function like a set? I would like to create a ring with elements which are sets and then place those elements into a matrix so that I can perform certain assigned operations on those elements. </p>
http://ask.sagemath.org/question/9424/is-a-parent-like-a-set/?answer=14146#post-id-14146Yes! A parent indeed models a mathematical set, more often than not endowed with some structure (a ring, a poset, a vector space, ...).
In your case, you want to implement a class that inherits from Parent, and sets its category to Rings() during the initialization. We don't have yet a minimal example of implementation of a ring, but you can already look at:
sage: S = Monoids()
sage: M = S.example()
sage: M??
Mon, 15 Oct 2012 04:30:06 -0500http://ask.sagemath.org/question/9424/is-a-parent-like-a-set/?answer=14146#post-id-14146
- Comment by SLOtoSF for <p>Yes! A parent indeed models a mathematical set, more often than not endowed with some structure (a ring, a poset, a vector space, ...).</p>
<p>In your case, you want to implement a class that inherits from Parent, and sets its category to Rings() during the initialization. We don't have yet a minimal example of implementation of a ring, but you can already look at:</p>
<pre><code>sage: S = Monoids()
sage: M = S.example()
sage: M??
</code></pre>
http://ask.sagemath.org/question/9424/is-a-parent-like-a-set/?comment=18863#post-id-18863Thanks, is it in the plans to do this for Rings? I was hoping to be able to account for 2 operations (addition and multiplication?).Mon, 15 Oct 2012 08:47:41 -0500http://ask.sagemath.org/question/9424/is-a-parent-like-a-set/?comment=18863#post-id-18863