/home/sage/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/sage/categories/category.py:2061: UserWarning: Resolving lazy import FinitelyGeneratedSemigroups during startup
  axiom_attribute = getattr(self.__class__, axiom, None)
/home/sage/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/sage/categories/category.py:2061: UserWarning: Resolving lazy import FinitelyGeneratedMagmas during startup
  axiom_attribute = getattr(self.__class__, axiom, None)
/home/sage/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/sage/modules/free_module.py:8467: UserWarning: Resolving lazy import CallableSymbolicExpressionRing_class during startup
  elif isinstance(R, CallableSymbolicExpressionRing_class) and not is_sparse:
/home/sage/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/sage/modules/free_module.py:8470: UserWarning: Resolving lazy import SymbolicRing during startup
  elif isinstance(R, SymbolicRing):
/home/sage/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/sage/modular/modsym/space.py:167: UserWarning: Resolving lazy import hecke_operator during startup
  return hecke_operator.HeckeOperator
/home/sage/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/sage/categories/pushout.py:1588: UserWarning: Resolving lazy import Rings during startup
  Functor.__init__(self, Rings(), Rings()) # Algebras() takes a base ring
/home/sage/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/sage/categories/pushout.py:2187: UserWarning: Resolving lazy import CommutativeAdditiveGroups during startup
  Functor.__init__(self, CommutativeAdditiveGroups(), CommutativeAdditiveGroups())
/home/sage/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/sage/categories/pushout.py:1882: UserWarning: Resolving lazy import CommutativeRings during startup
  Functor.__init__(self, CommutativeRings(), CommutativeAdditiveGroups())
N 1 SAGE ATKIN [1]
PARI [0, 1, -24, 252, -1472, 4830] [0, 1, -24, 252, -1472, 4830] norm 1
/home/sage/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/sage/categories/enumerated_sets.py:473: UserWarning: Resolving lazy import Integer during startup
  i = Integer(i)
N 3 SAGE ATKIN [243]
DOC 
        Return the Atkin-Lehner operator `W_d` on this space, if defined, where
        `d` is a divisor of the level `N` such that `N/d` and `d` are coprime.
        If `d` is not given, we take `d = N`.  If `N/d` is not coprime to `d`,
        then we replace `d` with the unique integer having this property which
        has the same prime factors as `d`.

        .. NOTE::

            The operator `W_d` is given by the action of any matrix of the form

            .. math::

                W_d = \begin{pmatrix} dx & y \\ Nz & dw \end{pmatrix}

            with `\det W_d = d` and such that `x = 1 \bmod N/d`, `y = 1 \bmod
            d`, as in [AL1978]_. However, our definition of the weight `k`
            action differs from theirs by a power of the determinant, so our
            operator `W_d` is `d^{k/2 - 1}` times the operator of Atkin-Li. In
            particular, if `k = 2` our conventions are identical to Atkin and
            Li's.

            With Sage's conventions, the operator `W_d` satisfies

            .. math::

                W_d^2 = d^{k - 2} \langle x^{-1} \rangle

            where `x` is congruent to `d` modulo `N/d` and to `-1` modulo `d`.
            In particular, the operator is an involution in weight 2 and
            trivial character (but not in most other situations).

        EXAMPLES::

            sage: M = ModularSymbols(11)
            sage: w = M.atkin_lehner_operator()
            sage: w
            Hecke module morphism Atkin-Lehner operator W_11 defined by the matrix
            [-1  0  0]
            [ 0 -1  0]
            [ 0  0 -1]
            Domain: Modular Symbols space of dimension 3 for Gamma_0(11) of weight ...
            Codomain: Modular Symbols space of dimension 3 for Gamma_0(11) of weight ...
            sage: M = ModularSymbols(Gamma1(13))
            sage: w = M.atkin_lehner_operator()
            sage: w.fcp('x')
            (x - 1)^7 * (x + 1)^8

        ::

            sage: M = ModularSymbols(33)
            sage: S = M.cuspidal_submodule()
            sage: S.atkin_lehner_operator()
            Hecke module morphism Atkin-Lehner operator W_33 defined by the matrix
            [ 0 -1  0  1 -1  0]
            [ 0 -1  0  0  0  0]
            [ 0 -1  0  0 -1  1]
            [ 1 -1  0  0 -1  0]
            [ 0  0  0  0 -1  0]
            [ 0 -1  1  0 -1  0]
            Domain: Modular Symbols subspace of dimension 6 of Modular Symbols space ...
            Codomain: Modular Symbols subspace of dimension 6 of Modular Symbols space ...

        ::

            sage: S.atkin_lehner_operator(3)
            Hecke module morphism Atkin-Lehner operator W_3 defined by the matrix
            [ 0  1  0 -1  1  0]
            [ 0  1  0  0  0  0]
            [ 0  1  0  0  1 -1]
            [-1  1  0  0  1  0]
            [ 0  0  0  0  1  0]
            [ 0  1 -1  0  1  0]
            Domain: Modular Symbols subspace of dimension 6 of Modular Symbols space ...
            Codomain: Modular Symbols subspace of dimension 6 of Modular Symbols space ...

        ::

            sage: N = M.new_submodule()
            sage: N.atkin_lehner_operator()
            Hecke module morphism Atkin-Lehner operator W_33 defined by the matrix
            [  1 2/5 4/5]
            [  0  -1   0]
            [  0   0  -1]
            Domain: Modular Symbols subspace of dimension 3 of Modular Symbols space ...
            Codomain: Modular Symbols subspace of dimension 3 of Modular Symbols space ...
        
PARI [0, 1, 78, -243, 4036, -5370] [0, 1, 78, -243, 4036, -5370] norm 1
N 4 SAGE ATKIN [-1024]
PARI [0, 1, 0, -516, 0, -10530] [0, -1, 0, 516, 0, 10530] norm 1
