Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
181 views
unlisted
ubuntu2004
a

��c'��@sbdZddlmZddlZddlmZddlmZm	Z	ddl
mZddlm
Z
ddlZddlZddlZddlZddlZddlZddlmZdd	lmZdd
lmZddlmZddlmZdd
lm Z gfdd�Z!Gdd�de�Z"Gdd�de�Z#gfdd�Z$ed+dd��Z%dd�Z&dd�Z'edd��Z(Gdd �d e�Z)d!d"�Z*d#d$�Z+d%d&�Z,d'd(�Z-d)d*�Z.dS),z�
Spin Stratum: A stratum with signature of even type will has spin structure, i.e.
its connected components can be partitioned to two non-empty sets.

cf. [KZ03]_ and [Boi15]_

�)�deepcopyN)�QQ)�matrix�vector)�cached_function)�
SetPartitions)�StableGraph)�GeneralisedStratum)�AdditiveGenerator)�ELGTautClass)�	Signature)�SolveMultLincCs8tt|�g|d�}t|d�}t|d|fg�}|����S)a�
    Compute the spin stratum class of given signature of even type (may
    have paired simple poles) and residue conditions.

    INPUT:

    - sig (tuple)
    - res_cond (list): It is a list of lists corresponding to residue
      conditions. For example, sig=(4,-2,-1,-1) with the
      simple poles being paired. Then
      res_cond=[[(0,2), (0,3)]]. Here the zero indicate
      the components of a generalized stratum.

    EXAMPLES::

        sage: from admcycles.diffstrata.spinstratum import Spin_strataclass
        sage: Spin_strataclass((2,2)).basis_vector()
        (159/4, -179/48, -7/24, -7/24, -131/48, -23/24, -131/48, 149/24, -83/16, 271/48, 77/48, 77/48, -193/8, -185/48, 127/48, 395/48, 221/48, -73/8, -185/48, 127/48, 395/48, 221/48, -73/8, -185/48, -41/48, 389/48, 389/48, -23/8, 51/8, -139/16, -323/16, 1/8, -25/4, -11/4, -11/4, -23/4, 973/48, 37/96, -5/2, 23/96, 23/96, -25/32)


    ��res_cond��r�)�SpinStratumr�AG_with_spin�ELGT_with_spin�to_prodtautclass_spin�pushforward)�sigr�X�A�Err�D/home/user/Introduction lectures/admcycles/diffstrata/spinstratum.py�Spin_strataclass"s
rcsHeZdZd�fdd�	Zdd�Zdd�Zdd	�Zdd
d�Zdd
�Z�Z	S)rNcs�t��||�|r||_ng|_|r,||_ng|_g|_tdt|j��D]D}tdt||j��D]*}||j|ddkr`|j�	||f�q`qHt
|���|_|j�
�g|_g|_g|_|jgkr�|dur�|��dS)a�
        A stratum can have spin structure if there are pairs of simple poles,
        such that their residues r_i + r_i+1 = 0. In this code, we only handle the
        cases of at most 1 pair of simple poles.

        INPUT:

        - sig_list (list): a list of tuples indicating the signatures
          of the components of a generalised stratum

        - res_cond (list): a list whose entries are lists corresponding
          to residue conditions

        EXAMPLES::

            sage: from admcycles.diffstrata.spinstratum import SpinStratum
            sage: from admcycles.diffstrata.sig import Signature
            sage: X = SpinStratum([Signature((4,-2,-1,-1))],
            ....: res_cond=[[(0,2),(0,3)]])

        r�N)�super�__init__�	_res_cond�
pair_res_cond�
odd_sing_list�range�len�	_sig_listr�append�list�simple_poles�
sim_pole_list�sort�hor_edgeZeff_hor_edge�eff_pair_res�is_legal)�self�sig_listrr"�i�j��	__class__rrr Es&
zSpinStratum.__init__cCsd|j|jfS)Nz$SpinStratum(sig_list=%r,res_cond=%r))r&r!�r/rrr�__repr__us�zSpinStratum.__repr__cCs|d}|jdkr|d7}n|d7}|jD]}|t|j�d7}q&|d7}|js\|tg�d7}|jD]}|t|�d7}qb|S)N�rzProduct of Strata with spin:
zSpin Stratum: �
zwith residue conditions: )�_h0r&�reprrr!)r/�repr�resrrr�__str__ys



zSpinStratum.__str__cs�t�j�t�j�dkr$td���n~t�j�dk�r�t�j�}|dkrNtd��|ddksbtd���jj}�jgkr�|���	�j��}n|}d}|�
�}|�
�}td|d�D]�}t|d|�D]z}�j|d�j|dkr��j|�j|g}	��	|	�}
|�|
�}|�
�}||k�rq�q��j�
�j|�j|g�q�q�t|dd�tdt|d��D����}g}
|D]x}g}|D]&}t|�}|�
�fdd�|D���qx|���	|��}|�
�}||k�rȐqln|�_|t�j�}
�q�ql�jd	u�r�td��|dk�r|dk�rg�_n�����s�g}t|
�D]f\}}|���	|g���
�}||k�r,|���	|g��}|d7}|�jv�r��j�
|�|�
|��q,|��|�_d	S)
a(
        This is just a method for initializing a spin stratum, checking whether
        the stratum really has spin structure.

        EXAMPLES::

            sage: from admcycles.diffstrata.spinstratum import SpinStratum
            sage: from admcycles.diffstrata.sig import Signature
            sage: X = SpinStratum([Signature((4,-2,-2))])
            sage: X = SpinStratum([Signature((4,-3,-1))])
            Traceback (most recent call last):
            ...
            ValueError: The Stratum does not have spin components
            sage: X = SpinStratum([Signature((4,-2,-1,-1))])
            sage: X = SpinStratum([Signature((4,-1,-1,-1,-1))])
            Traceback (most recent call last):
            ...
            NotImplementedError: We can only handle one pair of simple poles

        rz)The Stratum does not have spin componentsrz+We can only handle one pair of simple polesrcSsg|]}d�qS)rr��.0r1rrr�
<listcomp>��z(SpinStratum.is_legal.<locals>.<listcomp>csg|]}�j|d�qS�r)r*r>r5rrr@�s�N)r%r#r*�
ValueError�NotImplementedError�	smooth_LG�residue_matrix_from_RTr�stack�matrix_from_res_conditions�rankr$r,r'r�intr(r"rr!�is_empty�	enumerater-�reverse)r/�t�M1�M2�a�b�c�q�q1r<�T�M0Zsim_pole_list_partitons�rc�partZpair_res_cond_temp�w�new_rcr2�rkrr5rr.�s�




�

���



zSpinStratum.is_legalcs�|jgks�t|j�}|��}|d}t|j||jd����d|�}|����	|���
���
|�}g}|jD],}tdd�|dj
j��D��rp|�|�qp�fdd�|D�}	t�|	�}
|
}|St�d	S)
aJ
        This method will return the psi polynomial of the stratum in the
        tautological ring of ambient stratum (without a residue condition
        on the pair of simple poles. The formula follows Sauvaget-19 and we pick
        the leg of a simple pole for the elimination of psi class.

        Only the BICs, which have some odd enhancement (so odd even are half
        half), or still preserve the residue condition of the pair of
        simple poles, are left. Hence, one can
        still recursively compute the spin classes.

        INPUT:

        - psis (list): a list of dicts indicating the psi polynomial

        EXAMPLES::


            sage: from admcycles.diffstrata.spinstratum import SpinStratum
            sage: from admcycles.diffstrata.sig import Signature
            sage: from admcycles.admcycles import psiclass
            sage: X = SpinStratum([Signature((4,-2,-1,-1))],res_cond=[[(0,2),(0,3)]])
            sage: cl1 = X.remove_pair_res().to_prodtautclass_spin().pushforward()
            sage: (psiclass(1,1,4)**2*cl1).evaluate()
            5/24

        r)r"rcss|]\}}|ddkVqdS�rrNr�r?�e�kapparrr�	<genexpr>
s�z.SpinStratum.remove_pair_res.<locals>.<genexpr>rcs$g|]\}}|t�|j|j�f�qSr)r�_enh_profile�	_leg_dict�r?rS�AG��new_stratumrrr@s��z/SpinStratum.remove_pair_res.<locals>.<listcomp>N)r-rr!�poprr&r"�additive_generator�as_taut�res_stratum_class�xi_with_leg�	_psi_list�all�_G�LG�prongs_listr'rrD)r/�psisrZlost_rc�leg�new_AG�elgtZ
temp_psi_listrQ�psi_listZelgt_odd_enh�resultrrfr�remove_pair_res�s4

���
�
�
zSpinStratum.remove_pair_rescs�|j}|jdj}|jdj}|jj}|j}tdd�|D��r�tt	|���tdd��dD��rrt
j
j|gd�}ndt
j
��d�d�d��t
j
�
�d�d�d��t���fd	d
�tdt�d��D����}|St||�}|d�|d}dd�|d��D�}	|d}
tt	�t|
����td
d��dD���rPt
j
�|t���}n`t
j
��d�d�d��t
j
�
�d�d�d��t���fdd
�tdt�d��D��}|dk�r�|��fdd
�td|dd�D��}|j|	dd���}|S)a$
        To compute the spin stratum class of a connected stratum. The output will be a
        product tautological class. By making use of standised signature, we will do
        the core computation in the function smooth_stratum_standard().

        EXAMPLES::

            sage: from admcycles.diffstrata.spinstratum import SpinStratum
            sage: from admcycles.diffstrata.sig import Signature
            sage: X=SpinStratum([Signature((4,0,-2))])
            sage: X.smooth_con_stratum_prodtautclass().pushforward().basis_vector()
            (-63/2, 21/2, -20, -63/2, -37/2, 38, 61/2, 61/2, 147/2, 29, 57/2, 29, -41, -60, 21, -63/2, -42, 61/2, -41, -139/2, 147/2, 63/2, -147/2, 21/2, 0, -21/2, -7, -21/2, -19/2, 19/2, 21/2, -21/2, 1, -21/2, 0, 0, 21/2, 21/2, -7, 1, -1, -1, 0, 7)

        rcss|]}|dkVqdS�rNr�r?�xrrrra/rAz?SpinStratum.smooth_con_stratum_prodtautclass.<locals>.<genexpr>css|]}|dkVqdSryr�r?rZrrrra1rA���termsrrcs$g|]}�d|��|�qS�r}rr>��gen�indrNrrr@6s�[email protected]_con_stratum_prodtautclass.<locals>.<listcomp>cSsi|]\}}||�qSrr)r?�x1�x2rrr�
<dictcomp>=rA[email protected]_con_stratum_prodtautclass.<locals>.<dictcomp>css|]}|dkVqdSryrr|rrrraErAcs$g|]}�d|��|�qSr�rr>r�rrr@JrAcsg|]}t��|�qSr)r%r>)�
simplifiedrrr@Ls�F)�inplace)r!r&r�grErp�stgraphrnr�smooth_stratum_standard�	admcycles�
prodtautclass�generating_indices�tautgens�sumr$r%�toprodtautclass�standardise_sig�items�tuple�	fundclass�forgetful_pullback�rename_legs)r/rrr�rpZstgraph0rw�LZ
num_of_reg�legsr[�clr)r�r�r�rNr� smooth_con_stratum_prodtautclasss@�
(
�z,SpinStratum.smooth_con_stratum_prodtautclass)NN)N)
�__name__�
__module__�__qualname__r r6r=r.rxr��
__classcell__rrr3rrCs0\
6rcs8eZdZd�fdd�	Zdd�Zdd�Zdd	d
�Z�ZS)
rNcs(t|t�sJ�t��|||�||_dS�N��
isinstancerrr r)r/r�enh_profile�leg_dictr3rrr ^szAG_with_spin.__init__cCsd|j|j|jfS)Nz-AG_with_spin(X=%r,enh_profile=%r,leg_dict=%r))�_Xrbrcr5rrrr6cs�zAG_with_spin.__repr__cCsLd}|jdur8|jD]"}|d||j||j|f7}q|d|jf7}|S)Nr7z1Spin Psi class %r with exponent %r on level %r * zGraph %r)rc�_level_dictrb)r/�str�lrrrr=gs

�zAG_with_spin.__str__Tcs��jj}|j}tdd�|��D��r4tjj|gd�St�fdd�t�jd�D��r�|rr�jj	�j�
�dd�jj}tjj|gd�St|j�dk�r�tjj
|�jd�}tj�|g�}|jd	d	k�r
�jjgk�r
t�jd
���}|����}||g}tjj||d�}|S�jjgk�s2t�jj�t�jj�k�rb�j��}|��}||g}tjj||d�}|S�jjgk�r�t�jj�t�jj�k�r��j��}	|	����}
||
g}tjj||d�}|Sg}g}t�jd�D]�}
��|
�}��|
�}t|�}|jgk�r&t|j�t|j�k�r&|�|���}n|�|�}t |���}|�!|�|�!|�"|�#|
����q�|�r��jj	�j�
�dd�jj}tj�|�}ntj�|�}t$|�D]\}
}|�%||
|�}�q��j&|S)a
        This function is to compute the product tautological class of an
        additive generator with spin. It is basically the same as
        toprodtautclass, but just includes more case divisions.

        EXAMPLES::

            sage: from admcycles.diffstrata.spinstratum import SpinStratum,AG_with_spin
            sage: from admcycles.diffstrata.sig import Signature
            sage: X = SpinStratum([Signature((4,-2))])
            sage: AG_with_spin(X, ((1,),0)).to_prodtautclass_spin()
            Outer graph : [1, 0] [[3, 4], [1, 2, 5, 6]] [(3, 5), (4, 6)]
            Vertex 0 :
            Graph :      [1] [[1, 2]] []
            Polynomial : -1/2
            Vertex 1 :
            Graph :      [0] [[1, 2, 3, 4]] []
            Polynomial : psi_4
            <BLANKLINE>
            <BLANKLINE>
            Vertex 0 :
            Graph :      [1] [[1, 2]] []
            Polynomial : -1/2
            Vertex 1 :
            Graph :      [0, 0] [[2, 3, 11], [1, 4, 12]] [(11, 12)]
            Polynomial : 3
            <BLANKLINE>
            <BLANKLINE>
            Vertex 0 :
            Graph :      [1] [[1, 2]] []
            Polynomial : -1/2
            Vertex 1 :
            Graph :      [0, 0] [[3, 4, 11], [1, 2, 12]] [(11, 12)]
            Polynomial : -3

        css|]\}}|ddkVqdSr]rr^rrrra�rAz5AG_with_spin.to_prodtautclass_spin.<locals>.<genexpr>r~c3s|]}��|���VqdSr�)�level�zeroStratumClass)r?r�r5rrra�s�rF��tidyup)�psirr)�protaut)'rorpr��anyrqr�r�r$�codim�relabel�standard_markingsr%�genera�
decstratumr��	tautclassrr*r
rj�to_prodtautclassrrr-r"r�rxr�
psis_on_levelr��addspin�remove_res_cond�ELGT_addspinr'�verticesonlevel�internal_level_numberrL�factor_pullback�stack_factor)r/Zrearrange_markingsrpr��adm_psis�
adm_psis_taut�
stratum_classr�rw�Q�total�alpha�verticesr�rrr��ptcrVZ
prodtautst�prodrr5rrps�%��
��

��

�


�

z"AG_with_spin.to_prodtautclass_spin)N)T�r�r�r�r r6r=rr�rrr3rr\s	rcs4t|�}g}tt���}t��j}|��t����fdd�|D�}t|�}g}|D]}	|	dkrT|||	|	g7}qTt|�}
|dkr�|
dkr�|d|
dg7}i}tdt���D]����dk�rtdd�|�	�D��}||d|dd|�d<|dd8<��dkr�t��fdd�|�	�D��}||��|��d|�d<|��d8<q�g}
|
�
t|��d|v�r�|dk�r�|
dk�r�|
�
|dd|
�n|
�
|d�n
|
�
d�|
�
|�|D]F}g}|D](}d||dddf}|�
|��q�|�
t|���q�|
�
|�|
S)	a�
    To standardise the arrangement of entries in the signature, such that it go from low to high and all the 0s
    are placed at the right end. This is just to reduce the required memory and time to compute the stratum classes.
    It returns

            1. the simplified sig (0s removed);
            2. number of 0s;
            3. the leg_dict of rearrangement;
            4. new res_cond

    INPUT:

        - sig (tuple): a tuple of integers
        - res_cond (list, default=[]): the list of res_cond

    EXAMPLES::

        sage: from admcycles.diffstrata.spinstratum import standardise_sig
        sage: standardise_sig((2,4,-1,0,-1), res_cond=[[(0,2),(0,4)]])
        [(-1, -1, 2, 4), 1, {1: 3, 2: 4, 3: 1, 4: 5, 5: 2}, [((0, 0), (0, 1))]]

    csi|]}|��|��qSr)�countrz)rNrrr�rAz#standardise_sig.<locals>.<dictcomp>rr}cSsg|]\}}|dkr|�qS�rr�r?r2�frrrr@"rAz#standardise_sig.<locals>.<listcomp>rcs(g|] \}}|dkr|��kr|�qSr�rr�)r1rrrr@&rA)rr(�setrr�r+r%r$r�r�r'r�)rrr<r[r�r��freq�counterZstandard_sig_without_regularr{�mr��p�output�rrZrTrQr)r1rrNrr��sR
 (



r�rcCs�tdd�|D��dkr"t|�dksJtdd�|D��sJtdd�|D��sJJ�|dkr�g}|D]}d	d�|D�}|�|�qZtt|�g|�}ntt|�g�}|jd
j}|jd
j}d
}t	dd�|D��r�t|�d}||d}	t
||||	�}
|
gkr�|
St|||�}t|�}g}
t
|�D]^\}}|gk�rPt|�}t|j|	d
d��}|
�|�n$t||d
�}tt|�}|
�|��qt||
�}|||	|gS)aH
    This function is to compute the spin stratum class of a standardised
    signature i.e. it is ordered and has no 0s (or all are 0s), also the
    stratum has only one component. The results are cached.

    EXAMPLES::

        sage: from admcycles.diffstrata.spinstratum import smooth_stratum_standard
        sage: smooth_stratum_standard((-1,-1,4))
        [2,
         3,
         2,
         (0, 0, 4, 0, -11/2, -12, 0, -7/2, 0, 1/2, 35/2, 4, 0, -12, 0, 0, 0, -2, 19/2, 0, 7/2, 0, 0, 0, 2, 0, -7/2, 0, 2, -2, 5/2, -13/2, 9/2, 8, 0, 0, 0, 17/2, -11, 2, -2, -9/2, 0, 2)]


    cSsg|]}|�qSrrrzrrrr@PrAz+smooth_stratum_standard.<locals>.<listcomp>�����r}css|]}|dkVqdSryr�r?r2rrrraPrAz*smooth_stratum_standard.<locals>.<genexpr>css|]}|dkVqdSryrr�rrrraPrArcSsg|]}|�qSrr�r?rNrrrr@UrArcss|]}|dkVqdSryrrzrrrra`rArT��vecout)r�r%rnr'rrr&r��nr��is_base_case�Pullback_Matrices�bdry_pullback_classifyrLr�totensorTautbasisrr
)rrrXrTZres_single_condrr�r�r��kZcheck_basic�ListMZ
prodtaut_listZtensorTaut_listr1�urN�v�lengthZsol_inTautbasisrrrr�>s<J


r�cCs�|dkrxtdd�|D��r0|||ttd�g�gS|dkrP|||ttd�g�gS|dkrxtj�ddd���}||||gS|dkr�tdd�|D��r�|||ttd�g�gS|dkr�|dkr�|||ttd�dtd	�dtd�dg�gSgS)
Nrcss|]}|ddkVqdSr]r)r?rTrrrra�rAzis_base_case.<locals>.<genexpr>rr}�css|]}|dkVqdSryrr�rrrra�rAr�)rnrrr��psiclass�basis_vector)rr�r�r�rwrrrr��s0r�c(	s�|}|jdj�|jdj}|jdj�tj�|�d�}|dkr\�dkr\dd�t|�D�}n|d��}|��||d<dd�|D�}dd�|j	D�}t|�D�]�\}}��fdd�|j
dD�}d	|jdd	t|�}	|	d
k�r�|�
d
���fdd�|j
dD�d
g}
||
g}ttt|d��g�}ttt|d��g�}
|�d���}|
�d���}t|���}t|���}tj�|�}|�dg|�}|�dg|�}||�
|�q�t|j�dk�rN��fd
d�|j
dD�d
d
g}ttt|��gd�fd�dfggd�}|�d���}tj�|�}t|���}|�dg|�}||�
|�t|�D�]0\}}|jj}|jdd}|jdd}tj�||�}|gk�rVt|�|fdf��}|��} |j}!|D]‰t|j|j
g�}"�fdd�|jD���fdd�|jD�}#t|j|j
|#�}$tj�|$| j �}|�!|"�d�d�}%tj�||%j �}&|j�"�d|�d|f�}'t#|!|'�|&}||�
|��qqVq�|S)Nrrr}cSsg|]\}}|dkr|�qSr�r�r?r1�Grrrr@�rAz*bdry_pullback_classify.<locals>.<listcomp>cSsg|]}g�qSrr)r?r�rrrr@�rAcSsg|]}|j|��dd��qS)Fr�)r�r�)r?�bicrrrr@�rAcs$g|]}|�dkr�|d�qSrBrr>�r�rrrr@�rAr�����cs$g|]}|�dkr�|d�qSrBrr>r�rrr@�rArcs$g|]}|�dkr�|d�qSrBrr>r�rrr@�rArcs,g|]$}�d|d�d|df�qS�rrr�r?r_)rZrrr@�s�cs,g|]$}|�vr|d|df�vr|�qSr�rr�)�image_half_edgesrrr@�s�)$r&rr�r�r��list_stratarL�copy�tidy_up�bics�_legs�_generar�r'r	rr�rirjr�rr�r�r%rrpr��_edges�Astructures�
AG_addspin�ellrr�partial_pushforward�prongr)(�stratumrr�ZAgraphsr�Z"bddiv_codim1_LG_prodtautclass_listZbic_stgraphr2Zsig0Z	node_singZsig1Znew_sig_listZsplt_st0Zsplt_st1Zelgt0Zelgt1Zst0_spinZst1_spinZprodtaut�clutchZsig_new�Yrur�Z	Intersect�numr�r�rQrRZAstructure_listreZ
prodtaut_tempr�Z	G_no_edgeZst_edges_newZst_newZE_temprZkappa_er)r�r�rrZrr��s�

 ��

��� r�c
Cs�||d}tj�|||�}tj�|||�}tj�||d�}|dkr^|dkr^dd�t|�D�}g}|D]d}g}	t|j�dkr�|��}|��|D]&}
|�	||
�}|	|j
|dd�g}	q�t|	�}|�|�qf|S)Nrrr}cSsg|]\}}|dkr|�qSr�rr�rrrr@�rAz%Pullback_Matrices.<locals>.<listcomp>Tr�)
r�r�r�r�rLr%r�r�r��boundary_pullbackr�rr')
r�r�r�r��L1�Listgen1�
graph_list�M_listr�rWr1rV�Mrrrr��s$r�cs4eZdZ�fdd�Zdd�Zdd�Zdd�Z�ZS)	rcs&t|t�sJ�t��||�||_dSr�r�)r/rrvr3rrr szELGT_with_spin.__init__cCsd|j|jfS)Nz ELGT_SpinClass(X=%r,psi_list=%r)�r�rmr5rrrr6s
�zELGT_with_spin.__repr__cCs.d|j}|jD]\}}|d||f7}q|S)NzELGT_SpinClass on %s
z%s * %s + 
r)r/r��coeffr�rrrr=s
zELGT_with_spin.__str__cCs|jj}|jj}tjj|gd�}|jD]�\}}t|jj	�}|�
�}i}t|jj�D]z\}	}
|j	|jj
|	d}|jj|}|jj}
|
�|�}|
�|�}|
��}|�|�}|D]\}}}|dkr�q�|	||<q�qRdd�td|d�D�}|�|||�}|||7}q&|S)Nr~rrpcSsi|]
}||�qSrrr>rrrr�9rAz8ELGT_with_spin.to_prodtautclass_spin.<locals>.<dictcomp>r)rrErpr�r�r�rmr%ro�dmprrLr�r��dmp_inv�vertex�	UG_vertex�UG_without_infinity�%connected_component_containing_vertexr$r�)r/r�r�r�rSreZ
legdictlenr��
vertex_mapr��_�
mp_on_stratum�l_AGrp�v_AG�UG_vrVrZr��kind�leg_map�pfrrrr$s.


z$ELGT_with_spin.to_prodtautclass_spinr�rrr3rrsrcCs,t|jj|jj�}dd�|jD�}t||�S)NcSsg|]\}}|t|�f�qSr)r�rdrrrr@KrAz ELGT_addspin.<locals>.<listcomp>)rr�r&r!rmr)rurrvrrrr�Isr�cCs(t|t�sJ�t|j�}t||j|j�Sr�)r�r
r�r�rrbrc)�agrrrrr�Qs
r�cCst|t�sJ�t|j|j�Sr�)r�r	rr&r!)r�rrrr�Ysr�cCsttj�}tjj�|d�dS)NZspin_stratum_cache)�dictr��cache�sage�misc�persist�save)�	cachedictrrr�save_spin_stratum^s
rcCs:tjj�d�}|��D]\}}tj|g|d�R�qdS)Nzspin_stratum_cache.sobjr)rrr�loadr�r��	set_cache)rrQrRrrr�load_spin_stratumcsr!)r)/�__doc__r�r�sage.misc.persistr�sage.rings.allr�sage.matrix.constructorrr�sage.misc.cachefuncr�sage.combinat.allrZadmcycles.admcyclesr�Zadmcycles.stratarecursionZadmcycles.diffstrata.levelgraph�admcycles.diffstrata.bic�#admcycles.diffstrata.stratatautring�'admcycles.diffstrata.embeddedlevelgraphZadmcycles.stable_graphr�'admcycles.diffstrata.generalisedstratumr	�&admcycles.diffstrata.additivegeneratorr
�!admcycles.diffstrata.elgtautclassr�admcycles.diffstrata.sigrZadmcycles.identify_classesr
rrrr�r�r�r�r�rr�r�r�rr!rrrr�<module>sJ!GA]
6