unlisted
ubuntu2004a
��c) � @ st d dl mZ d dlmZmZ d dlmZ d dlZddlm Z m
Z
mZ ddd �Zdd
d�Z
dd
� Zdd� Zdd� ZdS )� )�QQ)�matrix�vector)�block_matrixN� )�list_strata�generating_indices�pullback_matrixFc sj | � |�}t|�}| �� | }ttd|�} g }
|dk}�dur�|s�|rR| �|�}n
| � |�}tt| j| j |��}
| j
|| |
d�}t| g|ggdd�} |
�fdd�|D �7 }
| �� |k}|du�r�|�s�| j
��fdd�t| j| j d �D �}t|�dk�r |d �� d k�r |�d�}|�|� |D ]f}t| j| j ||d
�}t| g|ggdd�} |
t||�j|dd��7 }
| �� |k}|�r$|�s$ �q��q$|du�r|�s| �|d�D ]t\}}� |||� �}|du�r�tt| gt� fd
d�|D �g�ggdd�} |
�|� | �� |k}|�r�|�s� �q�q�|�s,td��z| �tt|
��}W n t�y\ td��Y n0 | �||�S )a`
Identify a tautological class in degree d by specifying its
intersection pairing with classes in complementary degree
and/or its pullback under boundary gluing morphisms.
INPUT::
- tautring (TautologicalRing) : ring containing the class that
is to be identified
- d (integer): degree of the class
- pairfunction (function, optional): function taking classes in
complementary degree and returning the intersection product with
the desired class
- pullfunction (function, optional): function taking stable graphs
with at most two vertices and returning the prodtautclass obtained
by pulling back the desired class under the associated boundary
gluing map
- kappapsifunction (function, optional): function taking as arguments
a list, dictionary and TautologicalClass (giving a polynomial in
kappa and psi-classes) and returning the intersection product of
the desired class with this polynomial (or None)
- check (bool, default = False) : whether to use FZ relations to
verify that intersection numbers/pullbacks are consistent with
known tautological relations
EXAMPLES::
sage: from admcycles.identify_classes import identify_class
sage: from admcycles import TautologicalRing
sage: R = TautologicalRing(2, 1)
sage: cl = 3 * R.psi(1) -2 * R.kappa(1)
sage: def pairf(a):
....: return (a * cl).evaluate()
sage: cl2 = R.identify_class(1, pairfunction = pairf)
sage: cl == cl2
True
sage: def pullf(gamma):
....: return gamma.boundary_pullback(cl)
....:
sage: cl3 = R.identify_class(1, pullfunction=pullf)
sage: cl == cl3
True
Here is some code to reconstruct the class 42*psi_1 on Mbar_0,6 from its intersection
numbers with psi-monomials (which have an explicit formula). Note that the associated
function kpfun is allowed to return None if kappa-classes show up::
sage: R = TautologicalRing(0,6)
sage: def kpfun(kap, psi, cl):
....: if kap:
....: return None
....: b = vector(ZZ,[psi.get(i,0) for i in range(1,7)])+vector([1,0,0,0,0,0])
....: return 42*factorial(3)/prod(factorial(bi) for bi in b)
....:
sage: cl4 = R.identify_class(1, kappapsifunction=kpfun)
sage: cl4 == 42*R.psi(1)
True
TESTS::
sage: R = TautologicalRing(2, 1)
sage: def bad_pairf(a):
....: return (a * cl).evaluate() if not (a - R.kappa(3)).is_empty() else 0
sage: R.identify_class(1, pairfunction = bad_pairf, check=True)
Traceback (most recent call last):
...
ValueError: intersection numbers or pullbacks are not consistent with FZ relations
r N)�basis� ind_dcompF)� subdividec s g | ]}� |��qS � r
)�.0�a)�pairfunctionr
�>/home/user/Introduction lectures/admcycles/identify_classes.py�
<listcomp>b � z"identify_class.<locals>.<listcomp>c s g | ]}|� � �s|�qS r
)�vanishes)r �gam)�modulir
r r g s
�r )�bdryT��vecoutc s g | ]}|� � � �qS r
��evaluate)r �c)�clr
r r { r zLIntersection numbers and/or pullbacks are not enough to determine this classzFintersection numbers or pullbacks are not consistent with FZ relations)r
�len�socle_degreer r �
generators�tupler �_g�_n�pairing_matrixr �rank�_modulir � num_verts�pop�appendr �list�totensorTautbasis�kappa_psi_polynomials�
ValueError�solve_rightr �from_basis_vector)Ztautring�dr �pullfunction�kappapsifunction�check�gens�ngens�d_dual�M�vZrank_sufficientZ gens_dualr �inters�graphsZirrgraphr Zpulls�kappa�psi�intnum�wr
)r r r r �identify_class s\ K
�
*
r? c C s� t j �| ||�}t j �| ||�}t j �| |d�}g }|sLtt|�| d �}|D ]�}|| d } g }
d}| t|�d kr�t|| �� j�d }nt|| j�d }|D ]&}|�|| �}
|
|
j |dd�g7 }
q�t
|
�}||g7 }qP|S )a<
Compute the pullback matrices of given degree d and list of
boundary stratum.
INPUT::
- ind_list (list): the list of indices of the boundary stratum,
0 indicates the first nontrivial graph
appearing in the generator
list of degree d tautological classes
EXAMPLES::
sage: from admcycles.identify_classes import Pullback_Matrices
sage: from admcycles import TautologicalRing
sage: Pullback_Matrices(1, 2, 1)
[
[1] [1]
[0], [1]
]
r Nr Tr )� admcycles�tautgensr �ranger r* �standard_markings�_terms�boundary_pullbackr+ r )�g�nr0 Zind_list�L1ZListgen1�L2�M_listr �b�M0�Q�i�Tr7 r
r
r �Pullback_Matrices� s&