From cdf501f96008303331b78fa398aa039a080c23fb Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 24 Jun 2020 23:10:15 -0700 Subject: [PATCH 01/23] build/pkgs/sagelib/spkg-src: New --- build/pkgs/sagelib/spkg-src | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 build/pkgs/sagelib/spkg-src diff --git a/build/pkgs/sagelib/spkg-src b/build/pkgs/sagelib/spkg-src new file mode 100644 index 00000000000..d8e308186b5 --- /dev/null +++ b/build/pkgs/sagelib/spkg-src @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# Script to prepare an sdist tarball for sagelib +# This script is not used during build. +# +# HOW TO MAKE THE TARBALL: +# ./sage --sh build/pkgs/sagelib/spkg-src + +if [ -z "$SAGE_ROOT" ] ; then + echo >&2 "Error - SAGE_ROOT undefined ... exiting" + echo >&2 "Maybe run 'sage -sh'?" + exit 1 +fi + +# Exit on failure +set -e + +cd build/pkgs/sagelib + +cd src +sage-python23 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES" From ef4f5b8b6536243e494faa80148cf0bbb0b348b4 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 16 May 2020 22:41:26 -0700 Subject: [PATCH 02/23] Move src/MANIFEST.in to build/pkgs/sagelib/MANIFEST.in, fix up --- build/pkgs/sagelib/src/MANIFEST.in | 8 +++++++ src/MANIFEST.in | 38 ------------------------------ 2 files changed, 8 insertions(+), 38 deletions(-) create mode 100644 build/pkgs/sagelib/src/MANIFEST.in delete mode 100644 src/MANIFEST.in diff --git a/build/pkgs/sagelib/src/MANIFEST.in b/build/pkgs/sagelib/src/MANIFEST.in new file mode 100644 index 00000000000..182574a572a --- /dev/null +++ b/build/pkgs/sagelib/src/MANIFEST.in @@ -0,0 +1,8 @@ +global-include *.c *.cc *.cpp *.h *.hh *.hpp *.inc *.py *.pyx *.pxd *.pxi *.rst *.txt *.tex + +include MANIFEST.in + +prune .tox + +graft sage/libs/gap/test +recursive-exclude sage/ext/interpreters *.c *.h *.pyx *.pxd diff --git a/src/MANIFEST.in b/src/MANIFEST.in deleted file mode 100644 index ecc887652cb..00000000000 --- a/src/MANIFEST.in +++ /dev/null @@ -1,38 +0,0 @@ -global-include *.c *.cc *.cpp *.h *.hh *.hpp *.inc *.py *.pyx *.pxd *.pxi *.rst *.txt *.tex - -include MANIFEST.in - -graft sage/libs/gap/test -recursive-include sage -recursive-exclude sage/ext/interpreters *.c *.h *.pyx *.pxd -exclude sage/modular/arithgroup/farey_symbol.h -exclude sage/rings/real_mpfi.h -exclude sage/symbolic/pynac.h - -graft doc/common/static -graft doc/common/themes -include doc/common/python.inv -include doc/common/update-python-inv.sh -include doc/en/introspect/static/empty -include doc/en/introspect/templates/layout.html -include doc/en/website/static/pdf.png -include doc/en/website/templates/index.html -include doc/en/a_tour_of_sage/eigen_plot.png -include doc/en/a_tour_of_sage/sin_plot.png -include doc/en/bordeaux_2008/birch.png -include doc/en/bordeaux_2008/modpcurve.png -include doc/en/developer/sagenb/branch_dropdown.png -include doc/en/developer/sagenb/forking_button.png -include doc/en/developer/sagenb/pull_button.png -include doc/fr/a_tour_of_sage/eigen_plot.png -include doc/fr/a_tour_of_sage/sin_plot.png -include doc/tr/a_tour_of_sage/eigen_plot.png -include doc/tr/a_tour_of_sage/sin_plot.png -include doc/pt/a_tour_of_sage/eigen_plot.png -include doc/pt/a_tour_of_sage/sin_plot.png -graft doc/en/reference/*/media -graft doc/en/thematic_tutorials/media -graft doc/en/prep/media -prune doc/en/reference/*/sage -prune doc/en/reference/*/sagenb -prune doc/output From 233f6baf8f2d701104232601ad6fb7362fef7071 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 28 Jun 2020 10:39:32 -0700 Subject: [PATCH 03/23] build/pkgs/sagelib/src/requirements.txt, tox.ini: New --- build/pkgs/sagelib/src/requirements.txt | 12 ++++++++++ build/pkgs/sagelib/src/tox.ini | 32 +++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 build/pkgs/sagelib/src/requirements.txt create mode 100644 build/pkgs/sagelib/src/tox.ini diff --git a/build/pkgs/sagelib/src/requirements.txt b/build/pkgs/sagelib/src/requirements.txt new file mode 100644 index 00000000000..cd2008a2274 --- /dev/null +++ b/build/pkgs/sagelib/src/requirements.txt @@ -0,0 +1,12 @@ +#sage_conf +sage_setup @ file:///Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/upstream/sage-setup-0.0.0.tar.gz +six # use of six should be removed from sage_setup +Cython==0.29.17 +pkgconfig +cysignals +gmpy2==2.1.0b1 + +numpy # already needed by sage.env +jinja2 # sage_setup.autogen.interpreters + +cypari2 # but building bdist_wheel of cypari2 fails with recent pip... https://github.com/sagemath/cypari2/issues/93 diff --git a/build/pkgs/sagelib/src/tox.ini b/build/pkgs/sagelib/src/tox.ini new file mode 100644 index 00000000000..0a00d2cfdf3 --- /dev/null +++ b/build/pkgs/sagelib/src/tox.ini @@ -0,0 +1,32 @@ +# First pip-install tox: +# +# ./sage -pip install tox +# +# To build and test in the tox environment: +# +# ./sage -sh -c '(cd build/pkgs/sagelib/src && tox)' +# +# To test interactively: +# +# build/pkgs/sagelib/src/.tox/python/bin/python +# +[tox] + +[testenv] +deps = -rrequirements.txt + +## passenv = +## PATH +## CC +## CXX + +setenv = + # Sage scripts such as sage-runtests like to use $HOME/.sage + HOME={envdir} + +whitelist_externals = + bash + +commands = + # Beware of the treacherous non-src layout. "./sage/" shadows the install sage package. + python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.all' From 177cd4c40a9f74a547f605375ad501aa986c39ec Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 28 Jun 2020 11:25:39 -0700 Subject: [PATCH 04/23] build/pkgs/sagelib/src/MANIFEST.in: Prune sage/ext/interpreters --- build/pkgs/sagelib/src/MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/sagelib/src/MANIFEST.in b/build/pkgs/sagelib/src/MANIFEST.in index 182574a572a..7123d149222 100644 --- a/build/pkgs/sagelib/src/MANIFEST.in +++ b/build/pkgs/sagelib/src/MANIFEST.in @@ -5,4 +5,4 @@ include MANIFEST.in prune .tox graft sage/libs/gap/test -recursive-exclude sage/ext/interpreters *.c *.h *.pyx *.pxd +prune sage/ext/interpreters # In particular, __init__.py must not be present in the distribution; or sage_setup.autogen.interpreters.rebuild will not generate the code From 07b29fbe8af49c018f4b6453fe31225f7a9bc53c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 28 Jun 2020 11:26:12 -0700 Subject: [PATCH 05/23] build/pkgs/sagelib/src/requirements.txt: Add packages required for runtime --- build/pkgs/sagelib/src/requirements.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/pkgs/sagelib/src/requirements.txt b/build/pkgs/sagelib/src/requirements.txt index cd2008a2274..c75cebeed89 100644 --- a/build/pkgs/sagelib/src/requirements.txt +++ b/build/pkgs/sagelib/src/requirements.txt @@ -10,3 +10,8 @@ numpy # already needed by sage.env jinja2 # sage_setup.autogen.interpreters cypari2 # but building bdist_wheel of cypari2 fails with recent pip... https://github.com/sagemath/cypari2/issues/93 + +########## Runtime + +psutil +pexpect From ad3370590f559c4a13132896d31054b939ffaea5 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 28 Jun 2020 11:26:42 -0700 Subject: [PATCH 06/23] Suggest tox -v -v --- build/pkgs/sagelib/src/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/sagelib/src/tox.ini b/build/pkgs/sagelib/src/tox.ini index 0a00d2cfdf3..ee3c3df1d7d 100644 --- a/build/pkgs/sagelib/src/tox.ini +++ b/build/pkgs/sagelib/src/tox.ini @@ -4,7 +4,7 @@ # # To build and test in the tox environment: # -# ./sage -sh -c '(cd build/pkgs/sagelib/src && tox)' +# ./sage -sh -c '(cd build/pkgs/sagelib/src && tox -v -v)' # # To test interactively: # From 481e2128aa39dd1f9961955e51575d6bebb5031b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 23 Jun 2020 19:31:30 -0700 Subject: [PATCH 07/23] .gitignore: Ignore generated files in build/pkgs/*/src --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index d91c194b1b1..756cedd3bab 100644 --- a/.gitignore +++ b/.gitignore @@ -101,6 +101,11 @@ gitlab-build-docker.log /src/bin/sage-env-config /build/bin/sage-build-env-config +/build/pkgs/*/src/build +/build/pkgs/*/src/dist +/build/pkgs/*/src/MANIFEST +/build/pkgs/*/src/*.egg-info + ####################### # tox generated files # ####################### From 9955a3ff69870ff844e5ebb45cf47c4b6f214263 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 28 Jun 2020 11:46:06 -0700 Subject: [PATCH 08/23] Build sagelib from build/pkgs/sagelib/src --- .gitignore | 1 + build/pkgs/sagelib/spkg-install | 2 +- build/pkgs/sagelib/src/bin | 1 + build/pkgs/sagelib/src/requirements.txt | 2 +- build/pkgs/sagelib/src/sage | 1 + build/pkgs/sagelib/src/sage_setup | 1 + build/pkgs/sagelib/src/setup.py | 1 + 7 files changed, 7 insertions(+), 2 deletions(-) create mode 120000 build/pkgs/sagelib/src/bin create mode 120000 build/pkgs/sagelib/src/sage create mode 120000 build/pkgs/sagelib/src/sage_setup create mode 120000 build/pkgs/sagelib/src/setup.py diff --git a/.gitignore b/.gitignore index 756cedd3bab..35b0d843d7a 100644 --- a/.gitignore +++ b/.gitignore @@ -105,6 +105,7 @@ gitlab-build-docker.log /build/pkgs/*/src/dist /build/pkgs/*/src/MANIFEST /build/pkgs/*/src/*.egg-info +/build/pkgs/*/src/.tox ####################### # tox generated files # diff --git a/build/pkgs/sagelib/spkg-install b/build/pkgs/sagelib/spkg-install index 0fa42a7e912..0848bc307e3 100755 --- a/build/pkgs/sagelib/spkg-install +++ b/build/pkgs/sagelib/spkg-install @@ -1,5 +1,5 @@ #!/usr/bin/env bash -cd "$SAGE_SRC" +cd src ## All sagelib-building is done by setup.py. ## This is so that sagelib can be installed by standard Python procedures, ## such as "./setup.py install" or "pip install ." diff --git a/build/pkgs/sagelib/src/bin b/build/pkgs/sagelib/src/bin new file mode 120000 index 00000000000..459186de7e0 --- /dev/null +++ b/build/pkgs/sagelib/src/bin @@ -0,0 +1 @@ +../../../../src/bin \ No newline at end of file diff --git a/build/pkgs/sagelib/src/requirements.txt b/build/pkgs/sagelib/src/requirements.txt index c75cebeed89..ba1dd3d54c2 100644 --- a/build/pkgs/sagelib/src/requirements.txt +++ b/build/pkgs/sagelib/src/requirements.txt @@ -1,5 +1,5 @@ #sage_conf -sage_setup @ file:///Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/upstream/sage-setup-0.0.0.tar.gz +#sage_setup six # use of six should be removed from sage_setup Cython==0.29.17 pkgconfig diff --git a/build/pkgs/sagelib/src/sage b/build/pkgs/sagelib/src/sage new file mode 120000 index 00000000000..c4f2d5df534 --- /dev/null +++ b/build/pkgs/sagelib/src/sage @@ -0,0 +1 @@ +../../../../src/sage \ No newline at end of file diff --git a/build/pkgs/sagelib/src/sage_setup b/build/pkgs/sagelib/src/sage_setup new file mode 120000 index 00000000000..a2cca6f09f7 --- /dev/null +++ b/build/pkgs/sagelib/src/sage_setup @@ -0,0 +1 @@ +../../../../src/sage_setup \ No newline at end of file diff --git a/build/pkgs/sagelib/src/setup.py b/build/pkgs/sagelib/src/setup.py new file mode 120000 index 00000000000..884bbad9470 --- /dev/null +++ b/build/pkgs/sagelib/src/setup.py @@ -0,0 +1 @@ +../../../../src/setup.py \ No newline at end of file From 516358b66059dbf458ed7c970ff05923b539b71c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 28 Jun 2020 13:48:30 -0700 Subject: [PATCH 09/23] build/pkgs/sagelib/src/tox.ini: Pass SAGE_LOCAL --- build/pkgs/sagelib/src/tox.ini | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/pkgs/sagelib/src/tox.ini b/build/pkgs/sagelib/src/tox.ini index ee3c3df1d7d..e48f7eb0b01 100644 --- a/build/pkgs/sagelib/src/tox.ini +++ b/build/pkgs/sagelib/src/tox.ini @@ -15,10 +15,8 @@ [testenv] deps = -rrequirements.txt -## passenv = -## PATH -## CC -## CXX +passenv = + SAGE_LOCAL setenv = # Sage scripts such as sage-runtests like to use $HOME/.sage From eaced098339d5c7655244667b3dd1c90f5fd7f9e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 28 Jun 2020 15:52:19 -0700 Subject: [PATCH 10/23] build/pkgs/sagelib: Add remaining Python dependencies for sage.all --- build/pkgs/sagelib/src/requirements.txt | 2 ++ build/pkgs/sagelib/src/tox.ini | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build/pkgs/sagelib/src/requirements.txt b/build/pkgs/sagelib/src/requirements.txt index ba1dd3d54c2..1e5647c8608 100644 --- a/build/pkgs/sagelib/src/requirements.txt +++ b/build/pkgs/sagelib/src/requirements.txt @@ -15,3 +15,5 @@ cypari2 # but building bdist_wheel of cypari2 fails with recent pip... ht psutil pexpect +pplpy +ipython<=5.8 diff --git a/build/pkgs/sagelib/src/tox.ini b/build/pkgs/sagelib/src/tox.ini index e48f7eb0b01..d58eb823aa8 100644 --- a/build/pkgs/sagelib/src/tox.ini +++ b/build/pkgs/sagelib/src/tox.ini @@ -27,4 +27,9 @@ whitelist_externals = commands = # Beware of the treacherous non-src layout. "./sage/" shadows the install sage package. - python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.all' + python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.all; print(sage.all.__file__)' + + # FIXME: The following loads sage-env, which loads the wrong Python. + sage -c 'import sys; print("sys.path =", sys.path); import sage.all; print(sage.all.__file__)' + + #sage -t --all From b8e366ec56a9d3527c81df9d8d4206afc2562be4 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 28 Jun 2020 17:11:11 -0700 Subject: [PATCH 11/23] build/pkgs/sagelib/spkg-src: chmod +x --- build/pkgs/sagelib/spkg-src | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 build/pkgs/sagelib/spkg-src diff --git a/build/pkgs/sagelib/spkg-src b/build/pkgs/sagelib/spkg-src old mode 100644 new mode 100755 From 3aa2d8e86d4f18101c248fe5e3c59715ce194309 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 2 Aug 2020 17:53:04 -0700 Subject: [PATCH 12/23] src/module_list.py: Remove --- src/module_list.py | 1220 -------------------------------------------- 1 file changed, 1220 deletions(-) delete mode 100644 src/module_list.py diff --git a/src/module_list.py b/src/module_list.py deleted file mode 100644 index 6f6395f6efc..00000000000 --- a/src/module_list.py +++ /dev/null @@ -1,1220 +0,0 @@ -######################################################### -### -### OBSOLETE FILE - DO NOT ADD TO IT -### -### See https://trac.sagemath.org/ticket/29701 -### -######################################################### - -import os -from distutils.extension import Extension -from sage.env import SAGE_LOCAL - -SAGE_INC = os.path.join(SAGE_LOCAL, 'include') - -######################################################### -### pkg-config setup -######################################################### - -import pkgconfig - -# CBLAS can be one of multiple implementations -cblas_pc = pkgconfig.parse('cblas') -cblas_libs = cblas_pc['libraries'] -cblas_library_dirs = cblas_pc['library_dirs'] -cblas_include_dirs = cblas_pc['include_dirs'] - -# TODO: Remove Cygwin hack by installing a suitable cblas.pc -if os.path.exists('/usr/lib/libblas.dll.a'): - cblas_libs = ['gslcblas'] - -# LAPACK can be one of multiple implementations -lapack_pc = pkgconfig.parse('lapack') -lapack_libs = lapack_pc['libraries'] -lapack_library_dirs = lapack_pc['library_dirs'] -lapack_include_dirs = lapack_pc['include_dirs'] - -# GD image library -gd_pc = pkgconfig.parse('gdlib') -gd_libs = gd_pc['libraries'] -gd_library_dirs = gd_pc['library_dirs'] -gd_include_dirs = gd_pc['include_dirs'] - -# PNG image library -png_pc = pkgconfig.parse('libpng') -png_libs = png_pc['libraries'] -png_library_dirs = png_pc['library_dirs'] -png_include_dirs = png_pc['include_dirs'] - -# zlib -try: - zlib_pc = pkgconfig.parse('zlib') -except pkgconfig.PackageNotFoundError: - from collections import defaultdict - zlib_pc = defaultdict(list, {'libraries': ['z']}) -zlib_libs = zlib_pc['libraries'] -zlib_library_dirs = zlib_pc['library_dirs'] -zlib_include_dirs = zlib_pc['include_dirs'] - -######################################################### -### M4RI flags -######################################################### - -m4ri_pc = pkgconfig.parse('m4ri') -m4ri_libs = m4ri_pc['libraries'] -m4ri_library_dirs = m4ri_pc['library_dirs'] -m4ri_include_dirs = m4ri_pc['include_dirs'] - -m4ri_extra_compile_args = pkgconfig.cflags('m4ri').split() -try: - m4ri_extra_compile_args.remove("-pedantic") -except ValueError: - pass - -from sage.env import cython_aliases -aliases = cython_aliases() -arb_dylib_name = aliases["ARB_LIBRARY"] - -############################################################# -### List of modules -### -### Note that the list of modules is sorted alphabetically -### by extension name. Please keep this list sorted when -### adding new modules! -### -############################################################# - -from sage_setup.optional_extension import OptionalExtension - -ext_modules = [ - - ################################ - ## - ## sage.algebras - ## - ################################ - - Extension('*', ['sage/algebras/**/*.pyx']), - - ################################ - ## - ## sage.arith - ## - ################################ - - Extension('*', ['sage/arith/*.pyx']), - - ################################ - ## - ## sage.calculus - ## - ################################ - - Extension('*', ['sage/calculus/**/*.pyx']), - - ################################ - ## - ## sage.categories - ## - ################################ - - Extension('*', ['sage/categories/**/*.pyx']), - - ################################ - ## - ## sage.coding - ## - ################################ - - Extension('sage.coding.codecan.codecan', - sources = ['sage/coding/codecan/codecan.pyx']), - - Extension('sage.coding.kasami_codes', - sources = ['sage/coding/kasami_codes.pyx']), - - Extension('*', ['sage/coding/**/*.pyx']), - - ################################ - ## - ## sage.combinat - ## - ################################ - - Extension('*', ['sage/combinat/**/*.pyx']), - - Extension('sage.combinat.subword_complex_c', - sources=['sage/combinat/subword_complex_c.pyx']), - - ################################ - ## - ## sage.cpython - ## - ################################ - - Extension('*', ['sage/cpython/*.pyx']), - - ################################ - ## - ## sage.crypto - ## - ################################ - - Extension('*', ['sage/crypto/*.pyx']), - - ################################ - ## - ## sage.data_structures - ## - ################################ - - Extension('*', ['sage/data_structures/*.pyx']), - - ################################ - ## - ## sage.docs - ## - ################################ - - Extension('*', ['sage/docs/*.pyx']), - - ################################ - ## - ## sage.dynamics - ## - ################################ - - Extension('sage.dynamics.arithmetic_dynamics.projective_ds_helper', - sources = ['sage/dynamics/arithmetic_dynamics/projective_ds_helper.pyx']), - - Extension('sage.dynamics.complex_dynamics.mandel_julia_helper', - sources = ['sage/dynamics/complex_dynamics/mandel_julia_helper.pyx']), - - ################################ - ## - ## sage.ext - ## - ################################ - - Extension('*', ['sage/ext/**/*.pyx']), - - ################################ - ## - ## sage.finance - ## - ################################ - - Extension('*', ['sage/finance/*.pyx']), - - ################################ - ## - ## sage.functions - ## - ################################ - - Extension('sage.functions.prime_pi', - sources = ['sage/functions/prime_pi.pyx']), - - ################################ - ## - ## sage.games - ## - ################################ - - Extension('*', ['sage/games/*.pyx']), - - ################################ - ## - ## sage.geometry - ## - ################################ - - Extension('*', ['sage/geometry/**/*.pyx']), - - ################################ - ## - ## sage.graphs - ## - ################################ - - Extension('sage.graphs.asteroidal_triples', - sources = ['sage/graphs/asteroidal_triples.pyx']), - - Extension('sage.graphs.chrompoly', - sources = ['sage/graphs/chrompoly.pyx']), - - Extension('sage.graphs.cliquer', - sources = ['sage/graphs/cliquer.pyx']), - - Extension('sage.graphs.centrality', - sources = ['sage/graphs/centrality.pyx']), - - Extension('sage.graphs.independent_sets', - sources = ['sage/graphs/independent_sets.pyx']), - - Extension('sage.graphs.isoperimetric_inequalities', - sources = ['sage/graphs/isoperimetric_inequalities.pyx']), - - Extension('sage.graphs.graph_decompositions.fast_digraph', - sources = ['sage/graphs/graph_decompositions/fast_digraph.pyx']), - - Extension('sage.graphs.graph_decompositions.vertex_separation', - sources = ['sage/graphs/graph_decompositions/vertex_separation.pyx']), - - Extension('sage.graphs.graph_decompositions.graph_products', - sources = ['sage/graphs/graph_decompositions/graph_products.pyx']), - - Extension('sage.graphs.convexity_properties', - sources = ['sage/graphs/convexity_properties.pyx']), - - Extension('sage.graphs.comparability', - sources = ['sage/graphs/comparability.pyx']), - - Extension('sage.graphs.generic_graph_pyx', - sources = ['sage/graphs/generic_graph_pyx.pyx']), - - Extension('sage.graphs.traversals', - sources = ['sage/graphs/traversals.pyx']), - - Extension('sage.graphs.graph_generators_pyx', - sources = ['sage/graphs/graph_generators_pyx.pyx']), - - Extension('sage.graphs.distances_all_pairs', - sources = ['sage/graphs/distances_all_pairs.pyx']), - - Extension('sage.graphs.base.graph_backends', - sources = ['sage/graphs/base/graph_backends.pyx']), - - Extension('sage.graphs.base.static_dense_graph', - sources = ['sage/graphs/base/static_dense_graph.pyx']), - - Extension('sage.graphs.base.static_sparse_graph', - sources = ['sage/graphs/base/static_sparse_graph.pyx']), - - Extension('sage.graphs.base.static_sparse_backend', - sources = ['sage/graphs/base/static_sparse_backend.pyx']), - - Extension('sage.graphs.graph_coloring', - sources = ['sage/graphs/graph_coloring.pyx']), - - Extension('sage.graphs.line_graph', - sources = ['sage/graphs/line_graph.pyx']), - - Extension('sage.graphs.weakly_chordal', - sources = ['sage/graphs/weakly_chordal.pyx']), - - Extension('sage.graphs.matchpoly', - sources = ['sage/graphs/matchpoly.pyx']), - - OptionalExtension("sage.graphs.mcqd", - ["sage/graphs/mcqd.pyx"], - package = 'mcqd'), - - OptionalExtension("sage.graphs.bliss", - ["sage/graphs/bliss.pyx"], - package = 'bliss'), - - Extension('sage.graphs.planarity', - sources = ['sage/graphs/planarity.pyx']), - - Extension('sage.graphs.strongly_regular_db', - sources = ['sage/graphs/strongly_regular_db.pyx']), - - Extension('sage.graphs.graph_decompositions.rankwidth', - sources = ['sage/graphs/graph_decompositions/rankwidth.pyx']), - - Extension('sage.graphs.graph_decompositions.bandwidth', - sources = ['sage/graphs/graph_decompositions/bandwidth.pyx']), - - Extension('sage.graphs.graph_decompositions.cutwidth', - sources = ['sage/graphs/graph_decompositions/cutwidth.pyx']), - - OptionalExtension('sage.graphs.graph_decompositions.tdlib', - sources = ['sage/graphs/graph_decompositions/tdlib.pyx'], - package = 'tdlib'), - - Extension('sage.graphs.graph_decompositions.clique_separators', - sources = ['sage/graphs/graph_decompositions/clique_separators.pyx']), - - Extension('sage.graphs.spanning_tree', - sources = ['sage/graphs/spanning_tree.pyx']), - - Extension('sage.graphs.path_enumeration', - sources = ['sage/graphs/path_enumeration.pyx']), - - Extension('sage.graphs.connectivity', - sources = ['sage/graphs/connectivity.pyx']), - - Extension('sage.graphs.trees', - sources = ['sage/graphs/trees.pyx']), - - Extension('sage.graphs.genus', - sources = ['sage/graphs/genus.pyx']), - - Extension('sage.graphs.hyperbolicity', - sources = ['sage/graphs/hyperbolicity.pyx']), - - Extension('sage.graphs.base.c_graph', - sources = ['sage/graphs/base/c_graph.pyx']), - - Extension('sage.graphs.base.sparse_graph', - sources = ['sage/graphs/base/sparse_graph.pyx']), - - Extension('sage.graphs.base.dense_graph', - sources = ['sage/graphs/base/dense_graph.pyx']), - - Extension('sage.graphs.base.boost_graph', - sources = ['sage/graphs/base/boost_graph.pyx']), - - Extension('sage.graphs.views', - sources = ['sage/graphs/views.pyx']), - - ################################ - ## - ## sage.groups - ## - ################################ - - Extension('*', ['sage/groups/**/*.pyx']), - - ################################ - ## - ## sage.interacts - ## - ################################ - - Extension('*', ['sage/interacts/*.pyx']), - - ################################ - ## - ## sage.interfaces - ## - ################################ - - OptionalExtension("sage.interfaces.primecount", - ["sage/interfaces/primecount.pyx"], - package = "primecount"), - - Extension('*', ['sage/interfaces/*.pyx']), - - ################################ - ## - ## sage.lfunctions - ## - ################################ - - Extension('sage.lfunctions.zero_sums', - sources = ['sage/lfunctions/zero_sums.pyx']), - - ################################ - ## - ## sage.libs - ## - ################################ - - OptionalExtension('sage.libs.coxeter3.coxeter', - sources = ['sage/libs/coxeter3/coxeter.pyx'], - package = 'coxeter3'), - - Extension('sage.libs.ecl', - sources = ["sage/libs/ecl.pyx"]), - - OptionalExtension("sage.libs.fes", - ["sage/libs/fes.pyx"], - package = 'fes'), - - Extension('sage.libs.flint.flint', - sources = ["sage/libs/flint/flint.pyx"]), - - Extension('sage.libs.flint.fmpz_poly', - sources = ["sage/libs/flint/fmpz_poly.pyx"]), - - Extension('sage.libs.flint.arith', - sources = ["sage/libs/flint/arith.pyx"]), - - Extension("sage.libs.glpk.error", - ["sage/libs/glpk/error.pyx"]), - - Extension('sage.libs.gmp.pylong', - sources = ['sage/libs/gmp/pylong.pyx']), - - Extension('sage.libs.braiding', - sources = ["sage/libs/braiding.pyx"]), - - Extension('sage.libs.homfly', - sources = ["sage/libs/homfly.pyx"]), - - OptionalExtension('sage.libs.sirocco', - sources = ["sage/libs/sirocco.pyx"], - package="sirocco"), - - Extension('*', ['sage/libs/linbox/*.pyx']), - - Extension('sage.libs.lcalc.lcalc_Lfunction', - sources = ['sage/libs/lcalc/lcalc_Lfunction.pyx']), - - Extension('sage.libs.libecm', - sources = ['sage/libs/libecm.pyx']), - - Extension('sage.libs.lrcalc.lrcalc', - sources = ["sage/libs/lrcalc/lrcalc.pyx"]), - - OptionalExtension("sage.libs.meataxe", - sources = ['sage/libs/meataxe.pyx'], - package = 'meataxe'), - - Extension('*', ['sage/libs/pari/*.pyx']), - - Extension('sage.libs.ppl', - sources = ['sage/libs/ppl.pyx']), - - Extension('*', ['sage/libs/pynac/*.pyx']), - - Extension('sage.libs.ratpoints', - sources = ["sage/libs/ratpoints.pyx"]), - - Extension('sage.libs.readline', - sources = ['sage/libs/readline.pyx']), - - Extension('*', sources = ['sage/libs/singular/*.pyx']), - - Extension('sage.libs.symmetrica.symmetrica', - sources = ["sage/libs/symmetrica/symmetrica.pyx"]), - - Extension('sage.libs.mpmath.utils', - sources = ["sage/libs/mpmath/utils.pyx"]), - - Extension('sage.libs.mpmath.ext_impl', - sources = ["sage/libs/mpmath/ext_impl.pyx"]), - - Extension('sage.libs.mpmath.ext_main', - sources = ["sage/libs/mpmath/ext_main.pyx"]), - - Extension('sage.libs.mpmath.ext_libmp', - sources = ["sage/libs/mpmath/ext_libmp.pyx"]), - - ################################### - ## - ## sage.libs.arb - ## - ################################### - - Extension('*', ["sage/libs/arb/*.pyx"]), - - ################################### - ## - ## sage.libs.eclib - ## - ################################### - - Extension('*', ["sage/libs/eclib/*.pyx"]), - - ################################ - ## - ## sage.libs.gap - ## - ################################ - - Extension('*', ["sage/libs/gap/*.pyx"]), - - ################################### - ## - ## sage.libs.gsl - ## - ################################### - - Extension('*', ["sage/libs/gsl/*.pyx"]), - - ################################### - ## - ## sage.libs.ntl - ## - ################################### - - Extension('*', ["sage/libs/ntl/*.pyx"]), - - ################################ - ## - ## sage.matrix - ## - ################################ - - Extension('sage.matrix.action', - sources = ['sage/matrix/action.pyx']), - - Extension('sage.matrix.args', - sources = ['sage/matrix/args.pyx']), - - Extension('sage.matrix.echelon_matrix', - sources = ['sage/matrix/echelon_matrix.pyx']), - - Extension('sage.matrix.change_ring', - sources = ['sage/matrix/change_ring.pyx']), - - Extension('sage.matrix.constructor', - sources = ['sage/matrix/constructor.pyx']), - - Extension('sage.matrix.matrix', - sources = ['sage/matrix/matrix.pyx']), - - Extension('sage.matrix.matrix0', - sources = ['sage/matrix/matrix0.pyx']), - - Extension('sage.matrix.matrix1', - sources = ['sage/matrix/matrix1.pyx']), - - Extension('sage.matrix.matrix2', - sources = ['sage/matrix/matrix2.pyx']), - - Extension("sage.matrix.matrix_complex_ball_dense", - ["sage/matrix/matrix_complex_ball_dense.pyx"]), - - Extension('sage.matrix.matrix_complex_double_dense', - sources = ['sage/matrix/matrix_complex_double_dense.pyx']), - - Extension('sage.matrix.matrix_cyclo_dense', - sources = ['sage/matrix/matrix_cyclo_dense.pyx']), - - Extension('sage.matrix.matrix_gap', - sources = ['sage/matrix/matrix_gap.pyx']), - - Extension('sage.matrix.matrix_dense', - sources = ['sage/matrix/matrix_dense.pyx']), - - Extension('sage.matrix.matrix_double_dense', - sources = ['sage/matrix/matrix_double_dense.pyx']), - - Extension('sage.matrix.matrix_generic_dense', - sources = ['sage/matrix/matrix_generic_dense.pyx']), - - Extension('sage.matrix.matrix_generic_sparse', - sources = ['sage/matrix/matrix_generic_sparse.pyx']), - - Extension('sage.matrix.matrix_integer_dense', - sources = ['sage/matrix/matrix_integer_dense.pyx']), - - Extension('sage.matrix.matrix_integer_sparse', - sources = ['sage/matrix/matrix_integer_sparse.pyx']), - - Extension('sage.matrix.matrix_mod2_dense', - sources = ['sage/matrix/matrix_mod2_dense.pyx']), - - Extension('sage.matrix.matrix_gf2e_dense', - sources = ['sage/matrix/matrix_gf2e_dense.pyx']), - - Extension('sage.matrix.matrix_modn_dense_float', - sources = ['sage/matrix/matrix_modn_dense_float.pyx']), - - Extension('sage.matrix.matrix_modn_dense_double', - sources = ['sage/matrix/matrix_modn_dense_double.pyx']), - - Extension('sage.matrix.matrix_modn_sparse', - sources = ['sage/matrix/matrix_modn_sparse.pyx']), - - Extension('sage.matrix.matrix_mpolynomial_dense', - sources = ['sage/matrix/matrix_mpolynomial_dense.pyx']), - - Extension('sage.matrix.matrix_polynomial_dense', - sources = ['sage/matrix/matrix_polynomial_dense.pyx']), - - Extension('sage.matrix.matrix_rational_dense', - sources = ['sage/matrix/matrix_rational_dense.pyx']), - - Extension('sage.matrix.matrix_rational_sparse', - sources = ['sage/matrix/matrix_rational_sparse.pyx']), - - Extension('sage.matrix.matrix_real_double_dense', - sources = ['sage/matrix/matrix_real_double_dense.pyx']), - - Extension('sage.matrix.matrix_sparse', - sources = ['sage/matrix/matrix_sparse.pyx']), - - Extension('sage.matrix.matrix_symbolic_dense', - sources = ['sage/matrix/matrix_symbolic_dense.pyx']), - - Extension('sage.matrix.matrix_window', - sources = ['sage/matrix/matrix_window.pyx']), - - OptionalExtension("sage.matrix.matrix_gfpn_dense", - sources = ['sage/matrix/matrix_gfpn_dense.pyx'], - package = 'meataxe'), - - Extension('sage.matrix.misc', - sources = ['sage/matrix/misc.pyx']), - - Extension('sage.matrix.strassen', - sources = ['sage/matrix/strassen.pyx']), - - ################################ - ## - ## sage.matroids - ## - ################################ - - Extension('*', ['sage/matroids/*.pyx']), - - ################################ - ## - ## sage.media - ## - ################################ - - Extension('*', ['sage/media/*.pyx']), - - ################################ - ## - ## sage.misc - ## - ################################ - - Extension('*', ['sage/misc/*.pyx']), - Extension('sage.misc.sage_ostools', - sources = ['sage/misc/sage_ostools.pyx'], - libraries = ['sqlite3']), - - ################################ - ## - ## sage.modular - ## - ################################ - - Extension('*', ['sage/modular/**/*.pyx']), - - ################################ - ## - ## sage.modules - ## - ################################ - - Extension('*', ['sage/modules/**/*.pyx']), - - ################################ - ## - ## sage.monoids - ## - ################################ - - Extension('*', ['sage/monoids/**/*.pyx']), - - ################################ - ## - ## sage.numerical - ## - ################################ - - - Extension("sage.numerical.mip", - ["sage/numerical/mip.pyx"]), - - Extension("sage.numerical.linear_functions", - ["sage/numerical/linear_functions.pyx"]), - - Extension("sage.numerical.linear_tensor_element", - ["sage/numerical/linear_tensor_element.pyx"]), - - Extension("sage.numerical.gauss_legendre", - ["sage/numerical/gauss_legendre.pyx"]), - - Extension("sage.numerical.sdp", - ["sage/numerical/sdp.pyx"]), - - Extension("sage.numerical.backends.generic_backend", - ["sage/numerical/backends/generic_backend.pyx"]), - - Extension("sage.numerical.backends.generic_sdp_backend", - ["sage/numerical/backends/generic_sdp_backend.pyx"]), - - Extension("sage.numerical.backends.glpk_backend", - ["sage/numerical/backends/glpk_backend.pyx"]), - - Extension("sage.numerical.backends.glpk_exact_backend", - ["sage/numerical/backends/glpk_exact_backend.pyx"]), - - Extension("sage.numerical.backends.ppl_backend", - ["sage/numerical/backends/ppl_backend.pyx"]), - - Extension("sage.numerical.backends.cvxopt_backend", - ["sage/numerical/backends/cvxopt_backend.pyx"]), - - Extension("sage.numerical.backends.cvxopt_sdp_backend", - ["sage/numerical/backends/cvxopt_sdp_backend.pyx"]), - - Extension("sage.numerical.backends.glpk_graph_backend", - ["sage/numerical/backends/glpk_graph_backend.pyx"]), - - Extension("sage.numerical.backends.interactivelp_backend", - ["sage/numerical/backends/interactivelp_backend.pyx"]), - - ################################ - ## - ## sage.plot - ## - ################################ - - Extension('*', ['sage/plot/**/*.pyx']), - - ################################ - ## - ## sage.probability - ## - ################################ - - Extension('*', ['sage/probability/*.pyx']), - - ################################ - ## - ## sage.quadratic_forms - ## - ################################ - - Extension('*', ['sage/quadratic_forms/*.pyx']), - - ############################### - ## - ## sage.quivers - ## - ############################### - - Extension('*', ['sage/quivers/*.pyx']), - - ################################ - ## - ## sage.rings - ## - ################################ - - Extension('sage.rings.sum_of_squares', - sources = ['sage/rings/sum_of_squares.pyx']), - - Extension('sage.rings.bernmm', - sources = ['sage/rings/bernmm.pyx']), - - Extension('sage.rings.bernoulli_mod_p', - sources = ['sage/rings/bernoulli_mod_p.pyx']), - - Extension("sage.rings.complex_arb", - ["sage/rings/complex_arb.pyx"]), - - Extension('sage.rings.complex_double', - sources = ['sage/rings/complex_double.pyx']), - - Extension('sage.rings.complex_interval', - sources = ['sage/rings/complex_interval.pyx']), - - Extension('sage.rings.complex_number', - sources = ['sage/rings/complex_number.pyx']), - - Extension('sage.rings.integer', - sources = ['sage/rings/integer.pyx']), - - Extension('sage.rings.integer_ring', - sources = ['sage/rings/integer_ring.pyx']), - - Extension('sage.rings.factorint', - sources = ['sage/rings/factorint.pyx']), - - Extension('sage.rings.fast_arith', - sources = ['sage/rings/fast_arith.pyx']), - - Extension('sage.rings.fraction_field_element', - sources = ['sage/rings/fraction_field_element.pyx']), - - Extension('sage.rings.fraction_field_FpT', - sources = ['sage/rings/fraction_field_FpT.pyx']), - - Extension('sage.rings.laurent_series_ring_element', - sources = ['sage/rings/laurent_series_ring_element.pyx']), - - Extension('sage.rings.morphism', - sources = ['sage/rings/morphism.pyx']), - - Extension('sage.rings.complex_mpc', - sources = ['sage/rings/complex_mpc.pyx']), - - Extension('sage.rings.noncommutative_ideals', - sources = ['sage/rings/noncommutative_ideals.pyx']), - - Extension('sage.rings.power_series_mpoly', - sources = ['sage/rings/power_series_mpoly.pyx']), - - Extension('sage.rings.power_series_poly', - sources = ['sage/rings/power_series_poly.pyx']), - - Extension('sage.rings.power_series_pari', - sources = ['sage/rings/power_series_pari.pyx']), - - Extension('sage.rings.power_series_ring_element', - sources = ['sage/rings/power_series_ring_element.pyx']), - - Extension('sage.rings.tate_algebra_element', - sources = ['sage/rings/tate_algebra_element.pyx']), - - Extension('sage.rings.tate_algebra_ideal', - sources = ['sage/rings/tate_algebra_ideal.pyx']), - - Extension('sage.rings.puiseux_series_ring_element', - sources = ['sage/rings/puiseux_series_ring_element.pyx']), - - Extension('sage.rings.rational', - sources = ['sage/rings/rational.pyx']), - - Extension('sage.rings.real_double', - sources = ['sage/rings/real_double.pyx']), - - Extension('sage.rings.real_interval_absolute', - sources = ['sage/rings/real_interval_absolute.pyx']), - - Extension("sage.rings.real_arb", - ["sage/rings/real_arb.pyx"]), - - Extension('sage.rings.real_lazy', - sources = ['sage/rings/real_lazy.pyx']), - - Extension('sage.rings.real_mpfi', - sources = ['sage/rings/real_mpfi.pyx']), - - Extension('sage.rings.real_mpfr', - sources = ['sage/rings/real_mpfr.pyx']), - - Extension('sage.rings.finite_rings.residue_field', - sources = ['sage/rings/finite_rings/residue_field.pyx']), - - Extension('sage.rings.ring', - sources = ['sage/rings/ring.pyx']), - - Extension('sage.rings.ring_extension', - sources = ['sage/rings/ring_extension.pyx']), - - Extension('sage.rings.ring_extension_element', - sources = ['sage/rings/ring_extension_element.pyx']), - - Extension('sage.rings.ring_extension_morphism', - sources = ['sage/rings/ring_extension_morphism.pyx']), - - Extension('sage.rings.ring_extension_conversion', - sources = ['sage/rings/ring_extension_conversion.pyx']), - - Extension('*', ['sage/rings/convert/*.pyx']), - - ################################ - ## - ## sage.rings.finite_rings - ## - ################################ - - Extension('sage.rings.finite_rings.finite_field_base', - sources = ['sage/rings/finite_rings/finite_field_base.pyx']), - - Extension('sage.rings.finite_rings.element_base', - sources = ['sage/rings/finite_rings/element_base.pyx']), - - Extension('sage.rings.finite_rings.integer_mod', - sources = ['sage/rings/finite_rings/integer_mod.pyx']), - - Extension('sage.rings.finite_rings.element_givaro', - sources = ["sage/rings/finite_rings/element_givaro.pyx"]), - - Extension('sage.rings.finite_rings.element_ntl_gf2e', - sources = ['sage/rings/finite_rings/element_ntl_gf2e.pyx']), - - Extension('sage.rings.finite_rings.element_pari_ffelt', - sources = ['sage/rings/finite_rings/element_pari_ffelt.pyx']), - - Extension('sage.rings.finite_rings.hom_finite_field', - sources = ["sage/rings/finite_rings/hom_finite_field.pyx"]), - - Extension('sage.rings.finite_rings.hom_prime_finite_field', - sources = ["sage/rings/finite_rings/hom_prime_finite_field.pyx"]), - - Extension('sage.rings.finite_rings.hom_finite_field_givaro', - sources = ["sage/rings/finite_rings/hom_finite_field_givaro.pyx"]), - - ################################ - ## - ## sage.rings.function_field - ## - ################################ - - Extension('sage.rings.function_field.element', - sources = ['sage/rings/function_field/element.pyx']), - - ################################ - ## - ## sage.rings.number_field - ## - ################################ - - Extension('sage.rings.number_field.number_field_base', - sources = ['sage/rings/number_field/number_field_base.pyx']), - - Extension('sage.rings.number_field.number_field_element', - sources = ['sage/rings/number_field/number_field_element.pyx']), - - Extension('sage.rings.number_field.number_field_element_quadratic', - sources = ['sage/rings/number_field/number_field_element_quadratic.pyx']), - - Extension('sage.rings.number_field.number_field_morphisms', - sources = ['sage/rings/number_field/number_field_morphisms.pyx']), - - Extension('sage.rings.number_field.totallyreal', - sources = ['sage/rings/number_field/totallyreal.pyx']), - - Extension('sage.rings.number_field.totallyreal_data', - sources = ['sage/rings/number_field/totallyreal_data.pyx']), - - ################################ - ## - ## sage.rings.padics - ## - ################################ - - Extension('sage.rings.padics.morphism', - sources = ['sage/rings/padics/morphism.pyx']), - - Extension('sage.rings.padics.common_conversion', - sources = ['sage/rings/padics/common_conversion.pyx']), - - Extension('sage.rings.padics.local_generic_element', - sources = ['sage/rings/padics/local_generic_element.pyx']), - - Extension('sage.rings.padics.padic_capped_absolute_element', - sources = ['sage/rings/padics/padic_capped_absolute_element.pyx']), - - Extension('sage.rings.padics.padic_capped_relative_element', - sources = ['sage/rings/padics/padic_capped_relative_element.pyx']), - - Extension('sage.rings.padics.padic_floating_point_element', - sources = ['sage/rings/padics/padic_floating_point_element.pyx']), - - Extension('sage.rings.padics.padic_ext_element', - sources = ['sage/rings/padics/padic_ext_element.pyx']), - - Extension('sage.rings.padics.padic_fixed_mod_element', - sources = ['sage/rings/padics/padic_fixed_mod_element.pyx']), - - Extension('sage.rings.padics.padic_generic_element', - sources = ['sage/rings/padics/padic_generic_element.pyx']), - - Extension('sage.rings.padics.padic_printing', - sources = ['sage/rings/padics/padic_printing.pyx']), - - Extension('sage.rings.padics.padic_ZZ_pX_CA_element', - sources = ['sage/rings/padics/padic_ZZ_pX_CA_element.pyx']), - - Extension('sage.rings.padics.padic_ZZ_pX_CR_element', - sources = ['sage/rings/padics/padic_ZZ_pX_CR_element.pyx']), - - Extension('sage.rings.padics.padic_ZZ_pX_element', - sources = ['sage/rings/padics/padic_ZZ_pX_element.pyx']), - - Extension('sage.rings.padics.padic_ZZ_pX_FM_element', - sources = ['sage/rings/padics/padic_ZZ_pX_FM_element.pyx']), - - Extension('sage.rings.padics.pow_computer', - sources = ['sage/rings/padics/pow_computer.pyx']), - - Extension('sage.rings.padics.pow_computer_ext', - sources = ['sage/rings/padics/pow_computer_ext.pyx']), - - Extension('sage.rings.padics.pow_computer_flint', - sources = ['sage/rings/padics/pow_computer_flint.pyx']), - - Extension('sage.rings.padics.pow_computer_relative', - sources = ['sage/rings/padics/pow_computer_relative.pyx']), - - Extension('sage.rings.padics.qadic_flint_CR', - sources = ['sage/rings/padics/qadic_flint_CR.pyx']), - - Extension('sage.rings.padics.qadic_flint_CA', - sources = ['sage/rings/padics/qadic_flint_CA.pyx']), - - Extension('sage.rings.padics.qadic_flint_FM', - sources = ['sage/rings/padics/qadic_flint_FM.pyx']), - - Extension('sage.rings.padics.qadic_flint_FP', - sources = ['sage/rings/padics/qadic_flint_FP.pyx']), - - Extension('sage.rings.padics.relative_ramified_FM', - sources = ['sage/rings/padics/relative_ramified_FM.pyx']), - Extension('sage.rings.padics.relative_ramified_CA', - sources = ['sage/rings/padics/relative_ramified_CA.pyx']), - Extension('sage.rings.padics.relative_ramified_CR', - sources = ['sage/rings/padics/relative_ramified_CR.pyx']), - Extension('sage.rings.padics.relative_ramified_FP', - sources = ['sage/rings/padics/relative_ramified_FP.pyx']), - - ################################ - ## - ## sage.rings.polynomial - ## - ################################ - - Extension('sage.rings.polynomial.cyclotomic', - sources = ['sage/rings/polynomial/cyclotomic.pyx']), - - Extension('sage.rings.polynomial.evaluation_flint', - sources = ['sage/rings/polynomial/evaluation_flint.pyx']), - - Extension('sage.rings.polynomial.evaluation_ntl', - sources = ['sage/rings/polynomial/evaluation_ntl.pyx']), - - Extension('sage.rings.polynomial.laurent_polynomial', - sources = ['sage/rings/polynomial/laurent_polynomial.pyx']), - - Extension('sage.rings.polynomial.hilbert', - sources = ['sage/rings/polynomial/hilbert.pyx']), - - Extension('sage.rings.polynomial.multi_polynomial', - sources = ['sage/rings/polynomial/multi_polynomial.pyx']), - - Extension('sage.rings.polynomial.multi_polynomial_ideal_libsingular', - sources = ['sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx']), - - Extension('sage.rings.polynomial.plural', - sources = ['sage/rings/polynomial/plural.pyx']), - - Extension('sage.rings.polynomial.multi_polynomial_libsingular', - sources = ['sage/rings/polynomial/multi_polynomial_libsingular.pyx']), - - Extension('sage.rings.polynomial.multi_polynomial_ring_base', - sources = ['sage/rings/polynomial/multi_polynomial_ring_base.pyx']), - - Extension('sage.rings.polynomial.polynomial_number_field', - sources = ['sage/rings/polynomial/polynomial_number_field.pyx']), - - Extension('sage.rings.polynomial.polydict', - sources = ['sage/rings/polynomial/polydict.pyx']), - - Extension('sage.rings.polynomial.polynomial_complex_arb', - sources = ['sage/rings/polynomial/polynomial_complex_arb.pyx']), - - Extension('sage.rings.polynomial.polynomial_compiled', - sources = ['sage/rings/polynomial/polynomial_compiled.pyx']), - - Extension('sage.rings.polynomial.polynomial_element', - sources = ['sage/rings/polynomial/polynomial_element.pyx']), - - Extension('sage.rings.polynomial.polynomial_gf2x', - sources = ['sage/rings/polynomial/polynomial_gf2x.pyx']), - - Extension('sage.rings.polynomial.polynomial_zz_pex', - sources = ['sage/rings/polynomial/polynomial_zz_pex.pyx']), - - Extension('sage.rings.polynomial.polynomial_zmod_flint', - sources = ['sage/rings/polynomial/polynomial_zmod_flint.pyx']), - - Extension('sage.rings.polynomial.polynomial_integer_dense_flint', - sources = ['sage/rings/polynomial/polynomial_integer_dense_flint.pyx']), - - Extension('sage.rings.polynomial.polynomial_integer_dense_ntl', - sources = ['sage/rings/polynomial/polynomial_integer_dense_ntl.pyx']), - - Extension('sage.rings.polynomial.polynomial_rational_flint', - sources = ['sage/rings/polynomial/polynomial_rational_flint.pyx']), - - Extension('sage.rings.polynomial.polynomial_modn_dense_ntl', - sources = ['sage/rings/polynomial/polynomial_modn_dense_ntl.pyx']), - - Extension('sage.rings.polynomial.polynomial_ring_homomorphism', - sources = ['sage/rings/polynomial/polynomial_ring_homomorphism.pyx']), - - Extension('sage.rings.polynomial.pbori', - sources = ['sage/rings/polynomial/pbori.pyx'], - depends = [SAGE_INC + "/polybori/" + hd + ".h" for hd in ["polybori", "config"]]), - - Extension('sage.rings.polynomial.polynomial_real_mpfr_dense', - sources = ['sage/rings/polynomial/polynomial_real_mpfr_dense.pyx']), - - Extension('sage.rings.polynomial.real_roots', - sources = ['sage/rings/polynomial/real_roots.pyx']), - - Extension('sage.rings.polynomial.refine_root', - sources = ['sage/rings/polynomial/refine_root.pyx']), - - Extension('sage.rings.polynomial.symmetric_reduction', - sources = ['sage/rings/polynomial/symmetric_reduction.pyx']), - - Extension('sage.rings.polynomial.ore_polynomial_element', - sources = ['sage/rings/polynomial/ore_polynomial_element.pyx']), - - Extension('sage.rings.polynomial.skew_polynomial_element', - sources = ['sage/rings/polynomial/skew_polynomial_element.pyx']), - - Extension('sage.rings.polynomial.skew_polynomial_finite_order', - sources = ['sage/rings/polynomial/skew_polynomial_finite_order.pyx']), - - Extension('sage.rings.polynomial.skew_polynomial_finite_field', - sources = ['sage/rings/polynomial/skew_polynomial_finite_field.pyx']), - - # Note that weil_polynomials includes distutils directives in order to support - # conditional OpenMP compilation (by uncommenting lines) - Extension('sage.rings.polynomial.weil.weil_polynomials', - sources = ['sage/rings/polynomial/weil/weil_polynomials.pyx']), - - - ################################ - ## - ## sage.rings.semirings - ## - ################################ - - Extension('sage.rings.semirings.tropical_semiring', - sources = ['sage/rings/semirings/tropical_semiring.pyx']), - - ################################ - ## - ## sage.sat - ## - ################################ - - Extension('sage.sat.solvers.satsolver', - sources = ['sage/sat/solvers/satsolver.pyx']), - - ################################ - ## - ## sage.schemes - ## - ################################ - - Extension('*', ['sage/schemes/**/*.pyx']), - - ################################ - ## - ## sage.sets - ## - ################################ - - Extension('*', ['sage/sets/*.pyx']), - - ################################ - ## - ## sage.stats - ## - ################################ - - Extension('*', ['sage/stats/**/*.pyx']), - - ################################ - ## - ## sage.structure - ## - ################################ - - Extension('*', ['sage/structure/*.pyx']), - - ################################ - ## - ## sage.symbolic - ## - ################################ - - Extension('*', ['sage/symbolic/*.pyx']), - - ################################ - ## - ## sage.tests - ## - ################################ - - Extension('*', ['sage/tests/**/*.pyx']) - -] From 89aaa5bc2c1d68b9c62160cad382bf11580699ee Mon Sep 17 00:00:00 2001 From: Ivo Maffei Date: Tue, 28 Jul 2020 16:43:02 +0200 Subject: [PATCH 13/23] added a few sporadic distance regular graphs --- src/doc/en/reference/references/index.rst | 11 ++ src/sage/graphs/distance_regular.pyx | 212 ++++++++++++++++++++++ src/sage/graphs/graph_generators.py | 9 + 3 files changed, 232 insertions(+) create mode 100644 src/sage/graphs/distance_regular.pyx diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index b5fd40b2265..fbf21f7aaca 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -5303,6 +5303,9 @@ REFERENCES: .. [Terwilliger2011] Paul Terwilliger. *The universal Askey-Wilson algebra*. SIGMA **7** (2011), 069, 24 pages. :arxiv:`1104.2813`. +.. [TP1994] \J. Thas, S. Payne, *Spreads and ovoids in finite generalized + quadrangles*. Geometriae Dedicata, Vol. 52, pp. 227-253, 1994. + .. [Tho2010] \T. Thongjunthug, Computing a lower bound for the canonical height on elliptic curves over number fields, Math. Comp. 79 (2010), pages 2431-2449. @@ -5396,6 +5399,9 @@ REFERENCES: Numer. Algorithms, 3:451-462, 1992. :doi:`10.1007/BF02141952` +.. [VDKT2016] \E. R. van Dam, J. H. Koolen, H. Tanaka, *Distance Regular graphs* + The Electronic Journal of Combinatorics. 2016 + .. [Vee1978] William Veech, "Interval exchange transformations", J. Analyse Math. 33 (1978), 222-272 @@ -5534,6 +5540,11 @@ REFERENCES: tableaux*. Dissertation, Massachusetts Institute of Technology, 1984. +.. [WPNBBAtl] \R. A. Wilson, R. A. Parker, S. Nickerson, J. N. Bray, + \T. Breuer, *AtlasRep, a GAP interface to the atlas + of group representations*. + http://www.math.rwth-aachen.de/~Thomas.Breuer/atlasrep + .. [WP-Bessel] :wikipedia:`Bessel_function` .. [WP-Error] :wikipedia:`Error_function` diff --git a/src/sage/graphs/distance_regular.pyx b/src/sage/graphs/distance_regular.pyx new file mode 100644 index 00000000000..436a86d6ec4 --- /dev/null +++ b/src/sage/graphs/distance_regular.pyx @@ -0,0 +1,212 @@ +r""" +Dabase of distance regular graphs + +In this module we construct several distance regular graphs +and group them in a function that maps intersection arrays +to graphs. + +For a survey on distance-regular graph see [BCN1989]_ or [VDKT2016]_. + +EXAMPLES:: + + sage: G = graphs.cocliques_HoffmannSingleton() + sage: G.is_distance_regular() + True + +AUTHORS: + +- Ivo Maffei (2020-07-28): initial version + +""" + +# **************************************************************************** +# Copyright (C) 2020 Ivo Maffei +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# https://www.gnu.org/licenses/ +# **************************************************************************** + +from sage.graphs.graph import Graph +from sage.libs.gap.libgap import libgap +from sage.modules.free_module import VectorSpace +from sage.modules.free_module_element import vector +from sage.rings.finite_rings.finite_field_constructor import GF + +def cocliques_HoffmannSingleton(): + r""" + Return the graph obtained from the cocliques of the Hoffmann-Singleton graph. + + This is a distance-regular graph with intersecion array + `[15, 14, 10, 3; 1, 5, 12, 15]`. + + EXAMPLES:: + + sage: G = graphs.cocliques_HoffmannSingleton() + sage: G.is_distance_regular(True) + ([15, 14, 10, 3, None], [None, 1, 5, 12, 15]) + + REFERENCES: + + The construction of this graph can be found in [BCN1989]_ p. 392. + """ + from sage.graphs.graph_generators import GraphGenerators + D = GraphGenerators.HoffmanSingletonGraph() + DC = D.complement() + + cocliques = DC.cliques_maximum() # 100 of this + + edges = [] + for i in range(100): + sC = frozenset(cocliques[i]) + for j in range(i+1,100): + if len(sC.intersection(cocliques[j])) == 8: + sC2 = frozenset(cocliques[j]) + edges.append( (sC,sC2) ) + + G = Graph(edges,format="list_of_edges") + return G + + +def locally_GQ42_graph(): + r""" + Return the unique amply regular graph which is locally a generalised + quadrangle. + + This graph is distance-regular with intersection array + `[45, 32, 12, 1; 1, 6, 32, 45]`. + + This graph is also distance-transitive. + + EXAMPLES:: + + sage: G = graphs.locally_GQ42_graph() + sage: G.is_distance_regular(True) + ([45, 32, 12, 1, None], [None, 1, 6, 32, 45]) + + .. NOTE:: + + This function needs the GAP's package AtlasRep [WPNBBAtl]_. + Install it via ``sage -i gap_packages``. + """ + H = libgap.AtlasGroup("3^2.U4(3).D8",libgap.NrMovedPoints,756) + Ns = H.NormalSubgroups() + for N in Ns: + if len(N.GeneratorsSmallest()) == 7: # there is only one + break + + G = Graph(libgap.Orbit(N,[1,9],libgap.OnSets), format='list_of_edges') + G.name("locally GQ(4,2) graph") + return G + + +def ConwaySmith_for_3S7(): + r""" + Return the Conway-Smith graph related to `3 Sym(7)`. + + This is a distance-regular graph with intersection array + `[10, 6, 4, 1; 1, 2, 6, 10]`. + + EXAMPLES:: + + sage: G = graphs.ConwaySmith_for_3S7() + sage: G.is_distance_regular(True) + ([10, 6, 4, 1, None], [None, 1, 2, 6, 10]) + """ + from sage.rings.number_field.number_field import CyclotomicField + + F = CyclotomicField(3) + w = F.gen() + + V= VectorSpace(GF(4), 6) + z2 = GF(4)('z2') # GF(4) = {0,1,z2, z2+1} + + W = V.span([(0,0,1,1,1,1), (0,1,0,1,z2,z2+1), (1,0,0,1,z2+1,z2)]) + # we only need the 45 vectors with 2 zero entries + # we also embed everything into CC + + K = [] + for v in W: + #check zero entries + zeros = 0 + for x in v: + if x == 0: + zeros += 1 + + if zeros == 2: + # send to F and in K + # z2 -> w + # z2+1 -> w^2 + vv = [] # new vector + for x in v: + if x == z2: + vv.append(w) + elif x == z2+1: + vv.append(w**2) + else: + vv.append(int(x)) # this is weirdly needed for some reason + + # now vv is the new vector in F + vv = vector(F, vv) + K.append(vv) + + # we need to add other vectors + for i in range(6): + #create e_i + ei = [0]*6 + ei[i] = 1 + ei = vector(F, ei) + + K.append(2 * ei) + K.append(2 * w * ei) + K.append(2 * w**2 * ei) + # now K is all the 63 vertices + + def has_edge(u,v): + com = 0 + for i in range(6): + com += u[i].conjugate() * v[i] + + if com == 2: + return True + return False + + G = Graph() + length = len(K) + for i in range(length): + K[i].set_immutable() + for j in range(i+1, length): + if has_edge(K[i], K[j]): + K[j].set_immutable() + G.add_edge((K[i], K[j])) + + G.name("Conway-Smith graph for 3S7") + return G + +def graph_3O73(): + r""" + Return the graph related to the group `3 O(7,3)`. + + This graph is distance-regular with intersection array + `[117, 80, 24, 1; 1, 12, 80, 117]`. + + The graph is also distance transitive with "3.O(7,3)" as automorphism + group + + EXAMPLES:: + + sage: G = graphs.graph_3O73() + sage: G.is_distance_regular(True) + ([117, 80, 24, 1, None], [None, 1, 12, 80, 117]) + + .. NOTE:: + + This function needs the GAP's package AtlasRep [WPNBBAtl]_. + Install it via ``sage -i gap_packages``. + """ + group = libgap.AtlasGroup("3.O7(3)",libgap.NrMovedPoints,1134) + G = Graph(group.Orbit([1,3], libgap.OnSets), format='list_of_edges') + G.name("Distance transitive graph with automorphism group 3.O_7(3)") + return G diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py index e052476a52a..eff6afd2e17 100644 --- a/src/sage/graphs/graph_generators.py +++ b/src/sage/graphs/graph_generators.py @@ -104,6 +104,8 @@ def __append_to_doc(methods): "Cell120", "ChvatalGraph", "ClebschGraph", + "cocliques_HoffmannSingleton", + "ConwaySmith_for_3S7", "CoxeterGraph", "DesarguesGraph", "DejterGraph", @@ -122,6 +124,7 @@ def __append_to_doc(methods): "GoldnerHararyGraph", "GolombGraph", "GossetGraph", + "graph_3O73", "GrayGraph", "GrotzschGraph", "HallJankoGraph", @@ -142,6 +145,7 @@ def __append_to_doc(methods): "KrackhardtKiteGraph", "Klein3RegularGraph", "Klein7RegularGraph", + "locally_GQ42_graph", "LocalMcLaughlinGraph", "LjubljanaGraph", "LivingstoneGraph", @@ -1908,6 +1912,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None # Small Graphs ########################################################################### from .generators import smallgraphs + from sage.graphs import distance_regular Balaban10Cage = staticmethod(smallgraphs.Balaban10Cage) Balaban11Cage = staticmethod(smallgraphs.Balaban11Cage) BidiakisCube = staticmethod(smallgraphs.BidiakisCube) @@ -1922,6 +1927,8 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None Cell120 = staticmethod(smallgraphs.Cell120) ChvatalGraph = staticmethod(smallgraphs.ChvatalGraph) ClebschGraph = staticmethod(smallgraphs.ClebschGraph) + cocliques_HoffmannSingleton = staticmethod(distance_regular.cocliques_HoffmannSingleton) + ConwaySmith_for_3S7 = staticmethod(distance_regular.ConwaySmith_for_3S7) CoxeterGraph = staticmethod(smallgraphs.CoxeterGraph) DejterGraph = staticmethod(smallgraphs.DejterGraph) DesarguesGraph = staticmethod(smallgraphs.DesarguesGraph) @@ -1940,6 +1947,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None GoldnerHararyGraph = staticmethod(smallgraphs.GoldnerHararyGraph) GolombGraph = staticmethod(smallgraphs.GolombGraph) GossetGraph = staticmethod(smallgraphs.GossetGraph) + graph_3O73 = staticmethod(distance_regular.graph_3O73) GrayGraph = staticmethod(smallgraphs.GrayGraph) GrotzschGraph = staticmethod(smallgraphs.GrotzschGraph) HallJankoGraph = staticmethod(smallgraphs.HallJankoGraph) @@ -1961,6 +1969,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None KrackhardtKiteGraph = staticmethod(smallgraphs.KrackhardtKiteGraph) Klein3RegularGraph = staticmethod(smallgraphs.Klein3RegularGraph) Klein7RegularGraph = staticmethod(smallgraphs.Klein7RegularGraph) + locally_GQ42_graph = staticmethod(distance_regular.locally_GQ42_graph) LocalMcLaughlinGraph = staticmethod(smallgraphs.LocalMcLaughlinGraph) LjubljanaGraph = staticmethod(smallgraphs.LjubljanaGraph) LivingstoneGraph = staticmethod(smallgraphs.LivingstoneGraph) From 2f8ca0f778a391334088ad031579457160c94bb1 Mon Sep 17 00:00:00 2001 From: Ivo Maffei Date: Wed, 29 Jul 2020 21:03:06 +0200 Subject: [PATCH 14/23] moved file to generators; fixed tests --- src/sage/graphs/{ => generators}/distance_regular.pyx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename src/sage/graphs/{ => generators}/distance_regular.pyx (94%) diff --git a/src/sage/graphs/distance_regular.pyx b/src/sage/graphs/generators/distance_regular.pyx similarity index 94% rename from src/sage/graphs/distance_regular.pyx rename to src/sage/graphs/generators/distance_regular.pyx index 436a86d6ec4..4642b58e6f8 100644 --- a/src/sage/graphs/distance_regular.pyx +++ b/src/sage/graphs/generators/distance_regular.pyx @@ -82,8 +82,8 @@ def locally_GQ42_graph(): EXAMPLES:: - sage: G = graphs.locally_GQ42_graph() - sage: G.is_distance_regular(True) + sage: G = graphs.locally_GQ42_graph() # optional - gap_packages + sage: G.is_distance_regular(True) # optional - gap_packages ([45, 32, 12, 1, None], [None, 1, 6, 32, 45]) .. NOTE:: @@ -197,8 +197,8 @@ def graph_3O73(): EXAMPLES:: - sage: G = graphs.graph_3O73() - sage: G.is_distance_regular(True) + sage: G = graphs.graph_3O73() # optional - gap_packages + sage: G.is_distance_regular(True) # optional - gap_packages ([117, 80, 24, 1, None], [None, 1, 12, 80, 117]) .. NOTE:: @@ -207,6 +207,6 @@ def graph_3O73(): Install it via ``sage -i gap_packages``. """ group = libgap.AtlasGroup("3.O7(3)",libgap.NrMovedPoints,1134) - G = Graph(group.Orbit([1,3], libgap.OnSets), format='list_of_edges') + G = Graph(libgap.Orbit(group, [1, 3], libgap.OnSets), format='list_of_edges') G.name("Distance transitive graph with automorphism group 3.O_7(3)") return G From 7a906b1e8464f382d7ddc72b50dafe2241ede740 Mon Sep 17 00:00:00 2001 From: Ivo Maffei Date: Thu, 30 Jul 2020 12:11:17 +0200 Subject: [PATCH 15/23] fixed typos and formatting --- .../graphs/generators/distance_regular.pyx | 45 ++++++++----------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/src/sage/graphs/generators/distance_regular.pyx b/src/sage/graphs/generators/distance_regular.pyx index 4642b58e6f8..9cef7ffc549 100644 --- a/src/sage/graphs/generators/distance_regular.pyx +++ b/src/sage/graphs/generators/distance_regular.pyx @@ -1,5 +1,5 @@ r""" -Dabase of distance regular graphs +Database of distance regular graphs In this module we construct several distance regular graphs and group them in a function that maps intersection arrays @@ -39,7 +39,7 @@ def cocliques_HoffmannSingleton(): r""" Return the graph obtained from the cocliques of the Hoffmann-Singleton graph. - This is a distance-regular graph with intersecion array + This is a distance-regular graph with intersection array `[15, 14, 10, 3; 1, 5, 12, 15]`. EXAMPLES:: @@ -61,15 +61,13 @@ def cocliques_HoffmannSingleton(): edges = [] for i in range(100): sC = frozenset(cocliques[i]) - for j in range(i+1,100): + for j in range(i + 1, 100): if len(sC.intersection(cocliques[j])) == 8: - sC2 = frozenset(cocliques[j]) - edges.append( (sC,sC2) ) + edges.append((sC, frozenset(cocliques[j]))) - G = Graph(edges,format="list_of_edges") + G = Graph(edges, format="list_of_edges") return G - def locally_GQ42_graph(): r""" Return the unique amply regular graph which is locally a generalised @@ -91,13 +89,13 @@ def locally_GQ42_graph(): This function needs the GAP's package AtlasRep [WPNBBAtl]_. Install it via ``sage -i gap_packages``. """ - H = libgap.AtlasGroup("3^2.U4(3).D8",libgap.NrMovedPoints,756) + H = libgap.AtlasGroup("3^2.U4(3).D8", libgap.NrMovedPoints, 756) Ns = H.NormalSubgroups() for N in Ns: if len(N.GeneratorsSmallest()) == 7: # there is only one break - G = Graph(libgap.Orbit(N,[1,9],libgap.OnSets), format='list_of_edges') + G = Graph(libgap.Orbit(N, [1, 9], libgap.OnSets), format='list_of_edges') G.name("locally GQ(4,2) graph") return G @@ -121,7 +119,7 @@ def ConwaySmith_for_3S7(): w = F.gen() V= VectorSpace(GF(4), 6) - z2 = GF(4)('z2') # GF(4) = {0,1,z2, z2+1} + z2 = GF(4)('z2') # GF(4) = {0, 1, z2, z2+1} W = V.span([(0,0,1,1,1,1), (0,1,0,1,z2,z2+1), (1,0,0,1,z2+1,z2)]) # we only need the 45 vectors with 2 zero entries @@ -129,10 +127,10 @@ def ConwaySmith_for_3S7(): K = [] for v in W: - #check zero entries + # check zero entries zeros = 0 for x in v: - if x == 0: + if x.is_zero(): zeros += 1 if zeros == 2: @@ -143,7 +141,7 @@ def ConwaySmith_for_3S7(): for x in v: if x == z2: vv.append(w) - elif x == z2+1: + elif x == z2 + 1: vv.append(w**2) else: vv.append(int(x)) # this is weirdly needed for some reason @@ -154,8 +152,8 @@ def ConwaySmith_for_3S7(): # we need to add other vectors for i in range(6): - #create e_i - ei = [0]*6 + # create e_i + ei = [0, 0, 0, 0, 0, 0] ei[i] = 1 ei = vector(F, ei) @@ -164,22 +162,17 @@ def ConwaySmith_for_3S7(): K.append(2 * w**2 * ei) # now K is all the 63 vertices - def has_edge(u,v): - com = 0 - for i in range(6): - com += u[i].conjugate() * v[i] + for v in K: + v.set_immutable() - if com == 2: - return True - return False + def has_edge(u, v): + return sum(u[i].conjugate() * v[i] for i in range(6)) == 2 G = Graph() length = len(K) for i in range(length): - K[i].set_immutable() - for j in range(i+1, length): + for j in range(i + 1, length): if has_edge(K[i], K[j]): - K[j].set_immutable() G.add_edge((K[i], K[j])) G.name("Conway-Smith graph for 3S7") @@ -206,7 +199,7 @@ def graph_3O73(): This function needs the GAP's package AtlasRep [WPNBBAtl]_. Install it via ``sage -i gap_packages``. """ - group = libgap.AtlasGroup("3.O7(3)",libgap.NrMovedPoints,1134) + group = libgap.AtlasGroup("3.O7(3)", libgap.NrMovedPoints, 1134) G = Graph(libgap.Orbit(group, [1, 3], libgap.OnSets), format='list_of_edges') G.name("Distance transitive graph with automorphism group 3.O_7(3)") return G From 81644451a63474093440b9c834004d1f7d385185 Mon Sep 17 00:00:00 2001 From: Ivo Maffei Date: Thu, 30 Jul 2020 13:32:05 +0200 Subject: [PATCH 16/23] itertools to simplify code --- .../graphs/generators/distance_regular.pyx | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/sage/graphs/generators/distance_regular.pyx b/src/sage/graphs/generators/distance_regular.pyx index 9cef7ffc549..b1700da0550 100644 --- a/src/sage/graphs/generators/distance_regular.pyx +++ b/src/sage/graphs/generators/distance_regular.pyx @@ -53,17 +53,17 @@ def cocliques_HoffmannSingleton(): The construction of this graph can be found in [BCN1989]_ p. 392. """ from sage.graphs.graph_generators import GraphGenerators + import itertools + D = GraphGenerators.HoffmanSingletonGraph() DC = D.complement() - cocliques = DC.cliques_maximum() # 100 of this + cocliques = [frozenset(c) for c in DC.cliques_maximum()] # 100 of this edges = [] - for i in range(100): - sC = frozenset(cocliques[i]) - for j in range(i + 1, 100): - if len(sC.intersection(cocliques[j])) == 8: - edges.append((sC, frozenset(cocliques[j]))) + for c1, c2 in itertools.combinations(cocliques, 2): + if len(c1.intersection(c2)) == 8: + edges.append((c1, c2)) G = Graph(edges, format="list_of_edges") return G @@ -114,6 +114,7 @@ def ConwaySmith_for_3S7(): ([10, 6, 4, 1, None], [None, 1, 2, 6, 10]) """ from sage.rings.number_field.number_field import CyclotomicField + import itertools F = CyclotomicField(3) w = F.gen() @@ -144,7 +145,7 @@ def ConwaySmith_for_3S7(): elif x == z2 + 1: vv.append(w**2) else: - vv.append(int(x)) # this is weirdly needed for some reason + vv.append(int(x)) # now vv is the new vector in F vv = vector(F, vv) @@ -169,11 +170,9 @@ def ConwaySmith_for_3S7(): return sum(u[i].conjugate() * v[i] for i in range(6)) == 2 G = Graph() - length = len(K) - for i in range(length): - for j in range(i + 1, length): - if has_edge(K[i], K[j]): - G.add_edge((K[i], K[j])) + for Ki, Kj in itertools.combinations(K, 2): + if has_edge(Ki, Kj): + G.add_edge((Ki, Kj)) G.name("Conway-Smith graph for 3S7") return G From 6a1542037619f0c5ac686167d6f19710036662df Mon Sep 17 00:00:00 2001 From: Ivo Maffei Date: Fri, 31 Jul 2020 19:42:37 +0200 Subject: [PATCH 17/23] change optional flag for atlasrep --- .../graphs/generators/distance_regular.pyx | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/sage/graphs/generators/distance_regular.pyx b/src/sage/graphs/generators/distance_regular.pyx index b1700da0550..101aee8eb67 100644 --- a/src/sage/graphs/generators/distance_regular.pyx +++ b/src/sage/graphs/generators/distance_regular.pyx @@ -80,14 +80,9 @@ def locally_GQ42_graph(): EXAMPLES:: - sage: G = graphs.locally_GQ42_graph() # optional - gap_packages - sage: G.is_distance_regular(True) # optional - gap_packages + sage: G = graphs.locally_GQ42_graph() # optional - internet + sage: G.is_distance_regular(True) # optional - internet ([45, 32, 12, 1, None], [None, 1, 6, 32, 45]) - - .. NOTE:: - - This function needs the GAP's package AtlasRep [WPNBBAtl]_. - Install it via ``sage -i gap_packages``. """ H = libgap.AtlasGroup("3^2.U4(3).D8", libgap.NrMovedPoints, 756) Ns = H.NormalSubgroups() @@ -189,14 +184,9 @@ def graph_3O73(): EXAMPLES:: - sage: G = graphs.graph_3O73() # optional - gap_packages - sage: G.is_distance_regular(True) # optional - gap_packages + sage: G = graphs.graph_3O73() # optional - internet + sage: G.is_distance_regular(True) # optional - internet ([117, 80, 24, 1, None], [None, 1, 12, 80, 117]) - - .. NOTE:: - - This function needs the GAP's package AtlasRep [WPNBBAtl]_. - Install it via ``sage -i gap_packages``. """ group = libgap.AtlasGroup("3.O7(3)", libgap.NrMovedPoints, 1134) G = Graph(libgap.Orbit(group, [1, 3], libgap.OnSets), format='list_of_edges') From 92537c0980a717d8c45f6f4cc3f48c198876cae1 Mon Sep 17 00:00:00 2001 From: Ivo Maffei Date: Sat, 1 Aug 2020 10:15:15 +0200 Subject: [PATCH 18/23] renamed locally GQ function and added references --- .../graphs/generators/distance_regular.pyx | 23 +++++++++++++++---- src/sage/graphs/graph_generators.py | 4 ++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/sage/graphs/generators/distance_regular.pyx b/src/sage/graphs/generators/distance_regular.pyx index 101aee8eb67..b97174f14a6 100644 --- a/src/sage/graphs/generators/distance_regular.pyx +++ b/src/sage/graphs/generators/distance_regular.pyx @@ -68,10 +68,10 @@ def cocliques_HoffmannSingleton(): G = Graph(edges, format="list_of_edges") return G -def locally_GQ42_graph(): +def locally_GQ42_distance_transitive_graph(): r""" - Return the unique amply regular graph which is locally a generalised - quadrangle. + Return the unique amply regular graph with `\mu = 6` which is locally + a generalised quadrangle. This graph is distance-regular with intersection array `[45, 32, 12, 1; 1, 6, 32, 45]`. @@ -80,9 +80,14 @@ def locally_GQ42_graph(): EXAMPLES:: - sage: G = graphs.locally_GQ42_graph() # optional - internet + sage: G = graphs.locally_GQ42_distance_transitive_graph() # optional - internet sage: G.is_distance_regular(True) # optional - internet ([45, 32, 12, 1, None], [None, 1, 6, 32, 45]) + + REFERENCES: + + A description of this graph can be found in [BCN1989]_ p.399. + This construction is due to Dima Pasechnik. """ H = libgap.AtlasGroup("3^2.U4(3).D8", libgap.NrMovedPoints, 756) Ns = H.NormalSubgroups() @@ -107,6 +112,11 @@ def ConwaySmith_for_3S7(): sage: G = graphs.ConwaySmith_for_3S7() sage: G.is_distance_regular(True) ([10, 6, 4, 1, None], [None, 1, 2, 6, 10]) + + REFERENCES: + + A description and construction of this graph can be found in + [BCN1989]_ p. 399. """ from sage.rings.number_field.number_field import CyclotomicField import itertools @@ -187,6 +197,11 @@ def graph_3O73(): sage: G = graphs.graph_3O73() # optional - internet sage: G.is_distance_regular(True) # optional - internet ([117, 80, 24, 1, None], [None, 1, 12, 80, 117]) + + REFERENCES: + + A description and construction of this graph can be found in + [BCN1989]_ p. 400. """ group = libgap.AtlasGroup("3.O7(3)", libgap.NrMovedPoints, 1134) G = Graph(libgap.Orbit(group, [1, 3], libgap.OnSets), format='list_of_edges') diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py index eff6afd2e17..af7874771e0 100644 --- a/src/sage/graphs/graph_generators.py +++ b/src/sage/graphs/graph_generators.py @@ -145,7 +145,7 @@ def __append_to_doc(methods): "KrackhardtKiteGraph", "Klein3RegularGraph", "Klein7RegularGraph", - "locally_GQ42_graph", + "locally_GQ42_distance_transitive_graph", "LocalMcLaughlinGraph", "LjubljanaGraph", "LivingstoneGraph", @@ -1969,7 +1969,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None KrackhardtKiteGraph = staticmethod(smallgraphs.KrackhardtKiteGraph) Klein3RegularGraph = staticmethod(smallgraphs.Klein3RegularGraph) Klein7RegularGraph = staticmethod(smallgraphs.Klein7RegularGraph) - locally_GQ42_graph = staticmethod(distance_regular.locally_GQ42_graph) + locally_GQ42_distance_transitive_graph = staticmethod(distance_regular.locally_GQ42_distance_transitive_graph) LocalMcLaughlinGraph = staticmethod(smallgraphs.LocalMcLaughlinGraph) LjubljanaGraph = staticmethod(smallgraphs.LjubljanaGraph) LivingstoneGraph = staticmethod(smallgraphs.LivingstoneGraph) From 6f3754b84bfbeedcf2103789a82ed91829ef72b2 Mon Sep 17 00:00:00 2001 From: Ivo Maffei Date: Sat, 1 Aug 2020 10:21:04 +0200 Subject: [PATCH 19/23] forgot to rename graph --- src/sage/graphs/generators/distance_regular.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/graphs/generators/distance_regular.pyx b/src/sage/graphs/generators/distance_regular.pyx index b97174f14a6..f9bdf055d8c 100644 --- a/src/sage/graphs/generators/distance_regular.pyx +++ b/src/sage/graphs/generators/distance_regular.pyx @@ -96,7 +96,7 @@ def locally_GQ42_distance_transitive_graph(): break G = Graph(libgap.Orbit(N, [1, 9], libgap.OnSets), format='list_of_edges') - G.name("locally GQ(4,2) graph") + G.name("locally GQ(4,2) distance transitive graph") return G From 7754591fe4e8b4f56db6857c3598f2863e76d822 Mon Sep 17 00:00:00 2001 From: Ivo Maffei Date: Sat, 1 Aug 2020 16:46:43 +0200 Subject: [PATCH 20/23] fixed indentation issue --- src/sage/graphs/generators/distance_regular.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/graphs/generators/distance_regular.pyx b/src/sage/graphs/generators/distance_regular.pyx index f9bdf055d8c..dcf979914aa 100644 --- a/src/sage/graphs/generators/distance_regular.pyx +++ b/src/sage/graphs/generators/distance_regular.pyx @@ -63,7 +63,7 @@ def cocliques_HoffmannSingleton(): edges = [] for c1, c2 in itertools.combinations(cocliques, 2): if len(c1.intersection(c2)) == 8: - edges.append((c1, c2)) + edges.append((c1, c2)) G = Graph(edges, format="list_of_edges") return G From 4e17fd7fd738e0d1a376a8212fbbf44ea9262646 Mon Sep 17 00:00:00 2001 From: Ivo Maffei Date: Tue, 4 Aug 2020 09:58:59 +0200 Subject: [PATCH 21/23] fixed bug introduced by removing module_list --- src/sage/graphs/graph_generators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py index af7874771e0..edccdcb6cd7 100644 --- a/src/sage/graphs/graph_generators.py +++ b/src/sage/graphs/graph_generators.py @@ -1912,7 +1912,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None # Small Graphs ########################################################################### from .generators import smallgraphs - from sage.graphs import distance_regular + from sage.graphs.generators import distance_regular Balaban10Cage = staticmethod(smallgraphs.Balaban10Cage) Balaban11Cage = staticmethod(smallgraphs.Balaban11Cage) BidiakisCube = staticmethod(smallgraphs.BidiakisCube) From e063b5e46a9076c0a5cea1046f22121bb14f7642 Mon Sep 17 00:00:00 2001 From: Ivo Maffei Date: Tue, 4 Aug 2020 12:01:50 +0200 Subject: [PATCH 22/23] simplified import --- src/sage/graphs/graph_generators.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py index edccdcb6cd7..a4a21676594 100644 --- a/src/sage/graphs/graph_generators.py +++ b/src/sage/graphs/graph_generators.py @@ -1911,8 +1911,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None ########################################################################### # Small Graphs ########################################################################### - from .generators import smallgraphs - from sage.graphs.generators import distance_regular + from .generators import smallgraphs, distance_regular Balaban10Cage = staticmethod(smallgraphs.Balaban10Cage) Balaban11Cage = staticmethod(smallgraphs.Balaban11Cage) BidiakisCube = staticmethod(smallgraphs.BidiakisCube) From 574960d6141180687fcc749b9b2cef5554ffa59f Mon Sep 17 00:00:00 2001 From: Ivo Maffei Date: Wed, 5 Aug 2020 10:22:20 +0200 Subject: [PATCH 23/23] added gap_packages flag to atlasrep --- src/sage/graphs/generators/distance_regular.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sage/graphs/generators/distance_regular.pyx b/src/sage/graphs/generators/distance_regular.pyx index dcf979914aa..3fb0fd77763 100644 --- a/src/sage/graphs/generators/distance_regular.pyx +++ b/src/sage/graphs/generators/distance_regular.pyx @@ -80,8 +80,8 @@ def locally_GQ42_distance_transitive_graph(): EXAMPLES:: - sage: G = graphs.locally_GQ42_distance_transitive_graph() # optional - internet - sage: G.is_distance_regular(True) # optional - internet + sage: G = graphs.locally_GQ42_distance_transitive_graph() # optional - internet gap_packages + sage: G.is_distance_regular(True) # optional - internet gap_packages ([45, 32, 12, 1, None], [None, 1, 6, 32, 45]) REFERENCES: @@ -194,8 +194,8 @@ def graph_3O73(): EXAMPLES:: - sage: G = graphs.graph_3O73() # optional - internet - sage: G.is_distance_regular(True) # optional - internet + sage: G = graphs.graph_3O73() # optional - internet gap_packages + sage: G.is_distance_regular(True) # optional - internet gap_packages ([117, 80, 24, 1, None], [None, 1, 12, 80, 117]) REFERENCES: