{ "info": { "author": "Martin R. Albrecht", "author_email": "fplll-devel@googlegroups.com", "bugtrack_url": null, "classifiers": [], "description": "fpylll\n======\n\nA Python (2 and 3) wrapper for `fplll `__.\n\n.. image:: https://travis-ci.org/fplll/fpylll.svg?branch=master\n :target: https://travis-ci.org/fplll/fpylll\n.. image:: https://badge.fury.io/py/fpylll.svg\n :target: https://badge.fury.io/py/fpylll\n.. image:: https://readthedocs.org/projects/fpylll/badge/?version=latest\n :target: http://fpylll.readthedocs.io/en/latest/?badge=latest\n\n.. code-block:: python\n\n >>> from fpylll import *\n \n >>> A = IntegerMatrix(50, 50)\n >>> A.randomize(\"ntrulike\", bits=50, q=127)\n >>> A[0].norm()\n 3564748886669202.5\n\n >>> M = GSO.Mat(A)\n >>> M.update_gso()\n >>> M.get_mu(1,0)\n 0.815748944429783\n\n >>> L = LLL.Reduction(M)\n >>> L()\n >>> M.get_mu(1,0)\n 0.41812865497076024\n >>> A[0].norm()\n 24.06241883103193\n\nThe basic BKZ algorithm can be implemented in about 60 pretty readable lines of Python code (cf. `simple_bkz.py `__).\nFor a quick tour of the library, you can check out the `tutorial`.\n \nRequirements\n------------\n\n**fpylll** relies on the following C/C++ libraries:\n\n- `GMP `__ or `MPIR `__ for arbitrary precision integer arithmetic.\n- `MPFR `__ for arbitrary precision floating point arithmetic.\n- `QD `__ for double double and quad double arithmetic (optional).\n- `fplll `__ for pretty much everything.\n\n**fpylll** also relies on\n\n- `Cython `__ for linking Python and C/C++.\n- `cysignals `__ for signal handling such as interrupting C++ code.\n- `py.test `__ for testing Python.\n- `flake8 `__ for linting.\n\nWe also suggest\n\n- `IPython `__ for interacting with Python\n- `Numpy `__ for numerical computations (e.g. with Gram-Schmidt values)\n\nOnline\n------\n\n**fpylll** ships with Sage 7.4. Thus, it is available via `SageMathCell `__ and `SageMathCloud `__ (select a Jupyter notebook with a Sage 7.4 kernel, the default Sage worksheet still runs Sage 7.3 at the time of writing). You can also fire up a `dply.co virtual server `__ with the latest fpylll/fplll preinstalled (it takes perhaps 15 minutes until everything is compiled).\n\nGetting Started\n---------------\n\n**Note:** fpylll is also available via `PyPI `__ and `Conda-Forge `__ for `Conda `__. In what follows, we explain manual installation.\n\nWe recommend `virtualenv `__ for isolating Python build environments and `virtualenvwrapper `__ to manage virtual environments.\n\n1. Create a new virtualenv and activate it:\n\n .. code-block:: bash\n\n $ virtualenv env\n $ source ./env/bin/activate\n\n We indicate active virtualenvs by the prefix ``(fpylll)``.\n\n2. Install the required libraries - `GMP `__ or `MPIR `__ and `MPFR `__ - if not available already. You may also want to install `QD `__.\n\n3. Install fplll:\n\n .. code-block:: bash\n\n $ (fpylll) ./install-dependencies.sh $VIRTUAL_ENV\n\n Some OSX users report that they required ``export CXXFLAGS=\"-stdlib=lic++ -mmacosx-version-min=10.7`` and ``export CXX=clang++`` (after installing a recent clang with `brew `__) since the default GCC installed by Apple does not have full C++11 support.\n \n4. Then, execute:\n\n .. code-block:: bash\n\n $ (fpylll) pip install Cython\n $ (fpylll) pip install -r requirements.txt\n\n to install the required Python packages (see above).\n\n5. If you are so inclined, run:\n\n .. code-block:: bash\n\n $ (fpylll) pip install -r suggestions.txt\n\n to install suggested Python packages as well (optional).\n\n6. Build the Python extension:\n\n .. code-block:: bash\n\n $ (fpylll) export PKG_CONFIG_PATH=\"$VIRTUAL_ENV/lib/pkgconfig:$PKG_CONFIG_PATH\"\n $ (fpylll) python setup.py build_ext\n $ (fpylll) python setup.py install\n\n7. To run **fpylll**, you will need to:\n\n .. code-block:: bash\n\n $ (fpylll) export LD_LIBRARY_PATH=\"$VIRTUAL_ENV/lib\"\n\n so that Python can find fplll and friends.\n\n8. Start Python:\n\n .. code-block:: bash\n\n $ (fpylll) ipython\n\nTo reactivate the virtual environment later, simply run:\n\n .. code-block:: bash\n\n $ source ./env/bin/activate\n\nNote that you can also patch ``activate`` to set ``LD_LIBRRY_PATH``. For this, add:\n\n.. code-block:: bash\n\n ### LD_LIBRARY_HACK\n _OLD_LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"\n LD_LIBRARY_PATH=\"$VIRTUAL_ENV/lib:$LD_LIBRARY_PATH\"\n export LD_LIBRARY_PATH\n ### END_LD_LIBRARY_HACK\n\n ### PKG_CONFIG_HACK\n _OLD_PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\"\n PKG_CONFIG_PATH=\"$VIRTUAL_ENV/lib/pkgconfig:$PKG_CONFIG_PATH\"\n export PKG_CONFIG_PATH\n ### END_PKG_CONFIG_HACK\n\ntowards the end and:\n\n.. code-block:: bash\n\n ### LD_LIBRARY_HACK\n if ! [ -z ${_OLD_LD_LIBRARY_PATH+x} ] ; then\n LD_LIBRARY_PATH=\"$_OLD_LD_LIBRARY_PATH\"\n export LD_LIBRARY_PATH\n unset _OLD_LD_LIBRARY_PATH\n fi\n ### END_LD_LIBRARY_HACK\n\n ### PKG_CONFIG_HACK\n if ! [ -z ${_OLD_PKG_CONFIG_PATH+x} ] ; then\n PKG_CONFIG_PATH=\"$_OLD_PKG_CONFIG_PATH\"\n export PKG_CONFIG_PATH\n unset _OLD_PKG_CONFIG_PATH\n fi\n ### END_PKG_CONFIG_HACK\n\nin the ``deactivate`` function in the ``activate`` script.\n\nMulticore Support\n-----------------\n\n**fpylll** supports parallelisation on multiple cores. For all C++ support to drop the `GIL `_ is enabled, allowing the use of threads to parallelise. Fplll is thread safe as long as each thread works on a separate object such as ``IntegerMatrix`` or ``MatGSO``. Also, **fpylll** does not actually drop the GIL in all calls to C++ functions yet. In many scenarios using `multiprocessing `_, which sidesteps the GIL and thread safety issues by using processes instead of threads, will be the better choice.\n\nThe example below calls ``LLL.reduction`` on 128 matrices of dimension 30 on four worker processes.\n\n.. code-block:: python\n\n from fpylll import IntegerMatrix, LLL\n from multiprocessing import Pool\n\n d, workers, tasks = 30, 4, 128\n \n def run_it(p, f, A, prefix=\"\"):\n \"\"\"Print status during parallel execution.\"\"\" \n import sys\n r = []\n for i, retval in enumerate(p.imap_unordered(f, A, 1)):\n r.append(retval)\n sys.stderr.write('\\r{0} done: {1:.2%}'.format(prefix, float(i)/len(A)))\n sys.stderr.flush()\n sys.stderr.write('\\r{0} done {1:.2%}\\n'.format(prefix, float(i+1)/len(A)))\n return r\n \n A = [IntegerMatrix.random(d, \"uniform\", bits=30) for _ in range(tasks)] \n A = run_it(Pool(workers), LLL.reduction, A)\n\nTo test threading simply replace the line ``from multiprocessing import Pool`` with ``from multiprocessing.pool import ThreadPool as Pool``. For calling ``BKZ.reduction`` this way, which expects a second parameter with options, using `functools.partial `_ is a good choice. \n \nContributing\n------------\n\n**fpylll** welcomes contributions, cf. the list of `open issues `_. To contribute, clone this repository, commit your code on a separate branch and send a pull request. Please write tests for your code. You can run them by calling::\n\n $ (fpylll) py.test\n\nfrom the top-level directory which runs all tests in ``tests/test_*.py``. We run `flake8 `_ on every commit automatically, In particular, we run::\n\n $ (fpylll) flake8 --max-line-length=120 --max-complexity=16 --ignore=E22,E241 src\n\nNote that **fpylll** supports Python 2 and 3. In particular, tests are run using Python 2.7 and 3.5. See `.travis.yml `_ for details on automated testing.\n\nAttribution & License\n---------------------\n\n**fpylll** is maintained by Martin Albrecht.\n\nThe following people have contributed to **fpylll**\n\n+ E M Bray\n+ Fernando Virdia\n+ Guillaume Bonnoron\n+ Jeroen Demeyer\n+ J\u00e9r\u00f4me Benoit\n+ Konstantinos Draziotis\n+ Leo Ducas\n+ Martin Albrecht\n+ Michael Walter\n+ Omer Katz\n+ Fernando Virdia\n\nWe copied a decent bit of code over from Sage, mostly from it's fpLLL interface.\n\n**fpylll** is licensed under the GPLv2+. \n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/fplll/fpylll", "keywords": "", "license": "GNU General Public License, version 2 or later", "maintainer": "", "maintainer_email": "", "name": "fpylll", "package_url": "https://pypi.org/project/fpylll/", "platform": "", "project_url": "https://pypi.org/project/fpylll/", "project_urls": { "Homepage": "https://github.com/fplll/fpylll" }, "release_url": "https://pypi.org/project/fpylll/0.4.0dev/", "requires_dist": null, "requires_python": "", "summary": "A Python interface for https://github.com/fplll/fplll", "version": "0.4.0dev" }, "last_serial": 3876553, "releases": { "0.2.1dev": [ { "comment_text": "", "digests": { "md5": "875ab922ea249cd78d03831ebedaecb5", "sha256": "c2c1c711d95be44165c52c8ae703864558941f8768a14337d36dc4edbb26dcbf" }, "downloads": -1, "filename": "fpylll-0.2.1dev.tar.gz", "has_sig": false, "md5_digest": "875ab922ea249cd78d03831ebedaecb5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54471, "upload_time": "2016-09-08T07:52:47", "url": "https://files.pythonhosted.org/packages/2e/52/625ce257ae89ff7876be6e75cd156da6fa4bc160507b5d18bdb4fd54184e/fpylll-0.2.1dev.tar.gz" } ], "0.2.4dev": [ { "comment_text": "", "digests": { "md5": "cb8c58856a52a033bc2411cdcb02ecae", "sha256": "137f18e0dfb0a0697a297d26c2d253055d4cc196490886fb4c739a7a7b09955f" }, "downloads": -1, "filename": "fpylll-0.2.4dev.tar.gz", "has_sig": false, "md5_digest": "cb8c58856a52a033bc2411cdcb02ecae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 74632, "upload_time": "2017-04-15T12:20:59", "url": "https://files.pythonhosted.org/packages/a8/ba/89a5d5bbf1cd73ac99b4ccdbb585177e13b6d9458adf085d0200570586a7/fpylll-0.2.4dev.tar.gz" } ], "0.2dev": [ { "comment_text": "", "digests": { "md5": "18d889d3569eecdcdf044f87de38b5f3", "sha256": "bcf78c66bd335fda8023f6c83e8351638e591b73bad0a406f736070756d10fd2" }, "downloads": -1, "filename": "fpylll-0.2dev.tar.gz", "has_sig": false, "md5_digest": "18d889d3569eecdcdf044f87de38b5f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54081, "upload_time": "2016-08-26T14:40:04", "url": "https://files.pythonhosted.org/packages/82/56/42f8542fe0a27b43e690e6968f7ba97a2db0f6a6fd7b0846bb2ae20e64ea/fpylll-0.2dev.tar.gz" } ], "0.3.0dev": [ { "comment_text": "", "digests": { "md5": "8402e0e3e10ec5e11aef5dc8c6769464", "sha256": "e9daf76351f4ef7d93d54578f45318980bfa45901145f525ef5977eb0480532e" }, "downloads": -1, "filename": "fpylll-0.3.0dev.tar.gz", "has_sig": false, "md5_digest": "8402e0e3e10ec5e11aef5dc8c6769464", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 88915, "upload_time": "2017-09-11T14:12:15", "url": "https://files.pythonhosted.org/packages/1e/b8/1bcb8911dbf7211d0008d21578ad04194a5993b6021c2300ca74a676847e/fpylll-0.3.0dev.tar.gz" } ], "0.4.0dev": [ { "comment_text": "", "digests": { "md5": "ea5162875f70f752f8b181447bcdd1b1", "sha256": "905b5ec906be244c8e066914b951a92836f887c34c9ae49a57152884c537fac0" }, "downloads": -1, "filename": "fpylll-0.4.0dev.tar.gz", "has_sig": false, "md5_digest": "ea5162875f70f752f8b181447bcdd1b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 137815, "upload_time": "2018-05-18T15:22:43", "url": "https://files.pythonhosted.org/packages/a3/9c/138632761ef58181e32b7c3ec9eb86269b9ace0ccb210cddcae3459b20f5/fpylll-0.4.0dev.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ea5162875f70f752f8b181447bcdd1b1", "sha256": "905b5ec906be244c8e066914b951a92836f887c34c9ae49a57152884c537fac0" }, "downloads": -1, "filename": "fpylll-0.4.0dev.tar.gz", "has_sig": false, "md5_digest": "ea5162875f70f752f8b181447bcdd1b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 137815, "upload_time": "2018-05-18T15:22:43", "url": "https://files.pythonhosted.org/packages/a3/9c/138632761ef58181e32b7c3ec9eb86269b9ace0ccb210cddcae3459b20f5/fpylll-0.4.0dev.tar.gz" } ] }