unlisted
ubuntu2004a
��c^� � @ s� d Z ddlZddlmZ ddlmZ ddlmZ ddlm Z m
Z
ddlmZm
Z
ddlmZ dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZmZmZ ddlmZ ddlmZ ddl m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z' ddl(m)Z) ddl*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1m2Z2m3Z3m4Z4m5Z5 ddl6m7Z7 ddl8m9Z9 ddl:m;Z; e� �<� Z=G dd� de�Z>G dd � d ee!�Z?G d!d"� d"e�Z@dS )#zL
Tautological subring of the cohomology ring of the moduli space of curves.
� N)�
cached_method)�prod)�UniqueRepresentation)�op_EQ�op_NE)�
ModuleElement�parent)�coercion_model)�Functor)�ConstructionFunctor)�Algebras)�Rings)� factorial� bernoulli�multinomial)�
Partitions)�IntegerVectors)�Algebra��ZZ)�QQ��vector)�PolynomialRing)� TermOrder��WeightedIntegerVectors)�matrix� )�_moduli_to_str�_str_to_moduli� MODULI_TL�
get_moduli�socle_degree)�
decstratum)�StableGraph)�identify_classc @ sx e Zd ZdZdWdd�Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� ZdXdd�ZdYd d!�ZdZd"d#�Zd[d$d%�Zd&d'� Zd(d)� Zd*d+� Zd,d-� Zd.d/� Zd\d0d1�Zd2d3� Zd4d5� Zd6d7� Zd]d8d9�Zd:d;� Zd^d<d=�Z d_d>d?�Z!d`d@dA�Z"dBdC� Z#dadDdE�Z$dbdFdG�Z%dHdI� Z&dcdJdK�Z'dddLdM�Z(dedNdO�Z)dfdQdR�Z*dSdT� Z+dUdV� Z,dS )g�TautologicalClassaB
An element of a tautological ring.
Internally, it is represented by a list ``terms`` of objects of type
:class:`admcycles.admcycles.decstratum`. Such element should never
be constructed directly by calling :class:`TautologicalClass`. Instead
use the parent class :class:`TautologicalRing` or dedicated functions
as in the examples below
EXAMPLES::
sage: from admcycles import *
sage: R = TautologicalRing(3,1)
sage: gamma = StableGraph([1,2],[[1,2],[3]],[(2,3)])
sage: ds1 = R(gamma, kappa=[[1],[]])
sage: ds1
Graph : [1, 2] [[1, 2], [3]] [(2, 3)]
Polynomial : (kappa_1)_0
sage: ds2 = R(gamma, kappa=[[],[1]])
sage: ds2
Graph : [1, 2] [[1, 2], [3]] [(2, 3)]
Polynomial : (kappa_1)_1
sage: t = ds1 + ds2
sage: (t - R(gamma) * R.kappa(1)).is_zero()
True
Constructing a tautological class from dedicated functions::
sage: psiclass(1, 2, 1) # psi_1 on M_{2,1}
Graph : [2] [[1]] []
Polynomial : psi_1
Tc C sX t �| |� t|ttf�r�i | _|D ]�}t|t�s6t�|j� � rHt
d��|j�|j�rXq$|rp|�
|j� |�� |j| jv r�| j|j j|j7 _| j|j s�| j|j= q$|| j|j<