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

��c��@s2Gdd�d�ZGdd�de�ZGdd�de�ZdS)c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
kSignatureaE
    A signature of a stratum of k-differentials.

    Attributes:
        sig (tuple): signature tuple
        g (int): genus
        n (int): total number of points
        p (int): number of poles
        z (int): number of zeroes
        poles (tuple): tuple of pole orders
        zeroes (tuple): tuple of zero orders
        pole_ind (tuple): tuple of indices of poles
        zero_ind (tuple): tuple of indices of zeroes

    EXAMPLES::

        sage: from admcycles.diffstrata.sig import kSignature
        sage: sig=kSignature((2,1,-1,0), k=1)
        sage: sig.g
        2
        sage: sig.n
        4
        sage: sig.poles
        (-1,)
        sage: sig.zeroes
        (2, 1)
        sage: sig.pole_ind
        (2,)
        sage: sig.zero_ind
        (0, 1)
        sage: sig.p
        1
        sage: sig.z
        2
    cCs�t|�|_t|�}|d|dkr*td��t|d|�d|_t|�|_||_tdd�|D��|_	tdd�|D��|_
tdd�|D��|_t|j	�|_t|j
�|_
td	d�t|�D��|_td
d�t|�D��|_dS)z�
        Initialise signature

        Args:
            sig (tuple): signature tuple of integers adding up to k*(2g-2)
            k (int): order of the differential.
        ��z.Error! Illegal signature: Genus not an integer�css|]}|dkr|VqdS�rN�)�.0�prr�</home/user/Introduction lectures/admcycles/diffstrata/sig.py�	<genexpr>5�z&kSignature.__init__.<locals>.<genexpr>css|]}|dkr|VqdSrr)r�zrrr	r
6rcss|]}|dkr|VqdSrr)r�krrr	r
7rcss|]\}}|dkr|VqdSrr)r�irrrr	r
:rcss|]\}}|dkr|VqdSrr)rrrrrr	r
;rN)�tuple�sig�sum�
ValueError�int�g�len�nr
�poles�zeroes�
marked_pointsrr�	enumerate�pole_indZzero_ind)�selfrr
Zsum_sigrrr	�__init__&s

zkSignature.__init__cCs*|jdkrd|jfSd|j|jfSdS)Nrz
Signature(%r)zSignature(%r, k=%r))r
r�rrrr	�__repr__=s
zkSignature.__repr__cCst|j|jf�S�N)�hashrr
rrrr	�__hash__CszkSignature.__hash__cCs(z|j|jkWSty"YdS0dS)NF)r�AttributeError)r�otherrrr	�__eq__FszkSignature.__eq__N)�__name__�
__module__�__qualname__�__doc__rrr"r%rrrr	rs
$rcs eZdZdZ�fdd�Z�ZS)�	Signaturea4
    A signature of an abelian stratum.

    Attributes:
        sig (tuple): signature tuple
        g (int): genus
        n (int): total number of points
        p (int): number of poles
        z (int): number of zeroes
        poles (tuple): tuple of pole orders
        zeroes (tuple): tuple of zero orders
        pole_ind (tuple): tuple of indices of poles
        zero_ind (tuple): tuple of indices of zeroes

    EXAMPLES::

        sage: from admcycles.diffstrata.sig import Signature
        sage: sig=Signature((2,1,-1,0))
        sage: sig.g
        2
        sage: sig.n
        4
        sage: sig.poles
        (-1,)
        sage: sig.zeroes
        (2, 1)
        sage: sig.pole_ind
        (2,)
        sage: sig.zero_ind
        (0, 1)
        sage: sig.p
        1
        sage: sig.z
        2
    cst�j|dd�dS)Nr�r
)�superr)rr��	__class__rr	rrszSignature.__init__)r&r'r(r)r�
__classcell__rrr-r	r*Ms$r*cs0eZdZdZ�fdd�Zdd�Zdd�Z�ZS)�QuadraticSignaturea�
    A signature of an quadratic stratum.

    Attributes:
        sig (tuple): signature tuple
        difftype (string): either "p" for primitive or "gs" of global square
        g (int): genus
        n (int): total number of points
        p (int): number of poles
        z (int): number of zeroes
        poles (tuple): tuple of pole orders
        zeroes (tuple): tuple of zero orders
        pole_ind (tuple): tuple of indices of poles
        zero_ind (tuple): tuple of indices of zeroes

    EXAMPLES::

        sage: from admcycles.diffstrata.sig import QuadraticSignature
        sage: sig=QuadraticSignature((4,1,-1,0), "p")
        sage: sig.difftype
        'p'
        sage: sig.g
        2
        sage: sig.n
        4
        sage: sig.poles
        (-1,)
        sage: sig.zeroes
        (4, 1)
        sage: sig.pole_ind
        (2,)
        sage: sig.zero_ind
        (0, 1)
        sage: sig.p
        1
        sage: sig.z
        2
    csHt�j|dd�|dvsJ�|dkr>tdd�|D��r>td��||_dS)Nrr+)r�gsr1css|]}|ddkVqdS)rrNr)r�arrr	r
�rz.QuadraticSignature.__init__.<locals>.<genexpr>zFQuadratic differentials with odd-order points can't be global squares.)r,r�anyr�difftype)rrr4r-rr	r�s�zQuadraticSignature.__init__cCsd|j|jfS)NzQuadraticSignature(%r, %r))rr4rrrr	r�szQuadraticSignature.__repr__cCst|j|j|jf�Sr )r!rr
r4rrrr	r"�szQuadraticSignature.__hash__)r&r'r(r)rrr"r/rrr-r	r0vs'r0N)rr*r0rrrr	�<module>sL)