unlisted
ubuntu2004o
��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 ]y}
d}td|�D ]}|j| |f dkrA|j|
|f dkrAd} nq)|sEq t| g�}
d}|r�d}t|
�D ]7}td|�D ]/}|j||f dkr�td|�D ]}|j||f dkr�||
vr�|| ks�||
kr�|
�|� d}qkq[qT|sN|
|
v r�|�|
| g� q q|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 sB
$�
*
��� ��r* c s |dkS )N� )r r r r r* �lenr r )r r r r r r r �nonsep_pairsr"