ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 15 Oct 2012 15:47:41 +0200- is a parent like a set?https://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. Mon, 15 Oct 2012 03:51:39 +0200https://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>
https://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 11:30:06 +0200https://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>
https://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 15:47:41 +0200https://ask.sagemath.org/question/9424/is-a-parent-like-a-set/?comment=18863#post-id-18863