Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sage/algebras/lie_algebras/bch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from sage.algebras.lie_algebras.lie_algebra import LieAlgebra
from sage.arith.misc import bernoulli
from sage.categories.lie_algebras import LieAlgebras
from sage.combinat.integer_vector import IntegerListsLex
from sage.combinat.integer_lists import IntegerListsLex
from sage.arith.misc import factorial
from sage.rings.rational_field import QQ
from sage.structure.element import canonical_coercion
Expand Down
23 changes: 12 additions & 11 deletions src/sage/combinat/affine_permutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,24 @@
# https://www.gnu.org/licenses/
# ****************************************************************************
from itertools import repeat

from sage.arith.misc import binomial
from sage.categories.affine_weyl_groups import AffineWeylGroups
from sage.combinat.composition import Composition
from sage.combinat.partition import Partition
from sage.combinat.root_system.cartan_type import CartanType
from sage.misc.cachefunc import cached_method
from sage.misc.misc_c import prod
from sage.misc.constant_function import ConstantFunction
from sage.misc.lazy_import import lazy_import
from sage.misc.misc_c import prod
from sage.misc.prandom import randint

from sage.categories.affine_weyl_groups import AffineWeylGroups
from sage.rings.integer_ring import ZZ
from sage.structure.list_clone import ClonableArray
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent
from sage.rings.integer_ring import ZZ
from sage.structure.unique_representation import UniqueRepresentation

from sage.groups.perm_gps.permgroup_named import SymmetricGroup
from sage.arith.misc import binomial
from sage.combinat.root_system.cartan_type import CartanType
from sage.combinat.root_system.weyl_group import WeylGroup
from sage.combinat.composition import Composition
from sage.combinat.partition import Partition
lazy_import('sage.combinat.root_system.weyl_group', 'WeylGroup')
lazy_import('sage.groups.perm_gps.permgroup_named', 'SymmetricGroup')


class AffinePermutation(ClonableArray):
Expand Down
4 changes: 3 additions & 1 deletion src/sage/combinat/alternating_sign_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,18 @@
from sage.matrix.constructor import matrix
from sage.modules.free_module_element import zero_vector
from sage.misc.cachefunc import cached_method
from sage.misc.lazy_import import lazy_import
from sage.rings.integer_ring import ZZ
from sage.arith.misc import factorial
from sage.rings.integer import Integer
from sage.combinat.posets.lattices import LatticePoset
from sage.combinat.gelfand_tsetlin_patterns import GelfandTsetlinPatternsTopRow
from sage.combinat.combinatorial_map import combinatorial_map
from sage.combinat.non_decreasing_parking_function import NonDecreasingParkingFunction
from sage.combinat.permutation import Permutation
from sage.combinat.six_vertex_model import SquareIceModel

lazy_import('sage.combinat.posets.lattices', 'LatticePoset')


def _inplace_height_function_gyration(hf):
k = hf.nrows() - 1
Expand Down
10 changes: 6 additions & 4 deletions src/sage/combinat/binary_recurrence_sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,19 @@


from sage.structure.sage_object import SageObject
from sage.matrix.constructor import matrix
from sage.modules.free_module_element import vector
from sage.rings.number_field.number_field import QuadraticField
from sage.rings.finite_rings.integer_mod_ring import Integers
from sage.rings.finite_rings.finite_field_constructor import GF
from sage.rings.integer import Integer
from sage.arith.functions import lcm
from sage.arith.misc import is_prime, next_prime, next_prime_power, legendre_symbol
from sage.functions.log import log
from sage.misc.lazy_import import lazy_import
from sage.misc.functional import sqrt

lazy_import("sage.functions.log", "log")
lazy_import("sage.rings.number_field.number_field", "QuadraticField")
lazy_import("sage.matrix.constructor", "matrix")
lazy_import("sage.modules.free_module_element", "vector")


class BinaryRecurrenceSequence(SageObject):

Expand Down
4 changes: 3 additions & 1 deletion src/sage/combinat/cluster_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
# ****************************************************************************

from sage.categories.coxeter_groups import CoxeterGroups
from sage.combinat.root_system.coxeter_group import CoxeterGroup
from sage.combinat.subword_complex import SubwordComplex, SubwordComplexFacet
from sage.misc.lazy_import import lazy_import
from sage.rings.semirings.non_negative_integer_semiring import NN

lazy_import('sage.combinat.root_system.coxeter_group', 'CoxeterGroup')


class ClusterComplexFacet(SubwordComplexFacet):
r"""
Expand Down
6 changes: 4 additions & 2 deletions src/sage/combinat/colored_permutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@
from sage.structure.unique_representation import UniqueRepresentation
from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass
from sage.misc.cachefunc import cached_method
from sage.misc.lazy_import import lazy_import
from sage.misc.misc_c import prod
from sage.arith.functions import lcm

from sage.combinat.permutation import Permutations
from sage.matrix.constructor import diagonal_matrix
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing
from sage.rings.number_field.number_field import CyclotomicField
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.integer_ring import ZZ

lazy_import('sage.matrix.constructor', 'diagonal_matrix')
lazy_import('sage.rings.number_field.number_field', 'CyclotomicField')


class ColoredPermutation(MultiplicativeGroupElement):
"""
Expand Down
9 changes: 4 additions & 5 deletions src/sage/combinat/constellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@
from sage.structure.richcmp import (op_NE, op_EQ, richcmp_not_equal,
rich_to_bool)

from sage.groups.perm_gps.permgroup_named import SymmetricGroup
from sage.rings.integer import Integer
from sage.combinat.partition import Partition
from sage.graphs.graph import Graph
from sage.misc.misc_c import prod
from sage.misc.lazy_import import lazy_import
from sage.categories.groups import Groups

lazy_import('sage.graphs.graph', 'Graph')
lazy_import('sage.graphs.digraph', 'DiGraph')
lazy_import('sage.groups.perm_gps.permgroup_named', 'SymmetricGroup')

# constructors

Expand Down Expand Up @@ -886,8 +888,6 @@ def braid_group_orbit(self):
sage: G.num_edges()
12
"""
from sage.graphs.digraph import DiGraph

G = DiGraph(multiedges=True, loops=True)
waiting = [self.relabel()]

Expand Down Expand Up @@ -1537,7 +1537,6 @@ def perms_are_connected(g, n):
sage: perms_are_connected([S([0,1,2]),S([1,2,0])],3)
True
"""
from sage.graphs.graph import Graph
G = Graph()
if g:
G.add_vertices(g[0].domain())
Expand Down
4 changes: 3 additions & 1 deletion src/sage/combinat/crystals/affine_factorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#******************************************************************************

from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.lazy_import import lazy_import
from sage.structure.parent import Parent
from sage.structure.element_wrapper import ElementWrapper
from sage.structure.unique_representation import UniqueRepresentation
Expand All @@ -18,9 +19,10 @@
from sage.categories.enumerated_sets import EnumeratedSets
from sage.categories.homset import Hom
from sage.combinat.root_system.cartan_type import CartanType
from sage.combinat.root_system.weyl_group import WeylGroup
from sage.combinat.rsk import RSK

lazy_import('sage.combinat.root_system.weyl_group', 'WeylGroup')


class AffineFactorizationCrystal(UniqueRepresentation, Parent):
r"""
Expand Down
8 changes: 5 additions & 3 deletions src/sage/combinat/crystals/alcove_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,21 @@
from sage.structure.richcmp import richcmp
from sage.categories.classical_crystals import ClassicalCrystals
from sage.categories.loop_crystals import LoopCrystals
from sage.graphs.digraph import DiGraph
from sage.combinat.root_system.cartan_type import CartanType
from sage.combinat.root_system.root_system import RootSystem
from sage.modules.free_module_element import free_module_element as vector
from sage.rings.integer import Integer
from sage.combinat.root_system.weyl_group import WeylGroup
from sage.misc.misc_c import prod
from sage.categories.sets_cat import Sets
from sage.misc.cachefunc import cached_method, cached_in_parent_method
from sage.misc.lazy_import import lazy_import
from sage.categories.highest_weight_crystals import HighestWeightCrystals
from copy import copy
from sage.misc.latex import latex

lazy_import('sage.graphs.digraph', 'DiGraph')
lazy_import('sage.combinat.root_system.weyl_group', 'WeylGroup')
lazy_import('sage.modules.free_module_element', 'vector')


class CrystalOfAlcovePaths(UniqueRepresentation, Parent):
r"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
from sage.combinat.root_system.cartan_type import CartanType
from sage.combinat import permutation
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
from sage.rings.integer import Integer
from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass
from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.lazy_import import lazy_import

lazy_import('sage.groups.perm_gps.permgroup_named', 'SymmetricGroup')


class DecreasingHeckeFactorization(Element, metaclass=InheritComparisonClasscallMetaclass):
Expand Down
4 changes: 3 additions & 1 deletion src/sage/combinat/crystals/littelmann_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# ***************************************************************************

from sage.misc.cachefunc import cached_in_parent_method, cached_method
from sage.misc.lazy_import import lazy_import
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
from sage.structure.parent import Parent
Expand All @@ -38,13 +39,14 @@
from sage.categories.loop_crystals import (RegularLoopCrystals,
KirillovReshetikhinCrystals)
from sage.combinat.root_system.cartan_type import CartanType
from sage.combinat.root_system.weyl_group import WeylGroup
from sage.rings.integer import Integer
from sage.rings.rational_field import QQ
from sage.combinat.root_system.root_system import RootSystem
from sage.arith.misc import integer_floor as floor
from sage.misc.latex import latex

lazy_import('sage.combinat.root_system.weyl_group', 'WeylGroup')


class CrystalOfLSPaths(UniqueRepresentation, Parent):
r"""
Expand Down
13 changes: 7 additions & 6 deletions src/sage/combinat/diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@
from sage.combinat.composition import Composition
from sage.combinat.partition import Partition
from sage.combinat.permutation import Permutations
from sage.combinat.tableau import Tableau
from sage.combinat.tiling import Polyomino
from sage.combinat.skew_partition import SkewPartition
from sage.combinat.skew_tableau import SkewTableaux
from sage.matrix.matrix_dense import Matrix_dense
from sage.matrix.matrix_sparse import Matrix_sparse
from sage.combinat.tableau import Tableau
from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass
from sage.structure.unique_representation import UniqueRepresentation
from sage.misc.lazy_import import lazy_import
from sage.structure.element import Matrix
from sage.structure.list_clone import ClonableArray
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation

lazy_import('sage.combinat.tiling', 'Polyomino')


class Diagram(ClonableArray, metaclass=InheritComparisonClasscallMetaclass):
Expand Down Expand Up @@ -693,7 +694,7 @@ def _element_constructor_(self, cells, n_rows=None, n_cols=None, check=True):
return self.from_polyomino(cells)
if isinstance(cells, Composition):
return self.from_composition(cells)
if isinstance(cells, (Matrix_dense, Matrix_sparse)):
if isinstance(cells, Matrix):
return self.from_zero_one_matrix(cells)

return self.element_class(self, cells, n_rows, n_cols, check)
Expand Down
10 changes: 6 additions & 4 deletions src/sage/combinat/diagram_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
# https://www.gnu.org/licenses/
# ***************************************************************************

import itertools

from sage.categories.associative_algebras import AssociativeAlgebras
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
from sage.arith.power import generic_power
Expand All @@ -37,19 +39,19 @@
set_partition_composition)
from sage.combinat.set_partition import SetPartitions, AbstractSetPartition
from sage.combinat.set_partition_iterator import set_partition_iterator
from sage.combinat.symmetric_group_algebra import SymmetricGroupAlgebra_n
from sage.combinat.permutation import Permutations
from sage.graphs.graph import Graph
from sage.misc.cachefunc import cached_method
from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.flatten import flatten
from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.lazy_import import lazy_import
from sage.misc.misc_c import prod
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.arith.misc import integer_floor as floor
from sage.arith.misc import integer_ceil as ceil

import itertools
lazy_import('sage.graphs.graph', 'Graph')
lazy_import('sage.combinat.symmetric_group_algebra', 'SymmetricGroupAlgebra_n')


def partition_diagrams(k):
Expand Down
5 changes: 4 additions & 1 deletion src/sage/combinat/dyck_word.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@
from sage.rings.rational_field import QQ
from sage.combinat.permutation import Permutation, Permutations
from sage.combinat.words.word import Word
from sage.combinat.alternating_sign_matrix import AlternatingSignMatrices
from sage.combinat.set_partition import SetPartitions
from sage.misc.latex import latex
from sage.misc.lazy_import import lazy_import

lazy_import('sage.combinat.alternating_sign_matrix', 'AlternatingSignMatrices')


open_symbol = 1
close_symbol = 0
Expand Down
6 changes: 4 additions & 2 deletions src/sage/combinat/e_one_star.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@
from sage.misc.functional import det
from sage.structure.sage_object import SageObject
from sage.combinat.words.morphism import WordMorphism
from sage.matrix.constructor import matrix
from sage.modules.free_module_element import vector
from sage.misc.lazy_import import lazy_import
lazy_import("sage.plot.all", "Graphics")
lazy_import("sage.plot.colors", "Color")
Expand All @@ -226,6 +224,10 @@
from sage.misc.cachefunc import cached_method
from sage.structure.richcmp import richcmp_by_eq_and_lt, richcmp_method

lazy_import('sage.matrix.constructor', 'matrix')
lazy_import('sage.modules.free_module_element', 'vector')


# matplotlib color maps, loaded on-demand
cm = None

Expand Down
6 changes: 4 additions & 2 deletions src/sage/combinat/fqsym.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@
from sage.misc.cachefunc import cached_method
from sage.misc.bindable_class import BindableClass
from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.lazy_import import lazy_import
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.hopf_algebras import HopfAlgebras
from sage.categories.realizations import Category_realization_of_parent
from sage.combinat.free_module import CombinatorialFreeModule
from sage.combinat.permutation import Permutations, Permutation
from sage.groups.perm_gps.permgroup_element import PermutationGroupElement
from sage.combinat.words.word import Word
from sage.combinat.symmetric_group_algebra import SymmetricGroupAlgebra
from sage.combinat.words.word import Word

lazy_import('sage.groups.perm_gps.permgroup_element', 'PermutationGroupElement')


class FQSymBasis_abstract(CombinatorialFreeModule, BindableClass):
Expand Down
17 changes: 10 additions & 7 deletions src/sage/combinat/fully_commutative_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,18 @@
# (at your option) any later version.
# https://www.gnu.org/licenses/
# ****************************************************************************
from sage.structure.parent import Parent
from sage.structure.list_clone import NormalizedClonableList
from sage.categories.enumerated_sets import EnumeratedSets
from sage.structure.unique_representation import UniqueRepresentation
from .root_system.coxeter_matrix import CoxeterMatrix
from collections import deque
from sage.combinat.posets.posets import Poset

from sage.categories.coxeter_groups import CoxeterGroups
from sage.combinat.root_system.coxeter_group import CoxeterGroup
from sage.categories.enumerated_sets import EnumeratedSets
from sage.misc.lazy_import import lazy_import
from sage.structure.list_clone import NormalizedClonableList
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation

lazy_import('sage.combinat.posets.posets', 'Poset')
lazy_import('sage.combinat.root_system.coxeter_group', 'CoxeterGroup')
lazy_import('sage.combinat.root_system.coxeter_matrix', 'CoxeterMatrix')


class FullyCommutativeElement(NormalizedClonableList):
Expand Down
1 change: 0 additions & 1 deletion src/sage/combinat/growth.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,6 @@

from sage.structure.sage_object import SageObject
from sage.structure.unique_representation import UniqueRepresentation
from sage.combinat.posets.posets import Poset
from sage.combinat.words.word import Word
from sage.combinat.words.words import Words
from sage.combinat.binary_tree import BinaryTree, BinaryTrees, LabelledBinaryTree
Expand Down
Loading