cypari2


Namecypari2 JSON
Version 2.1.5 PyPI version JSON
download
home_pageNone
SummaryA Python interface to the number theory library PARI/GP
upload_time2024-03-24 18:46:47
maintainerNone
docs_urlNone
authorLuca De Feo, Vincent Delecroix, Jeroen Demeyer, Vincent Klein
requires_python>=3.9
licenseGNU General Public License, version 2 or later
keywords pari/gp number theory
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            CyPari 2
========

.. image:: https://readthedocs.org/projects/cypari2/badge/?version=latest
    :target: https://cypari2.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

A Python interface to the number theory library `PARI/GP <http://pari.math.u-bordeaux.fr/>`_.

Installation
------------

From a distribution package (GNU/Linux, conda-forge)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

A package might be available in your package manager, see
https://repology.org/project/python:cypari2/versions or
https://doc.sagemath.org/html/en/reference/spkg/cypari for
installation instructions.


From a pre-built wheel from PyPI
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Requirements:

- Python >= 3.9
- pip

Install cypari2 via the Python Package Index (PyPI) via

::

    $ pip install cypari2 [--user]

(the optional option *--user* allows to install cypari2 for a single user
and avoids using pip with administrator rights).


From source with pip
^^^^^^^^^^^^^^^^^^^^

Requirements:

- PARI/GP >= 2.9.4 (header files and library); see
  https://doc.sagemath.org/html/en/reference/spkg/pari#spkg-pari
  for availability in distributions (GNU/Linux, conda-forge, Homebrew, FreeBSD),
  or install from source.
- Python >= 3.9
- pip

Install cypari2 via the Python Package Index (PyPI) via

::

    $ pip install --no-binary cypari2 cypari2 [--user]

(the optional option *--user* allows to install cypari2 for a single user
and avoids using pip with administrator rights).

`pip` builds the package using build isolation.  All Python build dependencies
of the package, declared in pyproject.toml, are automatically installed in
a temporary virtual environment.

If you want to try the development version, use

::

    $ pip install git+https://github.com/sagemath/cypari2.git [--user]


Usage
-----

The interface as been kept as close as possible from PARI/GP. The following
computation in GP

::

    ? zeta(2)
    %1 = 1.6449340668482264364724151666460251892

    ? p = x^3 + x^2 + x - 1;
    ? modulus = t^3 + t^2 + t - 1;
    ? fq = factorff(p, 3, modulus);
    ? centerlift(lift(fq))
    %5 =
    [            x - t 1]

    [x + (t^2 + t - 1) 1]

    [   x + (-t^2 - 1) 1]

translates into

::

    >>> import cypari2
    >>> pari = cypari2.Pari()

    >>> pari(2).zeta()
    1.64493406684823

    >>> p = pari("x^3 + x^2 + x - 1")
    >>> modulus = pari("t^3 + t^2 + t - 1")
    >>> fq = p.factorff(3, modulus)
    >>> fq.lift().centerlift()
    [x - t, 1; x + (t^2 + t - 1), 1; x + (-t^2 - 1), 1]

The object **pari** above is the object for the interface and acts as a
constructor. It can be called with basic Python objects like integer
or floating point. When called with a string as in the last example
the corresponding string is interpreted as if it was executed in a GP shell.

Beyond the interface object **pari** of type **Pari**, any object you get a
handle on is of type **Gen** (that is a wrapper around the **GEN** type from
libpari). All PARI/GP functions are then available in their original names as
*methods* like **zeta**, **factorff**, **lift** or **centerlift** above.

Alternatively, the pari functions are accessible as methods of **pari**. The
same computations be done via

::

    >>> import cypari2
    >>> pari = cypari2.Pari()

    >>> pari.zeta(2)
    1.64493406684823

    >>> p = pari("x^3 + x^2 + x - 1")
    >>> modulus = pari("t^3 + t^2 + t - 1")
    >>> fq = pari.factorff(p, 3, modulus)
    >>> pari.centerlift(pari.lift(fq))
    [x - t, 1; x + (t^2 + t - 1), 1; x + (-t^2 - 1), 1]

The complete documentation of cypari2 is available at http://cypari2.readthedocs.io and
the PARI/GP documentation at http://pari.math.u-bordeaux.fr/doc.html

Contributing
------------

CyPari 2 is maintained by the SageMath community.

Open issues or submit pull requests at https://github.com/sagemath/cypari2
and join https://groups.google.com/group/sage-devel to discuss.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cypari2",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "SageMath developers <sage-devel@googlegroups.com>",
    "keywords": "PARI/GP number theory",
    "author": "Luca De Feo, Vincent Delecroix, Jeroen Demeyer, Vincent Klein",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/33/53/112739a92546ef9a0a2282f277cba1c05f2a76af0f1a3869e8051e3cd6ae/cypari2-2.1.5.tar.gz",
    "platform": null,
    "description": "CyPari 2\n========\n\n.. image:: https://readthedocs.org/projects/cypari2/badge/?version=latest\n    :target: https://cypari2.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\nA Python interface to the number theory library `PARI/GP <http://pari.math.u-bordeaux.fr/>`_.\n\nInstallation\n------------\n\nFrom a distribution package (GNU/Linux, conda-forge)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nA package might be available in your package manager, see\nhttps://repology.org/project/python:cypari2/versions or\nhttps://doc.sagemath.org/html/en/reference/spkg/cypari for\ninstallation instructions.\n\n\nFrom a pre-built wheel from PyPI\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nRequirements:\n\n- Python >= 3.9\n- pip\n\nInstall cypari2 via the Python Package Index (PyPI) via\n\n::\n\n    $ pip install cypari2 [--user]\n\n(the optional option *--user* allows to install cypari2 for a single user\nand avoids using pip with administrator rights).\n\n\nFrom source with pip\n^^^^^^^^^^^^^^^^^^^^\n\nRequirements:\n\n- PARI/GP >= 2.9.4 (header files and library); see\n  https://doc.sagemath.org/html/en/reference/spkg/pari#spkg-pari\n  for availability in distributions (GNU/Linux, conda-forge, Homebrew, FreeBSD),\n  or install from source.\n- Python >= 3.9\n- pip\n\nInstall cypari2 via the Python Package Index (PyPI) via\n\n::\n\n    $ pip install --no-binary cypari2 cypari2 [--user]\n\n(the optional option *--user* allows to install cypari2 for a single user\nand avoids using pip with administrator rights).\n\n`pip` builds the package using build isolation.  All Python build dependencies\nof the package, declared in pyproject.toml, are automatically installed in\na temporary virtual environment.\n\nIf you want to try the development version, use\n\n::\n\n    $ pip install git+https://github.com/sagemath/cypari2.git [--user]\n\n\nUsage\n-----\n\nThe interface as been kept as close as possible from PARI/GP. The following\ncomputation in GP\n\n::\n\n    ? zeta(2)\n    %1 = 1.6449340668482264364724151666460251892\n\n    ? p = x^3 + x^2 + x - 1;\n    ? modulus = t^3 + t^2 + t - 1;\n    ? fq = factorff(p, 3, modulus);\n    ? centerlift(lift(fq))\n    %5 =\n    [            x - t 1]\n\n    [x + (t^2 + t - 1) 1]\n\n    [   x + (-t^2 - 1) 1]\n\ntranslates into\n\n::\n\n    >>> import cypari2\n    >>> pari = cypari2.Pari()\n\n    >>> pari(2).zeta()\n    1.64493406684823\n\n    >>> p = pari(\"x^3 + x^2 + x - 1\")\n    >>> modulus = pari(\"t^3 + t^2 + t - 1\")\n    >>> fq = p.factorff(3, modulus)\n    >>> fq.lift().centerlift()\n    [x - t, 1; x + (t^2 + t - 1), 1; x + (-t^2 - 1), 1]\n\nThe object **pari** above is the object for the interface and acts as a\nconstructor. It can be called with basic Python objects like integer\nor floating point. When called with a string as in the last example\nthe corresponding string is interpreted as if it was executed in a GP shell.\n\nBeyond the interface object **pari** of type **Pari**, any object you get a\nhandle on is of type **Gen** (that is a wrapper around the **GEN** type from\nlibpari). All PARI/GP functions are then available in their original names as\n*methods* like **zeta**, **factorff**, **lift** or **centerlift** above.\n\nAlternatively, the pari functions are accessible as methods of **pari**. The\nsame computations be done via\n\n::\n\n    >>> import cypari2\n    >>> pari = cypari2.Pari()\n\n    >>> pari.zeta(2)\n    1.64493406684823\n\n    >>> p = pari(\"x^3 + x^2 + x - 1\")\n    >>> modulus = pari(\"t^3 + t^2 + t - 1\")\n    >>> fq = pari.factorff(p, 3, modulus)\n    >>> pari.centerlift(pari.lift(fq))\n    [x - t, 1; x + (t^2 + t - 1), 1; x + (-t^2 - 1), 1]\n\nThe complete documentation of cypari2 is available at http://cypari2.readthedocs.io and\nthe PARI/GP documentation at http://pari.math.u-bordeaux.fr/doc.html\n\nContributing\n------------\n\nCyPari 2 is maintained by the SageMath community.\n\nOpen issues or submit pull requests at https://github.com/sagemath/cypari2\nand join https://groups.google.com/group/sage-devel to discuss.\n",
    "bugtrack_url": null,
    "license": "GNU General Public License, version 2 or later",
    "summary": "A Python interface to the number theory library PARI/GP",
    "version": "2.1.5",
    "project_urls": {
        "Homepage": "https://github.com/sagemath/cypari2"
    },
    "split_keywords": [
        "pari/gp",
        "number",
        "theory"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3353112739a92546ef9a0a2282f277cba1c05f2a76af0f1a3869e8051e3cd6ae",
                "md5": "e9940034c6707a3faeb416f207444e81",
                "sha256": "1a25865c34f20b1dc95830798e34ab6436e278b8e0c80dc7bf0ab34c5db03ab8"
            },
            "downloads": -1,
            "filename": "cypari2-2.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "e9940034c6707a3faeb416f207444e81",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 127119,
            "upload_time": "2024-03-24T18:46:47",
            "upload_time_iso_8601": "2024-03-24T18:46:47.787286Z",
            "url": "https://files.pythonhosted.org/packages/33/53/112739a92546ef9a0a2282f277cba1c05f2a76af0f1a3869e8051e3cd6ae/cypari2-2.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-24 18:46:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sagemath",
    "github_project": "cypari2",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cypari2"
}
        
Elapsed time: 0.22120s