unlisted
ubuntu2004o
��cυ �
@ sz d Z ddlZddlmZmZ ddlmZ ddlmZ ddl m
Z
ddlm Z ddlm
Z
dd lmZ dd
lmZmZ ddlmZ ddlmZmZmZ dd
lmZ ddlmZ ddlmZ ddlm Z ddl!m"Z" ddl#m$Z$ ddl%m&Z& d1dd�Z'ddddddddedf
dd�Z(dd� Z)d2dd�Z*d2dd �Z+d!d"� Z,ed#d$� �Z-d%d&� Z.d3d'd(�Z/d4d)d*�Z0d+d,� Z1d-d.� Z2d5d/d0�Z3dS )6z
Double ramification cycle
� N)�Tautvecttobasis�tautgens)�StableGraph� )�TautologicalRing)�interpolate)�Subsets)� factorial)�floor�ceil)�prod)�PolynomialRing�QQ�ZZ)�vector)�MPolynomial)�cached_function)�PowerSeriesRing)�bernoulli_polynomial)�exp)�
PartitionsTFc C s� |du r| }t |�}t| |�}|du r!tt|�d| d | �}t|�|d| d | kr3td��t�| ||||�}tdd� t�|| |t t
d|d ��tj�D ��} |rgt| | ||�}
|re|�
|
|�S |
S |ro|�| |�S | S )a� Returns the k-twisted Double ramification cycle in genus g and codimension d
for the partition Avector of k*(2g-2+n).
In the notation of [JPPZ17]_, the output is 2^(-d) * P_g^{d,k}(Avector).
Note: This is based on the old implementation DR_compute by Pixton. A new one,
which can be faster in many examples is DR_cycle.
INPUT:
- ``tautout`` -- bool (default: `True`); if False, returns a vector
(in all generators for basis=false, in the basis of the ring for basis=true)
- ``basis`` -- bool (default: `False`); if True, use FZ relations to give out the
DR cycle in a basis of the tautological ring
N� �12g-2+n must divide the sum of entries of Avector.c S � g | ]}t |��qS � �r )�.0�ar r �G/home/user/Introduction lectures/admcycles/double_ramification_cycle.py�
<listcomp>= � z DR_cycle_old.<locals>.<listcomp>r )�lenr r
�sum�
ValueError�DR�
DR_computer � convert_vector_to_monomial_basis�tuple�range� MODULI_STr �from_basis_vector�from_vector)�g�Avector�d�k�tautout�basis�n�R�v�v1�v2r r r �DR_cycle_old"