passagemath-graphs 10.5.34__cp312-cp312-musllinux_1_2_aarch64.whl → 10.6.1rc1__cp312-cp312-musllinux_1_2_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {passagemath_graphs-10.5.34.dist-info → passagemath_graphs-10.6.1rc1.dist-info}/METADATA +85 -16
- passagemath_graphs-10.6.1rc1.dist-info/RECORD +260 -0
- {passagemath_graphs-10.5.34.dist-info → passagemath_graphs-10.6.1rc1.dist-info}/WHEEL +1 -1
- sage/all__sagemath_graphs.py +5 -0
- sage/combinat/abstract_tree.py +189 -18
- sage/combinat/binary_tree.py +1 -1
- sage/combinat/cluster_algebra_quiver/all.py +1 -1
- sage/combinat/cluster_algebra_quiver/cluster_seed.py +18 -12
- sage/combinat/cluster_algebra_quiver/interact.py +3 -0
- sage/combinat/cluster_algebra_quiver/mutation_type.py +518 -519
- sage/combinat/cluster_algebra_quiver/quiver.py +233 -205
- sage/combinat/designs/MOLS_handbook_data.py +5 -5
- sage/combinat/designs/bibd.py +1 -1
- sage/combinat/designs/covering_array.py +3 -3
- sage/combinat/designs/covering_design.py +4 -7
- sage/combinat/designs/database.py +11 -10
- sage/combinat/designs/designs_pyx.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/designs/designs_pyx.pyx +2 -2
- sage/combinat/designs/difference_matrices.py +1 -1
- sage/combinat/designs/evenly_distributed_sets.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/designs/evenly_distributed_sets.pyx +4 -4
- sage/combinat/designs/ext_rep.py +9 -14
- sage/combinat/designs/gen_quadrangles_with_spread.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/designs/group_divisible_designs.py +1 -1
- sage/combinat/designs/incidence_structures.py +8 -8
- sage/combinat/designs/latin_squares.py +54 -21
- sage/combinat/designs/orthogonal_arrays.py +2 -1
- sage/combinat/designs/orthogonal_arrays_find_recursive.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/designs/orthogonal_arrays_find_recursive.pyx +22 -21
- sage/combinat/designs/resolvable_bibd.py +192 -158
- sage/combinat/designs/steiner_quadruple_systems.py +1 -1
- sage/combinat/designs/subhypergraph_search.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/designs/subhypergraph_search.pyx +4 -4
- sage/combinat/designs/twographs.py +2 -2
- sage/combinat/finite_state_machine.py +6 -6
- sage/combinat/finite_state_machine_generators.py +2 -2
- sage/combinat/graph_path.py +3 -3
- sage/combinat/ordered_tree.py +1 -1
- sage/combinat/posets/bubble_shuffle.py +247 -0
- sage/combinat/posets/cartesian_product.py +1 -1
- sage/combinat/posets/d_complete.py +4 -4
- sage/combinat/posets/elements.py +3 -3
- sage/combinat/posets/forest.py +1 -1
- sage/combinat/posets/hasse_cython.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/posets/hasse_cython.pyx +1 -1
- sage/combinat/posets/hasse_diagram.py +16 -22
- sage/combinat/posets/hochschild_lattice.py +158 -0
- sage/combinat/posets/incidence_algebras.py +15 -17
- sage/combinat/posets/lattices.py +51 -53
- sage/combinat/posets/linear_extension_iterator.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/posets/linear_extension_iterator.pyx +2 -0
- sage/combinat/posets/linear_extensions.py +13 -24
- sage/combinat/posets/moebius_algebra.py +5 -5
- sage/combinat/posets/poset_examples.py +70 -23
- sage/combinat/posets/posets.py +294 -103
- sage/combinat/rooted_tree.py +1 -1
- sage/databases/knotinfo_db.py +2 -1
- sage/ext_data/kenzo/CP2.txt +45 -0
- sage/ext_data/kenzo/CP3.txt +349 -0
- sage/ext_data/kenzo/CP4.txt +4774 -0
- sage/ext_data/kenzo/README.txt +49 -0
- sage/ext_data/kenzo/S4.txt +20 -0
- sage/graphs/asteroidal_triples.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/asteroidal_triples.pyx +24 -3
- sage/graphs/base/boost_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/boost_graph.pxd +3 -3
- sage/graphs/base/c_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/c_graph.pyx +1 -1
- sage/graphs/base/dense_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/dense_graph.pxd +5 -3
- sage/graphs/base/dense_graph.pyx +44 -0
- sage/graphs/base/graph_backends.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/sparse_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/static_dense_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/static_sparse_backend.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/static_sparse_backend.pyx +8 -5
- sage/graphs/base/static_sparse_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/static_sparse_graph.pyx +86 -15
- sage/graphs/bipartite_graph.py +59 -36
- sage/graphs/centrality.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/centrality.pyx +82 -9
- sage/graphs/cographs.py +1 -1
- sage/graphs/comparability.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/comparability.pyx +64 -26
- sage/graphs/connectivity.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/convexity_properties.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/convexity_properties.pyx +52 -9
- sage/graphs/digraph.py +439 -95
- sage/graphs/digraph_generators.py +174 -102
- sage/graphs/distances_all_pairs.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/dot2tex_utils.py +1 -1
- sage/graphs/edge_connectivity.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/generators/basic.py +1 -1
- sage/graphs/generators/distance_regular.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/generators/distance_regular.pyx +2 -2
- sage/graphs/generators/families.py +37 -27
- sage/graphs/generators/random.py +2 -2
- sage/graphs/generators/smallgraphs.py +3 -3
- sage/graphs/generic_graph.py +558 -86
- sage/graphs/generic_graph_pyx.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/generic_graph_pyx.pyx +58 -11
- sage/graphs/genus.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/genus.pyx +3 -4
- sage/graphs/graph.py +292 -9
- sage/graphs/graph_coloring.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_database.py +67 -12
- sage/graphs/graph_decompositions/bandwidth.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/clique_separators.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/clique_separators.pyx +24 -3
- sage/graphs/graph_decompositions/cutwidth.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/fast_digraph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/fast_digraph.pyx +1 -1
- sage/graphs/graph_decompositions/graph_products.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/graph_products.pyx +67 -21
- sage/graphs/graph_decompositions/modular_decomposition.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/slice_decomposition.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/slice_decomposition.pyx +34 -8
- sage/graphs/graph_decompositions/tree_decomposition.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/vertex_separation.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_generators.py +45 -32
- sage/graphs/graph_generators_pyx.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_generators_pyx.pyx +15 -15
- sage/graphs/graph_latex.py +1 -1
- sage/graphs/graph_list.py +54 -12
- sage/graphs/graph_plot.py +7 -0
- sage/graphs/hyperbolicity.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/hyperbolicity.pyx +2 -0
- sage/graphs/independent_sets.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/isoperimetric_inequalities.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/isoperimetric_inequalities.pyx +42 -6
- sage/graphs/line_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/line_graph.pyx +153 -37
- sage/graphs/matching_covered_graph.py +84 -60
- sage/graphs/orientations.py +3 -18
- sage/graphs/path_enumeration.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/path_enumeration.pyx +2 -2
- sage/graphs/spanning_tree.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/strongly_regular_db.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/strongly_regular_db.pyx +15 -15
- sage/graphs/traversals.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/traversals.pyx +13 -12
- sage/graphs/trees.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/tutte_polynomial.py +1 -1
- sage/graphs/views.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/weakly_chordal.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/weakly_chordal.pyx +50 -8
- sage/groups/perm_gps/partn_ref/refinement_graphs.cpython-312-aarch64-linux-musl.so +0 -0
- sage/knots/free_knotinfo_monoid.py +3 -3
- sage/knots/knotinfo.py +102 -82
- sage/knots/link.py +72 -39
- sage/sandpiles/sandpile.py +1 -2
- sage/topology/cubical_complex.py +4 -5
- sage/topology/delta_complex.py +4 -4
- sage/topology/simplicial_complex.py +0 -1
- sage/topology/simplicial_complex_catalog.py +6 -0
- sage/topology/simplicial_complex_examples.py +4 -16
- passagemath_graphs-10.5.34.dist-info/RECORD +0 -253
- {passagemath_graphs-10.5.34.dist-info → passagemath_graphs-10.6.1rc1.dist-info}/top_level.txt +0 -0
@@ -1,11 +1,11 @@
|
|
1
1
|
# sage_setup: distribution = sagemath-graphs
|
2
2
|
r"""
|
3
|
-
|
4
|
-
Squares (MOLS) of a given size.
|
3
|
+
Bounds on the number of mutually orthogonal Latin squares
|
5
4
|
|
6
|
-
This module
|
7
|
-
|
8
|
-
|
5
|
+
This module contains known lower bounds on the number of mutually orthogonal
|
6
|
+
Latin squares (MOLS) of a given size, and consists (almost) entirely of an
|
7
|
+
internal, constant tuple of Python integers corresponding to Table 3.87 in the
|
8
|
+
Handbook of Combinatorial Designs, 2nd edition, by Colbourn and Dinitz. One public
|
9
9
|
function, :func:`lower_bound`, is provided to access it.
|
10
10
|
|
11
11
|
Make sure we have all of the entries::
|
sage/combinat/designs/bibd.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# sage_setup: distribution = sagemath-graphs
|
2
2
|
r"""
|
3
|
-
Balanced
|
3
|
+
Balanced incomplete block designs (BIBD)
|
4
4
|
|
5
5
|
This module gathers everything related to Balanced Incomplete Block Designs. One can build a
|
6
6
|
BIBD (or check that it can be built) with :func:`balanced_incomplete_block_design`::
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# sage_setup: distribution = sagemath-graphs
|
2
2
|
r"""
|
3
|
-
Covering
|
3
|
+
Covering arrays
|
4
4
|
|
5
|
-
A
|
5
|
+
A covering array, denoted `CA(N;t,k,v)`, is an `N` by `k` array with
|
6
6
|
entries from a set of `v` elements with the property that in every
|
7
7
|
selection of `t` columns, every sequence of `t` elements appears in at
|
8
8
|
least one row.
|
9
9
|
|
10
|
-
An
|
10
|
+
An orthogonal array, denoted `OA(N;t,k,v)` is a covering array with the
|
11
11
|
property that every sequence of `t`-elements appears in exactly one row.
|
12
12
|
(See :mod:`sage.combinat.designs.orthogonal_arrays`).
|
13
13
|
|
@@ -49,13 +49,11 @@ Classes and methods
|
|
49
49
|
from urllib.request import urlopen
|
50
50
|
from ssl import create_default_context as default_context
|
51
51
|
|
52
|
-
from sage.misc.sage_eval import sage_eval
|
53
52
|
from sage.structure.sage_object import SageObject
|
54
53
|
from sage.rings.rational import Rational
|
55
54
|
from sage.arith.misc import binomial
|
56
55
|
from sage.combinat.combination import Combinations
|
57
56
|
from sage.combinat.designs.incidence_structures import IncidenceStructure
|
58
|
-
from sage.cpython.string import bytes_to_str
|
59
57
|
|
60
58
|
|
61
59
|
def schonheim(v, k, t):
|
@@ -513,6 +511,8 @@ def best_known_covering_design_www(v, k, t, verbose=False):
|
|
513
511
|
A :exc:`ValueError` is raised if the ``(v, k, t)`` parameters are not
|
514
512
|
found in the database.
|
515
513
|
"""
|
514
|
+
from sage.misc.sage_eval import sage_eval
|
515
|
+
|
516
516
|
v = int(v)
|
517
517
|
k = int(k)
|
518
518
|
t = int(t)
|
@@ -521,11 +521,8 @@ def best_known_covering_design_www(v, k, t, verbose=False):
|
|
521
521
|
if verbose:
|
522
522
|
print("Looking up the bounds at %s" % url)
|
523
523
|
|
524
|
-
|
525
|
-
|
526
|
-
s = bytes_to_str(f.read())
|
527
|
-
finally:
|
528
|
-
f.close()
|
524
|
+
with urlopen(url, context=default_context()) as f:
|
525
|
+
s = f.read().decode()
|
529
526
|
|
530
527
|
if 'covering not in database' in s: # not found
|
531
528
|
str = "no (%d, %d, %d) covering design in database\n" % (v, k, t)
|
@@ -1111,7 +1111,8 @@ def OA_10_205():
|
|
1111
1111
|
|
1112
1112
|
B = [0, 1, 22, 33, 83, 122, 135, 141, 145, 159, 175, 200, 226, 229, 231, 238, 246]
|
1113
1113
|
pplane = [[(xx+i) % pplane_size for xx in B] for i in range(pplane_size)]
|
1114
|
-
baer_subplane =
|
1114
|
+
baer_subplane = {i * pplane_size / baer_subplane_size
|
1115
|
+
for i in range(baer_subplane_size)}
|
1115
1116
|
|
1116
1117
|
p = list(baer_subplane)[0]
|
1117
1118
|
|
@@ -1530,8 +1531,8 @@ def OA_17_560():
|
|
1530
1531
|
# We remove all elements except those from F_{p^alpha} in the last three
|
1531
1532
|
# columns
|
1532
1533
|
|
1533
|
-
elements_of_subgroup =
|
1534
|
-
relabel = {G_to_int[v]:i for i,v in enumerate(elements_of_subgroup)}
|
1534
|
+
elements_of_subgroup = {x for x in G_set if x.polynomial().degree() < beta}
|
1535
|
+
relabel = {G_to_int[v]: i for i, v in enumerate(elements_of_subgroup)}
|
1535
1536
|
for x in range(p**alpha):
|
1536
1537
|
if x not in relabel:
|
1537
1538
|
relabel[x] = None
|
@@ -2376,11 +2377,11 @@ def QDM_35_7_1_1_7():
|
|
2376
2377
|
M = [
|
2377
2378
|
[None,None,None,None,None,None,None],
|
2378
2379
|
[ 0, 0, 0, 0, 0, 0, 0],
|
2379
|
-
[ 18, -18, 11, -11, 5,
|
2380
|
+
[ 18, -18, 11, -11, 5, -5, 4],
|
2380
2381
|
[ 26, -26, 10, -10, 30, -30, 23],
|
2381
|
-
[ 20, -20, 3,
|
2382
|
-
[ 5,
|
2383
|
-
[ 17, -17, 4,
|
2382
|
+
[ 20, -20, 3, -3, 33, -33, 23],
|
2383
|
+
[ 5, -5, 25, -25, 24, -24, 4],
|
2384
|
+
[ 17, -17, 4, -4, 22, -22, 0]
|
2384
2385
|
]
|
2385
2386
|
|
2386
2387
|
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as AdditiveCyclic
|
@@ -2417,10 +2418,10 @@ def QDM_45_7_1_1_9():
|
|
2417
2418
|
M = [
|
2418
2419
|
[None,None,None,None,None,None,None,None,None],
|
2419
2420
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
2420
|
-
[ 1, 27, 16, 7,
|
2421
|
-
[ 24, 40, 1, 35, -24, -40,
|
2421
|
+
[ 1, 27, 16, 7, -1, -27, -16, -7, 3],
|
2422
|
+
[ 24, 40, 1, 35, -24, -40, -1, -35, 7],
|
2422
2423
|
[ 10, 30, 22, 44, -10, -30, -22, -44, 7],
|
2423
|
-
[ 5, 18, 14, 33,
|
2424
|
+
[ 5, 18, 14, 33, -5, -18, -14, -33, 3],
|
2424
2425
|
[ 30, 16, 33, 27, -30, -16, -33, -27, 0],
|
2425
2426
|
]
|
2426
2427
|
|
Binary file
|
@@ -949,12 +949,12 @@ cpdef _OA_cache_set(int k, int n, truth_value):
|
|
949
949
|
_OA_cache_size = new_cache_size
|
950
950
|
|
951
951
|
if truth_value is True:
|
952
|
-
_OA_cache[n].max_true
|
952
|
+
_OA_cache[n].max_true = k if k>_OA_cache[n].max_true else _OA_cache[n].max_true
|
953
953
|
elif truth_value is Unknown:
|
954
954
|
_OA_cache[n].min_unknown = k if k<_OA_cache[n].min_unknown else _OA_cache[n].min_unknown
|
955
955
|
_OA_cache[n].max_unknown = k if k>_OA_cache[n].max_unknown else _OA_cache[n].max_unknown
|
956
956
|
else:
|
957
|
-
_OA_cache[n].min_false
|
957
|
+
_OA_cache[n].min_false = k if k<_OA_cache[n].min_false else _OA_cache[n].min_false
|
958
958
|
|
959
959
|
cpdef _OA_cache_get(int k, int n):
|
960
960
|
r"""
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# sage_setup: distribution = sagemath-graphs
|
2
2
|
# sage.doctest: needs sage.rings.finite_rings
|
3
3
|
r"""
|
4
|
-
Difference
|
4
|
+
Difference matrices
|
5
5
|
|
6
6
|
This module gathers code related to difference matrices. One can build those
|
7
7
|
objects (or know if they can be built) with :func:`difference_matrix`::
|
Binary file
|
@@ -534,7 +534,7 @@ cdef class EvenlyDistributedSetsBacktracker:
|
|
534
534
|
x += 1
|
535
535
|
else:
|
536
536
|
kk += 1
|
537
|
-
x += m - x%m
|
537
|
+
x += m - x % m
|
538
538
|
else:
|
539
539
|
x += 1
|
540
540
|
|
@@ -555,7 +555,7 @@ cdef class EvenlyDistributedSetsBacktracker:
|
|
555
555
|
if self.check:
|
556
556
|
self._check_cosets(kk)
|
557
557
|
elif self.cosets[x / m]:
|
558
|
-
x += m - x%m
|
558
|
+
x += m - x % m
|
559
559
|
elif kk == 2:
|
560
560
|
if self.min_orb[x] < x:
|
561
561
|
x += 1
|
@@ -650,12 +650,12 @@ cdef class EvenlyDistributedSetsBacktracker:
|
|
650
650
|
c = 0
|
651
651
|
for i in range(self.e):
|
652
652
|
c += self.cosets[i]
|
653
|
-
if c != (kk * (kk-1))
|
653
|
+
if 2 * c != (kk * (kk-1)):
|
654
654
|
raise RuntimeError("the number of elements in cosets is wrong! Got {} instead of {}.".format(c, (kk*(kk-1))/2))
|
655
655
|
|
656
656
|
for i in range(kk):
|
657
657
|
for j in range(i):
|
658
658
|
if self.cosets[ self.diff[self.B[i]][self.B[j]] / m ] != 1:
|
659
|
-
raise RuntimeError("self.cosets misses the difference B[{}]-B[{}]".format(i,j))
|
659
|
+
raise RuntimeError("self.cosets misses the difference B[{}]-B[{}]".format(i, j))
|
660
660
|
|
661
661
|
return 0
|
sage/combinat/designs/ext_rep.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# sage_setup: distribution = sagemath-graphs
|
2
2
|
r"""
|
3
|
-
External
|
3
|
+
External representations of block designs
|
4
4
|
|
5
|
-
|
5
|
+
This module is an API to the abstract tree represented by
|
6
6
|
an XML document containing the External Representation of a list of
|
7
7
|
block designs. The module also provides the related I/O operations for
|
8
|
-
reading/writing ext-rep files or data. The parsing is based on expat.
|
8
|
+
reading/writing ``ext-rep`` files or data. The parsing is based on expat.
|
9
9
|
|
10
|
-
This is a modified form of the module ext_rep.py (version 0.8)
|
10
|
+
This is a modified form of the module ``ext_rep.py`` (version 0.8)
|
11
11
|
written by Peter Dobcsanyi [Do2009]_ peter@designtheory.org.
|
12
12
|
|
13
13
|
.. TODO::
|
@@ -16,12 +16,9 @@ written by Peter Dobcsanyi [Do2009]_ peter@designtheory.org.
|
|
16
16
|
information about things like automorphism groups, transitivity, cycle type
|
17
17
|
representatives, etc, but none of this data is made available through the
|
18
18
|
current implementation.
|
19
|
-
|
20
|
-
Functions
|
21
|
-
---------
|
22
19
|
"""
|
23
20
|
|
24
|
-
|
21
|
+
# ***********************************************************************
|
25
22
|
# This software is released under the terms of the GNU General Public
|
26
23
|
# License, version 2 or above (your choice). For details on licensing,
|
27
24
|
# see the accompanying documentation.
|
@@ -29,9 +26,9 @@ Functions
|
|
29
26
|
# This is a modified form of the module ext_rep.py (version 0.8)
|
30
27
|
# written by Peter Dobcsanyi peter@designtheory.org.
|
31
28
|
#
|
32
|
-
# Copyright 2004
|
33
|
-
#
|
34
|
-
|
29
|
+
# Copyright 2004 Peter Dobcsanyi peter@designtheory.org
|
30
|
+
# 2009 Carlo Hamalainen carlo.hamalainen@gmail.com
|
31
|
+
# ***********************************************************************
|
35
32
|
|
36
33
|
import sys
|
37
34
|
import xml.parsers.expat
|
@@ -598,7 +595,6 @@ def _encode_attribute(string):
|
|
598
595
|
sage: _encode_attribute('E')
|
599
596
|
'E'
|
600
597
|
"""
|
601
|
-
|
602
598
|
if pattern_integer.match(string):
|
603
599
|
return int(string)
|
604
600
|
elif pattern_decimal.match(string):
|
@@ -611,8 +607,7 @@ class XTree:
|
|
611
607
|
'''
|
612
608
|
A lazy class to wrap a rooted tree representing an XML document.
|
613
609
|
The tree's nodes are tuples of the structure:
|
614
|
-
|
615
|
-
(name, {dictionary of attributes}, [list of children])
|
610
|
+
(name, {dictionary of attributes}, [list of children])
|
616
611
|
|
617
612
|
Methods and services of an XTree object ``t``:
|
618
613
|
|
Binary file
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# sage_setup: distribution = sagemath-graphs
|
2
2
|
# sage.doctest: needs sage.rings.finite_rings
|
3
3
|
r"""
|
4
|
-
Group-
|
4
|
+
Group-divisible designs (GDD)
|
5
5
|
|
6
6
|
This module gathers everything related to Group-Divisible Designs. The
|
7
7
|
constructions defined here can be accessed through ``designs.<tab>``::
|
@@ -365,11 +365,11 @@ class IncidenceStructure:
|
|
365
365
|
True
|
366
366
|
sage: ["Am", "I", "finally", "done ?"] in IS
|
367
367
|
False
|
368
|
-
sage: IS = designs.ProjectiveGeometryDesign(3, 1, GF(2), # needs sage.combinat
|
368
|
+
sage: IS = designs.ProjectiveGeometryDesign(3, 1, GF(2), # needs sage.combinat sage.modules
|
369
369
|
....: point_coordinates=False)
|
370
|
-
sage: [3,8,7] in IS # needs sage.combinat
|
370
|
+
sage: [3,8,7] in IS # needs sage.combinat sage.modules
|
371
371
|
True
|
372
|
-
sage: [3,8,9] in IS # needs sage.combinat
|
372
|
+
sage: [3,8,9] in IS # needs sage.combinat sage.modules
|
373
373
|
False
|
374
374
|
"""
|
375
375
|
try:
|
@@ -1508,10 +1508,10 @@ class IncidenceStructure:
|
|
1508
1508
|
sage: BD.is_t_design(0,6,3,7) or BD.is_t_design(0,7,4,7) or BD.is_t_design(0,7,3,8)
|
1509
1509
|
False
|
1510
1510
|
|
1511
|
-
sage: BD = designs.AffineGeometryDesign(3, 1, GF(2)) # needs sage.combinat
|
1512
|
-
sage: BD.is_t_design(1) # needs sage.combinat
|
1511
|
+
sage: BD = designs.AffineGeometryDesign(3, 1, GF(2)) # needs sage.combinat sage.modules
|
1512
|
+
sage: BD.is_t_design(1) # needs sage.combinat sage.modules
|
1513
1513
|
True
|
1514
|
-
sage: BD.is_t_design(2) # needs sage.combinat
|
1514
|
+
sage: BD.is_t_design(2) # needs sage.combinat sage.modules
|
1515
1515
|
True
|
1516
1516
|
|
1517
1517
|
Steiner triple and quadruple systems are other names for `2-(v,3,1)` and
|
@@ -1924,8 +1924,8 @@ class IncidenceStructure:
|
|
1924
1924
|
sage: TD.is_resolvable()
|
1925
1925
|
True
|
1926
1926
|
|
1927
|
-
sage: AG = designs.AffineGeometryDesign(3,1,GF(2)) # needs sage.combinat
|
1928
|
-
sage: AG.is_resolvable() # needs sage.combinat
|
1927
|
+
sage: AG = designs.AffineGeometryDesign(3,1,GF(2)) # needs sage.combinat sage.modules
|
1928
|
+
sage: AG.is_resolvable() # needs sage.combinat sage.modules
|
1929
1929
|
True
|
1930
1930
|
|
1931
1931
|
Their classes::
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# sage_setup: distribution = sagemath-graphs
|
2
2
|
# sage.doctest: needs sage.modules
|
3
3
|
r"""
|
4
|
-
Mutually
|
4
|
+
Mutually orthogonal Latin squares (MOLS)
|
5
5
|
|
6
6
|
The main function of this module is :func:`mutually_orthogonal_latin_squares`
|
7
7
|
and can be can be used to generate MOLS (or check that they exist)::
|
@@ -127,6 +127,8 @@ from itertools import repeat
|
|
127
127
|
from sage.rings.integer import Integer
|
128
128
|
from sage.categories.sets_cat import EmptySetError
|
129
129
|
from sage.misc.unknown import Unknown
|
130
|
+
from sage.arith.misc import is_prime_power
|
131
|
+
from sage.rings.finite_rings.finite_field_constructor import GF
|
130
132
|
|
131
133
|
|
132
134
|
def are_mutually_orthogonal_latin_squares(l, verbose=False):
|
@@ -240,22 +242,22 @@ def mutually_orthogonal_latin_squares(k, n, partitions=False, check=True):
|
|
240
242
|
|
241
243
|
sage: designs.mutually_orthogonal_latin_squares(4,5) # needs sage.schemes
|
242
244
|
[
|
243
|
-
[0 2 4
|
244
|
-
[
|
245
|
-
[3 0
|
246
|
-
[
|
247
|
-
[
|
245
|
+
[0 1 2 3 4] [0 1 2 3 4] [0 1 2 3 4] [0 1 2 3 4]
|
246
|
+
[1 2 3 4 0] [2 3 4 0 1] [3 4 0 1 2] [4 0 1 2 3]
|
247
|
+
[2 3 4 0 1] [4 0 1 2 3] [1 2 3 4 0] [3 4 0 1 2]
|
248
|
+
[3 4 0 1 2] [1 2 3 4 0] [4 0 1 2 3] [2 3 4 0 1]
|
249
|
+
[4 0 1 2 3], [3 4 0 1 2], [2 3 4 0 1], [1 2 3 4 0]
|
248
250
|
]
|
249
251
|
|
250
252
|
sage: designs.mutually_orthogonal_latin_squares(3,7) # needs sage.schemes
|
251
253
|
[
|
252
|
-
[0 2 4 6 1 3 5] [0
|
253
|
-
[
|
254
|
-
[
|
255
|
-
[4 6 1
|
256
|
-
[
|
257
|
-
[
|
258
|
-
[
|
254
|
+
[0 1 2 3 4 5 6] [0 1 2 3 4 5 6] [0 1 2 3 4 5 6]
|
255
|
+
[1 2 3 4 5 6 0] [2 3 4 5 6 0 1] [3 4 5 6 0 1 2]
|
256
|
+
[2 3 4 5 6 0 1] [4 5 6 0 1 2 3] [6 0 1 2 3 4 5]
|
257
|
+
[3 4 5 6 0 1 2] [6 0 1 2 3 4 5] [2 3 4 5 6 0 1]
|
258
|
+
[4 5 6 0 1 2 3] [1 2 3 4 5 6 0] [5 6 0 1 2 3 4]
|
259
|
+
[5 6 0 1 2 3 4] [3 4 5 6 0 1 2] [1 2 3 4 5 6 0]
|
260
|
+
[6 0 1 2 3 4 5], [5 6 0 1 2 3 4], [4 5 6 0 1 2 3]
|
259
261
|
]
|
260
262
|
|
261
263
|
sage: designs.mutually_orthogonal_latin_squares(2,5,partitions=True) # needs sage.schemes
|
@@ -269,16 +271,16 @@ def mutually_orthogonal_latin_squares(k, n, partitions=False, check=True):
|
|
269
271
|
[2, 7, 12, 17, 22],
|
270
272
|
[3, 8, 13, 18, 23],
|
271
273
|
[4, 9, 14, 19, 24]],
|
272
|
-
[[0, 8, 11, 19, 22],
|
273
|
-
[3, 6, 14, 17, 20],
|
274
|
-
[1, 9, 12, 15, 23],
|
275
|
-
[4, 7, 10, 18, 21],
|
276
|
-
[2, 5, 13, 16, 24]],
|
277
274
|
[[0, 9, 13, 17, 21],
|
278
|
-
[2, 6, 10, 19, 23],
|
279
|
-
[4, 8, 12, 16, 20],
|
280
275
|
[1, 5, 14, 18, 22],
|
281
|
-
[
|
276
|
+
[2, 6, 10, 19, 23],
|
277
|
+
[3, 7, 11, 15, 24],
|
278
|
+
[4, 8, 12, 16, 20]],
|
279
|
+
[[0, 8, 11, 19, 22],
|
280
|
+
[1, 9, 12, 15, 23],
|
281
|
+
[2, 5, 13, 16, 24],
|
282
|
+
[3, 6, 14, 17, 20],
|
283
|
+
[4, 7, 10, 18, 21]]]
|
282
284
|
|
283
285
|
What is the maximum number of MOLS of size 8 that Sage knows how to build?::
|
284
286
|
|
@@ -342,6 +344,21 @@ def mutually_orthogonal_latin_squares(k, n, partitions=False, check=True):
|
|
342
344
|
[3 4 5 6 7 1 2 0 8 9] [5 6 7 1 2 3 4 0 9 8]
|
343
345
|
[4 5 6 7 1 2 3 9 0 8], [7 1 2 3 4 5 6 9 8 0]
|
344
346
|
]
|
347
|
+
|
348
|
+
Verify the construction from [KD2015]_::
|
349
|
+
|
350
|
+
sage: designs.mutually_orthogonal_latin_squares(2, 9)
|
351
|
+
[
|
352
|
+
[0 1 2 3 4 5 6 7 8] [0 1 2 3 4 5 6 7 8]
|
353
|
+
[2 3 6 4 1 8 0 5 7] [3 8 4 7 5 2 1 0 6]
|
354
|
+
[3 8 4 7 5 2 1 0 6] [4 7 1 5 8 6 3 2 0]
|
355
|
+
[4 7 1 5 8 6 3 2 0] [5 0 8 2 6 1 7 4 3]
|
356
|
+
[5 0 8 2 6 1 7 4 3] [6 4 0 1 3 7 2 8 5]
|
357
|
+
[6 4 0 1 3 7 2 8 5] [7 6 5 0 2 4 8 3 1]
|
358
|
+
[7 6 5 0 2 4 8 3 1] [8 2 7 6 0 3 5 1 4]
|
359
|
+
[8 2 7 6 0 3 5 1 4] [1 5 3 8 7 0 4 6 2]
|
360
|
+
[1 5 3 8 7 0 4 6 2], [2 3 6 4 1 8 0 5 7]
|
361
|
+
]
|
345
362
|
"""
|
346
363
|
from sage.combinat.designs.orthogonal_arrays import orthogonal_array
|
347
364
|
from sage.matrix.constructor import Matrix
|
@@ -367,6 +384,22 @@ def mutually_orthogonal_latin_squares(k, n, partitions=False, check=True):
|
|
367
384
|
|
368
385
|
matrices = construction()[:k]
|
369
386
|
|
387
|
+
# Implements the construction from Theorem 5.2.4 of [KD2015]_ for prime powers.
|
388
|
+
# This was implemented to fix :issue:`26107`, which pointed out that this
|
389
|
+
# function was unacceptably slow when n was a large prime power
|
390
|
+
elif is_prime_power(n):
|
391
|
+
F = list(GF(n))
|
392
|
+
|
393
|
+
# We need the first element of the list to be 0
|
394
|
+
assert F[0] == 0
|
395
|
+
|
396
|
+
# This dictionary is used to convert from field elements to integers
|
397
|
+
conv = {F[i] : i for i in range(n)}
|
398
|
+
|
399
|
+
# Make the matrices
|
400
|
+
matrices = [Matrix([[conv[F[i] + F[r]*F[j]] for i in range(n)]
|
401
|
+
for j in range(n)]) for r in range(1, k+1)]
|
402
|
+
|
370
403
|
elif orthogonal_array(k + 2, n, existence=True) is not Unknown:
|
371
404
|
# Forwarding non-existence results
|
372
405
|
if orthogonal_array(k + 2, n, existence=True):
|
@@ -1724,7 +1724,8 @@ def OA_n_times_2_pow_c_from_matrix(k, c, G, A, Y, check=True):
|
|
1724
1724
|
for i in range(len(B)):
|
1725
1725
|
for j in range(i):
|
1726
1726
|
g_to_col_indices = {g: [] for g in G}
|
1727
|
-
|
1727
|
+
YY = Y[i] - Y[j]
|
1728
|
+
Hij = {YY * v for v in H}
|
1728
1729
|
for s in range(2 * G_card):
|
1729
1730
|
g_to_col_indices[B[i][s] - B[j][s]].append(s)
|
1730
1731
|
for s1, s2 in g_to_col_indices.values():
|
Binary file
|
@@ -147,12 +147,13 @@ cpdef find_product_decomposition(int k, int n):
|
|
147
147
|
"""
|
148
148
|
cdef int n1,n2
|
149
149
|
for n1 in range(2, n):
|
150
|
-
|
150
|
+
if n % n1:
|
151
|
+
# we want to iterate only through divisors of n1... it seems
|
152
|
+
# faster to use that rather than calling the divisors function
|
153
|
+
continue
|
154
|
+
n2 = n // n1 # n2 is decreasing along the loop
|
151
155
|
if n2 < n1:
|
152
156
|
break
|
153
|
-
if n%n1: # we want to iterate only through divisors of n1... it seems
|
154
|
-
# faster to use that rather than calling the divisors function
|
155
|
-
continue
|
156
157
|
if is_available(k, n1) and is_available(k, n2):
|
157
158
|
from sage.combinat.designs.orthogonal_arrays import wilson_construction
|
158
159
|
return wilson_construction, (None,k,n1,n2,(),False)
|
@@ -188,11 +189,11 @@ cpdef find_wilson_decomposition_with_one_truncated_group(int k, int n):
|
|
188
189
|
"""
|
189
190
|
cdef int r,u,m
|
190
191
|
# If there exists a TD(k+1,t) then k+1 < t+2, i.e. k <= t
|
191
|
-
for r in range(max(1,k),n-1):
|
192
|
-
u = n%r
|
192
|
+
for r in range(max(1, k), n - 1):
|
193
|
+
u = n % r
|
193
194
|
# We ensure that 1<=u, and that there can exists a TD(k,u), i.e k<u+2
|
194
195
|
# (unless u == 1)
|
195
|
-
if u == 0 or (u>1 and k >= u+2):
|
196
|
+
if u == 0 or (u > 1 and k >= u + 2):
|
196
197
|
continue
|
197
198
|
|
198
199
|
m = n // r
|
@@ -292,9 +293,9 @@ cpdef find_construction_3_3(int k, int n):
|
|
292
293
|
(11, 11, 16, 1)
|
293
294
|
sage: find_construction_3_3(12,11)
|
294
295
|
"""
|
295
|
-
cdef int mm,nn,i
|
296
|
+
cdef int mm, nn, i
|
296
297
|
for mm in range(k-1, n//2+1):
|
297
|
-
if not(is_available(k, mm) and is_available(k, mm + 1)):
|
298
|
+
if not (is_available(k, mm) and is_available(k, mm + 1)):
|
298
299
|
continue
|
299
300
|
|
300
301
|
for nn in range(2, n//mm+1):
|
@@ -392,10 +393,10 @@ cpdef find_construction_3_5(int k, int n):
|
|
392
393
|
for s in range(min(i+1,nn)):
|
393
394
|
for r in range(max(0,i-nn-s), min(s+1,i-s+1,nn)):
|
394
395
|
t = i - r - s
|
395
|
-
if ((nn-r-1)*(nn-s) < t
|
396
|
-
(r==0 or is_available(k,r)) and
|
397
|
-
(s==0 or is_available(k,s)) and
|
398
|
-
(t==0 or is_available(k,t))):
|
396
|
+
if ((nn-r-1)*(nn-s) < t and
|
397
|
+
(r==0 or is_available(k, r)) and
|
398
|
+
(s==0 or is_available(k, s)) and
|
399
|
+
(t==0 or is_available(k, t))):
|
399
400
|
from sage.combinat.designs.orthogonal_arrays_build_recursive import construction_3_5
|
400
401
|
return construction_3_5, (k,nn,mm,r,s,t)
|
401
402
|
|
@@ -482,15 +483,15 @@ cpdef find_q_x(int k, int n):
|
|
482
483
|
x = (n-q**2+q-2)/(2-q)
|
483
484
|
if (x < q and
|
484
485
|
0 < x and
|
485
|
-
n == (q-1)*(q-x)+x+2
|
486
|
-
is_available(k+1,q-x-1)
|
487
|
-
is_available(k+1,q-x+1)
|
486
|
+
n == (q-1)*(q-x)+x+2 and
|
487
|
+
is_available(k+1, q-x-1) and
|
488
|
+
is_available(k+1, q-x+1) and
|
488
489
|
# The next is always True, because q is a prime power
|
489
490
|
# is_available(k+1,q) and
|
490
|
-
is_available(k, x+2 )
|
491
|
+
is_available(k, x+2 ) and
|
491
492
|
smallInteger(q).is_prime_power()):
|
492
493
|
from sage.combinat.designs.orthogonal_arrays_build_recursive import construction_q_x
|
493
|
-
return construction_q_x, (k,q,x)
|
494
|
+
return construction_q_x, (k, q, x)
|
494
495
|
return False
|
495
496
|
|
496
497
|
cpdef find_thwart_lemma_3_5(int k, int N):
|
@@ -866,11 +867,11 @@ def int_as_sum(int value, list S, int k_max):
|
|
866
867
|
vv = v-i
|
867
868
|
if vv == 0:
|
868
869
|
return D[v] + (i,)
|
869
|
-
if (vv > 0
|
870
|
+
if (vv > 0 and # The new integer i is too big
|
870
871
|
vv <= j*max_value and # The new integer i is too small
|
871
|
-
vv not in D
|
872
|
+
vv not in D and # We had it in D already
|
872
873
|
vv not in new_D): # We had it in new_D already
|
873
|
-
new_D[vv] = D[v]+(i,)
|
874
|
+
new_D[vv] = D[v] + (i,)
|
874
875
|
if not new_D:
|
875
876
|
break
|
876
877
|
D.update(new_D)
|