Le 19/07/2012 11:17, Simon King a �crit :
Hi all,
Currently, the most sophiticated example in Sage is probably the
Symmetric Functions. It is an abstract parent with no element class,
with no basis as free module. It is just an abstract Parent gluyng
differant realizations.
*************************************************************
sage: SF = SymmetricFunctions(QQ); SF
Symmetric Functions over Rational Field
sage: SF.category()
Join of Category of hopf algebras over Rational Field and Category of
graded algebras over Rational Field and Category of coalgebras over
Rational Field with realizations
sage: for pres in SF.realizations(): print pres
....:
Symmetric Function Algebra over Rational Field, Power symmetric
functions as basis
Symmetric Function Algebra over Rational Field, Homogeneous symmetric
functions as basis
Symmetric Function Algebra over Rational Field, Elementary symmetric
functions as basis
Symmetric Function Algebra over Rational Field, Schur symmetric
functions as basis
Symmetric Function Algebra over Rational Field, Monomial symmetric
functions as basis
sage: SF.basis()
Traceback (most recent call last):
...
AttributeError: 'SymmetricFunctions_with_category' object has no
attribute 'basis'
sage: SF.schur().basis()
Lazy family (Term map from Partitions to Symmetric Function Algebra over
Rational Field, Schur symmetric functions as basis(i))_{i in Partitions}
*************************************************************
Now, I am not sure but I really think the Realizations framework is
adapted to any kind of parent (Any Group should work fine...)
Here is the structure of the code to declare practical realizations of
an abstract parent.
**************************************************************
class MyAbstractParent(UniqueRepresentation, Parent):
def __init__(self, foo):
Parent.__init__(self, bla, category = (
cat1.WithRealizations(), cat2, cat3, ... ) )
def realization_as_bla(self):
return PracticalRealization1( good_args )
...
class PracticalRealization1(UniqueRepresentation, Parent):
def __init__(self, foo3):
Parent.__init__(self, bla2, category = (
Realizations(MyAbstractParent), cat4, cat5, ... ) )
...
class Element( Good_data_structure_class ):
...
**************************************************************
I don't really know what are the good pointers for the documentation.
One can read :
sage: Realizations??
sage: SymmetricFunctions??
As I am only a level 1 sage contributor with categories, I can't tell
you how to implement morphisms between the differents realizations. But
that's clearly the second step (and the interessting one!!). The
TestSuite is already aware of abstract parent and their different
realizations.
Hope that would help a little.
Best regards,
Nicolas B.
P.S. : Nicolas (Thi�ry) is probably not availlable for a time...