code
stringlengths
17
6.64M
class AllowZeroInversionsContext(): '\n Temporarily allow zero inversion.\n ' def __init__(self, sr): '\n EXAMPLES::\n\n sage: from sage.crypto.mq.sr import AllowZeroInversionsContext\n sage: sr = mq.SR(1,2,2,4)\n sage: with AllowZeroInversionsContext(sr)...
def test_consistency(max_n=2, **kwargs): '\n Test all combinations of ``r``, ``c``, ``e`` and ``n`` in ``(1,\n 2)`` for consistency of random encryptions and their polynomial\n systems. `\\GF{2}` and `\\GF{2^e}` systems are tested. This test takes\n a while.\n\n INPUT:\n\n - ``max_n`` -- maximal...
class BlumGoldwasser(PublicKeyCryptosystem): '\n The Blum-Goldwasser probabilistic public-key encryption scheme.\n\n The Blum-Goldwasser encryption and decryption algorithms as described in\n :func:`encrypt() <BlumGoldwasser.encrypt>` and\n :func:`decrypt() <BlumGoldwasser.decrypt>`, respectively, mak...
def bracken_leander(n): '\n Return the Bracken-Leander construction.\n\n For n = 4*k and odd k, the construction is `x \\mapsto x^{2^{2k} + 2^k + 1}`\n over `\\GF{2^n}`\n\n INPUT:\n\n - ``n`` -- size of the S-Box\n\n EXAMPLES::\n\n sage: from sage.crypto.sboxes import bracken_leander\n ...
def carlet_tang_tang_liao(n, c=None, bf=None): '\n Return the Carlet-Tang-Tang-Liao construction.\n\n See [CTTL2014]_ for its definition.\n\n INPUT:\n\n - ``n`` -- integer, the bit length of inputs and outputs, has to be even and >= 6\n - ``c`` -- element of `\\GF{2^{n-1}}` used in the construction...
def gold(n, i): '\n Return the Gold function defined by `x \\mapsto x^{2^i + 1}` over `\\GF{2^n}`.\n\n INPUT:\n\n - ``n`` -- size of the S-Box\n - ``i`` -- a positive integer\n\n EXAMPLES::\n\n sage: from sage.crypto.sboxes import gold\n sage: gold(3, 1)\n (0, 1, 3, 4, 5, 6, 7,...
def kasami(n, i): '\n Return the Kasami function defined by `x \\mapsto x^{2^{2i} - 2^i + 1}` over `\\GF{2^n}`.\n\n INPUT:\n\n - ``n`` -- size of the S-Box\n - ``i`` -- a positive integer\n\n EXAMPLES::\n\n sage: from sage.crypto.sboxes import kasami\n sage: kasami(3, 1)\n (0, ...
def niho(n): '\n Return the Niho function over `\\GF{2^n}`.\n\n It is defined by `x \\mapsto x^{2^t + 2^s - 1}` with `s = t/2` if t is even\n or `s = (3t+1)/2` if t is odd.\n\n INPUT:\n\n - ``n`` -- size of the S-Box\n\n EXAMPLES::\n\n sage: from sage.crypto.sboxes import niho\n sa...
def welch(n): '\n Return the Welch function defined by `x \\mapsto x^{2^{(n-1)/2} + 3}` over `\\GF{2^n}`.\n\n INPUT:\n\n - ``n`` -- size of the S-Box\n\n EXAMPLES::\n\n sage: from sage.crypto.sboxes import welch\n sage: welch(3)\n (0, 1, 7, 2, 3, 4, 5, 6)\n sage: welch(3).d...
def monomial_function(n, e): '\n Return an S-Box as a function `x^e` defined over `\\GF{2^n}`.\n\n INPUT:\n\n - ``n`` -- size of the S-Box (i.e. the degree of the finite field extension)\n - ``e`` -- exponent of the monomial function\n\n EXAMPLES::\n\n sage: from sage.crypto.sboxes import mo...
class LFSRCryptosystem(SymmetricKeyCryptosystem): '\n Linear feedback shift register cryptosystem class\n ' def __init__(self, field=None): '\n Create a linear feedback shift cryptosystem.\n\n INPUT: A string monoid over a binary alphabet.\n\n OUTPUT:\n\n EXAMPLES::\...
class ShrinkingGeneratorCryptosystem(SymmetricKeyCryptosystem): '\n Shrinking generator cryptosystem class\n ' def __init__(self, field=None): '\n Create a shrinking generator cryptosystem.\n\n INPUT: A string monoid over a binary alphabet.\n\n OUTPUT:\n\n EXAMPLES::...
def blum_blum_shub(length, seed=None, p=None, q=None, lbound=None, ubound=None, ntries=100): '\n The Blum-Blum-Shub (BBS) pseudorandom bit generator.\n\n See the original paper by Blum, Blum and Shub [BBS1986]_. The\n BBS algorithm is also discussed in section 5.5.2 of [MvOV1996]_.\n\n INPUT:\n\n -...
class LFSRCipher(SymmetricKeyCipher): def __init__(self, parent, poly, IS): '\n Create a linear feedback shift register (LFSR) cipher.\n\n INPUT:\n\n\n - ``parent`` - parent\n\n - ``poly`` - connection polynomial\n\n - ``IS`` - initial state\n\n\n EXAMPLES::\n...
class ShrinkingGeneratorCipher(SymmetricKeyCipher): def __init__(self, parent, e1, e2): '\n Create a shrinking generator cipher.\n\n INPUT:\n\n\n - ``parent`` - parent\n\n - ``poly`` - connection polynomial\n\n - ``IS`` - initial state\n\n\n EXAMPLES::\n\n ...
def ascii_integer(B): '\n Return the ASCII integer corresponding to the binary string ``B``.\n\n INPUT:\n\n - ``B`` -- a non-empty binary string or a non-empty list of bits. The\n number of bits in ``B`` must be 8.\n\n OUTPUT:\n\n - The ASCII integer corresponding to the 8-bit block ``B``.\n\n...
def ascii_to_bin(A): '\n Return the binary representation of the ASCII string ``A``.\n\n INPUT:\n\n - ``A`` -- a string or list of ASCII characters.\n\n OUTPUT:\n\n - The binary representation of ``A``.\n\n ALGORITHM:\n\n Let `A = a_0 a_1 \\cdots a_{n-1}` be an ASCII string, where each `a_i` ...
def bin_to_ascii(B): '\n Return the ASCII representation of the binary string ``B``.\n\n INPUT:\n\n - ``B`` -- a non-empty binary string or a non-empty list of bits. The\n number of bits in ``B`` must be a multiple of 8.\n\n OUTPUT:\n\n - The ASCII string corresponding to ``B``.\n\n ALGORIT...
def has_blum_prime(lbound, ubound): '\n Determine whether or not there is a Blum prime within the specified closed\n interval.\n\n INPUT:\n\n - ``lbound`` -- positive integer; the lower bound on how small a\n Blum prime can be. The lower bound must be distinct from the upper\n bound.\n\n ...
def is_blum_prime(n): '\n Determine whether or not ``n`` is a Blum prime.\n\n INPUT:\n\n - ``n`` a positive prime.\n\n OUTPUT:\n\n - ``True`` if ``n`` is a Blum prime; ``False`` otherwise.\n\n Let `n` be a positive prime. Then `n` is a Blum prime if `n` is\n congruent to 3 modulo 4, i.e. `n \...
def least_significant_bits(n, k): "\n Return the ``k`` least significant bits of ``n``.\n\n INPUT:\n\n - ``n`` -- an integer.\n\n - ``k`` -- a positive integer.\n\n OUTPUT:\n\n - The ``k`` least significant bits of the integer ``n``. If ``k=1``,\n then return the parity bit of the integer `...
def random_blum_prime(lbound, ubound, ntries=100): '\n A random Blum prime within the specified bounds.\n\n Let `p` be a positive prime. Then `p` is a Blum prime if `p` is\n congruent to 3 modulo 4, i.e. `p \\equiv 3 \\pmod{4}`.\n\n INPUT:\n\n - ``lbound`` -- positive integer; the lower bound on ho...
class MutablePosetShell(SageObject): '\n A shell for an element of a :class:`mutable poset <MutablePoset>`.\n\n INPUT:\n\n - ``poset`` -- the poset to which this shell belongs.\n\n - ``element`` -- the element which should be\n contained/encapsulated in this shell.\n\n OUTPUT:\n\n A shell f...
def is_MutablePoset(P): '\n Test whether ``P`` inherits from :class:`MutablePoset`.\n\n .. SEEALSO::\n\n :class:`MutablePoset`\n\n TESTS::\n\n sage: from sage.data_structures.mutable_poset import MutablePoset as MP\n sage: from sage.data_structures.mutable_poset import is_MutablePose...
class MutablePoset(SageObject): '\n A data structure that models a mutable poset (partially ordered\n set).\n\n INPUT:\n\n - ``data`` -- data from which to construct the poset. It can be\n any of the following:\n\n #. ``None`` (default), in which case an empty poset is created,\n\n #. a...
class Stream(): '\n Abstract base class for all streams.\n\n INPUT:\n\n - ``true_order`` -- boolean; if the approximate order is the actual order\n\n .. NOTE::\n\n An implementation of a stream class depending on other stream\n classes must not access coefficients or the approximate orde...
class Stream_inexact(Stream): '\n An abstract base class for the stream when we do not know it is\n eventually constant.\n\n In particular, a cache is provided.\n\n INPUT:\n\n - ``is_sparse`` -- boolean; whether the implementation of the stream is sparse\n - ``true_order`` -- boolean; if the app...
class Stream_exact(Stream): '\n A stream of eventually constant coefficients.\n\n INPUT:\n\n - ``initial_values`` -- a list of initial values\n - ``is_sparse`` -- boolean; specifies whether the stream is sparse\n - ``order`` -- integer (default: 0); determining the degree\n of the first elemen...
class Stream_iterator(Stream_inexact): '\n Class that creates a stream from an iterator.\n\n INPUT:\n\n - ``iter`` -- a function that generates the coefficients of the\n stream\n - ``approximate_order`` -- integer; a lower bound for the order\n of the stream\n\n Instances of this class ar...
class Stream_function(Stream_inexact): '\n Class that creates a stream from a function on the integers.\n\n INPUT:\n\n - ``function`` -- a function that generates the\n coefficients of the stream\n - ``is_sparse`` -- boolean; specifies whether the stream is sparse\n - ``approximate_order`` -- ...
class Stream_uninitialized(Stream_inexact): "\n Coefficient stream for an uninitialized series.\n\n INPUT:\n\n - ``approximate_order`` -- integer; a lower bound for the order\n of the stream\n\n Instances of this class are always dense.\n\n .. TODO::\n\n shouldn't instances of this clas...
class Stream_unary(Stream_inexact): '\n Base class for unary operators on coefficient streams.\n\n INPUT:\n\n - ``series`` -- :class:`Stream` the operator acts on\n - ``is_sparse`` -- boolean\n - ``true_order`` -- boolean (default: ``False``) if the approximate order\n is the actual order\n\n ...
class Stream_binary(Stream_inexact): '\n Base class for binary operators on coefficient streams.\n\n INPUT:\n\n - ``left`` -- :class:`Stream` for the left side of the operator\n - ``right`` -- :class:`Stream` for the right side of the operator\n\n EXAMPLES::\n\n sage: from sage.data_structur...
class Stream_binaryCommutative(Stream_binary): '\n Base class for commutative binary operators on coefficient streams.\n\n EXAMPLES::\n\n sage: from sage.data_structures.stream import (Stream_function, Stream_add)\n sage: f = Stream_function(lambda n: 2*n, True, 0)\n sage: g = Stream_fu...
class Stream_zero(Stream): '\n A coefficient stream that is exactly equal to zero.\n\n EXAMPLES::\n\n sage: from sage.data_structures.stream import Stream_zero\n sage: s = Stream_zero()\n sage: s[5]\n 0\n ' def __init__(self): '\n Initialize ``self``.\n\n ...
class Stream_add(Stream_binaryCommutative): '\n Operator for addition of two coefficient streams.\n\n INPUT:\n\n - ``left`` -- :class:`Stream` of coefficients on the left side of the operator\n - ``right`` -- :class:`Stream` of coefficients on the right side of the operator\n\n EXAMPLES::\n\n ...
class Stream_sub(Stream_binary): '\n Operator for subtraction of two coefficient streams.\n\n INPUT:\n\n - ``left`` -- :class:`Stream` of coefficients on the left side of the operator\n - ``right`` -- :class:`Stream` of coefficients on the right side of the operator\n\n EXAMPLES::\n\n sage: ...
class Stream_cauchy_mul(Stream_binary): '\n Operator for multiplication of two coefficient streams using the\n Cauchy product.\n\n We are *not* assuming commutativity of the coefficient ring here,\n only that the coefficient ring commutes with the (implicit) variable.\n\n INPUT:\n\n - ``left`` -...
class Stream_cauchy_mul_commutative(Stream_cauchy_mul, Stream_binaryCommutative): '\n Operator for multiplication of two coefficient streams using the\n Cauchy product for commutative multiplication of coefficients.\n ' pass
class Stream_dirichlet_convolve(Stream_binary): '\n Operator for the Dirichlet convolution of two streams.\n\n INPUT:\n\n - ``left`` -- :class:`Stream` of coefficients on the left side of the operator\n - ``right`` -- :class:`Stream` of coefficients on the right side of the operator\n\n The coeffic...
class Stream_cauchy_compose(Stream_binary): '\n Return ``f`` composed by ``g``.\n\n This is the composition `(f \\circ g)(z) = f(g(z))`.\n\n INPUT:\n\n - ``f`` -- a :class:`Stream`\n - ``g`` -- a :class:`Stream` with positive order\n\n EXAMPLES::\n\n sage: from sage.data_structures.stream...
class Stream_plethysm(Stream_binary): '\n Return the plethysm of ``f`` composed by ``g``.\n\n This is the plethysm `f \\circ g = f(g)` when `g` is an element of\n a ring of symmetric functions.\n\n INPUT:\n\n - ``f`` -- a :class:`Stream`\n - ``g`` -- a :class:`Stream` with positive order, unless...
class Stream_scalar(Stream_unary): '\n Base class for operators multiplying a coefficient stream by a\n scalar.\n\n INPUT:\n\n - ``series`` -- a :class:`Stream`\n - ``scalar`` -- a non-zero, non-one scalar\n - ``is_sparse`` -- boolean\n ' def __init__(self, series, scalar, is_sparse): ...
class Stream_rmul(Stream_scalar): "\n Operator for multiplying a coefficient stream with a scalar\n as ``scalar * self``.\n\n INPUT:\n\n - ``series`` -- a :class:`Stream`\n - ``scalar`` -- a non-zero, non-one scalar\n\n EXAMPLES::\n\n sage: # needs sage.modules\n sage: from sage.da...
class Stream_lmul(Stream_scalar): "\n Operator for multiplying a coefficient stream with a scalar\n as ``self * scalar``.\n\n INPUT:\n\n - ``series`` -- a :class:`Stream`\n - ``scalar`` -- a non-zero, non-one scalar\n\n EXAMPLES::\n\n sage: # needs sage.modules\n sage: from sage.da...
class Stream_neg(Stream_unary): '\n Operator for negative of the stream.\n\n INPUT:\n\n - ``series`` -- a :class:`Stream`\n\n EXAMPLES::\n\n sage: from sage.data_structures.stream import (Stream_neg, Stream_function)\n sage: f = Stream_function(lambda n: 1, True, 1)\n sage: g = St...
class Stream_cauchy_invert(Stream_unary): '\n Operator for multiplicative inverse of the stream.\n\n INPUT:\n\n - ``series`` -- a :class:`Stream`\n - ``approximate_order`` -- ``None``, or a lower bound on the\n order of the resulting stream\n\n Instances of this class are always dense, because...
class Stream_dirichlet_invert(Stream_unary): '\n Operator for inverse with respect to Dirichlet convolution of the stream.\n\n INPUT:\n\n - ``series`` -- a :class:`Stream`\n\n EXAMPLES::\n\n sage: from sage.data_structures.stream import (Stream_dirichlet_invert, Stream_function)\n sage: ...
class Stream_map_coefficients(Stream_unary): '\n The stream with ``function`` applied to each non-zero coefficient\n of ``series``.\n\n INPUT:\n\n - ``series`` -- a :class:`Stream`\n - ``function`` -- a function that modifies the elements of the stream\n\n .. NOTE::\n\n We assume for equa...
class Stream_shift(Stream): '\n Operator for shifting a non-zero, non-exact stream.\n\n Instances of this class share the cache with its input stream.\n\n INPUT:\n\n - ``series`` -- a :class:`Stream`\n - ``shift`` -- an integer\n ' def __init__(self, series, shift): '\n Initi...
class Stream_truncated(Stream_unary): '\n Operator for shifting a non-zero, non-exact stream that has\n been shifted below its minimal valuation.\n\n Instances of this class share the cache with its input stream.\n\n INPUT:\n\n - ``series`` -- a :class:`Stream_inexact`\n - ``shift`` -- an intege...
class Stream_derivative(Stream_unary): '\n Operator for taking derivatives of a non-exact stream.\n\n INPUT:\n\n - ``series`` -- a :class:`Stream`\n - ``shift`` -- a positive integer\n - ``is_sparse`` -- boolean\n ' def __init__(self, series, shift, is_sparse): '\n Initialize...
class Stream_infinite_operator(Stream): '\n Stream defined by applying an operator an infinite number of times.\n\n The ``iterator`` returns elements `s_i` to compute an infinite operator.\n The valuation of `s_i` is weakly increasing as we iterate over `I` and\n there are only finitely many terms wit...
class Stream_infinite_sum(Stream_infinite_operator): '\n Stream defined by an infinite sum.\n\n The ``iterator`` returns elements `s_i` to compute the product\n `\\sum_{i \\in I} s_i`. See :class:`Stream_infinite_operator`\n for restrictions on the `s_i`.\n\n INPUT:\n\n - ``iterator`` -- the ite...
class Stream_infinite_product(Stream_infinite_operator): '\n Stream defined by an infinite product.\n\n The ``iterator`` returns elements `p_i` to compute the product\n `\\prod_{i \\in I} (1 + p_i)`. See :class:`Stream_infinite_operator`\n for restrictions on the `p_i`.\n\n INPUT:\n\n - ``iterat...
class DictInMapping(Mapping): def __init__(self, dict): "\n Places dict into a non-mutable mapping.\n\n TESTS::\n\n sage: from sage.databases.conway import DictInMapping\n sage: d = {}\n sage: m = DictInMapping(d); m\n {}\n sage: d[0] =...
class ConwayPolynomials(Mapping): def __init__(self): "\n Initialize the database.\n\n TESTS::\n\n sage: c = ConwayPolynomials()\n sage: c\n Frank Lübeck's database of Conway polynomials\n " import conway_polynomials self._store = conw...
def build(name, data_tgz, largest_conductor=0, mini=False, decompress=True): "\n Build the CremonaDatabase with given name from scratch\n using the data_tgz tarball.\n\n .. note::\n\n For data up to level 350000, this function takes about\n 3m40s. The resulting database occupies 426M...
def is_optimal_id(id): "\n Return True if the Cremona id refers to an optimal curve, and\n false otherwise.\n\n The curve is optimal if the id, which is of the\n form [letter code][number] has number 1.\n\n .. note::\n\n 990h3 is the optimal curve in that class, so doesn't obey\n this r...
def cremona_letter_code(n): "\n Return the Cremona letter code corresponding to an integer.\n\n For example, 0 - a 25 - z 26 - ba 51 - bz 52 - ca 53 - cb etc.\n\n .. note::\n\n This is just the base 26 representation of n, where a=0, b=1,\n ..., z=25. This extends the old Cremona notation (co...
def old_cremona_letter_code(n): "\n Return the *old* Cremona letter code corresponding to an integer.\n\n For example::\n\n 1 --> A\n 26 --> Z\n 27 --> AA\n 52 --> ZZ\n 53 --> AAA\n etc.\n\n INPUT:\n\n - ``n`` - int\n\n OUTPUT: str\n\n EXAMPLES::\n\n ...
def parse_cremona_label(label, numerical_class_code=False): "\n Given a Cremona label that defines an elliptic\n curve, e.g., 11a1 or 37b3, parse the label and return the\n conductor, isogeny class label, and number.\n\n For this function, the curve number may be omitted, in which case\n it default...
def parse_lmfdb_label(label, numerical_class_code=False): "\n Given an LMFDB label that defines an elliptic curve, e.g., 11.a1\n or 37.b3, parse the label and return the conductor, isogeny class\n label, and number.\n\n The LMFDB label (named after the L-functions and modular forms\n database), is ...
def split_code(key): "\n Split class + curve id string into its two parts.\n\n EXAMPLES::\n\n sage: import sage.databases.cremona as cremona\n sage: cremona.split_code('ba2')\n ('ba', '2')\n sage: cremona.split_code('42')\n Traceback (most recent call last):\n ...\n...
def class_to_int(k): "\n Convert class id string into an integer.\n\n Note that this is the inverse of :func:`cremona_letter_code`.\n\n EXAMPLES::\n\n sage: import sage.databases.cremona as cremona\n sage: cremona.class_to_int('ba')\n 26\n sage: cremona.class_to_int('cremona')...
def sort_key(key1): "\n Comparison key for curve id strings.\n\n .. note::\n\n Not the same as standard lexicographic order!\n\n EXAMPLES::\n\n sage: from sage.databases.cremona import sort_key\n sage: l = ['ba1', 'z1']\n sage: sorted(l, key=sort_key)\n ['z1', 'ba1']\n ...
def cremona_to_lmfdb(cremona_label, CDB=None): "\n Convert a Cremona label into an LMFDB label.\n\n See :func:`parse_lmfdb_label` for an explanation of LMFDB labels.\n\n INPUT:\n\n - ``cremona_label`` -- a string, the Cremona label of a curve.\n This can be the label of a curve (e.g. '990j1') or ...
def lmfdb_to_cremona(lmfdb_label, CDB=None): "\n Convert an LMFDB label into a Cremona label.\n\n See :func:`parse_lmfdb_label` for an explanation of LMFDB labels.\n\n INPUT:\n\n - ``lmfdb_label`` -- a string, the LMFDB label of a curve.\n This can be the label of a curve (e.g. '990.j1') or of an...
class MiniCremonaDatabase(SQLDatabase): "\n The Cremona database of elliptic curves.\n\n EXAMPLES::\n\n sage: c = CremonaDatabase()\n sage: c.allcurves(11)\n {'a1': [[0, -1, 1, -10, -20], 0, 5],\n 'a2': [[0, -1, 1, -7820, -263580], 0, 1],\n 'a3': [[0, -1, 1, 0, 0], 0, 5]...
class LargeCremonaDatabase(MiniCremonaDatabase): "\n The Cremona database of elliptic curves.\n\n EXAMPLES::\n\n sage: c = CremonaDatabase('cremona') # optional - database_cremona_ellcurve\n sage: c.allcurves(11) # optional - database_cremona_ellcurve\n {'a1': [[0, -1, ...
def CremonaDatabase(name=None, mini=None, set_global=None): "\n Initializes the Cremona database with name ``name``. If ``name`` is\n ``None`` it instead initializes large Cremona database (named 'cremona'),\n if available or default mini Cremona database (named 'cremona mini').\n\n If the Cremona dat...
def simplify(mat): "\n Convert a matrix to a dictionary consisting of flat Python objects.\n\n INPUT:\n\n - ``mat`` -- matrix to be converted into a ``dict``\n\n OUTPUT:\n\n A ``dict`` from which ``mat`` can be reconstructed via\n element construction. The values of the dictionary may be\n di...
class CubicHeckeDataSection(Enum): "\n Enum for the different sections of the database.\n\n The following choices are possible:\n\n - ``basis`` -- list of basis elements\n - ``reg_left_reprs`` -- data for the left regular representation\n - ``reg_right_reprs`` -- data for the right regular repre...
class CubicHeckeDataBase(SageObject): "\n Database interface for\n :class:`~sage.algebras.hecke_algebras.cubic_hecke_algebras.CubicHeckeAlgebra`\n\n The original data are obtained from `Ivan Marin's web page\n <http://www.lamfa.u-picardie.fr/marin/representationH4-en.html>`__\n\n The data needed to...
class MarkovTraceModuleBasis(Enum): "\n Enum for the basis elements for the Markov trace module.\n\n The choice of the basis elements doesn't have a systematically background\n apart from generating the submodule of maximal rank in the module of linear\n forms on the cubic Hecke algebra for which the ...
class CubicHeckeFileCache(SageObject): '\n A class to cache calculations of\n :class:`~sage.algebras.hecke_algebras.cubic_hecke_algebras.CubicHeckeAlgebra`\n in the local file system.\n ' class section(Enum): "\n Enum for the different sections of file cache. The following choices ...
def create_demo_data(filename='demo_data.py'): '\n Generate code for the functions inserted below to access the\n small cases of less than 4 strands as demonstration cases.\n\n The code is written to a file with the given name from where\n it can be copied into this source file (in case a change is ne...
def read_basis(num_strands=3): '\n Return precomputed data of Ivan Marin.\n\n This code was generated by :func:`create_demo_data`, please do not edit.\n\n INPUT:\n\n - ``num_strands`` -- integer; number of strands of the cubic Hecke algebra\n\n EXAMPLES::\n\n sage: from sage.databases.cubic_...
def read_irr(variables, num_strands=3): '\n Return precomputed data of Ivan Marin.\n\n This code was generated by :func:`create_demo_data`, please do not edit.\n\n INPUT:\n\n - ``variables`` -- tuple containing the indeterminates of the representation\n - ``num_strands`` -- integer; number of stran...
def read_regl(variables, num_strands=3): '\n Return precomputed data of Ivan Marin.\n\n This code was generated by :func:`create_demo_data`, please do not edit.\n\n INPUT:\n\n - ``variables`` -- tuple containing the indeterminates of the representation\n - ``num_strands`` -- integer; number of stra...
def read_regr(variables, num_strands=3): '\n Return precomputed data of Ivan Marin.\n\n This code was generated by :func:`create_demo_data`, please do not edit.\n\n INPUT:\n\n - ``variables`` -- tuple containing the indeterminates of the representation\n - ``num_strands`` -- integer; number of stra...
def read_markov(bas_ele, variables, num_strands=4): "\n Return precomputed Markov trace coefficients.\n\n This code was generated by ``create_markov_trace_data.py`` (from\n the ``database_cubic_hecke`` repository), please do not edit.\n\n INPUT:\n\n - ``bas_ele`` -- an element of :class:`MarkovTrac...
@cached_function def cunningham_prime_factors(): '\n List of all the prime numbers occurring in the so called Cunningham table.\n\n They occur in the factorization of numbers of type `b^n+1` or `b^n-1` with `b \\in \\{2,3,5,6,7,10,11,12\\}`.\n\n EXAMPLES::\n\n sage: # optional - cunningham_tables\...
class ClassPolynomialDatabase(): def _dbpath(self, disc, level=1): "\n TESTS::\n\n sage: db = HilbertClassPolynomialDatabase()\n sage: db._dbpath(5, 1)\n 'PolHeeg/Cls/0000001-0005000/pol.0000005.dbz'\n sage: db._dbpath(15000, 1)\n 'PolHeeg/Cls...
class HilbertClassPolynomialDatabase(ClassPolynomialDatabase): '\n The database of Hilbert class polynomials.\n\n EXAMPLES::\n\n sage: # optional - database_kohel\n sage: db = HilbertClassPolynomialDatabase()\n sage: db[-4]\n x - 1728\n sage: db[-7]\n x + 3375\n ...
class AtkinClassPolynomialDatabase(ClassPolynomialDatabase): '\n The database of Atkin class polynomials.\n ' model = 'Atk' def __repr__(self): return 'Atkin class polynomial database'
class WeberClassPolynomialDatabase(ClassPolynomialDatabase): '\n The database of Weber class polynomials.\n ' def __repr__(self): return 'Weber class polynomial database'
class DedekindEtaClassPolynomialDatabase(ClassPolynomialDatabase): '\n The database of Dedekind eta class polynomials.\n ' model = 'Eta' def __repr__(self): return 'Dedekind eta class polynomial database'
def _dbz_to_string(name): "\n TESTS::\n\n sage: # optional - database_kohel\n sage: from sage.databases.db_modular_polynomials import _dbz_to_string\n sage: _dbz_to_string('PolMod/Atk/pol.002.dbz')\n '3 0 1 \\n2 1 -1 \\n2 0 744 \\n1 1 -1 \\n1 0 184512 \\n0 2 1 \\n0 1 7256 \\n0 0 152...
def _dbz_to_integer_list(name): "\n TESTS::\n\n sage: # optional - database_kohel\n sage: from sage.databases.db_modular_polynomials import _dbz_to_integer_list\n sage: _dbz_to_integer_list('PolMod/Atk/pol.002.dbz')\n [[3, 0, 1],\n [2, 1, -1],\n [2, 0, 744],\n ...
def _dbz_to_integers(name): "\n TESTS::\n\n sage: from sage.databases.db_modular_polynomials import _dbz_to_integers\n sage: _dbz_to_integers('PolHeeg/Cls/0000001-0005000/pol.0000003.dbz') # optional - database_kohel\n [0, 1]\n " from sage.rings.integer import Integer return [In...
class ModularPolynomialDatabase(): def _dbpath(self, level): "\n TESTS::\n\n sage: C = ClassicalModularPolynomialDatabase()\n sage: C._dbpath(3)\n 'PolMod/Cls/pol.003.dbz'\n sage: C._dbpath(8)\n 'PolMod/Cls/pol.008.dbz'\n " retu...
class ModularCorrespondenceDatabase(ModularPolynomialDatabase): def _dbpath(self, level): "\n TESTS::\n\n sage: DB = DedekindEtaModularCorrespondenceDatabase()\n sage: DB._dbpath((2,4))\n 'PolMod/EtaCrr/crr.02.004.dbz'\n " (Nlevel, crrlevel) = level ...
class ClassicalModularPolynomialDatabase(ModularPolynomialDatabase): '\n The database of classical modular polynomials, i.e. the polynomials\n Phi_N(X,Y) relating the j-functions j(q) and j(q^N).\n ' model = 'Cls'
class DedekindEtaModularPolynomialDatabase(ModularPolynomialDatabase): '\n The database of modular polynomials Phi_N(X,Y) relating a quotient\n of Dedekind eta functions, well-defined on X_0(N), relating x(q) and\n the j-function j(q).\n ' model = 'Eta'
class DedekindEtaModularCorrespondenceDatabase(ModularCorrespondenceDatabase): "\n The database of modular correspondences in `X_0(p) \\times X_0(p)`, where\n the model of the curves `X_0(p) = \\Bold{P}^1` are specified by quotients of\n Dedekind's eta function.\n " model = 'EtaCrr'
class AtkinModularPolynomialDatabase(ModularPolynomialDatabase): '\n The database of modular polynomials Phi(x,j) for `X_0(p)`, where\n x is a function on invariant under the Atkin-Lehner invariant,\n with pole of minimal order at infinity.\n ' model = 'Atk'
class AtkinModularCorrespondenceDatabase(ModularCorrespondenceDatabase): model = 'AtkCrr'
class FindStat(UniqueRepresentation, SageObject): '\n The Combinatorial Statistic Finder.\n\n :class:`FindStat` is a class preserving user information.\n ' def __init__(self): '\n Initialize the database.\n\n TESTS::\n\n sage: findstat()\n The Combinatoria...
def _get_json(url, **kwargs): '\n Return the json response or raise an error.\n\n EXAMPLES::\n\n sage: from sage.databases.findstat import _get_json, FINDSTAT_API_MAPS\n sage: _get_json(FINDSTAT_API_MAPS + "?fields=yyy") # optional -- internet\n Traceback (most rece...