unlisted
ubuntu2004a
��c�P � @ sf d Z ddlmZ ddlZddlmZ ddlmZ ddlmZ ddl m
Z
dd lmZ dd
l
mZmZmZmZ ddlmZ ddlmZ d
efdd�Zd
efdd�Zdd
efdd�Zd
efdd�Zefdd�Zdd� Zdd
defdd�Zdd
defdd�Zdd
defdd�Zdd
defd d!�Zdd
defd"d#�Z dd
defd$d%�Z!dd
defd&d'�Z"d(d)� Z#d,d*d+�Z$dS )-a�
Double ramification cycle
The main function to use to compute DR cycles are the following:
- :func:`DR_compute`
- :func:`DR_sparse`: same as ``DR_compute`` except that it returns the answer as a
sparse vector
- :func:`DR_reduced`: same as ``DR_compute`` except that it only requires two
arguments (g and dvector) and simplifies the answer using the 3-spin
tautological relations.
EXAMPLES::
sage: from admcycles.DR import DR_compute, DR_sparse, DR_reduced
To compute the genus 1 DR cycle with weight vector (2,-2)::
sage: DR_compute(1,1,2,(2,-2))
(0, 2, 2, 0, -1/24)
In the example above, the five classes described on R^1(Mbar_{1,2}) are:
kappa_1, psi_1, psi_2, delta_{12}, delta_{irr}. (Here by delta_{irr} we mean
the pushforward of 1 under the gluing map Mbar_{0,4} -> Mbar_{1,2}, so twice
the class of the physical locus.)
Sparse version::
sage: DR_sparse(1,1,2,(2,-2))
[[1, 2], [2, 2], [4, -1/24]]
Reduced version::
sage: DR_reduced(1,(2,-2))
(0, 0, 0, 4, 1/8)
� )�copyN)�ZZ��QQ)�ceil)�vector� )� MODULI_ST)�R�
num_strata�single_stratum�autom_count)�interpolate)�FZ_rels� c C s> t | ||||�}|j�� }|j�� }g }td|�D �]} td| �D ]�}
d}td|�D ]0}|j| |f dkrT|j|
|f dkrTd} q�qT|s�qBt| g�}
d}|�r d}t|
�D ]p}td|�D ]`}|j||f dkr�td|�D ]>}|j||f dkr�||
vr�|| k�s
||
kr�|
�|� d}q�q�q�q�|
|
v rB|�|
| g� qBq2|S )Nr Fr T) r �M�nrows�ncols�range�set�tuple�add�append)�num�g�r�markings�moduli_type�G�nr�nc�answer�i1�i2Z
found_edge�j�S�
did_something�i3�i4r r �J/home/user/Introduction lectures/admcycles/DR/double_ramification_cycle.py�find_nonsep_pairs5 s6
$
,
r* c s� |dkS t|�dk� r�|d d }|d d } |d d }
g }td|�D ]0�t� �fdd�|| |
fD ��dkrH|��� qHt|�dkr�dS |D ]2�|| |
fD ]"}� j|�f d dkr� dS q�q�d S �]�g }
td|�D ]$}� j|�f dk� r�|
�|� � q�t|
�dk�r� q�|
d }|
d }g }td|�D ]8}� j||f dk�r0� j||f dk�r0|�|� �q0t|�dk� s�|d �k�r�� q�t|�}||fD ](}|D ]}|� j||f d 7 }�q��q�|dk� r� dS � q�d S )
N� � Fr r � c s"