From f98bc6e48426cca78812c169af091554ed5433e5 Mon Sep 17 00:00:00 2001 From: dcoudert Date: Fri, 10 May 2024 16:57:54 +0200 Subject: [PATCH 01/51] cographs generator --- src/doc/en/reference/graphs/index.rst | 1 + src/doc/en/reference/references/index.rst | 5 + src/sage/graphs/cographs.py | 571 ++++++++++++++++++++++ src/sage/graphs/graph_generators.py | 3 + 4 files changed, 580 insertions(+) create mode 100644 src/sage/graphs/cographs.py diff --git a/src/doc/en/reference/graphs/index.rst b/src/doc/en/reference/graphs/index.rst index 496f00ebcba..f681c083a08 100644 --- a/src/doc/en/reference/graphs/index.rst +++ b/src/doc/en/reference/graphs/index.rst @@ -78,6 +78,7 @@ Libraries of algorithms sage/graphs/centrality sage/graphs/asteroidal_triples sage/graphs/independent_sets + sage/graphs/cographs sage/graphs/comparability sage/graphs/line_graph sage/graphs/spanning_tree diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 894b680b2a9..556a3ed9c5d 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -3624,6 +3624,11 @@ REFERENCES: .. [Jon2005] \V. Jones, The Jones Polynomial, 2005. https://math.berkeley.edu/~vfr/jones.pdf +.. [JPD2018] Átila A. Jones, Fábio Protti and Renata R. Del-Vecchio: + *Cograph generation with linear delay*. + Theoretical Computer Science, 713:1-10, 2018. + :doi:`10.1016/j.tcs.2017.12.037` + .. [JRJ94] Jourdan, Guy-Vincent; Rampon, Jean-Xavier; Jard, Claude (1994), "Computing on-line the lattice of maximal antichains of posets", Order 11 (3) p. 197-210, :doi:`10.1007/BF02115811` diff --git a/src/sage/graphs/cographs.py b/src/sage/graphs/cographs.py new file mode 100644 index 00000000000..516b9fb89b5 --- /dev/null +++ b/src/sage/graphs/cographs.py @@ -0,0 +1,571 @@ +r""" +Cographs + +A cograph is a `P_4`-free graph, that is a graph without induced path of order +4. Any cograph may be constructed, starting from the single vertex graph, by a +sequence of join and disjoint union operations. See the :wikipedia:`Cograph` for +more details on this graph class, and :oeis:`A000084` to know the number of +cographs of order `n \geq 1`. + +This module implements the folowing methods concerning cographs: + +.. csv-table:: + :class: contentstable + :widths: 30, 70 + :delim: | + + :meth:`cographs` | Return an iterator over the cographs of order `n`. + +Methods +------- +""" +# **************************************************************************** +# Copyright (C) 2024 David Coudert +# +# 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/ +# **************************************************************************** + + +class CoTree: + """ + Generic cotree node. + + This data structure is used for the generation of cographs in + :meth:`cographs`. + """ + def __init__(self, name='root'): + r""" + Initialize a cotree. + + INPUT: + + - ``name`` -- either an operation ('U' or 'J') or the size of the + subtree rooted at this node + + EXAMPLES:: + + sage: from sage.graphs.cographs import CoTree + sage: CoTree(1) + ( 1 ) + sage: CoTree() + ( root ) + """ + self.name = name + self.children = [] + self.info = None + self.parent = None + + def __repr__(self): + r""" + Return a string representation of ``self``. + + EXAMPLES:: + + sage: from sage.graphs.cographs import CoTree + sage: CoTree(1) + ( 1 ) + sage: CoTree('J') + [ J ] + sage: next(graphs.cographs(4, as_graph=False)) # indirect doctest + [ J ( 0 ) ( 1 ) ( 2 ) ( 3 ) ] + """ + return self.__str__() + + def __str__(self): + r""" + Return a string representation of ``self``. + + The subtree of a node is inside brackets and starts with the operation + to perform between the children ('J' for join or 'U' for disjoint + union). + + EXAMPLES:: + + sage: from sage.graphs.cographs import CoTree + sage: CoTree(1) + ( 1 ) + sage: CoTree('J') + [ J ] + sage: next(graphs.cographs(4, as_graph=False)) # indirect doctest + [ J ( 0 ) ( 1 ) ( 2 ) ( 3 ) ] + """ + first = '[' if self.name in ['J', 'U'] else '(' + last = ' ]' if self.name in ['J', 'U'] else ' )' + s = f"{first} {self.name}" + for child in self.children: + s += f' {child}' + s += last + return s + + + def add_child(self, node): + r""" + Add cotree ``node`` in the list of children of ``self``. + + INPUT: + + - ``node`` -- a CoTree + + EXAMPLES:: + + sage: from sage.graphs.cographs import CoTree + sage: T = CoTree('J') + sage: T.add_child(CoTree(1)) + sage: T + [ J ( 1 ) ] + """ + assert isinstance(node, CoTree) + self.children.append(node) + node.parent = self + + def copy_tree(self, T): + r""" + Make `T` a copy of ``self``. + + INPUT: + + - ``T`` -- a CoTree + + EXAMPLES:: + + sage: from sage.graphs.cographs import CoTree + sage: T = CoTree('J') + sage: T.add_child(CoTree(1)) + sage: T.add_child(CoTree(2)) + sage: T + [ J ( 1 ) ( 2 ) ] + sage: B = CoTree('U') + sage: T.copy_tree(B) + sage: B + [ U ( 1 ) ( 2 ) ] + """ + for i, child in enumerate(self.children): + T.add_child(CoTree(child.name)) + child.copy_tree(T.children[i]) + + def reset_info(self): + r""" + Reset parameter ``info`` from all nodes of ``self``. + + EXAMPLES:: + + sage: from sage.graphs.cographs import CoTree + sage: T = CoTree(1) + sage: B = CoTree(2) + sage: T.add_child(B) + sage: C = CoTree(3) + sage: B.add_child(C) + sage: C.info = 'info' + sage: T.reset_info() + sage: C.info is None + True + """ + for child in self.children: + child.reset_info() + self.info = None + + +def next_partition(P): + r""" + Return the next partition after `P`, if any. + + This is a helper method to method :meth:`cographs`. + + INPUT: + + - ``P`` -- a list encoding a partition of a number `n` + + EXAMPLES:: + + sage: from sage.graphs.cographs import next_partition + sage: P = [1, 1, 1, 1, 1, 1] + sage: while P: + ....: print(P) + ....: P = next_partition(P) + [1, 1, 1, 1, 1, 1] + [1, 1, 1, 1, 2] + [1, 1, 1, 3] + [1, 1, 2, 2] + [1, 1, 4] + [1, 2, 3] + [1, 5] + [2, 2, 2] + [2, 4] + [3, 3] + """ + if len(P) < 2: + raise ValueError("the length of the input partition must be at least 2") + n = sum(P) + if P[0] != n//2: + if P[-1] - P[-2] <= 1: + return P[:-2] + [P[-2] + P[-1]] + + x = P[-2] + 1 + y = P[-1] - 1 + q = y // x + if q > 1: + r = y % x + return P[:-2] + [x]*q + [x + r] + return P[:-2] + [x, y] + + if n == 3 and P[1] != n//2 + n%2: + return [1, 2] + return None + + +def rebuild_node(u, P): + r""" + Replace the subtree rooted at `u` by a subtree induced by partition `P`. + + This is a helper method to method :meth:`cographs`. + + INPUT: + + - ``u`` -- a ``CoTree`` + + - ``P`` -- a partition encoding the new structure of the children of `u` + + EXAMPLES:: + + sage: next(graphs.cographs(3, as_graph=True)).vertices() # indirect doctest + [0, 1, 2] + """ + u.children = [] # delete the subtree rooted at u + for value in P: + this_child = CoTree(value) + u.add_child(this_child) + if value > 1: + for j in range(value): + this_child.add_child(CoTree(1)) + + +def find_pivot(T): + r""" + Seach for a pivot node in `T`. + + This is a helper method to method :meth:`cographs`. + + A node in `T` is a ``pivot`` if it is not a leaf, it does not induce a + maximum partition and it is the first such node in the inverse postorder + traversal. + + INPUT: + + - ``T`` -- a ``CoTree`` + + EXAMPLES:: + + sage: next(graphs.cographs(3, as_graph=True)).vertices() # indirect doctest + [0, 1, 2] + """ + for child in reversed(T.children): + pivot = find_pivot(child) + if pivot is not None: + return pivot + + # Check if T is a pivot + i = T.name + if (i != 1 and ((i//2 != T.children[0].name) or + (i//2 + i%2 != T.children[1].name))): + T.info = 'p' # pivot mark + return T + return None + + +def next_tree(T): + r""" + Check if there is another tree after `T`. + + This is a helper method to method :meth:`cographs`. + + This methods returns ``True`` if there is a tree after `T`, and if so it + modifies the input tree `T` that becomes the next tree. + + INPUT: + + - ``T`` -- a ``CoTree`` + + EXAMPLES:: + + sage: next(graphs.cographs(3, as_graph=True)).vertices() # indirect doctest + [0, 1, 2] + """ + pivot = find_pivot(T) + if pivot is None: + return False + + # Find the next partition induced by the subtree pivot + partition = [c.name for c in pivot.children] + P = next_partition(partition) + # and rebuild the subtree of pivot accordingly + rebuild_node(pivot, P) + + x = pivot + while x.parent is not None: + ancestor = x.parent + # Modify the bigger siblings of x (i.e., the siblings placed after + # x in the list of children of ancestor) + is_bigger_sibling = False + for y, this_child in enumerate(ancestor.children): + if this_child.info == 'p': + is_bigger_sibling = True + elif is_bigger_sibling: # true only for bigger siblings of x + if x.name == this_child.name: + temp = CoTree(x.name) + x.copy_tree(temp) + ancestor.children[y] = temp # copy subtree T(x) in T(y) + temp.parent = ancestor + else: + P = [1] * ancestor.children[y].name + rebuild_node(ancestor.children[y], P) + + # Make the parent of x (if any) the new pivot + x.info = None # reset the pivot mark + ancestor.info = 'p' # parent gets the pivot mark + x = ancestor + + return True + + +def cographs(n, as_graph=True, immutable=False): + r""" + Return an iterator over the cographs of order `n`. + + A cograph is a `P_4`-free graph, that is a graph without induced path of + order 4. Any cograph may be constructed, starting from the single vertex + graph, by a sequence of :meth:`sage.graphs.graph.Graph.join` and + :meth:`sage.graphs.generic_graph.GenericGraph.disjoint_union` operations. + See the :wikipedia:`Cograph` for more details. + + This method implements the generator of all cographs of order `n` proposd + in [JPD2018]_. The algorithm generates one by one every cotree with `n` nodes, + and each cotree is generated by using its previous cotree. The time to + construct the first cotree is `O(n)` and the time spent between two + consecutive outputs is `O(n)`. Hence, the overall complexity of the algorithm + is `O(n*Mn)`, where `n` is the number of nodes and `Mn` is the total number of + cographs with `n` nodes (see :oeis:`A000084`). + + INPUT: + + - ``n`` -- an integer larger or equal to 1 + + - ``as_graph`` -- boolean (default: ``True``); whether to return graphs or + the tree data structure encoding the graph + + - ``immutable`` -- boolean (default: ``False``); whether to return an + immutable or a mutable graph. This parameter is used only when ``as_graph + is True``. + + EXAMPLES: + + The output can be either cotrees or graphs:: + + sage: for t in graphs.cographs(3, as_graph=False): + ....: print(t) + [ J ( 0 ) ( 1 ) ( 2 ) ] + [ J [ U ( 0 ) ( 1 ) ( 2 ) ] ] + [ J ( 0 ) [ U ( 1 ) ( 2 ) ] ] + [ J [ U ( 0 ) [ J ( 1 ) ( 2 ) ] ] ] + sage: for g in graphs.cographs(3, as_graph=True): + ....: print(g.edges(labels=False, sort=True)) + [(0, 1), (0, 2), (1, 2)] + [] + [(0, 1), (0, 2)] + [(1, 2)] + + Check that we agree with :oeis:`A000084`:: + + sage: [sum(1 for _ in graphs.cographs(n, as_graph=False)) + ....: for n in range(1, 8)] + [1, 2, 4, 10, 24, 66, 180] + + TESTS:: + + sage: g = next(graphs.cographs(2, as_graph=True, immutable=False)) + sage: g.is_immutable() + False + sage: g = next(graphs.cographs(2, as_graph=True, immutable=True)) + sage: g.is_immutable() + True + sage: next(graphs.cographs(0)) + Traceback (most recent call last): + ... + ValueError: parameter n must be at least >= 1 + """ + if n < 1: + raise ValueError('parameter n must be at least >= 1') + if as_graph: + def func(T): + return tree_to_graph(T, immutable=immutable) + else: + def func(T): + return T + + if n == 1: + T = CoTree('J') + B = CoTree('U') + B.add_child(CoTree(0)) + T.add_child(B) + yield func(T) + return + + # Construct the minimum tree + T = CoTree(n) + for j in range(n): + T.add_child(CoTree(1)) + + while True: + # T corresponds to 2 cotrees: one with 'U' root and one with 'J' root + tree_J = CoTree(T.name) + T.copy_tree(tree_J) + tree_U = CoTree(T.name) + T.copy_tree(tree_U) + # tree_J has root 'J' + change_label(tree_J, True, [0]) + # tree 0 has root 'U' + change_label(tree_U, False, [0]) + tree_UU = CoTree('J') + tree_UU.add_child(tree_U) + yield func(tree_J) + yield func(tree_UU) + if not next_tree(T): + break + + +def change_label(tree, status, counter): + """ + Set the names of the nodes of ``tree``. + + This is a helper method to method :meth:`cographs`. + + The input ``tree`` is such that each node has as label its number of + children. This method changes the label of each node so that a parallel + node is labeled 'U', a series node is labeled 'J' and a leaf node gets a + unique number. + + INPUT: + + - ``tree`` -- the tree to relabel + + - ``status`` -- boolean; used to to detect series (``True``) and parallel + (``False``) internal nodes + + - ``counter`` -- list; the first integer of the list is used to assign a + unique number to the leaves of the tree + + EXAMPLES:: + + sage: next(graphs.cographs(4, as_graph=True)).vertices() # indirect doctest + [0, 1, 2, 3] + """ + if tree.name != 1: + tree.name = 'J' if status else 'U' + else: + tree.name = counter[0] + counter[0] += 1 + for child in tree.children: + if child is not None: + change_label(child, not status, counter) + + +def tree_to_graph(tree, immutable=False): + r""" + Return the cograph represented by ``tree``. + + This is a helper method to method :meth:`cographs`. + + EXAMPLES:: + + sage: for t in graphs.cographs(3, as_graph=True): # indirect doctest + ....: print(t.edges(labels=False, sort=True)) # indirect doctest + [(0, 1), (0, 2), (1, 2)] + [] + [(0, 1), (0, 2)] + [(1, 2)] + """ + from sage.graphs.graph import Graph + g = Graph() + _tree_to_graph_rec(tree, g) + return g.copy(immutable=True) if immutable else g + + +def _tree_to_graph_rec(tree, g): + r""" + Add recursively one by one the vertices and edges of ``tree`` to ``g``. + + This is a helper method to method :meth:`tree_to_graph`. + + EXAMPLES:: + + sage: for t in graphs.cographs(3, as_graph=True): # indirect doctest + ....: print(t.edges(labels=False, sort=True)) # indirect doctest + [(0, 1), (0, 2), (1, 2)] + [] + [(0, 1), (0, 2)] + [(1, 2)] + """ + for child in tree.children: + _tree_to_graph_rec(child, g) + if tree.name not in ['J', 'U']: + tree.info = 'v' + g.add_vertex(tree.name) + _find_neighbors(tree, g) + tree.reset_info() + + +def _find_neighbors(tree, g): + r""" + Identify the neighbors of node ``tree`` in ``g`` and add needed edges. + + This is a helper method to method :meth:`tree_to_graph`. + + EXAMPLES:: + + sage: for t in graphs.cographs(3, as_graph=True): # indirect doctest + ....: print(t.edges(labels=False, sort=True)) # indirect doctest + [(0, 1), (0, 2), (1, 2)] + [] + [(0, 1), (0, 2)] + [(1, 2)] + """ + ancestor = tree.parent + ancestor.info = 'v' + while ancestor is not None: + if ancestor.name == 'J': + for sibling in ancestor.children: + if sibling != tree and sibling.info != 'v': + _add_edge(tree, sibling, g) + elif ancestor.name == 'U': + ancestor.info = 'v' + ancestor = ancestor.parent + + +def _add_edge(u, v, g): + r""" + Add an edge in `g` between the nodes associated to the cotrees `u` and `v`. + + This is a helper method to method :meth:`tree_to_graph`. + + If `v` is not a leaf, then the method add edges between `u` and all leaves + of the subtree rooted at `v`. + + The method assumes that `u` is a leaf (not tested). + + EXAMPLES:: + + sage: for t in graphs.cographs(3, as_graph=True): # indirect doctest + ....: print(t.edges(labels=False, sort=True)) # indirect doctest + [(0, 1), (0, 2), (1, 2)] + [] + [(0, 1), (0, 2)] + [(1, 2)] + """ + if v.name in ['J', 'U']: + for child in v.children: + _add_edge(u, child, g) + else: + g.add_edge(u.name, v.name) diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py index 5a09c617ba2..d7b5af8fc22 100644 --- a/src/sage/graphs/graph_generators.py +++ b/src/sage/graphs/graph_generators.py @@ -232,6 +232,7 @@ def wrap_name(x): "CaiFurerImmermanGraph", "chang_graphs", "CirculantGraph", + "cographs", "cospectral_graphs", "CubeGraph", "CubeConnectedCycle", @@ -2632,6 +2633,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None ########################################################################### # Families ########################################################################### + from . import cographs as cographs_module from .generators import families from . import strongly_regular_db AlternatingFormsGraph = staticmethod(distance_regular.AlternatingFormsGraph) @@ -2643,6 +2645,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None CaiFurerImmermanGraph = staticmethod(families.CaiFurerImmermanGraph) chang_graphs = staticmethod(families.chang_graphs) CirculantGraph = staticmethod(families.CirculantGraph) + cographs = staticmethod(cographs_module.cographs) CubeGraph = staticmethod(families.CubeGraph) CubeConnectedCycle = staticmethod(families.CubeConnectedCycle) DipoleGraph = staticmethod(families.DipoleGraph) From 6323dab97388d09b0957e72482c9a6eeaf4ff058 Mon Sep 17 00:00:00 2001 From: dcoudert Date: Fri, 10 May 2024 17:14:31 +0200 Subject: [PATCH 02/51] fix lint --- src/sage/graphs/cographs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sage/graphs/cographs.py b/src/sage/graphs/cographs.py index 516b9fb89b5..e816166d6dc 100644 --- a/src/sage/graphs/cographs.py +++ b/src/sage/graphs/cographs.py @@ -481,7 +481,7 @@ def tree_to_graph(tree, immutable=False): EXAMPLES:: sage: for t in graphs.cographs(3, as_graph=True): # indirect doctest - ....: print(t.edges(labels=False, sort=True)) # indirect doctest + ....: print(t.edges(labels=False, sort=True)) [(0, 1), (0, 2), (1, 2)] [] [(0, 1), (0, 2)] @@ -502,7 +502,7 @@ def _tree_to_graph_rec(tree, g): EXAMPLES:: sage: for t in graphs.cographs(3, as_graph=True): # indirect doctest - ....: print(t.edges(labels=False, sort=True)) # indirect doctest + ....: print(t.edges(labels=False, sort=True)) [(0, 1), (0, 2), (1, 2)] [] [(0, 1), (0, 2)] @@ -526,7 +526,7 @@ def _find_neighbors(tree, g): EXAMPLES:: sage: for t in graphs.cographs(3, as_graph=True): # indirect doctest - ....: print(t.edges(labels=False, sort=True)) # indirect doctest + ....: print(t.edges(labels=False, sort=True)) [(0, 1), (0, 2), (1, 2)] [] [(0, 1), (0, 2)] @@ -558,7 +558,7 @@ def _add_edge(u, v, g): EXAMPLES:: sage: for t in graphs.cographs(3, as_graph=True): # indirect doctest - ....: print(t.edges(labels=False, sort=True)) # indirect doctest + ....: print(t.edges(labels=False, sort=True)) [(0, 1), (0, 2), (1, 2)] [] [(0, 1), (0, 2)] From 8b603483b9f40d300bb4432b8e4b848e6e34c9d5 Mon Sep 17 00:00:00 2001 From: dcoudert Date: Fri, 10 May 2024 17:26:20 +0200 Subject: [PATCH 03/51] more lint issues --- src/sage/graphs/cographs.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sage/graphs/cographs.py b/src/sage/graphs/cographs.py index e816166d6dc..67fb3d72c36 100644 --- a/src/sage/graphs/cographs.py +++ b/src/sage/graphs/cographs.py @@ -101,7 +101,6 @@ def __str__(self): s += last return s - def add_child(self, node): r""" Add cotree ``node`` in the list of children of ``self``. @@ -198,7 +197,7 @@ def next_partition(P): [3, 3] """ if len(P) < 2: - raise ValueError("the length of the input partition must be at least 2") + raise ValueError("the length of the input partition must be at least 2") n = sum(P) if P[0] != n//2: if P[-1] - P[-2] <= 1: @@ -212,7 +211,7 @@ def next_partition(P): return P[:-2] + [x]*q + [x + r] return P[:-2] + [x, y] - if n == 3 and P[1] != n//2 + n%2: + if n == 3 and P[1] != n//2 + n % 2: return [1, 2] return None @@ -270,7 +269,7 @@ def find_pivot(T): # Check if T is a pivot i = T.name if (i != 1 and ((i//2 != T.children[0].name) or - (i//2 + i%2 != T.children[1].name))): + (i//2 + i % 2 != T.children[1].name))): T.info = 'p' # pivot mark return T return None @@ -314,7 +313,7 @@ def next_tree(T): if this_child.info == 'p': is_bigger_sibling = True elif is_bigger_sibling: # true only for bigger siblings of x - if x.name == this_child.name: + if x.name == this_child.name: temp = CoTree(x.name) x.copy_tree(temp) ancestor.children[y] = temp # copy subtree T(x) in T(y) From a70f6c2cbdcbe34f501ef69d1bcb360093ac04b3 Mon Sep 17 00:00:00 2001 From: dcoudert Date: Sun, 12 May 2024 14:29:50 +0200 Subject: [PATCH 04/51] fix typos --- src/sage/graphs/cographs.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/sage/graphs/cographs.py b/src/sage/graphs/cographs.py index 67fb3d72c36..a85ba748a6a 100644 --- a/src/sage/graphs/cographs.py +++ b/src/sage/graphs/cographs.py @@ -31,7 +31,7 @@ class CoTree: - """ + r""" Generic cotree node. This data structure is used for the generation of cographs in @@ -340,13 +340,13 @@ def cographs(n, as_graph=True, immutable=False): :meth:`sage.graphs.generic_graph.GenericGraph.disjoint_union` operations. See the :wikipedia:`Cograph` for more details. - This method implements the generator of all cographs of order `n` proposd - in [JPD2018]_. The algorithm generates one by one every cotree with `n` nodes, - and each cotree is generated by using its previous cotree. The time to - construct the first cotree is `O(n)` and the time spent between two - consecutive outputs is `O(n)`. Hence, the overall complexity of the algorithm - is `O(n*Mn)`, where `n` is the number of nodes and `Mn` is the total number of - cographs with `n` nodes (see :oeis:`A000084`). + This method implements the generator of all cographs of order `n` proposed + in [JPD2018]_. The algorithm generates one by one every cotree with `n` + nodes, and each cotree is generated by using its previous cotree. The time + to construct the first cotree is `O(n)` and the time spent between two + consecutive outputs is `O(n)`. Hence, the overall complexity of the + algorithm is `O(n*M_n)`, where `n` is the number of nodes and `M_n` is the + total number of cographs with `n` nodes (see :oeis:`A000084`). INPUT: @@ -436,7 +436,7 @@ def func(T): def change_label(tree, status, counter): - """ + r""" Set the names of the nodes of ``tree``. This is a helper method to method :meth:`cographs`. From 421b552c5da6805e7867228ad2f1ca973ad6866d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 2 Jun 2024 22:50:23 -0700 Subject: [PATCH 05/51] .github/workflows/ci-linux-incremental.yml (sitepackages): Remove label condition --- .github/workflows/ci-linux-incremental.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/ci-linux-incremental.yml b/.github/workflows/ci-linux-incremental.yml index 88a31a5ce42..5613a4b71a3 100644 --- a/.github/workflows/ci-linux-incremental.yml +++ b/.github/workflows/ci-linux-incremental.yml @@ -107,14 +107,6 @@ jobs: site: needs: [changed_files] - if: | - github.event_name != 'pull_request' || - ((github.event.action != 'labeled' && - (contains(github.event.pull_request.labels.*.name, 'c: packages: standard') || - contains(github.event.pull_request.labels.*.name, 'c: packages: optional'))) || - (github.event.action == 'labeled' && - (github.event.label.name == 'c: packages: optional' || - github.event.label.name == 'c: packages: standard'))) uses: ./.github/workflows/docker.yml with: # Build incrementally from published Docker image From e90d73704bef9cf52d1678e4f6affea96baacda3 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 2 Jun 2024 23:22:24 -0700 Subject: [PATCH 06/51] .github/workflows/build.yml: Determine build_targets (adapted from ci-linux-incremental.yml) --- .github/workflows/build.yml | 46 +++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 161704a280c..9d355e29482 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,6 +78,8 @@ env: jobs: test-new: runs-on: ubuntu-latest + outputs: + build_targets: ${{ steps.build-targets.outputs.build_targets }} services: # https://docs.docker.com/build/ci/github-actions/local-registry/ registry: @@ -98,6 +100,42 @@ jobs: - name: Checkout id: checkout uses: actions/checkout@v4 + - name: Get all packages that have changed + id: changed-packages + uses: tj-actions/changed-files@v44 + with: + files_yaml: | + configures: + - 'build/pkgs/*/spkg-configure.m4' + pkgs: + - 'build/pkgs/**' + - 'pkgs/**' + - name: Determine targets to build + id: build-targets + run: | + uninstall_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u)) + build_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u)) + if [ -n "$uninstall_targets" ]; then + echo "build_targets=$uninstall_targets reconfigure $build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT + else + echo "build_targets=$build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT + fi + cat $GITHUB_OUTPUT + - uses: actions/checkout@v4 + with: + ref: ${{ github.base_ref }} + path: worktree-base + if: github.base_ref && steps.changed-packages.outputs.pkgs_all_changed_files + - name: Compute metrics + run: | + export PATH=build/bin:$PATH + if [ -d worktree-base ]; then + (echo "# $GITHUB_BASE_REF"; SAGE_ROOT=worktree-base sage-package metrics :all:) > base-metrics.txt + (echo "# $GITHUB_REF"; sage-package metrics :all:) > metrics.txt + diff --color=always --width=100 --side-by-side --left-column base-metrics.txt metrics.txt || true + else + sage-package metrics :all: + fi - name: Install test prerequisites # From docker.yml run: | @@ -153,7 +191,7 @@ jobs: NUMPROC=6 USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse TARGETS_PRE=build/make/Makefile - TARGETS=ci-build-with-fallback + TARGETS=${{ steps.build-targets.outputs.build_targets }} - name: Start container run: | @@ -266,7 +304,7 @@ jobs: NUMPROC=6 USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse TARGETS_PRE=build/make/Makefile - TARGETS=ci-build-with-fallback + TARGETS=${{ needs.test-new.outputs.build_targets }} - name: Start container run: | @@ -361,7 +399,7 @@ jobs: NUMPROC=6 USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse TARGETS_PRE=build/make/Makefile - TARGETS=ci-build-with-fallback + TARGETS=${{ needs.test-new.outputs.build_targets }} - name: Start container id: container @@ -473,7 +511,7 @@ jobs: NUMPROC=6 USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse TARGETS_PRE=build/make/Makefile - TARGETS=ci-build-with-fallback + TARGETS=${{ needs.test-new.outputs.build_targets }} - name: Start container id: container From dae0ff152b11481dab1358ce7ef4bd2075c07284 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 2 Jun 2024 23:54:06 -0700 Subject: [PATCH 07/51] .github/workflows/build.yml: Combine calls of tj-actions/changed-files --- .github/workflows/build.yml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d355e29482..45a8bb56e8d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,21 +100,25 @@ jobs: - name: Checkout id: checkout uses: actions/checkout@v4 - - name: Get all packages that have changed - id: changed-packages + - name: Get changed files and packages + id: changed-files uses: tj-actions/changed-files@v44 with: + # File extensions for doctests per sage.doctest.control.skipfile files_yaml: | configures: - 'build/pkgs/*/spkg-configure.m4' pkgs: - 'build/pkgs/**' - 'pkgs/**' + doctests: + - 'src/**/*.{py,pyx,pxd,pxi,sage,spyx,rst,tex}' + - '!src/{setup,conftest*}.py' - name: Determine targets to build id: build-targets run: | - uninstall_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u)) - build_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u)) + uninstall_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u)) + build_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u)) if [ -n "$uninstall_targets" ]; then echo "build_targets=$uninstall_targets reconfigure $build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT else @@ -125,7 +129,7 @@ jobs: with: ref: ${{ github.base_ref }} path: worktree-base - if: github.base_ref && steps.changed-packages.outputs.pkgs_all_changed_files + if: github.base_ref && steps.changed-files.outputs.pkgs_all_changed_files - name: Compute metrics run: | export PATH=build/bin:$PATH @@ -213,20 +217,12 @@ jobs: ./sage -python -m pytest -c tox.ini -qq --doctest --collect-only || true shell: sh .ci/docker-exec-script.sh BUILD /sage {0} - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v44 - with: - # File extensions per sage.doctest.control.skipfile - files: src/**/*.{py,pyx,pxd,pxi,sage,spyx,rst,tex} - files_ignore: src/{setup,conftest*}.py - - name: Test changed files (sage -t --new) - if: steps.changed-files.outputs.all_changed_files + if: steps.changed-files.outputs.doctests_all_changed_files run: | export MAKE="make -j2 --output-sync=recurse" SAGE_NUM_THREADS=4 # https://github.com/tj-actions/changed-files?tab=readme-ov-file#outputs- - ./sage -t --long --format github -p4 ${{ steps.changed-files.outputs.all_changed_files }} + ./sage -t --long --format github -p4 ${{ steps.changed-files.outputs.doctests_all_changed_files }} shell: sh .ci/docker-exec-script.sh BUILD /sage {0} test-mod: From 62ade48069563b91335ee7361c14f7427ed55343 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 00:55:52 -0700 Subject: [PATCH 08/51] .github/workflows/build.yml (test-new): Do not push and do not start container if nothing to be tested --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45a8bb56e8d..605707ffd9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -184,7 +184,7 @@ jobs: # more reliable than "load", for which we observed random failure # conditions in which the built image could not be found. # - push: true + push: ${{ steps.changed-files.outputs.doctests_all_changed_files && true || false }} load: false context: . tags: ${{ env.BUILD_IMAGE }} @@ -198,6 +198,7 @@ jobs: TARGETS=${{ steps.build-targets.outputs.build_targets }} - name: Start container + if: steps.changed-files.outputs.doctests_all_changed_files run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -207,6 +208,7 @@ jobs: # Testing - name: Check that all modules can be imported + if: steps.changed-files.outputs.doctests_all_changed_files run: | # Increase the length of the lines in the "short summary" export COLUMNS=120 From a1b3a44fcc55bed6a9c3718f9382fd165a09984a Mon Sep 17 00:00:00 2001 From: dcoudert Date: Mon, 3 Jun 2024 11:58:46 +0200 Subject: [PATCH 09/51] use AccelAsc_next --- src/sage/graphs/cographs.py | 63 +++++++------------------------------ 1 file changed, 11 insertions(+), 52 deletions(-) diff --git a/src/sage/graphs/cographs.py b/src/sage/graphs/cographs.py index a85ba748a6a..8a141b1088a 100644 --- a/src/sage/graphs/cographs.py +++ b/src/sage/graphs/cographs.py @@ -20,7 +20,8 @@ ------- """ # **************************************************************************** -# Copyright (C) 2024 David Coudert +# Copyright (C) 2017-2024 Marianna Spyrakou +# 2024 David Coudert # # 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 @@ -29,6 +30,8 @@ # https://www.gnu.org/licenses/ # **************************************************************************** +from sage.combinat.partitions import AccelAsc_next + class CoTree: r""" @@ -168,54 +171,6 @@ def reset_info(self): self.info = None -def next_partition(P): - r""" - Return the next partition after `P`, if any. - - This is a helper method to method :meth:`cographs`. - - INPUT: - - - ``P`` -- a list encoding a partition of a number `n` - - EXAMPLES:: - - sage: from sage.graphs.cographs import next_partition - sage: P = [1, 1, 1, 1, 1, 1] - sage: while P: - ....: print(P) - ....: P = next_partition(P) - [1, 1, 1, 1, 1, 1] - [1, 1, 1, 1, 2] - [1, 1, 1, 3] - [1, 1, 2, 2] - [1, 1, 4] - [1, 2, 3] - [1, 5] - [2, 2, 2] - [2, 4] - [3, 3] - """ - if len(P) < 2: - raise ValueError("the length of the input partition must be at least 2") - n = sum(P) - if P[0] != n//2: - if P[-1] - P[-2] <= 1: - return P[:-2] + [P[-2] + P[-1]] - - x = P[-2] + 1 - y = P[-1] - 1 - q = y // x - if q > 1: - r = y % x - return P[:-2] + [x]*q + [x + r] - return P[:-2] + [x, y] - - if n == 3 and P[1] != n//2 + n % 2: - return [1, 2] - return None - - def rebuild_node(u, P): r""" Replace the subtree rooted at `u` by a subtree induced by partition `P`. @@ -233,6 +188,8 @@ def rebuild_node(u, P): sage: next(graphs.cographs(3, as_graph=True)).vertices() # indirect doctest [0, 1, 2] """ + if P is None: + print('P is None') u.children = [] # delete the subtree rooted at u for value in P: this_child = CoTree(value) @@ -244,7 +201,7 @@ def rebuild_node(u, P): def find_pivot(T): r""" - Seach for a pivot node in `T`. + Search for a pivot node in `T`. This is a helper method to method :meth:`cographs`. @@ -297,9 +254,11 @@ def next_tree(T): if pivot is None: return False - # Find the next partition induced by the subtree pivot + # Find the next partition induced by the subtree pivot. + # Partitions are represented in ascending order (i.e., `P_i \leq P_{i+1}`) + # and we search for the next partition in lexicographic order. partition = [c.name for c in pivot.children] - P = next_partition(partition) + P = AccelAsc_next(partition) # and rebuild the subtree of pivot accordingly rebuild_node(pivot, P) From 9d3a3f23c052ef89fd175085acd8003c587eb67b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 11:42:51 -0700 Subject: [PATCH 10/51] .github/workflows/ci-linux-incremental.yml: Remove duplicate testing of the default platform (ubuntu-jammy) --- .github/workflows/ci-linux-incremental.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-linux-incremental.yml b/.github/workflows/ci-linux-incremental.yml index 5613a4b71a3..e63c097bec3 100644 --- a/.github/workflows/ci-linux-incremental.yml +++ b/.github/workflows/ci-linux-incremental.yml @@ -91,7 +91,6 @@ jobs: targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest" tox_system_factors: >- ["ubuntu-focal", - "ubuntu-jammy", "ubuntu-mantic", "debian-bullseye", "debian-bookworm", From cacd8d8230f6885f597a8959a68dfe85a766cc64 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 12:12:11 -0700 Subject: [PATCH 11/51] build/pkgs/scip: Update to 9.0.1 --- build/pkgs/scip/checksums.ini | 4 ++-- build/pkgs/scip/package-version.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/pkgs/scip/checksums.ini b/build/pkgs/scip/checksums.ini index d99a2b7930f..25100a06dad 100644 --- a/build/pkgs/scip/checksums.ini +++ b/build/pkgs/scip/checksums.ini @@ -1,4 +1,4 @@ tarball=scip-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}.tar.gz -sha1=bb28aef4bad00a1ff2c7f4ee982961709d15b9f8 -sha256=ee221bd13a6b24738f2e74321e2efdebd6d7c603574ca6f6cb9d4472ead2c22f +sha1=7bae5feab37e6e602d25d9468d003479d268d6a8 +sha256=08ad3e7ad6f84f457d95bb70ab21fa7fc648dd43103099359ef8a8f30fcce32e upstream_url=https://github.com/scipopt/scip/archive/refs/tags/v${VERSION_MAJOR}${VERSION_MINOR}${VERSION_MICRO}.tar.gz diff --git a/build/pkgs/scip/package-version.txt b/build/pkgs/scip/package-version.txt index 486ff8cd7ba..37ad5c8b19d 100644 --- a/build/pkgs/scip/package-version.txt +++ b/build/pkgs/scip/package-version.txt @@ -1 +1 @@ -9.0.0.p0 +9.0.1 From a86b8413680aebe6674da0825557f8d41901f260 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 12:12:19 -0700 Subject: [PATCH 12/51] build/pkgs/soplex: Update to 7.0.1 --- build/pkgs/soplex/checksums.ini | 4 ++-- build/pkgs/soplex/package-version.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/pkgs/soplex/checksums.ini b/build/pkgs/soplex/checksums.ini index 4eb6d430aff..eadf0896fcf 100644 --- a/build/pkgs/soplex/checksums.ini +++ b/build/pkgs/soplex/checksums.ini @@ -1,4 +1,4 @@ tarball=soplex-VERSION.tar.gz -sha1=5d0e7fa41b45aa0877134a5b8e261d9608505636 -sha256=ab1906d3afb1793a6f129a5baef9dd8eee929ee945aade427cb9f0b17888239c +sha1=a53fecd8d916751ee6e9a8daee0be795ed5222a6 +sha256=80cce994dcbe45fd52b60e31a3aeb5d2c60a7ddbaae495e0ce6bf58481675696 upstream_url=https://github.com/scipopt/soplex/archive/refs/tags/release-${VERSION_MAJOR}${VERSION_MINOR}${VERSION_MICRO}.tar.gz diff --git a/build/pkgs/soplex/package-version.txt b/build/pkgs/soplex/package-version.txt index 66ce77b7ead..9fe9ff9d996 100644 --- a/build/pkgs/soplex/package-version.txt +++ b/build/pkgs/soplex/package-version.txt @@ -1 +1 @@ -7.0.0 +7.0.1 From c095189add5d5c3af4dbf57e2d64a483ec66a94c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 12:12:39 -0700 Subject: [PATCH 13/51] build/pkgs/papilo: Update to 2.2.1 --- build/pkgs/papilo/checksums.ini | 4 ++-- build/pkgs/papilo/package-version.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/pkgs/papilo/checksums.ini b/build/pkgs/papilo/checksums.ini index 831334dbdb9..d99180dc1e1 100644 --- a/build/pkgs/papilo/checksums.ini +++ b/build/pkgs/papilo/checksums.ini @@ -1,4 +1,4 @@ tarball=papilo-VERSION.tar.gz -sha1=069f64ff25cfb08c9b2a416d1d215bd5b907c877 -sha256=4ed759e55fe1c74be779137e4e3cdae67e1b64bd62ca31793ca3b321509c27a8 +sha1=55e8416d5512d3f823ae87c4161ccff30e76f4a1 +sha256=b022af82bda3db1a594fe67524d98be82e67279f9d9d645b2fcdfc9349cdc6f7 upstream_url=https://github.com/scipopt/papilo/archive/refs/tags/vVERSION.tar.gz diff --git a/build/pkgs/papilo/package-version.txt b/build/pkgs/papilo/package-version.txt index ccbccc3dc62..c043eea7767 100644 --- a/build/pkgs/papilo/package-version.txt +++ b/build/pkgs/papilo/package-version.txt @@ -1 +1 @@ -2.2.0 +2.2.1 From b07fa20c3be88e2e7b600b92d2de603e026ad790 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 12:13:05 -0700 Subject: [PATCH 14/51] build/pkgs/onetbb: Update to 2021.12.0 --- build/pkgs/onetbb/checksums.ini | 4 ++-- build/pkgs/onetbb/package-version.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/pkgs/onetbb/checksums.ini b/build/pkgs/onetbb/checksums.ini index 6573c2f7b99..c7b278c01af 100644 --- a/build/pkgs/onetbb/checksums.ini +++ b/build/pkgs/onetbb/checksums.ini @@ -1,4 +1,4 @@ tarball=onetbb-VERSION.tar.gz -sha1=740e86b703f42446ddde392b73a9db3dc0f5f4cd -sha256=782ce0cab62df9ea125cdea253a50534862b563f1d85d4cda7ad4e77550ac363 +sha1=bd663861ab6bfec2469f3a8133c3ac1244f260cb +sha256=c7bb7aa69c254d91b8f0041a71c5bcc3936acb64408a1719aec0b2b7639dd84f upstream_url=https://github.com/oneapi-src/oneTBB/archive/refs/tags/vVERSION.tar.gz diff --git a/build/pkgs/onetbb/package-version.txt b/build/pkgs/onetbb/package-version.txt index 90431db79ad..5c5abc38ec9 100644 --- a/build/pkgs/onetbb/package-version.txt +++ b/build/pkgs/onetbb/package-version.txt @@ -1 +1 @@ -2021.11.0 +2021.12.0 From 4db331384bb68a7b1e9899ac6bd6c148cc1642aa Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 11:46:40 -0700 Subject: [PATCH 15/51] .github/workflows/ci-linux-incremental.yml: Replace ubuntu-mantic, fedora-38 by latest --- .github/workflows/ci-linux-incremental.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-linux-incremental.yml b/.github/workflows/ci-linux-incremental.yml index e63c097bec3..a74eb4e0597 100644 --- a/.github/workflows/ci-linux-incremental.yml +++ b/.github/workflows/ci-linux-incremental.yml @@ -91,11 +91,11 @@ jobs: targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest" tox_system_factors: >- ["ubuntu-focal", - "ubuntu-mantic", + "ubuntu-noble", "debian-bullseye", "debian-bookworm", "fedora-30", - "fedora-38", + "fedora-40", "gentoo-python3.11", "debian-bullseye-i386"] tox_packages_factors: >- From 358609098cb3d951b829fd25af0d80980a11de69 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 12:07:15 -0700 Subject: [PATCH 16/51] .github/workflows/ci-linux-incremental.yml: Update build_target script from build.yml, use ptest-nodoc to avoid duplicate doc-html build --- .github/workflows/ci-linux-incremental.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-linux-incremental.yml b/.github/workflows/ci-linux-incremental.yml index a74eb4e0597..ce468ff3a42 100644 --- a/.github/workflows/ci-linux-incremental.yml +++ b/.github/workflows/ci-linux-incremental.yml @@ -41,12 +41,11 @@ jobs: runs-on: ubuntu-latest name: List changed packages outputs: - uninstall_targets: ${{ steps.build-targets.outputs.uninstall_targets }} build_targets: ${{ steps.build-targets.outputs.build_targets }} steps: - uses: actions/checkout@v4 - name: Get all packages that have changed - id: changed-packages + id: changed-files uses: tj-actions/changed-files@v44 with: files_yaml: | @@ -58,14 +57,19 @@ jobs: - name: Determine targets to build id: build-targets run: | - echo "uninstall_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u))" >> $GITHUB_OUTPUT - echo "build_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u))" >> $GITHUB_OUTPUT + uninstall_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u)) + build_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u)) + if [ -n "$uninstall_targets" ]; then + echo "build_targets=$uninstall_targets reconfigure $build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT + else + echo "build_targets=$build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT + fi cat $GITHUB_OUTPUT - uses: actions/checkout@v4 with: ref: ${{ github.base_ref }} path: worktree-base - if: github.base_ref + if: github.base_ref && steps.changed-files.outputs.pkgs_all_changed_files - name: Compute metrics run: | export PATH=build/bin:$PATH @@ -88,7 +92,7 @@ jobs: from_docker_target: "with-targets" from_docker_tag: "dev" docker_targets: "with-targets" - targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest" + targets: "${{needs.changed_files.outputs.build_targets}} doc-html ptest-nodoc" tox_system_factors: >- ["ubuntu-focal", "ubuntu-noble", @@ -115,7 +119,7 @@ jobs: from_docker_target: "with-targets" from_docker_tag: "dev" docker_targets: "with-targets" - targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest" + targets: "${{needs.changed_files.outputs.build_targets}} doc-html ptest-nodoc" # Only test systems with a usable system python (>= 3.9) # with only a small number of test failures as of 10.2.rc0 tox_system_factors: >- From 1df4f5a5c508dfdbb8779161283cf780459dd908 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 18:27:13 -0700 Subject: [PATCH 17/51] .ci/retrofit-worktree.sh: Commit /new --- .ci/retrofit-worktree.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.ci/retrofit-worktree.sh b/.ci/retrofit-worktree.sh index eba1b674ecb..4c283f7ff4a 100755 --- a/.ci/retrofit-worktree.sh +++ b/.ci/retrofit-worktree.sh @@ -23,9 +23,10 @@ set -x # If actions/checkout downloaded our source tree using the GitHub REST API # instead of with git (because do not have git installed in our image), # we first make the source tree a repo. -if [ ! -d .git ]; then git init && git add -A && git commit --quiet -m "new"; fi +if [ ! -d .git ]; then git init; fi -# Tag this state of the source tree "new". This is what we want to build and test. +# Commit and tag this state of the source tree "new". This is what we want to build and test. +git add -A && git commit --quiet --allow-empty -m "new" git tag -f new # Our container image contains a source tree in $WORKTREE_DIRECTORY with a full build of Sage. From 44903a34f188a355e5901398e75b52ab12833ce5 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 15:50:24 -0700 Subject: [PATCH 18/51] build/pkgs/scip/patches/struct_symmetry_header.patch: Remove --- .../pkgs/scip/patches/struct_symmetry_header.patch | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 build/pkgs/scip/patches/struct_symmetry_header.patch diff --git a/build/pkgs/scip/patches/struct_symmetry_header.patch b/build/pkgs/scip/patches/struct_symmetry_header.patch deleted file mode 100644 index 39d9114a58e..00000000000 --- a/build/pkgs/scip/patches/struct_symmetry_header.patch +++ /dev/null @@ -1,14 +0,0 @@ -From https://github.com/scipopt/SCIP-SDP/issues/12#issuecomment-1969453709 - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 5392127c5d..b66e86dec5 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -991,6 +991,7 @@ set(scipheaders - set(symheaders - symmetry/build_sassy_graph.h - symmetry/compute_symmetry.h -+ symmetry/struct_symmetry.h - symmetry/type_symmetry.h - ) - From 5d1fc2aec090c301d9a187af4eb32d5e45e251df Mon Sep 17 00:00:00 2001 From: David Coudert Date: Tue, 4 Jun 2024 12:59:03 +0200 Subject: [PATCH 19/51] Update src/sage/graphs/cographs.py Co-authored-by: Travis Scrimshaw --- src/sage/graphs/cographs.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/sage/graphs/cographs.py b/src/sage/graphs/cographs.py index 8a141b1088a..44a0c736060 100644 --- a/src/sage/graphs/cographs.py +++ b/src/sage/graphs/cographs.py @@ -62,21 +62,7 @@ def __init__(self, name='root'): self.info = None self.parent = None - def __repr__(self): - r""" - Return a string representation of ``self``. - - EXAMPLES:: - - sage: from sage.graphs.cographs import CoTree - sage: CoTree(1) - ( 1 ) - sage: CoTree('J') - [ J ] - sage: next(graphs.cographs(4, as_graph=False)) # indirect doctest - [ J ( 0 ) ( 1 ) ( 2 ) ( 3 ) ] - """ - return self.__str__() + __repr__ = __str__ def __str__(self): r""" From c8a1949968e557a98919b901cb646a441e33ec23 Mon Sep 17 00:00:00 2001 From: dcoudert Date: Tue, 4 Jun 2024 16:04:36 +0200 Subject: [PATCH 20/51] fix error --- src/sage/graphs/cographs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/graphs/cographs.py b/src/sage/graphs/cographs.py index 44a0c736060..b921375f643 100644 --- a/src/sage/graphs/cographs.py +++ b/src/sage/graphs/cographs.py @@ -62,8 +62,6 @@ def __init__(self, name='root'): self.info = None self.parent = None - __repr__ = __str__ - def __str__(self): r""" Return a string representation of ``self``. @@ -90,6 +88,8 @@ def __str__(self): s += last return s + __repr__ = __str__ + def add_child(self, node): r""" Add cotree ``node`` in the list of children of ``self``. From a872aacc3f879472a98de7796b0c48c0e6d39899 Mon Sep 17 00:00:00 2001 From: Giacomo Pope Date: Tue, 4 Jun 2024 17:42:54 +0100 Subject: [PATCH 21/51] fix slow columns --- src/sage/matrix/matrix_mod2_dense.pyx | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/sage/matrix/matrix_mod2_dense.pyx b/src/sage/matrix/matrix_mod2_dense.pyx index 0d3c15be395..1bbb41fe205 100644 --- a/src/sage/matrix/matrix_mod2_dense.pyx +++ b/src/sage/matrix/matrix_mod2_dense.pyx @@ -526,6 +526,47 @@ cdef class Matrix_mod2_dense(matrix_dense.Matrix_dense): # dense or sparse mzd_submatrix(z._entries, self._entries, i, 0, i+1, self._ncols) return z + def columns(self, copy=True): + """ + Return list of the columns of self. + + INPUT: + + - ``copy`` - (default: True) if True, return a copy so you can + modify it safely + + EXAMPLES: + + An example with a small 3x3 matrix:: + + sage: M2 = Matrix(GF(2), [[1, 0, 0], [0, 1, 0], [0, 1, 1]]) + sage: M2.columns() + [(1, 0, 0), (0, 1, 1), (0, 0, 1)] + + """ + x = self.fetch('columns') + if x is not None: + if copy: return list(x) + return x + cdef Py_ssize_t i + + # Note: due to the way M4ri represents values, extracting rows + # if fast, but columns are slow. Therefore we transpose + # then take rows. For more information, see the issue + # https://github.com/sagemath/sage/issues/38150 + C = self.transpose().rows() + + # Make the vectors immutable since we are caching them + for x in C: + x.set_immutable() + + # cache result + self.cache('columns', C) + if copy: + return list(C) + else: + return C + ######################################################################## # LEVEL 2 functionality # * def _pickle From 74b12f423b71a7dd9b34b0bce7d134a0bb0d5ad5 Mon Sep 17 00:00:00 2001 From: Giacomo Pope <44242839+GiacomoPope@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:55:40 +0100 Subject: [PATCH 22/51] fix a typo in comment --- src/sage/matrix/matrix_mod2_dense.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/matrix/matrix_mod2_dense.pyx b/src/sage/matrix/matrix_mod2_dense.pyx index 1bbb41fe205..14eb6f02539 100644 --- a/src/sage/matrix/matrix_mod2_dense.pyx +++ b/src/sage/matrix/matrix_mod2_dense.pyx @@ -551,7 +551,7 @@ cdef class Matrix_mod2_dense(matrix_dense.Matrix_dense): # dense or sparse cdef Py_ssize_t i # Note: due to the way M4ri represents values, extracting rows - # if fast, but columns are slow. Therefore we transpose + # is fast, but columns are slow. Therefore we transpose # then take rows. For more information, see the issue # https://github.com/sagemath/sage/issues/38150 C = self.transpose().rows() From 8d0c849d0d1f4d6a4b45d857722f0dfe8f43240e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 4 Jun 2024 15:07:45 -0700 Subject: [PATCH 23/51] .ci/write-dockerfile.sh: Remove old /new at the beginning, remove new /new at the end --- .ci/write-dockerfile.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/write-dockerfile.sh b/.ci/write-dockerfile.sh index 67ef594729c..ffdfa5404f6 100755 --- a/.ci/write-dockerfile.sh +++ b/.ci/write-dockerfile.sh @@ -264,6 +264,7 @@ cat < Date: Tue, 4 Jun 2024 15:09:09 -0700 Subject: [PATCH 24/51] .ci/write-dockerfile.sh: Remove duplicated ADD --- .ci/write-dockerfile.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.ci/write-dockerfile.sh b/.ci/write-dockerfile.sh index ffdfa5404f6..beee1440368 100755 --- a/.ci/write-dockerfile.sh +++ b/.ci/write-dockerfile.sh @@ -339,7 +339,6 @@ ENV SAGE_CHECK=warn ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst" $ADD .gitignore /new/.gitignore $ADD src /new/src -ADD .ci /.ci RUN cd /new && rm -rf .git && \ if /.ci/retrofit-worktree.sh worktree-pre /sage; then \ cd /sage && touch configure build/make/Makefile; \ From 7fb032388d799a2e06d9a41dd60a7a6dde32bf6a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 4 Jun 2024 16:46:13 -0700 Subject: [PATCH 25/51] .ci/write-dockerfile.sh: Remove old .git file at the beginning, remove new .git file at the end --- .ci/write-dockerfile.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/write-dockerfile.sh b/.ci/write-dockerfile.sh index beee1440368..3a4ae5b152d 100755 --- a/.ci/write-dockerfile.sh +++ b/.ci/write-dockerfile.sh @@ -264,7 +264,7 @@ cat < Date: Tue, 26 Mar 2024 10:00:26 +0000 Subject: [PATCH 26/51] convert pycryptosat into pip package --- build/pkgs/cryptominisat/SPKG.rst | 38 ---------------- build/pkgs/cryptominisat/checksums.ini | 4 -- build/pkgs/cryptominisat/dependencies | 4 -- build/pkgs/cryptominisat/distros/conda.txt | 1 - build/pkgs/cryptominisat/distros/homebrew.txt | 1 - build/pkgs/cryptominisat/distros/repology.txt | 1 - build/pkgs/cryptominisat/package-version.txt | 1 - build/pkgs/cryptominisat/patches/679.patch | 43 ------------------- ...tominisat-5.8.0-rm_extra_python_vars.patch | 37 ---------------- build/pkgs/cryptominisat/spkg-install.in | 5 --- build/pkgs/cryptominisat/type | 1 - build/pkgs/pycryptosat/SPKG.rst | 17 +++++++- build/pkgs/pycryptosat/checksums.ini | 1 - build/pkgs/pycryptosat/dependencies | 2 +- build/pkgs/pycryptosat/package-version.txt | 1 - build/pkgs/pycryptosat/patches | 1 - build/pkgs/pycryptosat/spkg-install.in | 9 ---- .../pkgs/pycryptosat/version_requirements.txt | 1 - 18 files changed, 16 insertions(+), 152 deletions(-) delete mode 100644 build/pkgs/cryptominisat/SPKG.rst delete mode 100644 build/pkgs/cryptominisat/checksums.ini delete mode 100644 build/pkgs/cryptominisat/dependencies delete mode 100644 build/pkgs/cryptominisat/distros/conda.txt delete mode 100644 build/pkgs/cryptominisat/distros/homebrew.txt delete mode 100644 build/pkgs/cryptominisat/distros/repology.txt delete mode 100644 build/pkgs/cryptominisat/package-version.txt delete mode 100644 build/pkgs/cryptominisat/patches/679.patch delete mode 100644 build/pkgs/cryptominisat/patches/cryptominisat-5.8.0-rm_extra_python_vars.patch delete mode 100644 build/pkgs/cryptominisat/spkg-install.in delete mode 100644 build/pkgs/cryptominisat/type delete mode 120000 build/pkgs/pycryptosat/checksums.ini delete mode 120000 build/pkgs/pycryptosat/package-version.txt delete mode 120000 build/pkgs/pycryptosat/patches delete mode 100644 build/pkgs/pycryptosat/spkg-install.in delete mode 100644 build/pkgs/pycryptosat/version_requirements.txt diff --git a/build/pkgs/cryptominisat/SPKG.rst b/build/pkgs/cryptominisat/SPKG.rst deleted file mode 100644 index 45c987baf84..00000000000 --- a/build/pkgs/cryptominisat/SPKG.rst +++ /dev/null @@ -1,38 +0,0 @@ -cryptominisat: A SAT solver -=========================== - -Description ------------ - - CryptoMiniSat is a SAT solver that aims to become a premiere SAT - solver with all the features and speed of successful SAT solvers, - such as MiniSat and PrecoSat. The long-term goals of CryptoMiniSat - are to be an efficient sequential, parallel and distributed - solver. There are solvers that are good at one or the other, - e.g. ManySat (parallel) or PSolver (distributed), but we wish to - excel at all. - - CryptoMiniSat 2.5 won the SAT Race 2010 among 20 solvers submitted - by researchers and industry. - -License -------- - -MIT License - - -Upstream Contact ----------------- - -- Authors: Mate Soos -- Email: soos.mate@gmail.com -- Website: http://www.msoos.org/ -- Releases: https://github.com/msoos/cryptominisat/releases - - -Special Update/Build Instructions ---------------------------------- - -CryptoMiniSat's tarball downloaded from github is called VERSION.tar.gz -and should be renamed to cryptominisat-VERSION.tar.gz -Its Python module is installed by the pycryptosat spkg. diff --git a/build/pkgs/cryptominisat/checksums.ini b/build/pkgs/cryptominisat/checksums.ini deleted file mode 100644 index f3838f6618c..00000000000 --- a/build/pkgs/cryptominisat/checksums.ini +++ /dev/null @@ -1,4 +0,0 @@ -tarball=cryptominisat-VERSION.tar.gz -sha1=f79dfa1ffc6c9c75b3a33f76d3a89a3df2b3f4c2 -sha256=50153025c8503ef32f32fff847ee24871bb0fc1f0b13e17fe01aa762923f6d94 -upstream_url=https://github.com/msoos/cryptominisat/archive/refs/tags/VERSION.tar.gz diff --git a/build/pkgs/cryptominisat/dependencies b/build/pkgs/cryptominisat/dependencies deleted file mode 100644 index e30473e40f6..00000000000 --- a/build/pkgs/cryptominisat/dependencies +++ /dev/null @@ -1,4 +0,0 @@ - m4ri zlib libpng | cmake boost_cropped $(PYTHON) - ----------- -All lines of this file are ignored except the first. diff --git a/build/pkgs/cryptominisat/distros/conda.txt b/build/pkgs/cryptominisat/distros/conda.txt deleted file mode 100644 index 5ba98aa9061..00000000000 --- a/build/pkgs/cryptominisat/distros/conda.txt +++ /dev/null @@ -1 +0,0 @@ -cryptominisat diff --git a/build/pkgs/cryptominisat/distros/homebrew.txt b/build/pkgs/cryptominisat/distros/homebrew.txt deleted file mode 100644 index 5ba98aa9061..00000000000 --- a/build/pkgs/cryptominisat/distros/homebrew.txt +++ /dev/null @@ -1 +0,0 @@ -cryptominisat diff --git a/build/pkgs/cryptominisat/distros/repology.txt b/build/pkgs/cryptominisat/distros/repology.txt deleted file mode 100644 index 5ba98aa9061..00000000000 --- a/build/pkgs/cryptominisat/distros/repology.txt +++ /dev/null @@ -1 +0,0 @@ -cryptominisat diff --git a/build/pkgs/cryptominisat/package-version.txt b/build/pkgs/cryptominisat/package-version.txt deleted file mode 100644 index 11d9efa3d5a..00000000000 --- a/build/pkgs/cryptominisat/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -5.8.0 diff --git a/build/pkgs/cryptominisat/patches/679.patch b/build/pkgs/cryptominisat/patches/679.patch deleted file mode 100644 index a7dec833f6f..00000000000 --- a/build/pkgs/cryptominisat/patches/679.patch +++ /dev/null @@ -1,43 +0,0 @@ -From a01179ffd6b0dd47bfdef2d9350d80b575571f24 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Maciej=20Bar=C4=87?= -Date: Sun, 3 Apr 2022 20:02:59 +0200 -Subject: [PATCH] python/setup.py.in: import sysconfig instead of importing it - from distutils -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -setuptools 61 dropped sysconfig module - -Ref: https://github.com/stamparm/pcapy-ng/commit/f6ce5248f78ac0a247d76e48cff152f4e3f26482 -Bug: https://bugs.gentoo.org/836684 - -Signed-off-by: Maciej Barć ---- - python/setup.py.in | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/python/setup.py.in b/python/setup.py.in -index b3ab64af4..293eb1f80 100644 ---- a/python/setup.py.in -+++ b/python/setup.py.in -@@ -27,7 +27,7 @@ import sys - import os - import platform - from distutils.core import setup, Extension --from distutils import sysconfig -+import sysconfig - from distutils.cmd import Command - - __PACKAGE_VERSION__ = "0.2.0" -@@ -59,8 +59,8 @@ def _init_posix(init): - Forces g++ instead of gcc on most systems - credits to eric jones (eric@enthought.com) (found at Google Groups) - """ -- def wrapper(): -- init() -+ def wrapper(vars): -+ init(vars) - - config_vars = sysconfig.get_config_vars() # by reference - if config_vars["MACHDEP"].startswith("sun"): diff --git a/build/pkgs/cryptominisat/patches/cryptominisat-5.8.0-rm_extra_python_vars.patch b/build/pkgs/cryptominisat/patches/cryptominisat-5.8.0-rm_extra_python_vars.patch deleted file mode 100644 index 5ef6f21c948..00000000000 --- a/build/pkgs/cryptominisat/patches/cryptominisat-5.8.0-rm_extra_python_vars.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt -index f549ca7..4a9f0d8 100644 ---- a/python/CMakeLists.txt -+++ b/python/CMakeLists.txt -@@ -25,19 +25,6 @@ import sysconfig; - print(sysconfig.get_config_var('CFLAGS'), end = '')" - OUTPUT_VARIABLE PY_C_CONFIG) - --execute_process(COMMAND ${PYTHON_EXECUTABLE} -c " --from __future__ import print_function; --import sysconfig; --print(sysconfig.get_config_var('SHLIBS'), end = '')" -- OUTPUT_VARIABLE PY_LD_CONFIG) -- -- --execute_process(COMMAND ${PYTHON_EXECUTABLE} -c " --from __future__ import print_function; --import sysconfig; --print(sysconfig.get_config_var('LINKFORSHARED'), end = '')" -- OUTPUT_VARIABLE PY_LINKFORSHARED_CONFIG) -- - if(DEFINED ENV{PYCRYPTOSAT_INSTALL_PATH}) - set(PY_INSTALL_PREFIX "--prefix=$ENV{PYCRYPTOSAT_INSTALL_PATH}") - elseif(DEFINED ENV{VIRTUAL_ENV}) -@@ -47,12 +34,8 @@ else() - endif() - - string(REPLACE "\n" " " PY_C_CONFIG ${PY_C_CONFIG}) --string(REPLACE "\n" " " PY_LD_CONFIG ${PY_LD_CONFIG}) --string(REPLACE "\n" " " PY_LINKFORSHARED_CONFIG ${PY_LINKFORSHARED_CONFIG}) - - message(STATUS "Python CFLAGS: '${PY_C_CONFIG}'") --message(STATUS "Python LDFLAGS: '${PY_LD_CONFIG}'") --message(STATUS "Python LINKFORSHARED flags: '${PY_LINKFORSHARED_CONFIG}'") - message(STATUS "Python module installation prefix: ${PY_INSTALL_PREFIX}") - - set(PY_LD_CONFIG "${PY_LD_CONFIG} ${PY_LINKFORSHARED_CONFIG}") diff --git a/build/pkgs/cryptominisat/spkg-install.in b/build/pkgs/cryptominisat/spkg-install.in deleted file mode 100644 index edcbcf4f0b2..00000000000 --- a/build/pkgs/cryptominisat/spkg-install.in +++ /dev/null @@ -1,5 +0,0 @@ -cd src - -sdh_cmake -DUSE_GAUSS='ON' -DENABLE_PYTHON_INTERFACE=OFF $EXTRA_OPTS -sdh_make VERBOSE=ON -sdh_make_install VERBOSE=ON diff --git a/build/pkgs/cryptominisat/type b/build/pkgs/cryptominisat/type deleted file mode 100644 index 134d9bc32d5..00000000000 --- a/build/pkgs/cryptominisat/type +++ /dev/null @@ -1 +0,0 @@ -optional diff --git a/build/pkgs/pycryptosat/SPKG.rst b/build/pkgs/pycryptosat/SPKG.rst index a0b0ef6a510..c61a3a69bc3 100644 --- a/build/pkgs/pycryptosat/SPKG.rst +++ b/build/pkgs/pycryptosat/SPKG.rst @@ -4,8 +4,21 @@ pycryptosat: Python module of cryptominisat Description ----------- - Build and install pycryptosat into appropriate venv. - See cryptominisat for more details. + Build and install pycryptosat (Python frontend to CryptoMiniSat, which will be built if needed too) + into appropriate venv. + + + + CryptoMiniSat is a SAT solver that aims to become a premiere SAT solver + with all the features and speed of successful SAT solvers, such as MiniSat + and PrecoSat. The long-term goals of CryptoMiniSat are to be an efficient + sequential, parallel and distributed solver. There are solvers that are + good at one or the other, e.g. ManySat (parallel) or PSolver (distributed), + but we wish to excel at all. + + CryptoMiniSat 2.5 won the SAT Race 2010 among 20 solvers submitted by researchers and industry. + + License ------- diff --git a/build/pkgs/pycryptosat/checksums.ini b/build/pkgs/pycryptosat/checksums.ini deleted file mode 120000 index 93cecdab18f..00000000000 --- a/build/pkgs/pycryptosat/checksums.ini +++ /dev/null @@ -1 +0,0 @@ -../cryptominisat/checksums.ini \ No newline at end of file diff --git a/build/pkgs/pycryptosat/dependencies b/build/pkgs/pycryptosat/dependencies index c51735427aa..58247760d8a 100644 --- a/build/pkgs/pycryptosat/dependencies +++ b/build/pkgs/pycryptosat/dependencies @@ -1,4 +1,4 @@ - m4ri zlib libpng cryptominisat | cmake boost_cropped $(PYTHON_TOOLCHAIN) $(PYTHON) + m4ri zlib libpng | cmake boost_cropped $(PYTHON_TOOLCHAIN) $(PYTHON) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/pycryptosat/package-version.txt b/build/pkgs/pycryptosat/package-version.txt deleted file mode 120000 index 1743d5359eb..00000000000 --- a/build/pkgs/pycryptosat/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -../cryptominisat/package-version.txt \ No newline at end of file diff --git a/build/pkgs/pycryptosat/patches b/build/pkgs/pycryptosat/patches deleted file mode 120000 index a9b6b7c63e5..00000000000 --- a/build/pkgs/pycryptosat/patches +++ /dev/null @@ -1 +0,0 @@ -../cryptominisat/patches \ No newline at end of file diff --git a/build/pkgs/pycryptosat/spkg-install.in b/build/pkgs/pycryptosat/spkg-install.in deleted file mode 100644 index b218fe1a924..00000000000 --- a/build/pkgs/pycryptosat/spkg-install.in +++ /dev/null @@ -1,9 +0,0 @@ -cd src - -sdh_cmake -DUSE_GAUSS='ON' $EXTRA_OPTS - -cd pycryptosat - -export CFLAGS="$CFLAGS -std=gnu++11" - -sdh_pip_install . diff --git a/build/pkgs/pycryptosat/version_requirements.txt b/build/pkgs/pycryptosat/version_requirements.txt deleted file mode 100644 index a6b5d27edc4..00000000000 --- a/build/pkgs/pycryptosat/version_requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pycryptosat From 6692a941c603eb03d3df1278d5c40cf56be9aeee Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Wed, 17 Apr 2024 11:04:25 +0100 Subject: [PATCH 27/51] correct spkg name --- src/sage/sat/solvers/cryptominisat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/sat/solvers/cryptominisat.py b/src/sage/sat/solvers/cryptominisat.py index 82f1ffd9086..0a968dbde65 100644 --- a/src/sage/sat/solvers/cryptominisat.py +++ b/src/sage/sat/solvers/cryptominisat.py @@ -26,7 +26,7 @@ from sage.misc.lazy_import import lazy_import from sage.features import PythonModule lazy_import('pycryptosat', ['Solver'], - feature=PythonModule('pycryptosat', spkg='cryptominisat')) + feature=PythonModule('pycryptosat', spkg='pycryptosat')) class CryptoMiniSat(SatSolver): From 8f2a0a00c91b7a43bc62005c845e70f5deb7dfd1 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Thu, 18 Apr 2024 08:34:22 +0100 Subject: [PATCH 28/51] added the elusive requirements.txt --- build/pkgs/pycryptosat/requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 build/pkgs/pycryptosat/requirements.txt diff --git a/build/pkgs/pycryptosat/requirements.txt b/build/pkgs/pycryptosat/requirements.txt new file mode 100644 index 00000000000..a6b5d27edc4 --- /dev/null +++ b/build/pkgs/pycryptosat/requirements.txt @@ -0,0 +1 @@ +pycryptosat From b5ae24b8213519e78ca767b855effbdce48b7ba2 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Thu, 18 Apr 2024 08:50:18 +0100 Subject: [PATCH 29/51] remove/update outdated comments --- src/sage/sat/solvers/cryptominisat.py | 2 -- src/sage/sat/solvers/satsolver.pyx | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/sage/sat/solvers/cryptominisat.py b/src/sage/sat/solvers/cryptominisat.py index 0a968dbde65..27955c43eef 100644 --- a/src/sage/sat/solvers/cryptominisat.py +++ b/src/sage/sat/solvers/cryptominisat.py @@ -3,8 +3,6 @@ This solver relies on Python bindings provided by upstream cryptominisat. -The ``cryptominisat`` package should be installed on your Sage installation. - AUTHORS: - Thierry Monteil (2017): complete rewrite, using upstream Python bindings, diff --git a/src/sage/sat/solvers/satsolver.pyx b/src/sage/sat/solvers/satsolver.pyx index 2f9ed49bcc0..7b63a1ee87d 100644 --- a/src/sage/sat/solvers/satsolver.pyx +++ b/src/sage/sat/solvers/satsolver.pyx @@ -322,7 +322,7 @@ def SAT(solver=None, *args, **kwds): - ``solver`` (string) -- select a solver. Admissible values are: - - ``"cryptominisat"`` -- note that the cryptominisat package must be + - ``"cryptominisat"`` -- note that the pycryptosat package must be installed. - ``"picosat"`` -- note that the pycosat package must be installed. From a21881a20e39020c2a2524f5dd21602608ba9de7 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sat, 20 Apr 2024 16:25:16 +0100 Subject: [PATCH 30/51] Update SPKG.rst --- build/pkgs/pycryptosat/SPKG.rst | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/build/pkgs/pycryptosat/SPKG.rst b/build/pkgs/pycryptosat/SPKG.rst index c61a3a69bc3..d09e5b7f6cb 100644 --- a/build/pkgs/pycryptosat/SPKG.rst +++ b/build/pkgs/pycryptosat/SPKG.rst @@ -4,19 +4,16 @@ pycryptosat: Python module of cryptominisat Description ----------- - Build and install pycryptosat (Python frontend to CryptoMiniSat, which will be built if needed too) - into appropriate venv. +Build and install pycryptosat (Python frontend to CryptoMiniSat, which will be built if needed too). +CryptoMiniSat is a SAT solver that aims to become a premiere SAT solver +with all the features and speed of successful SAT solvers, such as MiniSat +and PrecoSat. The long-term goals of CryptoMiniSat are to be an efficient +sequential, parallel and distributed solver. There are solvers that are +good at one or the other, e.g. ManySat (parallel) or PSolver (distributed), +but we wish to excel at all. - - CryptoMiniSat is a SAT solver that aims to become a premiere SAT solver - with all the features and speed of successful SAT solvers, such as MiniSat - and PrecoSat. The long-term goals of CryptoMiniSat are to be an efficient - sequential, parallel and distributed solver. There are solvers that are - good at one or the other, e.g. ManySat (parallel) or PSolver (distributed), - but we wish to excel at all. - - CryptoMiniSat 2.5 won the SAT Race 2010 among 20 solvers submitted by researchers and industry. +CryptoMiniSat 2.5 won the SAT Race 2010 among 20 solvers submitted by researchers and industry. From 601631c6b564ea046845fefcd2fc1d12a36b8123 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 4 Jun 2024 18:24:17 -0700 Subject: [PATCH 31/51] build/pkgs/cryptominisat: Remove leftover file --- build/pkgs/cryptominisat/math | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 build/pkgs/cryptominisat/math diff --git a/build/pkgs/cryptominisat/math b/build/pkgs/cryptominisat/math deleted file mode 100644 index e69de29bb2d..00000000000 From 41b88e19f4a203c36558b85eadc6dfc0eaa0bf88 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 16 Apr 2024 18:52:21 -0700 Subject: [PATCH 32/51] build/pkgs/igraph: Update to 0.10.11 --- build/pkgs/igraph/checksums.ini | 5 +++-- build/pkgs/igraph/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/pkgs/igraph/checksums.ini b/build/pkgs/igraph/checksums.ini index 6d63bbce214..1f4fc517e29 100644 --- a/build/pkgs/igraph/checksums.ini +++ b/build/pkgs/igraph/checksums.ini @@ -1,4 +1,5 @@ tarball=igraph-VERSION.tar.gz -sha1=40efbd2adf3c1cc0a2bb3e14f4c7898d053f1fe4 -sha256=ac5fa94ae6fd1eace651e4b235e99c056479a5c5d0d641aed30240ac33b19403 +sha1=ca6752410ad8593b60de2fb6e1e2644ba009e62a +md5=024e65e7e4c32949f71f1469b57bbff7 +cksum=773092395 upstream_url=https://github.com/igraph/igraph/releases/download/VERSION/igraph-VERSION.tar.gz diff --git a/build/pkgs/igraph/package-version.txt b/build/pkgs/igraph/package-version.txt index 1a46c7f13e7..223df198464 100644 --- a/build/pkgs/igraph/package-version.txt +++ b/build/pkgs/igraph/package-version.txt @@ -1 +1 @@ -0.10.8 +0.10.11 From 2299e0624db940c1a6fca7d08ea087332409cd14 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 16 Apr 2024 19:02:55 -0700 Subject: [PATCH 33/51] build/pkgs/python_igraph/spkg-install.in: We can pass another --config-settings now, as we have setuptools>=64 with https://github.com/pypa/setuptools/issues/3380 --- build/pkgs/python_igraph/spkg-install.in | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/build/pkgs/python_igraph/spkg-install.in b/build/pkgs/python_igraph/spkg-install.in index bafbbda375e..ea42c2d9241 100644 --- a/build/pkgs/python_igraph/spkg-install.in +++ b/build/pkgs/python_igraph/spkg-install.in @@ -2,9 +2,4 @@ cd src # Use --use-pep517 because https://github.com/igraph/python-igraph as of 0.9.11 does not have pyproject.toml # and so "pip wheel" would use a legacy build method, ignoring --config-settings. # -# TODO: With setuptools 63.2.0, passing another --config-settings "--global-option=--no-wait" (not really needed) -# kills the "--global-option=--use-pkg-config". -# https://github.com/pypa/setuptools/issues/3380 makes changes to this, so we can revisit this after -# the next setuptools upgrade. -# -sdh_pip_install --use-pep517 --config-settings "--global-option=--use-pkg-config" . +sdh_pip_install --use-pep517 --config-settings "--global-option=--use-pkg-config" --config-settings "--global-option=--no-wait" . From 0a9bf9fc82bf82a0010210580e62dae7c258f9b7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 16 Apr 2024 19:03:44 -0700 Subject: [PATCH 34/51] build/pkgs/python_igraph/spkg-install.in: No more need to use --use-pep-517 explicitly --- build/pkgs/python_igraph/spkg-install.in | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build/pkgs/python_igraph/spkg-install.in b/build/pkgs/python_igraph/spkg-install.in index ea42c2d9241..07408c34b0d 100644 --- a/build/pkgs/python_igraph/spkg-install.in +++ b/build/pkgs/python_igraph/spkg-install.in @@ -1,5 +1,2 @@ cd src -# Use --use-pep517 because https://github.com/igraph/python-igraph as of 0.9.11 does not have pyproject.toml -# and so "pip wheel" would use a legacy build method, ignoring --config-settings. -# -sdh_pip_install --use-pep517 --config-settings "--global-option=--use-pkg-config" --config-settings "--global-option=--no-wait" . +sdh_pip_install --config-settings "--global-option=--use-pkg-config" --config-settings "--global-option=--no-wait" . From 176cbaf81759e6db4b57a325ff85a5f280b2c4e1 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 16 Apr 2024 19:17:10 -0700 Subject: [PATCH 35/51] build/pkgs/igraph/spkg-check.in: Fix --- build/pkgs/igraph/spkg-check.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/pkgs/igraph/spkg-check.in b/build/pkgs/igraph/spkg-check.in index 27cd9419538..29b0a04f2cc 100644 --- a/build/pkgs/igraph/spkg-check.in +++ b/build/pkgs/igraph/spkg-check.in @@ -1,2 +1,3 @@ cd src -$MAKE check +cd build +sdh_make_check From 8010f7f5ef0fc56ddb7173795d4bdf01f06bdd1d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 17 Apr 2024 12:29:50 -0700 Subject: [PATCH 36/51] build/pkgs/igraph/spkg-configure.m4: Accept system igraph 0.10.11 --- build/pkgs/igraph/spkg-configure.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/igraph/spkg-configure.m4 b/build/pkgs/igraph/spkg-configure.m4 index 5133fce98da..22823f5ae8d 100644 --- a/build/pkgs/igraph/spkg-configure.m4 +++ b/build/pkgs/igraph/spkg-configure.m4 @@ -3,7 +3,7 @@ SAGE_SPKG_CONFIGURE([igraph], [ dnl check for igraph with pkg-config dnl Per upstream in https://github.com/sagemath/sage/pull/36750#issuecomment-1826998762: dnl each python-igraph release is only guaranteed to be compatible with the same C/igraph that it bundles - PKG_CHECK_MODULES([IGRAPH], [igraph >= 0.10.8 igraph < 0.10.9], [], [ + PKG_CHECK_MODULES([IGRAPH], [igraph >= 0.10.8 igraph < 0.10.12], [], [ sage_spkg_install_igraph=yes]) ]) ]) From 645757c9af8ccda1fcd4412dc00770a81cd10a03 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 17 Apr 2024 17:47:40 -0700 Subject: [PATCH 37/51] build/pkgs/python_igraph: Update to 0.11.4 --- build/pkgs/python_igraph/checksums.ini | 5 +++-- build/pkgs/python_igraph/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/pkgs/python_igraph/checksums.ini b/build/pkgs/python_igraph/checksums.ini index ecdc7ea2dfe..2e820f171fd 100644 --- a/build/pkgs/python_igraph/checksums.ini +++ b/build/pkgs/python_igraph/checksums.ini @@ -1,4 +1,5 @@ tarball=python-igraph-VERSION.tar.gz -sha1=ef7ee85cb1bc83109c744d5dd6bbe5e37598ce3f -sha256=e55df60f882a51b8e8c1c5e7e940c5f90685d75634ea6df63bebcc983397adfa +sha1=ab9e19b43b598b15c8cd671f73efa0bbce98395f +md5=909d1b330e317d5b8cc9ac37096c94c1 +cksum=1231908814 upstream_url=https://pypi.io/packages/source/i/igraph/igraph-VERSION.tar.gz diff --git a/build/pkgs/python_igraph/package-version.txt b/build/pkgs/python_igraph/package-version.txt index 1a96df19c09..35ad34429be 100644 --- a/build/pkgs/python_igraph/package-version.txt +++ b/build/pkgs/python_igraph/package-version.txt @@ -1 +1 @@ -0.11.3 +0.11.4 From bd02730f7b9bc6168e0c3a5462adcf4091905ebf Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 4 Jun 2024 19:02:00 -0700 Subject: [PATCH 38/51] build/pkgs/igraph: Update to 0.10.12 --- build/pkgs/igraph/checksums.ini | 5 ++--- build/pkgs/igraph/package-version.txt | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build/pkgs/igraph/checksums.ini b/build/pkgs/igraph/checksums.ini index 1f4fc517e29..62eafa1aec9 100644 --- a/build/pkgs/igraph/checksums.ini +++ b/build/pkgs/igraph/checksums.ini @@ -1,5 +1,4 @@ tarball=igraph-VERSION.tar.gz -sha1=ca6752410ad8593b60de2fb6e1e2644ba009e62a -md5=024e65e7e4c32949f71f1469b57bbff7 -cksum=773092395 +sha1=3789f61beac1f1231f8c3832102dcb2720f2a0c9 +sha256=b011f7f9f38a3e59924cc9ff652e6d33105fa03fcaf3792f47d752626a0a4625 upstream_url=https://github.com/igraph/igraph/releases/download/VERSION/igraph-VERSION.tar.gz diff --git a/build/pkgs/igraph/package-version.txt b/build/pkgs/igraph/package-version.txt index 223df198464..70016a7c6ad 100644 --- a/build/pkgs/igraph/package-version.txt +++ b/build/pkgs/igraph/package-version.txt @@ -1 +1 @@ -0.10.11 +0.10.12 From 735a90e29fad0a969cb8deea9db44e2a0c2fe6d5 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 4 Jun 2024 19:02:28 -0700 Subject: [PATCH 39/51] build/pkgs/python_igraph: Update to 0.11.5 --- build/pkgs/python_igraph/checksums.ini | 5 ++--- build/pkgs/python_igraph/package-version.txt | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build/pkgs/python_igraph/checksums.ini b/build/pkgs/python_igraph/checksums.ini index 2e820f171fd..d7247b21a30 100644 --- a/build/pkgs/python_igraph/checksums.ini +++ b/build/pkgs/python_igraph/checksums.ini @@ -1,5 +1,4 @@ tarball=python-igraph-VERSION.tar.gz -sha1=ab9e19b43b598b15c8cd671f73efa0bbce98395f -md5=909d1b330e317d5b8cc9ac37096c94c1 -cksum=1231908814 +sha1=da963213ab22c60938d4e77ffab811875ee43a8a +sha256=2d71d645a4c3344c5910543fabbae10d3163f46a3e824ba7753c14b9036b8233 upstream_url=https://pypi.io/packages/source/i/igraph/igraph-VERSION.tar.gz diff --git a/build/pkgs/python_igraph/package-version.txt b/build/pkgs/python_igraph/package-version.txt index 35ad34429be..62d5dbdf3c7 100644 --- a/build/pkgs/python_igraph/package-version.txt +++ b/build/pkgs/python_igraph/package-version.txt @@ -1 +1 @@ -0.11.4 +0.11.5 From 254adacea70cbebc1540302cd4c1dc041b0edd9a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 4 Jun 2024 19:04:14 -0700 Subject: [PATCH 40/51] build/pkgs/igraph/spkg-configure.m4: Only accept igraph 0.10.12 --- build/pkgs/igraph/spkg-configure.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/igraph/spkg-configure.m4 b/build/pkgs/igraph/spkg-configure.m4 index 22823f5ae8d..0072f6ea6bc 100644 --- a/build/pkgs/igraph/spkg-configure.m4 +++ b/build/pkgs/igraph/spkg-configure.m4 @@ -3,7 +3,7 @@ SAGE_SPKG_CONFIGURE([igraph], [ dnl check for igraph with pkg-config dnl Per upstream in https://github.com/sagemath/sage/pull/36750#issuecomment-1826998762: dnl each python-igraph release is only guaranteed to be compatible with the same C/igraph that it bundles - PKG_CHECK_MODULES([IGRAPH], [igraph >= 0.10.8 igraph < 0.10.12], [], [ + PKG_CHECK_MODULES([IGRAPH], [igraph >= 0.10.12 igraph < 0.10.13], [], [ sage_spkg_install_igraph=yes]) ]) ]) From e7d34311fed20ff320f77002103649570b091a87 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Tue, 9 Apr 2024 10:57:53 +0900 Subject: [PATCH 41/51] Implementation of faithful repr of a Lie algebra in char p > 0. --- .../algebras/lie_algebras/representation.py | 239 ++++++++++++++++++ ...ite_dimensional_lie_algebras_with_basis.py | 17 +- 2 files changed, 252 insertions(+), 4 deletions(-) diff --git a/src/sage/algebras/lie_algebras/representation.py b/src/sage/algebras/lie_algebras/representation.py index b283bf3e694..069eecef004 100644 --- a/src/sage/algebras/lie_algebras/representation.py +++ b/src/sage/algebras/lie_algebras/representation.py @@ -788,3 +788,242 @@ def _acted_upon_(self, scalar, self_on_left=False): return P._project(P._to_pbw(scalar) * self._lift_pbw()) return super()._acted_upon_(scalar, self_on_left) + + +class FaithfulRepresentationPBWPosChar(CombinatorialFreeModule, Representation_abstract): + r""" + A faithful representation of a finite dimensional Lie algebra + in positive characteristic. + + .. WARNING:: + + This is often a very large dimensional representation relative + to the dimension of the Lie algebra. + + ALGORITHM: + + We implement the algorithm given in [deG2000] Section 6.6. Let `L` + be a finite dimensional Lie algebra over a ring of characteristic `p` + with basis `(b_1, \ldots, b_n)`. We compute (monic) `p`-polynomials + `f_i` such that `A = \mathrm{ad}(b_i)` solves `f_i(A) = 0` by using + minimal polynomial of `A`. The `(f_1, \ldots, f_n)` is a Gröbner basis + for an ideal `I` of the universal enveloping algebra `U(L)` such that + the quotient `U(L) / I` is a faithful representation of `L`. + + EXAMPLES:: + + sage: sl2 = LieAlgebra(GF(3), cartan_type=['A',1]) + sage: F = sl2.faithful_representation() + sage: F + Faithful representation with p-multiplicies (1, 3, 1) of Lie algebra + of ['A', 1] in the Chevalley basis + sage: F.dimension() + 243 + """ + def __init__(self, L): + r""" + Initialize ``self``. + + EXAMPLES:: + + sage: sl2 = LieAlgebra(GF(3), cartan_type=['A',1]) + sage: F = sl2.faithful_representation() + sage: TestSuite(F).run() + """ + R = L.base_ring() + self._p = R.characteristic() + if self._p == 0: + raise ValueError("the Lie algebra must be over a ring of positive characteristic") + + self._pbw = L.pbw_basis() + self._key_order = tuple(self._pbw.algebra_generators().keys()) + + # calculate the Gröbner basis and p-exponents + gb = [] + p_exp = [] + B = L.basis() + for k in self._key_order: + b = B[k] + ad = b.adjoint_matrix() + g = ad.minpoly() + d = g.degree() + # TODO: Use the sparse polynomial ring? + x = g.parent().gen() + r = [x**(self._p**i) % g for i in range(d+1)] + deg = max(ri.degree() for ri in r) + mat = matrix(R, [[ri[j] for ri in r] for j in range(deg+1)]) + la = mat.right_kernel_matrix()[0] + if la: + mongen = self._pbw._indices.monoid_generators()[k] + gb.append(self._pbw._from_dict({mongen ** (self._p ** i): val + for i, val in enumerate(la) if val}, + remove_zeros=False)) + p_exp.append(max(la.support())) + + self._groebner_basis = gb + self._p_exp = tuple(p_exp) + self._degrees = [self._p ** m for m in self._p_exp] + + from sage.groups.abelian_gps.abelian_group import AbelianGroup + indices = AbelianGroup(self._degrees) + + Representation_abstract.__init__(self, L) + CombinatorialFreeModule.__init__(self, R, indices, prefix='', bracket=False) + + def _repr_(self): + r""" + Return a string representation of ``self``. + + EXAMPLES:: + + sage: sl3 = LieAlgebra(GF(3), cartan_type=['A',2]) + sage: sl3.faithful_representation() + Faithful representation with p-multiplicies (1, 1, 1, 3, 3, 1, 1, 1) + of Lie algebra of ['A', 2] in the Chevalley basis + """ + return "Faithful representation with p-multiplicies {} of {}".format(self.p_exponents(), self._lie_algebra) + + def _latex_(self): + r""" + Return a string representation of ``self``. + + EXAMPLES:: + + sage: sl2 = LieAlgebra(GF(3), cartan_type=['A',1]) + sage: latex(sl2.faithful_representation()) + U(\mathfrak{g}(A_{1})_{\Bold{F}_{3}}) / \langle PBW_{\alpha_{1}}^{3}, + 2 PBW_{\alpha^\vee_{1}}^{27} + PBW_{\alpha^\vee_{1}}, + PBW_{-\alpha_{1}}^{3} \rangle + """ + from sage.misc.latex import latex + g = latex(self._lie_algebra) + data = ', '.join(latex(f) for f in self._groebner_basis) + return "U({}) / \\langle {} \\rangle".format(g, data) + + @cached_method + def p_exponents(self): + """ + Return the `p`-exponents of ``self``. + + Let `p` be the characteristic of the base ring of ``self`. + The `p`-*exponents* are the exponents `m_i` such that the `i`-th + `p`-polynomial `f_i` is of degree `p^{m_i}`. + + EXAMPLES:: + + sage: sp4 = LieAlgebra(GF(3), cartan_type=['C',2]) + sage: F = sp4.faithful_representation() + sage: F.p_exponents() + (1, 1, 1, 1, 3, 3, 1, 1, 1, 1) + """ + return self._p_exp + + def groebner_basis(self): + """ + Return the defining Gröbner basis of ``self``. + + EXAMPLES:: + + sage: sp4 = LieAlgebra(GF(3), cartan_type=['C',2]) + sage: F = sp4.faithful_representation() + sage: F.groebner_basis() + [PBW[alpha[2]]^3, + PBW[alpha[1]]^3, + PBW[alpha[1] + alpha[2]]^3, + PBW[2*alpha[1] + alpha[2]]^3, + 2*PBW[alphacheck[1]]^27 + PBW[alphacheck[1]], + 2*PBW[alphacheck[2]]^27 + PBW[alphacheck[2]], + PBW[-alpha[2]]^3, + PBW[-alpha[1]]^3, + PBW[-alpha[1] - alpha[2]]^3, + PBW[-2*alpha[1] - alpha[2]]^3] + """ + return self._groebner_basis + + def _project(self, x): + r""" + The projection to ``self`` from the PBW basis. + + EXAMPLES:: + + sage: sl2 = LieAlgebra(GF(3), cartan_type=['A',1]) + sage: F = sl2.faithful_representation() + sage: PBW = F._pbw + sage: elt = PBW.an_element(); elt + PBW[alpha[1]]^2*PBW[alphacheck[1]]^2*PBW[-alpha[1]]^3 + + 2*PBW[alpha[1]] + 1 + sage: F._project(elt) + 1 + 2*f0 + sage: F._project(elt^2) + 1 + f0 + f0^2 + sage: F._project(elt^3) + 1 + + sage: elt = PBW(sum(sl2.basis())); elt + PBW[alpha[1]] + PBW[alphacheck[1]] + PBW[-alpha[1]] + sage: F._project(elt) + f2 + f1 + f0 + sage: F._project(elt^2) + 2*f2 + f2^2 + 2*f1 + 2*f1*f2 + f1^2 + 2*f0 + 2*f0*f2 + 2*f0*f1 + f0^2 + sage: F._project(elt^3) + 2*f2 + f1 + f1^3 + 2*f0 + sage: F._project(elt^4) + f2 + 2*f2^2 + f1 + f1^2 + f1^3*f2 + f1^4 + f0 + f0*f2 + f0*f1^3 + 2*f0^2 + """ + reduction = True + while reduction: + reduction = False + mc = x._monomial_coefficients + for m, c in mc.items(): + d = m.dict() + for k, e, g in zip(self._key_order, self._degrees, self._groebner_basis): + if k not in d: + continue + if d[k] >= e: + d[k] -= e + x -= self._pbw.monomial(self._pbw._indices(d)) * g + reduction = True + break + data = {} + for m, c in x._monomial_coefficients.items(): + d = m.dict() + data[self._indices([d.get(k, 0) for k in self._key_order])] = c + return self.element_class(self, data) + + class Element(CombinatorialFreeModule.Element): + def _acted_upon_(self, scalar, self_on_left=False): + r""" + Return the action of ``scalar`` on ``self``. + + EXAMPLES:: + + sage: sl2 = LieAlgebra(GF(3), cartan_type=['A',1]) + sage: F = sl2.faithful_representation() + sage: v = F.an_element(); v + 1 + 2*f2 + f0*f1*f2 + sage: sl2.an_element() * v + f2 + 2*f2^2 + f1 + 2*f1*f2 + 2*f1^2*f2 + f0 + 2*f0*f2 + 2*f0*f2^2 + + 2*f0*f1*f2 + f0*f1*f2^2 + f0*f1^2*f2 + f0^2*f1*f2 + sage: sl2.pbw_basis().an_element() * v + 1 + 2*f2 + 2*f0 + f0*f2 + f0*f1*f2 + 2*f0^2*f1*f2 + sage: 5 * v + 2 + f2 + 2*f0*f1*f2 + sage: v * 5 + 2 + f2 + 2*f0*f1*f2 + sage: v._acted_upon_(sl2.an_element(), True) is None + True + """ + P = self.parent() + if scalar in P._lie_algebra or scalar in P._pbw: + if self_on_left: + return None + if not self: # we are (already) the zero vector + return self + scalar = P._pbw(scalar) + monoid = P._pbw._indices + I = P._key_order + lift = P._pbw.element_class(P._pbw, {monoid(list(zip(I, m.exponents()))): coeff + for m, coeff in self._monomial_coefficients.items()}) + return P._project(scalar * lift) + + return super()._acted_upon_(scalar, self_on_left) diff --git a/src/sage/categories/finite_dimensional_lie_algebras_with_basis.py b/src/sage/categories/finite_dimensional_lie_algebras_with_basis.py index 4477401a909..7e66c6f6f4e 100644 --- a/src/sage/categories/finite_dimensional_lie_algebras_with_basis.py +++ b/src/sage/categories/finite_dimensional_lie_algebras_with_basis.py @@ -2139,7 +2139,7 @@ def faithful_representation(self, algorithm=None): - ``algorithm`` -- one of the following depending on the classification of the Lie algebra: - Nilpotent Lie algebras: + Nilpotent: * ``'regular'`` -- use the universal enveloping algebra quotient :class:`~sage.algebras.lie_algebras.representation.FaithfulRepresentationNilpotentPBW` @@ -2147,7 +2147,7 @@ def faithful_representation(self, algorithm=None): precise details, see the documentation of :class:`~sage.algebras.lie_algebras.representation.FaithfulRepresentationNilpotentPBW`) - Solvable but not nilpotent: + Solvable: * Not implemented @@ -2157,7 +2157,13 @@ def faithful_representation(self, algorithm=None): General case - * Not implemented + * ``'generic'`` -- generic algortihm (only implemented currently + for positive characteristic) + + Note that the algorithm for any more generic cases can be used + in the specialized cases. For instance, using ``'generic'`` for + any Lie algebra (e.g., even if nilpotent) will use the generic + implementation. EXAMPLES:: @@ -2207,7 +2213,10 @@ def faithful_representation(self, algorithm=None): if algorithm == "minimal": from sage.algebras.lie_algebras.representation import FaithfulRepresentationNilpotentPBW return FaithfulRepresentationNilpotentPBW(self, minimal=True) - else: + if algorithm is None or algorithm == "generic": + if self.base_ring().characteristic() > 0: + from sage.algebras.lie_algebras.representation import FaithfulRepresentationPBWPosChar + return FaithfulRepresentationPBWPosChar(self) raise NotImplementedError("only implemented for nilpotent Lie algebras") raise ValueError("invalid algorithm '{}'".format(algorithm)) From 67637264db0cca4f346b80984a74f0d755c1b371 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Thu, 11 Apr 2024 14:39:41 +0900 Subject: [PATCH 42/51] Fixing lint/doc issue. --- src/sage/algebras/lie_algebras/representation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/algebras/lie_algebras/representation.py b/src/sage/algebras/lie_algebras/representation.py index 069eecef004..e6494806d26 100644 --- a/src/sage/algebras/lie_algebras/representation.py +++ b/src/sage/algebras/lie_algebras/representation.py @@ -905,7 +905,7 @@ def p_exponents(self): """ Return the `p`-exponents of ``self``. - Let `p` be the characteristic of the base ring of ``self`. + Let `p` be the characteristic of the base ring of ``self``. The `p`-*exponents* are the exponents `m_i` such that the `i`-th `p`-polynomial `f_i` is of degree `p^{m_i}`. From 6149b978a57f7b51ca7ba2fe4c62501d1903792d Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Tue, 4 Jun 2024 16:13:48 +0900 Subject: [PATCH 43/51] Implementing reviewer changes. --- src/sage/algebras/lie_algebras/representation.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/sage/algebras/lie_algebras/representation.py b/src/sage/algebras/lie_algebras/representation.py index e6494806d26..6594c9d1148 100644 --- a/src/sage/algebras/lie_algebras/representation.py +++ b/src/sage/algebras/lie_algebras/representation.py @@ -805,17 +805,18 @@ class FaithfulRepresentationPBWPosChar(CombinatorialFreeModule, Representation_a We implement the algorithm given in [deG2000] Section 6.6. Let `L` be a finite dimensional Lie algebra over a ring of characteristic `p` with basis `(b_1, \ldots, b_n)`. We compute (monic) `p`-polynomials - `f_i` such that `A = \mathrm{ad}(b_i)` solves `f_i(A) = 0` by using - minimal polynomial of `A`. The `(f_1, \ldots, f_n)` is a Gröbner basis - for an ideal `I` of the universal enveloping algebra `U(L)` such that - the quotient `U(L) / I` is a faithful representation of `L`. + `f_i` such that `A = \mathrm{ad}(b_i)` (the adjoint action of `b_i`) + solves `f_i(A) = 0` by using minimal polynomial of `A`. The + `(f_1, \ldots, f_n)` is a Gröbner basis for an ideal `I` of the + universal enveloping algebra `U(L)` such that the quotient `U(L) / I` + is a faithful representation of `L`. EXAMPLES:: sage: sl2 = LieAlgebra(GF(3), cartan_type=['A',1]) sage: F = sl2.faithful_representation() sage: F - Faithful representation with p-multiplicies (1, 3, 1) of Lie algebra + Faithful representation with p-multiplicities (1, 3, 1) of Lie algebra of ['A', 1] in the Chevalley basis sage: F.dimension() 243 @@ -878,10 +879,10 @@ def _repr_(self): sage: sl3 = LieAlgebra(GF(3), cartan_type=['A',2]) sage: sl3.faithful_representation() - Faithful representation with p-multiplicies (1, 1, 1, 3, 3, 1, 1, 1) + Faithful representation with p-multiplicities (1, 1, 1, 3, 3, 1, 1, 1) of Lie algebra of ['A', 2] in the Chevalley basis """ - return "Faithful representation with p-multiplicies {} of {}".format(self.p_exponents(), self._lie_algebra) + return "Faithful representation with p-multiplicities {} of {}".format(self.p_exponents(), self._lie_algebra) def _latex_(self): r""" From 46d125c080f36fddac064b0689193c324927aa71 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Wed, 5 Jun 2024 11:16:23 +0900 Subject: [PATCH 44/51] Adding back in import that was there in previous version. --- src/sage/algebras/lie_algebras/representation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sage/algebras/lie_algebras/representation.py b/src/sage/algebras/lie_algebras/representation.py index 6594c9d1148..bedcb869867 100644 --- a/src/sage/algebras/lie_algebras/representation.py +++ b/src/sage/algebras/lie_algebras/representation.py @@ -16,6 +16,7 @@ # https://www.gnu.org/licenses/ # **************************************************************************** +from sage.misc.cachefunc import cached_method from sage.sets.family import Family, AbstractFamily from sage.matrix.constructor import matrix from sage.combinat.free_module import CombinatorialFreeModule From 57260136c4f655c85ba6027fe5a966da4a6821b7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 4 Jun 2024 22:17:00 -0700 Subject: [PATCH 45/51] .github/workflows/*build*.yml: Survive GHA cache upload timeouts --- .github/workflows/build.yml | 17 ++++++++++++++--- .github/workflows/doc-build-pdf.yml | 6 ++++++ .github/workflows/doc-build.yml | 5 +++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 605707ffd9e..c7200f847d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -198,7 +198,9 @@ jobs: TARGETS=${{ steps.build-targets.outputs.build_targets }} - name: Start container - if: steps.changed-files.outputs.doctests_all_changed_files + id: container + # Try to continue when "exporting to GitHub Actions Cache" failed with timeout + if: (success() || failure()) && steps.changed-files.outputs.doctests_all_changed_files run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -208,7 +210,7 @@ jobs: # Testing - name: Check that all modules can be imported - if: steps.changed-files.outputs.doctests_all_changed_files + if: (success() || failure()) && steps.container.outcome == 'success' && steps.changed-files.outputs.doctests_all_changed_files run: | # Increase the length of the lines in the "short summary" export COLUMNS=120 @@ -220,7 +222,7 @@ jobs: shell: sh .ci/docker-exec-script.sh BUILD /sage {0} - name: Test changed files (sage -t --new) - if: steps.changed-files.outputs.doctests_all_changed_files + if: (success() || failure()) && steps.container.outcome == 'success' && steps.changed-files.outputs.doctests_all_changed_files run: | export MAKE="make -j2 --output-sync=recurse" SAGE_NUM_THREADS=4 # https://github.com/tj-actions/changed-files?tab=readme-ov-file#outputs- @@ -305,6 +307,8 @@ jobs: TARGETS=${{ needs.test-new.outputs.build_targets }} - name: Start container + id: container + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -314,6 +318,7 @@ jobs: # Testing - name: Test modularized distributions + if: (success() || failure()) && steps.container.outcome == 'success' run: | export MAKE="make -j2 --output-sync=recurse" SAGE_NUM_THREADS=4 make V=0 tox-ensure && make ${{ matrix.targets }} @@ -401,6 +406,7 @@ jobs: - name: Start container id: container + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -410,6 +416,7 @@ jobs: # Testing - name: Test all files (sage -t --long ${{ matrix.tests }}) + if: (success() || failure()) && steps.container.outcome == 'success' run: | mkdir .coverage rm -rf /sage/.coverage @@ -513,6 +520,7 @@ jobs: - name: Start container id: container + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -526,8 +534,10 @@ jobs: with: path: .coverage pattern: coverage-* + if: (success() || failure()) && steps.container.outcome == 'success' - name: Coverage report + if: (success() || failure()) && steps.container.outcome == 'success' # Using --omit to avoid "CoverageWarning: Couldn't parse '/tmp/tmp06qizzie/tmp_ldpu46ob.py': No source for code" run: | rm -rf /sage/.coverage @@ -541,6 +551,7 @@ jobs: shell: sh .ci/docker-exec-script.sh BUILD . {0} - name: Upload coverage to codecov + if: (success() || failure()) && steps.container.outcome == 'success' uses: codecov/codecov-action@v4 with: directory: .coverage/coverage-report diff --git a/.github/workflows/doc-build-pdf.yml b/.github/workflows/doc-build-pdf.yml index d4cc6ebc6ca..2eac8e17ffc 100644 --- a/.github/workflows/doc-build-pdf.yml +++ b/.github/workflows/doc-build-pdf.yml @@ -101,6 +101,9 @@ jobs: TARGETS=ci-build-with-fallback - name: Start container + id: container + # Try to continue when "exporting to GitHub Actions Cache" failed with timeout + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -110,6 +113,8 @@ jobs: # Docs - name: Update system packages + id: packages + if: (success() || failure()) && steps.container.outcome == 'success' run: | export PATH="build/bin:$PATH" eval $(sage-print-system-package-command auto update) @@ -119,6 +124,7 @@ jobs: - name: Build docs (PDF) id: docbuild + if: (success() || failure()) && steps.packages.outcome == 'success' run: | export MAKE="make -j5 --output-sync=recurse" SAGE_NUM_THREADS=5 make doc-clean doc-uninstall; make sagemath_doc_html-build-deps sagemath_doc_pdf-no-deps diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 4d0420874b8..f47dac38d57 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -105,6 +105,9 @@ jobs: TARGETS=ci-build-with-fallback - name: Start container + id: container + # Try to continue when "exporting to GitHub Actions Cache" failed with timeout + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -115,6 +118,7 @@ jobs: - name: Store old docs id: worktree + if: (success() || failure()) && steps.container.outcome == 'success' run: | git config --global --add safe.directory $(pwd) git config --global user.email "ci-sage@example.com" @@ -140,6 +144,7 @@ jobs: - name: Build docs id: docbuild + if: (success() || failure()) && steps.worktree.outcome == 'success' # Always non-incremental because of the concern that # incremental docbuild may introduce broken links (inter-file references) though build succeeds run: | From 6d3a2336c39f088c43da6718f342f8fd66436c48 Mon Sep 17 00:00:00 2001 From: Giacomo Pope <44242839+GiacomoPope@users.noreply.github.com> Date: Wed, 5 Jun 2024 14:58:43 +0100 Subject: [PATCH 46/51] Apply suggestions from code review Add reviewer suggestions Co-authored-by: grhkm21 <83517584+grhkm21@users.noreply.github.com> --- src/sage/matrix/matrix_mod2_dense.pyx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sage/matrix/matrix_mod2_dense.pyx b/src/sage/matrix/matrix_mod2_dense.pyx index 14eb6f02539..5eb71dc252a 100644 --- a/src/sage/matrix/matrix_mod2_dense.pyx +++ b/src/sage/matrix/matrix_mod2_dense.pyx @@ -532,7 +532,7 @@ cdef class Matrix_mod2_dense(matrix_dense.Matrix_dense): # dense or sparse INPUT: - - ``copy`` - (default: True) if True, return a copy so you can + - ``copy`` -- (default: ``True``) if True, return a copy so you can modify it safely EXAMPLES: @@ -542,7 +542,6 @@ cdef class Matrix_mod2_dense(matrix_dense.Matrix_dense): # dense or sparse sage: M2 = Matrix(GF(2), [[1, 0, 0], [0, 1, 0], [0, 1, 1]]) sage: M2.columns() [(1, 0, 0), (0, 1, 1), (0, 0, 1)] - """ x = self.fetch('columns') if x is not None: @@ -564,8 +563,7 @@ cdef class Matrix_mod2_dense(matrix_dense.Matrix_dense): # dense or sparse self.cache('columns', C) if copy: return list(C) - else: - return C + return C ######################################################################## # LEVEL 2 functionality From 2693e1cd3964b9084fb02545869bf3b46fe50dfb Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 4 Jun 2024 19:34:03 -0700 Subject: [PATCH 47/51] build/bin/sage-dist-helpers (sdh_pip_install): Pass config-settings which begin with a hyphen correctly --- build/bin/sage-dist-helpers | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/bin/sage-dist-helpers b/build/bin/sage-dist-helpers index d7ef0a81a8b..d55ac539837 100644 --- a/build/bin/sage-dist-helpers +++ b/build/bin/sage-dist-helpers @@ -247,9 +247,10 @@ sdh_pip_install() { install_options="$install_options $1" ;; -C|--config-settings) - build_options="$build_options --config-setting" shift - build_options="$build_options $1" + # Per 'python -m build --help', options which begin with a hyphen + # must be in the form of "--config-setting=--opt(=value)" or "-C--opt(=value)" + build_options="$build_options --config-setting=$1" ;; *) break From 0996d9509ae27a2526625b68edb9f49789d5749e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 5 Jun 2024 10:29:41 -0700 Subject: [PATCH 48/51] build/pkgs/cmake/spkg-configure.m4: Require at least 3.18 (for igraph) --- build/pkgs/cmake/spkg-configure.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/pkgs/cmake/spkg-configure.m4 b/build/pkgs/cmake/spkg-configure.m4 index 4210442c44c..6149f49a7c5 100644 --- a/build/pkgs/cmake/spkg-configure.m4 +++ b/build/pkgs/cmake/spkg-configure.m4 @@ -1,5 +1,5 @@ SAGE_SPKG_CONFIGURE([cmake], [dnl - AC_CACHE_CHECK([for cmake >= 3.11], [ac_cv_path_CMAKE], [dnl + AC_CACHE_CHECK([for cmake >= 3.18], [ac_cv_path_CMAKE], [dnl dnl Do not accept cmake installed via https://pypi.org/project/cmake/ dnl in the default user scheme; it will not work in our venv because dnl we set PYTHONUSERBASE in sage-env. @@ -8,7 +8,7 @@ SAGE_SPKG_CONFIGURE([cmake], [dnl cmake_version=`$ac_path_CMAKE --version 2>&1 \ | $SED -n -e 's/cmake version *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'` AS_IF([test -n "$cmake_version"], [dnl - AX_COMPARE_VERSION([$cmake_version], [ge], [3.11], [dnl + AX_COMPARE_VERSION([$cmake_version], [ge], [3.18], [dnl ac_cv_path_CMAKE="$ac_path_CMAKE" ac_path_CMAKE_found=: ]) From 9cf43cf3fb6fdfa839b62df2c9f6e202a9be2227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Wed, 5 Jun 2024 20:59:40 +0200 Subject: [PATCH 49/51] just a few details in permutation.py --- src/sage/combinat/permutation.py | 145 ++++++++++++++++--------------- 1 file changed, 73 insertions(+), 72 deletions(-) diff --git a/src/sage/combinat/permutation.py b/src/sage/combinat/permutation.py index b4e93a80b60..79e68a0a8bf 100644 --- a/src/sage/combinat/permutation.py +++ b/src/sage/combinat/permutation.py @@ -463,17 +463,17 @@ def __classcall_private__(cls, l, check=True): # if l is a pair of standard tableaux or a pair of lists elif isinstance(l, (tuple, list)) and len(l) == 2 and \ - all(isinstance(x, Tableau) for x in l): + all(isinstance(x, Tableau) for x in l): return RSK_inverse(*l, output='permutation') elif isinstance(l, (tuple, list)) and len(l) == 2 and \ - all(isinstance(x, list) for x in l): - P,Q = (Tableau(_) for _ in l) + all(isinstance(x, list) for x in l): + P, Q = (Tableau(_) for _ in l) return RSK_inverse(P, Q, 'permutation') # if it's a tuple or nonempty list of tuples, also assume cycle # notation elif isinstance(l, tuple) or \ (isinstance(l, list) and l and - all(isinstance(x, tuple) for x in l)): + all(isinstance(x, tuple) for x in l)): if l and (isinstance(l[0], (int, Integer)) or len(l[0]) > 0): if isinstance(l[0], tuple): n = max(max(x) for x in l) @@ -683,8 +683,8 @@ def _latex_(self): return " ".join(f"{let}_{{{i}}}" for i in redword) if display == "twoline": return r"\begin{{pmatrix}} {} \\ {} \end{{pmatrix}}".format( - " & ".join("%s" % i for i in range(1, len(self._list)+1)), - " & ".join("%s" % i for i in self._list)) + " & ".join("%s" % i for i in range(1, len(self._list)+1)), + " & ".join("%s" % i for i in self._list)) if display == "list": return repr(self._list) if display == "cycle": @@ -1068,20 +1068,20 @@ def _to_cycles_set(self, singletons=True): if not singletons: # remove the fixed points - L = {i+1 for i,pi in enumerate(p) if pi != i+1} + L = {i for i, pi in enumerate(p, start=1) if pi != i} else: - L = set(range(1,len(p)+1)) + L = set(range(1, len(p) + 1)) # Go through until we've considered every remaining number while L: # take the first remaining element cycleFirst = L.pop() - next = p[cycleFirst-1] + next = p[cycleFirst - 1] cycle = [cycleFirst] while next != cycleFirst: cycle.append(next) L.remove(next) - next = p[next-1] + next = p[next - 1] # add the cycle cycles.append(tuple(cycle)) @@ -1109,7 +1109,7 @@ def _to_cycles_list(self, singletons=True): if not singletons: # remove the fixed points - L = [i + 1 for i, pi in enumerate(p) if pi != i + 1] + L = [i for i, pi in enumerate(p, start=1) if pi != i] else: L = list(range(1, len(p) + 1)) @@ -1125,7 +1125,7 @@ def _to_cycles_list(self, singletons=True): cycle.append(next) # remove next from L # we use a binary search to find it - L.pop(bisect_left(L,next)) + L.pop(bisect_left(L, next)) next = p[next-1] # add the cycle cycles.append(tuple(cycle)) @@ -1164,7 +1164,7 @@ def signature(self) -> Integer: sage: Permutation([]).sign() 1 """ - return (-1)**(len(self)-len(self.to_cycles())) + return (-1)**(len(self) - len(self.to_cycles())) # one can also use sign as an alias for signature sign = signature @@ -1592,7 +1592,7 @@ def merge_and_countv(ivA_A, ivB_B): else: C.extend(B[j:]) ivC.extend(ivB[j:]) - return ivC,C + return ivC, C def base_case(L): s = sorted(L) @@ -1628,7 +1628,7 @@ def inversions(self) -> list: """ p = self[:] n = len(p) - return [(i+1,j+1) for i in range(n-1) for j in range(i+1,n) + return [(i+1, j+1) for i in range(n-1) for j in range(i+1, n) if p[i] > p[j]] def stack_sort(self) -> Permutation: @@ -1917,7 +1917,7 @@ def absolute_length(self) -> Integer: """ return self.size() - len(self.cycle_type()) - @combinatorial_map(order=2,name='inverse') + @combinatorial_map(order=2, name='inverse') def inverse(self) -> Permutation: r""" Return the inverse of ``self``. @@ -1932,8 +1932,8 @@ def inverse(self) -> Permutation: [3, 1, 5, 2, 4] """ w = list(range(len(self))) - for i, j in enumerate(self): - w[j - 1] = i + 1 + for i, j in enumerate(self, start=1): + w[j - 1] = i return Permutations()(w) __invert__ = inverse @@ -3081,7 +3081,6 @@ def number_of_fixed_points(self) -> Integer: sage: Permutation([1,2,3,4]).number_of_fixed_points() 4 """ - return len(self.fixed_points()) def is_derangement(self) -> bool: @@ -3778,7 +3777,7 @@ def weak_excedences(self) -> list: sage: Permutation([1,4,3,2,5]).weak_excedences() [1, 4, 3, 5] """ - return [pi for i, pi in enumerate(self) if pi >= i + 1] + return [pi for i, pi in enumerate(self, start=1) if pi >= i] def bruhat_inversions(self) -> list: r""" @@ -5370,7 +5369,7 @@ def shifted_shuffle(self, other): True """ return self.shifted_concatenation(other, "right").\ - right_permutohedron_interval(self.shifted_concatenation(other, "left")) + right_permutohedron_interval(self.shifted_concatenation(other, "left")) def nth_roots(self, n): r""" @@ -5480,8 +5479,8 @@ def rewind(L, n): b = True poss = [P.identity()] for pa in partition: - poss = [p*q for p in poss - for q in merging_cycles([rewind(cycles[m][i-1], n//len(pa)) for i in pa])] + poss = [p*q for p in poss + for q in merging_cycles([rewind(cycles[m][i-1], n//len(pa)) for i in pa])] possibilities[i] += poss if not b: return @@ -5613,6 +5612,7 @@ def number_of_nth_roots(self, n): return result + def _tableau_contribution(T): r""" Get the number of SYT of shape(``T``). @@ -5856,21 +5856,21 @@ def __classcall_private__(cls, n=None, k=None, **kwargs): if len(a) == 1 and a[0] != 1: a = a[0] if a in StandardPermutations_all(): - if a == [1,2]: + if a == [1, 2]: return StandardPermutations_avoiding_12(n) - elif a == [2,1]: + elif a == [2, 1]: return StandardPermutations_avoiding_21(n) - elif a == [1,2,3]: + elif a == [1, 2, 3]: return StandardPermutations_avoiding_123(n) - elif a == [1,3,2]: + elif a == [1, 3, 2]: return StandardPermutations_avoiding_132(n) - elif a == [2,1,3]: + elif a == [2, 1, 3]: return StandardPermutations_avoiding_213(n) - elif a == [2,3,1]: + elif a == [2, 3, 1]: return StandardPermutations_avoiding_231(n) - elif a == [3,1,2]: + elif a == [3, 1, 2]: return StandardPermutations_avoiding_312(n) - elif a == [3,2,1]: + elif a == [3, 2, 1]: return StandardPermutations_avoiding_321(n) else: return StandardPermutations_avoiding_generic(n, (a,)) @@ -5970,36 +5970,36 @@ class options(GlobalOptions): NAME = 'Permutations' module = 'sage.combinat.permutation' display = {'default': "list", - 'description': "Specifies how the permutations should be printed", - 'values': {'list': "the permutations are displayed in list notation" - " (aka 1-line notation)", - 'cycle': "the permutations are displayed in cycle notation" - " (i. e., as products of disjoint cycles)", - 'singleton': "the permutations are displayed in cycle notation" - " with singleton cycles shown as well", - 'reduced_word': "the permutations are displayed as reduced words"}, - 'alias': {'word': "reduced_word", 'reduced_expression': "reduced_word"}, - 'case_sensitive': False} - latex = {'default': "list", - 'description': "Specifies how the permutations should be latexed", - 'values': {'list': "latex as a list in one-line notation", - 'twoline': "latex in two-line notation", - 'cycle': "latex in cycle notation", - 'singleton': "latex in cycle notation with singleton cycles shown as well", - 'reduced_word': "latex as reduced words"}, - 'alias': {'word': "reduced_word", 'reduced_expression': "reduced_word", 'oneline': "list"}, + 'description': "Specifies how the permutations should be printed", + 'values': {'list': "the permutations are displayed in list notation" + " (aka 1-line notation)", + 'cycle': "the permutations are displayed in cycle notation" + " (i. e., as products of disjoint cycles)", + 'singleton': "the permutations are displayed in cycle notation" + " with singleton cycles shown as well", + 'reduced_word': "the permutations are displayed as reduced words"}, + 'alias': {'word': "reduced_word", 'reduced_expression': "reduced_word"}, 'case_sensitive': False} + latex = {'default': "list", + 'description': "Specifies how the permutations should be latexed", + 'values': {'list': "latex as a list in one-line notation", + 'twoline': "latex in two-line notation", + 'cycle': "latex in cycle notation", + 'singleton': "latex in cycle notation with singleton cycles shown as well", + 'reduced_word': "latex as reduced words"}, + 'alias': {'word': "reduced_word", 'reduced_expression': "reduced_word", 'oneline': "list"}, + 'case_sensitive': False} latex_empty_str = {'default': "1", - 'description': 'The LaTeX representation of a reduced word when said word is empty', - 'checker': lambda char: isinstance(char,str)} + 'description': 'The LaTeX representation of a reduced word when said word is empty', + 'checker': lambda char: isinstance(char, str)} generator_name = {'default': "s", - 'description': "the letter used in latexing the reduced word", - 'checker': lambda char: isinstance(char,str)} + 'description': "the letter used in latexing the reduced word", + 'checker': lambda char: isinstance(char, str)} mult = {'default': "l2r", - 'description': "The multiplication of permutations", - 'values': {'l2r': r"left to right: `(p_1 \cdot p_2)(x) = p_2(p_1(x))`", - 'r2l': r"right to left: `(p_1 \cdot p_2)(x) = p_1(p_2(x))`"}, - 'case_sensitive': False} + 'description': "The multiplication of permutations", + 'values': {'l2r': r"left to right: `(p_1 \cdot p_2)(x) = p_2(p_1(x))`", + 'r2l': r"right to left: `(p_1 \cdot p_2)(x) = p_1(p_2(x))`"}, + 'case_sensitive': False} class Permutations_nk(Permutations): @@ -6082,7 +6082,8 @@ def __iter__(self) -> Iterator[Permutation]: sage: [p for p in Permutations(3,4)] [] """ - for x in itertools.permutations(range(1,self.n+1), int(self._k)): + for x in itertools.permutations(range(1, self.n + 1), + int(self._k)): yield self.element_class(self, x, check=False) def cardinality(self) -> Integer: @@ -7751,8 +7752,8 @@ def inverse(self): [4, 2, 1, 3] """ w = list(range(len(self))) - for i, j in enumerate(self): - w[j - 1] = i + 1 + for i, j in enumerate(self, start=1): + w[j - 1] = i return self.__class__(self.parent(), w) __invert__ = inverse @@ -7868,8 +7869,8 @@ def from_rank(n, rank): """ # Find the factoradic of rank factoradic = [None] * n - for j in range(1,n+1): - factoradic[n-j] = Integer(rank % j) + for j in range(1, n + 1): + factoradic[n - j] = Integer(rank % j) rank = int(rank) // j return from_lehmer_code(factoradic, Permutations(n)) @@ -7896,8 +7897,8 @@ def from_inversion_vector(iv, parent=None): """ p = iv[:] open_spots = list(range(len(iv))) - for i, ivi in enumerate(iv): - p[open_spots.pop(ivi)] = i + 1 + for i, ivi in enumerate(iv, start=1): + p[open_spots.pop(ivi)] = i if parent is None: parent = Permutations() @@ -8182,16 +8183,16 @@ def bistochastic_as_sum_of_permutations(M, check=True): while G.size() > 0: matching = G.matching(use_edge_labels=True) - matching = [(min(u,v), max(u, v), w) for u,v,w in matching] + matching = [(min(u, v), max(u, v), w) for u, v, w in matching] # This minimum is strictly larger than 0 minimum = min([x[2] for x in matching]) - for (u,v,l) in matching: + for u, v, l in matching: if minimum == l: - G.delete_edge((u,v,l)) + G.delete_edge((u, v, l)) else: - G.set_edge_label(u,v,l-minimum) + G.set_edge_label(u, v, l - minimum) matching.sort(key=lambda x: x[0]) value += minimum * CFM(P([x[1]-n+1 for x in matching])) @@ -8481,9 +8482,9 @@ def descents_composition_last(dc): raise TypeError("The argument must be of type Composition") s = 0 res = [] - for i in reversed(range(len(dc))): - res = list(range(s+1,s+dc[i]+1)) + res - s += dc[i] + for dci in reversed(dc): + res = list(range(s + 1, s + dci + 1)) + res + s += dci return Permutations()(res) @@ -8756,7 +8757,7 @@ def from_major_code(mc, final_descent=False): # the letter i into the word w^(i+1) in such a way that # maj(w^i)-maj(w^(i+1)) = mc[i] - for i in reversed(range(1,len(mc))): + for i in reversed(range(1, len(mc))): # Lemma 2.2 in Skandera # Get the descents of w and place them in reverse order From 35587cb6d0753c9de2c94fdcc193a84944ee7d71 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 5 Jun 2024 22:03:13 -0700 Subject: [PATCH 50/51] build/pkgs/openssl: Update to 3.2.2 --- build/pkgs/openssl/checksums.ini | 4 ++-- build/pkgs/openssl/package-version.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/pkgs/openssl/checksums.ini b/build/pkgs/openssl/checksums.ini index 6e2b7e18955..eac86dcdd87 100644 --- a/build/pkgs/openssl/checksums.ini +++ b/build/pkgs/openssl/checksums.ini @@ -1,4 +1,4 @@ tarball=openssl-VERSION.tar.gz -sha1=b48e20c07facfdf6da9ad43a6c5126d51897699b -sha256=f93c9e8edde5e9166119de31755fc87b4aa34863662f67ddfcba14d0b6b69b61 +sha1=b12311372a0277ca0eb218a68a7fd9f5ce66d162 +sha256=197149c18d9e9f292c43f0400acaba12e5f52cacfe050f3d199277ea738ec2e7 upstream_url=https://www.openssl.org/source/openssl-VERSION.tar.gz diff --git a/build/pkgs/openssl/package-version.txt b/build/pkgs/openssl/package-version.txt index f93fc9f42ea..be94e6f53db 100644 --- a/build/pkgs/openssl/package-version.txt +++ b/build/pkgs/openssl/package-version.txt @@ -1 +1 @@ -3.0.12 +3.2.2 From 31e216689afea5bc4e0daaee0122c546f42d1da5 Mon Sep 17 00:00:00 2001 From: Release Manager Date: Sun, 9 Jun 2024 12:05:34 +0200 Subject: [PATCH 51/51] Updated SageMath version to 10.4.beta9 --- CITATION.cff | 4 ++-- VERSION.txt | 2 +- build/pkgs/configure/checksums.ini | 4 ++-- build/pkgs/configure/package-version.txt | 2 +- build/pkgs/sage_conf/version_requirements.txt | 2 +- build/pkgs/sage_docbuild/version_requirements.txt | 2 +- build/pkgs/sage_setup/version_requirements.txt | 2 +- build/pkgs/sage_sws2rst/version_requirements.txt | 2 +- build/pkgs/sagelib/version_requirements.txt | 2 +- build/pkgs/sagemath_bliss/version_requirements.txt | 2 +- build/pkgs/sagemath_categories/version_requirements.txt | 2 +- build/pkgs/sagemath_coxeter3/version_requirements.txt | 2 +- build/pkgs/sagemath_environment/version_requirements.txt | 2 +- build/pkgs/sagemath_mcqd/version_requirements.txt | 2 +- build/pkgs/sagemath_meataxe/version_requirements.txt | 2 +- build/pkgs/sagemath_objects/version_requirements.txt | 2 +- build/pkgs/sagemath_repl/version_requirements.txt | 2 +- build/pkgs/sagemath_sirocco/version_requirements.txt | 2 +- build/pkgs/sagemath_tdlib/version_requirements.txt | 2 +- pkgs/sage-conf/VERSION.txt | 2 +- pkgs/sage-conf_conda/VERSION.txt | 2 +- pkgs/sage-conf_pypi/VERSION.txt | 2 +- pkgs/sage-docbuild/VERSION.txt | 2 +- pkgs/sage-setup/VERSION.txt | 2 +- pkgs/sage-sws2rst/VERSION.txt | 2 +- pkgs/sagemath-bliss/VERSION.txt | 2 +- pkgs/sagemath-categories/VERSION.txt | 2 +- pkgs/sagemath-coxeter3/VERSION.txt | 2 +- pkgs/sagemath-environment/VERSION.txt | 2 +- pkgs/sagemath-mcqd/VERSION.txt | 2 +- pkgs/sagemath-meataxe/VERSION.txt | 2 +- pkgs/sagemath-objects/VERSION.txt | 2 +- pkgs/sagemath-repl/VERSION.txt | 2 +- pkgs/sagemath-sirocco/VERSION.txt | 2 +- pkgs/sagemath-tdlib/VERSION.txt | 2 +- src/VERSION.txt | 2 +- src/bin/sage-version.sh | 6 +++--- src/sage/version.py | 7 +++---- 38 files changed, 44 insertions(+), 45 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 6a6902fc831..0d43a526e62 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -4,8 +4,8 @@ title: SageMath abstract: SageMath is a free open-source mathematics software system. authors: - name: "The SageMath Developers" -version: 10.4.beta8 +version: 10.4.beta9 doi: 10.5281/zenodo.8042260 -date-released: 2024-06-01 +date-released: 2024-06-09 repository-code: "https://github.com/sagemath/sage" url: "https://www.sagemath.org/" diff --git a/VERSION.txt b/VERSION.txt index 5d451269673..76bb72f1560 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -SageMath version 10.4.beta8, Release Date: 2024-06-01 +SageMath version 10.4.beta9, Release Date: 2024-06-09 diff --git a/build/pkgs/configure/checksums.ini b/build/pkgs/configure/checksums.ini index c85cd40f8b1..da9cfbb1ff9 100644 --- a/build/pkgs/configure/checksums.ini +++ b/build/pkgs/configure/checksums.ini @@ -1,3 +1,3 @@ tarball=configure-VERSION.tar.gz -sha1=350c449fd9df824dcb6a12b4a0cd50fca58df01b -sha256=113e10f9ffbb9c4b9e372efd5de3321122472f5dfb4dafddda1fadd4f03caf6f +sha1=f3e560bbf33add8504ba9f7ba93fff9e82e3e445 +sha256=bef93be1bb978fa34cd5aaa9c041d1a97a33ff35f88c9df2f9c25e6764770c56 diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt index 784c733b28c..ca5926f5634 100644 --- a/build/pkgs/configure/package-version.txt +++ b/build/pkgs/configure/package-version.txt @@ -1 +1 @@ -5d54f4073fe10ee7578952774c799363fda8939d +5c12765f7e585b58ab0cd99f7998cfa615f85247 diff --git a/build/pkgs/sage_conf/version_requirements.txt b/build/pkgs/sage_conf/version_requirements.txt index bc253d58444..bf5142c02e5 100644 --- a/build/pkgs/sage_conf/version_requirements.txt +++ b/build/pkgs/sage_conf/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-conf ~= 10.4b8 +sage-conf ~= 10.4b9 diff --git a/build/pkgs/sage_docbuild/version_requirements.txt b/build/pkgs/sage_docbuild/version_requirements.txt index 88c4d5b252f..3bc4e773ff1 100644 --- a/build/pkgs/sage_docbuild/version_requirements.txt +++ b/build/pkgs/sage_docbuild/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-docbuild ~= 10.4b8 +sage-docbuild ~= 10.4b9 diff --git a/build/pkgs/sage_setup/version_requirements.txt b/build/pkgs/sage_setup/version_requirements.txt index 8431cb882ad..d04bde41fdd 100644 --- a/build/pkgs/sage_setup/version_requirements.txt +++ b/build/pkgs/sage_setup/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-setup ~= 10.4b8 +sage-setup ~= 10.4b9 diff --git a/build/pkgs/sage_sws2rst/version_requirements.txt b/build/pkgs/sage_sws2rst/version_requirements.txt index 45259114676..d3698b0a9ae 100644 --- a/build/pkgs/sage_sws2rst/version_requirements.txt +++ b/build/pkgs/sage_sws2rst/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-sws2rst ~= 10.4b8 +sage-sws2rst ~= 10.4b9 diff --git a/build/pkgs/sagelib/version_requirements.txt b/build/pkgs/sagelib/version_requirements.txt index fbefd68c27a..1dd1a4f846b 100644 --- a/build/pkgs/sagelib/version_requirements.txt +++ b/build/pkgs/sagelib/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-standard ~= 10.4b8 +sagemath-standard ~= 10.4b9 diff --git a/build/pkgs/sagemath_bliss/version_requirements.txt b/build/pkgs/sagemath_bliss/version_requirements.txt index 9831109152b..bc95834828a 100644 --- a/build/pkgs/sagemath_bliss/version_requirements.txt +++ b/build/pkgs/sagemath_bliss/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-bliss ~= 10.4b8 +sagemath-bliss ~= 10.4b9 diff --git a/build/pkgs/sagemath_categories/version_requirements.txt b/build/pkgs/sagemath_categories/version_requirements.txt index e22c57defcd..08fa02e2044 100644 --- a/build/pkgs/sagemath_categories/version_requirements.txt +++ b/build/pkgs/sagemath_categories/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-categories ~= 10.4b8 +sagemath-categories ~= 10.4b9 diff --git a/build/pkgs/sagemath_coxeter3/version_requirements.txt b/build/pkgs/sagemath_coxeter3/version_requirements.txt index a16d1a99bd4..13e0b652f36 100644 --- a/build/pkgs/sagemath_coxeter3/version_requirements.txt +++ b/build/pkgs/sagemath_coxeter3/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-coxeter3 ~= 10.4b8 +sagemath-coxeter3 ~= 10.4b9 diff --git a/build/pkgs/sagemath_environment/version_requirements.txt b/build/pkgs/sagemath_environment/version_requirements.txt index c265b92492a..72433ad30cd 100644 --- a/build/pkgs/sagemath_environment/version_requirements.txt +++ b/build/pkgs/sagemath_environment/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-environment ~= 10.4b8 +sagemath-environment ~= 10.4b9 diff --git a/build/pkgs/sagemath_mcqd/version_requirements.txt b/build/pkgs/sagemath_mcqd/version_requirements.txt index 026c86366d5..76e1fd5907c 100644 --- a/build/pkgs/sagemath_mcqd/version_requirements.txt +++ b/build/pkgs/sagemath_mcqd/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-mcqd ~= 10.4b8 +sagemath-mcqd ~= 10.4b9 diff --git a/build/pkgs/sagemath_meataxe/version_requirements.txt b/build/pkgs/sagemath_meataxe/version_requirements.txt index d92e7b1741a..db6dcee5827 100644 --- a/build/pkgs/sagemath_meataxe/version_requirements.txt +++ b/build/pkgs/sagemath_meataxe/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-meataxe ~= 10.4b8 +sagemath-meataxe ~= 10.4b9 diff --git a/build/pkgs/sagemath_objects/version_requirements.txt b/build/pkgs/sagemath_objects/version_requirements.txt index 22c106b51ab..a48fb049cb7 100644 --- a/build/pkgs/sagemath_objects/version_requirements.txt +++ b/build/pkgs/sagemath_objects/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-objects ~= 10.4b8 +sagemath-objects ~= 10.4b9 diff --git a/build/pkgs/sagemath_repl/version_requirements.txt b/build/pkgs/sagemath_repl/version_requirements.txt index 60f6680492b..661b369f395 100644 --- a/build/pkgs/sagemath_repl/version_requirements.txt +++ b/build/pkgs/sagemath_repl/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-repl ~= 10.4b8 +sagemath-repl ~= 10.4b9 diff --git a/build/pkgs/sagemath_sirocco/version_requirements.txt b/build/pkgs/sagemath_sirocco/version_requirements.txt index 4910ccf4f54..af89ffdd30f 100644 --- a/build/pkgs/sagemath_sirocco/version_requirements.txt +++ b/build/pkgs/sagemath_sirocco/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-sirocco ~= 10.4b8 +sagemath-sirocco ~= 10.4b9 diff --git a/build/pkgs/sagemath_tdlib/version_requirements.txt b/build/pkgs/sagemath_tdlib/version_requirements.txt index 919126f9b00..13e940295b6 100644 --- a/build/pkgs/sagemath_tdlib/version_requirements.txt +++ b/build/pkgs/sagemath_tdlib/version_requirements.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-tdlib ~= 10.4b8 +sagemath-tdlib ~= 10.4b9 diff --git a/pkgs/sage-conf/VERSION.txt b/pkgs/sage-conf/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sage-conf/VERSION.txt +++ b/pkgs/sage-conf/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sage-conf_conda/VERSION.txt b/pkgs/sage-conf_conda/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sage-conf_conda/VERSION.txt +++ b/pkgs/sage-conf_conda/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sage-conf_pypi/VERSION.txt b/pkgs/sage-conf_pypi/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sage-conf_pypi/VERSION.txt +++ b/pkgs/sage-conf_pypi/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sage-docbuild/VERSION.txt b/pkgs/sage-docbuild/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sage-docbuild/VERSION.txt +++ b/pkgs/sage-docbuild/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sage-setup/VERSION.txt b/pkgs/sage-setup/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sage-setup/VERSION.txt +++ b/pkgs/sage-setup/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sage-sws2rst/VERSION.txt b/pkgs/sage-sws2rst/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sage-sws2rst/VERSION.txt +++ b/pkgs/sage-sws2rst/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sagemath-bliss/VERSION.txt b/pkgs/sagemath-bliss/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sagemath-bliss/VERSION.txt +++ b/pkgs/sagemath-bliss/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sagemath-categories/VERSION.txt b/pkgs/sagemath-categories/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sagemath-categories/VERSION.txt +++ b/pkgs/sagemath-categories/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sagemath-coxeter3/VERSION.txt b/pkgs/sagemath-coxeter3/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sagemath-coxeter3/VERSION.txt +++ b/pkgs/sagemath-coxeter3/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sagemath-environment/VERSION.txt b/pkgs/sagemath-environment/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sagemath-environment/VERSION.txt +++ b/pkgs/sagemath-environment/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sagemath-mcqd/VERSION.txt b/pkgs/sagemath-mcqd/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sagemath-mcqd/VERSION.txt +++ b/pkgs/sagemath-mcqd/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sagemath-meataxe/VERSION.txt b/pkgs/sagemath-meataxe/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sagemath-meataxe/VERSION.txt +++ b/pkgs/sagemath-meataxe/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sagemath-objects/VERSION.txt b/pkgs/sagemath-objects/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sagemath-objects/VERSION.txt +++ b/pkgs/sagemath-objects/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sagemath-repl/VERSION.txt b/pkgs/sagemath-repl/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sagemath-repl/VERSION.txt +++ b/pkgs/sagemath-repl/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sagemath-sirocco/VERSION.txt b/pkgs/sagemath-sirocco/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sagemath-sirocco/VERSION.txt +++ b/pkgs/sagemath-sirocco/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/pkgs/sagemath-tdlib/VERSION.txt b/pkgs/sagemath-tdlib/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/pkgs/sagemath-tdlib/VERSION.txt +++ b/pkgs/sagemath-tdlib/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/src/VERSION.txt b/src/VERSION.txt index 3ed4d9d5bfe..88de6ab407c 100644 --- a/src/VERSION.txt +++ b/src/VERSION.txt @@ -1 +1 @@ -10.4.beta8 +10.4.beta9 diff --git a/src/bin/sage-version.sh b/src/bin/sage-version.sh index 1cf2fdb230e..e07f9f4e32b 100644 --- a/src/bin/sage-version.sh +++ b/src/bin/sage-version.sh @@ -4,6 +4,6 @@ # which stops "setup.py develop" from rewriting it as a Python file. : # This file is auto-generated by the sage-update-version script, do not edit! -SAGE_VERSION='10.4.beta8' -SAGE_RELEASE_DATE='2024-06-01' -SAGE_VERSION_BANNER='SageMath version 10.4.beta8, Release Date: 2024-06-01' +SAGE_VERSION='10.4.beta9' +SAGE_RELEASE_DATE='2024-06-09' +SAGE_VERSION_BANNER='SageMath version 10.4.beta9, Release Date: 2024-06-09' diff --git a/src/sage/version.py b/src/sage/version.py index 19902d4869d..7aa5469a8ce 100644 --- a/src/sage/version.py +++ b/src/sage/version.py @@ -1,6 +1,5 @@ -# sage_setup: distribution = sagemath-environment # Sage version information for Python scripts # This file is auto-generated by the sage-update-version script, do not edit! -version = '10.4.beta8' -date = '2024-06-01' -banner = 'SageMath version 10.4.beta8, Release Date: 2024-06-01' +version = '10.4.beta9' +date = '2024-06-09' +banner = 'SageMath version 10.4.beta9, Release Date: 2024-06-09'