unlisted
ubuntu2004o
��cn, � @ sH d dl mZ d dlmZ d dlmZ d dlZd dlZG dd� de�Z dS )� )�Counter)�
SageObject)�
cached_methodNc @ s� e Zd ZdZd1dd�Zedd� �Zedd� �Zd d
� Z dd� Z
d
d� Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd� Zdd� Zedd � �Zd!d"� Z # #d2d$d%�Zd&d'� Zed(d)� �Zed*d+� �Zd,d-� Zd.d/� Zd0S )3�ELGTautClassaT
A Tautological class of a stratum X, i.e. a formal sum of of psi classes on
EmbeddedLevelGraphs.
This is encoded by a list of summands.
Each summand corresponds to an AdditiveGenerator with coefficient.
Thus an ELGTautClass is a list with entries tuples (coefficient, AdditiveGenerator).
These can be added, multiplied and reduced (simplified).
INPUT :
* X : GeneralisedStratum that we are on
* psi_list : list of tuples (coefficient, AdditiveGenerator) as
described above.
* reduce=True : call self.reduce() on initialisation
Tc C s || _ || _|r| �� d S d S �N)� _psi_list�_X�reduce)�self�X�psi_listr � r
�E/home/user/Introduction lectures/admcycles/diffstrata/elgtautclass.py�__init__ s
�zELGTautClass.__init__c s | � � fdd�|D �dd�S )Nc s g | ]\}}|� � |�f�qS r
)�additive_generator_from_hash)�.0�c�h�r r
r �
<listcomp>) s �z/ELGTautClass.from_hash_list.<locals>.<listcomp>F�r r
)�clsr Z hash_listr
r r �from_hash_list&