code
stringlengths
17
6.64M
def is_Fan(x) -> bool: '\n Check if ``x`` is a Fan.\n\n INPUT:\n\n - ``x`` -- anything.\n\n OUTPUT:\n\n ``True`` if ``x`` is a fan and ``False`` otherwise\n\n EXAMPLES::\n\n sage: from sage.geometry.fan import is_Fan\n sage: is_Fan(1)\n False\n sage: fan = toric_varie...
def Fan(cones, rays=None, lattice=None, check=True, normalize=True, is_complete=None, virtual_rays=None, discard_faces=False, allow_arrangement=False): '\n Construct a rational polyhedral fan.\n\n .. NOTE::\n\n Approximate time to construct a fan consisting of `n` cones is `n^2/5`\n seconds. T...
def FaceFan(polytope, lattice=None): "\n Construct the face fan of the given rational ``polytope``.\n\n INPUT:\n\n - ``polytope`` -- a :func:`polytope\n <sage.geometry.polyhedron.constructor.Polyhedron>` over `\\QQ` or\n a :class:`lattice polytope\n <sage.geometry.lattice_polytope.LatticeP...
def NormalFan(polytope, lattice=None): "\n Construct the normal fan of the given rational ``polytope``.\n\n This returns the inner normal fan. For the outer normal fan, use\n ``NormalFan(-P)``.\n\n INPUT:\n\n - ``polytope`` -- a full-dimensional :func:`polytope\n <sage.geometry.polyhedron.cons...
def Fan2d(rays, lattice=None): "\n Construct the maximal 2-d fan with given ``rays``.\n\n In two dimensions we can uniquely construct a fan from just rays,\n just by cyclically ordering the rays and constructing as many\n cones as possible. This is why we implement a special constructor\n for this ...
class Cone_of_fan(ConvexRationalPolyhedralCone): '\n Construct a cone belonging to a fan.\n\n .. WARNING::\n\n This class does not check that the input defines a valid cone of a\n fan. You must not construct objects of this class directly.\n\n In addition to all of the properties of "regula...
@richcmp_method class RationalPolyhedralFan(IntegralRayCollection, Callable, Container): '\n Create a rational polyhedral fan.\n\n .. WARNING::\n\n This class does not perform any checks of correctness of input nor\n does it convert input into the standard representation. Use\n :func:`F...
def discard_faces(cones): '\n Return the cones of the given list which are not faces of each other.\n\n INPUT:\n\n - ``cones`` -- a list of\n :class:`cones <sage.geometry.cone.ConvexRationalPolyhedralCone>`.\n\n OUTPUT:\n\n a list of\n :class:`cones <sage.geometry.cone.ConvexRationalPolyhed...
def _refine_arrangement_to_fan(cones): '\n Refine the cones of the given list so that they can belong to the same fan.\n\n INPUT:\n\n - ``cones`` -- a list of rational cones that are possibly overlapping.\n\n OUTPUT:\n\n a list of refined cones\n\n EXAMPLES::\n\n sage: from sage.geometry....
class FanNotIsomorphicError(Exception): '\n Exception to return if there is no fan isomorphism\n ' pass
def fan_isomorphic_necessary_conditions(fan1, fan2): '\n Check necessary (but not sufficient) conditions for the fans to be isomorphic.\n\n INPUT:\n\n - ``fan1``, ``fan2`` -- two fans.\n\n OUTPUT:\n\n Boolean. ``False`` if the two fans cannot be isomorphic. ``True``\n if the two fans may be isom...
def fan_isomorphism_generator(fan1, fan2): '\n Iterate over the isomorphisms from ``fan1`` to ``fan2``.\n\n ALGORITHM:\n\n The :meth:`sage.geometry.fan.Fan.vertex_graph` of the two fans is\n compared. For each graph isomorphism, we attempt to lift it to an\n actual isomorphism of fans.\n\n INPUT...
def find_isomorphism(fan1, fan2, check=False): '\n Find an isomorphism of the two fans.\n\n INPUT:\n\n - ``fan1``, ``fan2`` -- two fans.\n\n - ``check`` -- boolean (default: False). Passed to the fan\n morphism constructor, see\n :func:`~sage.geometry.fan_morphism.FanMorphism`.\n\n OUTPUT...
def fan_2d_cyclically_ordered_rays(fan): '\n Return the rays of a 2-dimensional ``fan`` in cyclic order.\n\n INPUT:\n\n - ``fan`` -- a 2-dimensional fan.\n\n OUTPUT:\n\n A :class:`~sage.geometry.point_collection.PointCollection`\n containing the rays in one particular cyclic order.\n\n EXAMPL...
def fan_2d_echelon_forms(fan): '\n Return echelon forms of all cyclically ordered ray matrices.\n\n Note that the echelon form of the ordered ray matrices are unique\n up to different cyclic orderings.\n\n INPUT:\n\n - ``fan`` -- a fan.\n\n OUTPUT:\n\n A set of matrices. The set of all echelo...
def fan_2d_echelon_form(fan): '\n Return echelon form of a cyclically ordered ray matrix.\n\n INPUT:\n\n - ``fan`` -- a fan.\n\n OUTPUT:\n\n A matrix. The echelon form of the rays in one particular cyclic\n order.\n\n EXAMPLES::\n\n sage: fan = toric_varieties.P2().fan() ...
class FanMorphism(FreeModuleMorphism): '\n Create a fan morphism.\n\n Let `\\Sigma_1` and `\\Sigma_2` be two fans in lattices `N_1` and `N_2`\n respectively. Let `\\phi` be a morphism (i.e. a linear map) from `N_1` to\n `N_2`. We say that `\\phi` is *compatible* with `\\Sigma_1` and `\\Sigma_2`\n i...
def lattice_from_incidences(atom_to_coatoms, coatom_to_atoms, face_constructor=None, required_atoms=None, key=None, **kwds): '\n Compute an atomic and coatomic lattice from the incidence between\n atoms and coatoms.\n\n INPUT:\n\n - ``atom_to_coatoms`` -- list, ``atom_to_coatom[i]`` should list all\n ...
class HyperbolicModelCoercion(Morphism): '\n Abstract base class for morphisms between the hyperbolic models.\n ' def _repr_type(self): "\n Return the type of morphism.\n\n EXAMPLES::\n\n sage: UHP = HyperbolicPlane().UHP()\n sage: PD = HyperbolicPlane().PD()...
class CoercionUHPtoPD(HyperbolicModelCoercion): '\n Coercion from the UHP to PD model.\n ' def image_coordinates(self, x): '\n Return the image of the coordinates of the hyperbolic point ``x``\n under ``self``.\n\n EXAMPLES::\n\n sage: UHP = HyperbolicPlane().UHP...
class CoercionUHPtoKM(HyperbolicModelCoercion): '\n Coercion from the UHP to KM model.\n ' def image_coordinates(self, x): '\n Return the image of the coordinates of the hyperbolic point ``x``\n under ``self``.\n\n EXAMPLES::\n\n sage: UHP = HyperbolicPlane().UHP...
class CoercionUHPtoHM(HyperbolicModelCoercion): '\n Coercion from the UHP to HM model.\n ' def image_coordinates(self, x): '\n Return the image of the coordinates of the hyperbolic point ``x``\n under ``self``.\n\n EXAMPLES::\n\n sage: UHP = HyperbolicPlane().UHP...
class CoercionPDtoUHP(HyperbolicModelCoercion): '\n Coercion from the PD to UHP model.\n ' def image_coordinates(self, x): '\n Return the image of the coordinates of the hyperbolic point ``x``\n under ``self``.\n\n EXAMPLES::\n\n sage: PD = HyperbolicPlane().PD()...
class CoercionPDtoKM(HyperbolicModelCoercion): '\n Coercion from the PD to KM model.\n ' def image_coordinates(self, x): '\n Return the image of the coordinates of the hyperbolic point ``x``\n under ``self``.\n\n EXAMPLES::\n\n sage: PD = HyperbolicPlane().PD()\n...
class CoercionPDtoHM(HyperbolicModelCoercion): '\n Coercion from the PD to HM model.\n ' def image_coordinates(self, x): '\n Return the image of the coordinates of the hyperbolic point ``x``\n under ``self``.\n\n EXAMPLES::\n\n sage: PD = HyperbolicPlane().PD()\n...
class CoercionKMtoUHP(HyperbolicModelCoercion): '\n Coercion from the KM to UHP model.\n ' def image_coordinates(self, x): '\n Return the image of the coordinates of the hyperbolic point ``x``\n under ``self``.\n\n EXAMPLES::\n\n sage: KM = HyperbolicPlane().KM()...
class CoercionKMtoPD(HyperbolicModelCoercion): '\n Coercion from the KM to PD model.\n ' def image_coordinates(self, x): '\n Return the image of the coordinates of the hyperbolic point ``x``\n under ``self``.\n\n EXAMPLES::\n\n sage: KM = HyperbolicPlane().KM()\n...
class CoercionKMtoHM(HyperbolicModelCoercion): '\n Coercion from the KM to HM model.\n ' def image_coordinates(self, x): '\n Return the image of the coordinates of the hyperbolic point ``x``\n under ``self``.\n\n EXAMPLES::\n\n sage: KM = HyperbolicPlane().KM()\n...
class CoercionHMtoUHP(HyperbolicModelCoercion): '\n Coercion from the HM to UHP model.\n ' def image_coordinates(self, x): '\n Return the image of the coordinates of the hyperbolic point ``x``\n under ``self``.\n\n EXAMPLES::\n\n sage: HM = HyperbolicPlane().HM()...
class CoercionHMtoPD(HyperbolicModelCoercion): '\n Coercion from the HM to PD model.\n ' def image_coordinates(self, x): '\n Return the image of the coordinates of the hyperbolic point ``x``\n under ``self``.\n\n EXAMPLES::\n\n sage: HM = HyperbolicPlane().HM()\n...
class CoercionHMtoKM(HyperbolicModelCoercion): '\n Coercion from the HM to KM model.\n ' def image_coordinates(self, x): '\n Return the image of the coordinates of the hyperbolic point ``x``\n under ``self``.\n\n EXAMPLES::\n\n sage: HM = HyperbolicPlane().HM()\n...
def SL2R_to_SO21(A): '\n Given a matrix in `SL(2, \\RR)` return its irreducible representation in\n `O(2,1)`.\n\n Note that this is not the only homomorphism, but it is the only one\n that works in the context of the implemented 2D hyperbolic geometry\n models.\n\n EXAMPLES::\n\n sage: fr...
def SO21_to_SL2R(M): '\n A homomorphism from `SO(2, 1)` to `SL(2, \\RR)`.\n\n Note that this is not the only homomorphism, but it is the only one\n that works in the context of the implemented 2D hyperbolic geometry\n models.\n\n EXAMPLES::\n\n sage: from sage.geometry.hyperbolic_space.hyper...
class HyperbolicGeodesic(SageObject): '\n Abstract base class for oriented geodesics that are not necessarily\n complete.\n\n INPUT:\n\n - ``start`` -- a HyperbolicPoint or coordinates of a point in\n hyperbolic space representing the start of the geodesic\n\n - ``end`` -- a HyperbolicPoint or...
class HyperbolicGeodesicUHP(HyperbolicGeodesic): '\n Create a geodesic in the upper half plane model.\n\n The geodesics in this model are represented by circular arcs perpendicular\n to the real axis (half-circles whose origin is on the real axis) and\n straight vertical lines ending on the real axis....
class HyperbolicGeodesicPD(HyperbolicGeodesic): "\n A geodesic in the Poincaré disk model.\n\n Geodesics in this model are represented by segments of circles contained\n within the unit disk that are orthogonal to the boundary of the disk,\n plus all diameters of the disk.\n\n INPUT:\n\n - ``sta...
class HyperbolicGeodesicKM(HyperbolicGeodesic): "\n A geodesic in the Klein disk model.\n\n Geodesics are represented by the chords, straight line segments with ideal\n endpoints on the boundary circle.\n\n INPUT:\n\n - ``start`` -- a :class:`HyperbolicPoint` in hyperbolic space\n representing...
class HyperbolicGeodesicHM(HyperbolicGeodesic): "\n A geodesic in the hyperboloid model.\n\n Valid points in the hyperboloid model satisfy :math:`x^2 + y^2 - z^2 = -1`\n\n INPUT:\n\n - ``start`` -- a :class:`HyperbolicPoint` in hyperbolic space\n representing the start of the geodesic\n\n - ``...
def HyperbolicSpace(n): '\n Return ``n`` dimensional hyperbolic space.\n\n EXAMPLES::\n\n sage: from sage.geometry.hyperbolic_space.hyperbolic_interface import HyperbolicSpace\n sage: HyperbolicSpace(2)\n Hyperbolic plane\n ' if (n == 2): return HyperbolicPlane() rais...
class HyperbolicPlane(Parent, UniqueRepresentation): '\n The hyperbolic plane `\\mathbb{H}^2`.\n\n Here are the models currently implemented:\n\n - ``UHP`` -- upper half plane\n - ``PD`` -- Poincaré disk\n - ``KM`` -- Klein disk\n - ``HM`` -- hyperboloid model\n ' def __init__(self): ...
class HyperbolicModels(Category_realization_of_parent): '\n The category of hyperbolic models of hyperbolic space.\n ' def __init__(self, base): '\n Initialize the hyperbolic models of hyperbolic space.\n\n INPUT:\n\n - ``base`` -- a hyperbolic space\n\n TESTS::\n\n ...
class HyperbolicIsometry(Morphism): '\n Abstract base class for hyperbolic isometries. This class should\n never be instantiated.\n\n INPUT:\n\n - ``A`` -- a matrix representing a hyperbolic isometry in the\n appropriate model\n\n EXAMPLES::\n\n sage: HyperbolicPlane().HM().get_isometr...
class HyperbolicIsometryUHP(HyperbolicIsometry): '\n Create a hyperbolic isometry in the UHP model.\n\n INPUT:\n\n - a matrix in `GL(2, \\RR)`\n\n EXAMPLES::\n\n sage: HyperbolicPlane().UHP().get_isometry(identity_matrix(2))\n Isometry in UHP\n [1 0]\n [0 1]\n ' def...
class HyperbolicIsometryPD(HyperbolicIsometry): '\n Create a hyperbolic isometry in the PD model.\n\n INPUT:\n\n - a matrix in `PU(1,1)`\n\n EXAMPLES::\n\n sage: HyperbolicPlane().PD().get_isometry(identity_matrix(2))\n Isometry in PD\n [1 0]\n [0 1]\n ' def _call_(...
class HyperbolicIsometryKM(HyperbolicIsometry): '\n Create a hyperbolic isometry in the KM model.\n\n INPUT:\n\n - a matrix in `SO(2,1)`\n\n EXAMPLES::\n\n sage: HyperbolicPlane().KM().get_isometry(identity_matrix(3))\n Isometry in KM\n [1 0 0]\n [0 1 0]\n [0 0 1]\n ...
def moebius_transform(A, z): "\n Given a matrix ``A`` in `GL(2, \\CC)` and a point ``z`` in the complex\n plane return the Möbius transformation action of ``A`` on ``z``.\n\n INPUT:\n\n - ``A`` -- a `2 \\times 2` invertible matrix over the complex numbers\n - ``z`` -- a complex number or infinity\n...
class HyperbolicModel(Parent, UniqueRepresentation, BindableClass): '\n Abstract base class for hyperbolic models.\n ' Element = HyperbolicPoint _Geodesic = HyperbolicGeodesic _Isometry = HyperbolicIsometry def __init__(self, space, name, short_name, bounded, conformal, dimension, isometry_...
class HyperbolicModelUHP(HyperbolicModel): '\n Upper Half Plane model.\n ' Element = HyperbolicPointUHP _Geodesic = HyperbolicGeodesicUHP _Isometry = HyperbolicIsometryUHP def __init__(self, space): '\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: UHP = Hyp...
class HyperbolicModelPD(HyperbolicModel): '\n Poincaré Disk Model.\n ' _Geodesic = HyperbolicGeodesicPD _Isometry = HyperbolicIsometryPD def __init__(self, space): '\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: PD = HyperbolicPlane().PD()\n sage: T...
class HyperbolicModelKM(HyperbolicModel): '\n Klein Model.\n ' _Geodesic = HyperbolicGeodesicKM _Isometry = HyperbolicIsometryKM def __init__(self, space): '\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: KM = HyperbolicPlane().KM()\n sage: TestSuite...
class HyperbolicModelHM(HyperbolicModel): '\n Hyperboloid Model.\n ' _Geodesic = HyperbolicGeodesicHM def __init__(self, space): '\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: HM = HyperbolicPlane().HM()\n sage: TestSuite(HM).run()\n ' H...
class HyperbolicPoint(Element): '\n Abstract base class for hyperbolic points. This class should never\n be instantiated.\n\n INPUT:\n\n - ``model`` -- the model of the hyperbolic space\n - ``coordinates`` -- the coordinates of a hyperbolic point in the\n appropriate model\n - ``is_boundar...
class HyperbolicPointUHP(HyperbolicPoint): '\n A point in the UHP model.\n\n INPUT:\n\n - the coordinates of a point in the unit disk in the complex plane `\\CC`\n\n EXAMPLES::\n\n sage: HyperbolicPlane().UHP().get_point(2*I)\n Point in UHP 2*I\n\n sage: HyperbolicPlane().UHP().ge...
class AffineSubspace(SageObject): '\n An affine subspace.\n\n INPUT:\n\n - ``p`` -- list/tuple/iterable representing a point on the\n affine space\n\n - ``V`` -- vector subspace\n\n OUTPUT:\n\n Affine subspace parallel to ``V`` and passing through ``p``.\n\n EXAMPLES::\n\n sage: f...
class HyperplaneArrangementElement(Element): '\n A hyperplane arrangement.\n\n .. WARNING::\n\n You should never create\n :class:`HyperplaneArrangementElement` instances directly,\n always use the parent.\n ' def __init__(self, parent, hyperplanes, check=True, backend=None): ...
class HyperplaneArrangements(Parent, UniqueRepresentation): '\n Hyperplane arrangements.\n\n For more information on hyperplane arrangements, see\n :mod:`sage.geometry.hyperplane_arrangement.arrangement`.\n\n INPUT:\n\n - ``base_ring`` -- ring; the base ring\n\n - ``names`` -- tuple of strings; ...
def less_generators(X): '\n Reduce the generator matrix of the module defined by ``X``.\n\n This is Algorithm 6.4 in [BC2012]_ and relies on the row syzygies of\n the matrix ``X``.\n\n EXAMPLES::\n\n sage: from sage.geometry.hyperplane_arrangement.check_freeness import less_generators\n ...
def construct_free_chain(A): '\n Construct the free chain for the hyperplanes ``A``.\n\n ALGORITHM:\n\n We follow Algorithm 6.5 in [BC2012]_.\n\n INPUT:\n\n - ``A`` -- a hyperplane arrangement\n\n EXAMPLES::\n\n sage: from sage.geometry.hyperplane_arrangement.check_freeness import constru...
class Hyperplane(LinearExpression): '\n A hyperplane.\n\n You should always use :class:`AmbientVectorSpace` to construct\n instances of this class.\n\n INPUT:\n\n - ``parent`` -- the parent :class:`AmbientVectorSpace`\n\n - ``coefficients`` -- a vector of coefficients of the linear variables\n\n...
class AmbientVectorSpace(LinearExpressionModule): "\n The ambient space for hyperplanes.\n\n This class is the parent for the :class:`Hyperplane` instances.\n\n TESTS::\n\n sage: from sage.geometry.hyperplane_arrangement.hyperplane import AmbientVectorSpace\n sage: V = AmbientVectorSpace(QQ...
def make_parent(base_ring, dimension, names=None): '\n Construct the parent for the hyperplane arrangements.\n\n For internal use only.\n\n INPUT:\n\n - ``base_ring`` -- a ring\n\n - ``dimension`` -- integer\n\n - ``names`` -- ``None`` (default) or a list/tuple/iterable of\n strings\n\n ...
class HyperplaneArrangementLibrary(): '\n The library of hyperplane arrangements.\n ' def braid(self, n, K=QQ, names=None): '\n The braid arrangement.\n\n INPUT:\n\n - ``n`` -- integer\n\n - ``K`` -- field (default: ``QQ``)\n\n - ``names`` -- tuple of strings ...
def plot(hyperplane_arrangement, **kwds): '\n Return a plot of the hyperplane arrangement.\n\n If the arrangement is in 4 dimensions but inessential, a plot of\n the essentialization is returned.\n\n .. NOTE::\n\n This function is available as the\n :meth:`~sage.geometry.hyperplane_arran...
def plot_hyperplane(hyperplane, **kwds): "\n Return the plot of a single hyperplane.\n\n INPUT:\n\n - ``**kwds`` -- plot options: see below\n\n OUTPUT:\n\n A graphics object of the plot.\n\n .. RUBRIC:: Plot Options\n\n Beside the usual plot options (enter ``plot?``), the plot command for\n ...
def legend_3d(hyperplane_arrangement, hyperplane_colors, length): "\n Create plot of a 3d legend for an arrangement of planes in 3-space.\n\n The ``length`` parameter determines whether short or long labels\n are used in the legend.\n\n INPUT:\n\n - ``hyperplane_arrangement`` -- a hyperplane arrang...
class SetOfAllLatticePolytopesClass(Set_generic): def _repr_(self): "\n Return a string representation.\n\n TESTS::\n\n sage: lattice_polytope.SetOfAllLatticePolytopesClass()._repr_()\n 'Set of all Lattice Polytopes'\n " return 'Set of all Lattice Polyto...
def LatticePolytope(data, compute_vertices=True, n=0, lattice=None): '\n Construct a lattice polytope.\n\n INPUT:\n\n - ``data`` -- points spanning the lattice polytope, specified as one of:\n\n * a :class:`point collection\n <sage.geometry.point_collection.PointCollection>` (this is the\...
def ReflexivePolytope(dim, n): '\n Return the `n`-th 2- or 3-dimensional reflexive polytope.\n\n .. NOTE::\n\n #. Numeration starts with zero: `0 \\leq n \\leq 15` for `{\\rm dim} = 2`\n and `0 \\leq n \\leq 4318` for `{\\rm dim} = 3`.\n\n #. During the first call, all reflexive polytop...
def ReflexivePolytopes(dim): '\n Return the sequence of all 2- or 3-dimensional reflexive polytopes.\n\n .. NOTE::\n\n During the first call the database is loaded and cached for\n future use, so repetitive calls will return the same object in\n memory.\n\n :param dim: dimension of requ...
def is_LatticePolytope(x): '\n Check if ``x`` is a lattice polytope.\n\n INPUT:\n\n - ``x`` -- anything.\n\n OUTPUT:\n\n - ``True`` if ``x`` is a :class:`lattice polytope <LatticePolytopeClass>`,\n ``False`` otherwise.\n\n EXAMPLES::\n\n sage: from sage.geometry.lattice_polytope impo...
@richcmp_method class LatticePolytopeClass(ConvexSet_compact, Hashable, sage.geometry.abc.LatticePolytope): '\n Create a lattice polytope.\n\n .. WARNING::\n\n This class does not perform any checks of correctness of input nor\n does it convert input into the standard representation. Use\n ...
def is_NefPartition(x): '\n Check if ``x`` is a nef-partition.\n\n INPUT:\n\n - ``x`` -- anything.\n\n OUTPUT:\n\n - ``True`` if ``x`` is a :class:`nef-partition <NefPartition>` and\n ``False`` otherwise.\n\n EXAMPLES::\n\n sage: from sage.geometry.lattice_polytope import is_NefParti...
class NefPartition(SageObject, Hashable): '\n Create a nef-partition.\n\n INPUT:\n\n - ``data`` -- a list of integers, the `i`-th element of this list must be\n the part of the `i`-th vertex of ``Delta_polar`` in this nef-partition;\n\n - ``Delta_polar`` -- a :class:`lattice polytope\n <sage...
def _palp(command, polytopes, reduce_dimension=False): '\n Run ``command`` on vertices of given\n ``polytopes``.\n\n Returns the name of the file containing the output of\n ``command``. You should delete it after using.\n\n .. note::\n\n PALP cannot be called for polytopes that do not span the...
def _palp_canonical_order(V, PM_max, permutations): '\n Compute the PALP normal form of the vertices V\n using auxiliary data computed elsewhere.\n\n This is a helper function for\n :meth:`~sage.geometry.lattice_polytope.LatticePolytopeClass.normal_form`\n and should not be called directly.\n\n ...
def _palp_convert_permutation(permutation): "\n Convert a permutation from PALPs notation to a Sage permutation.\n\n PALP specifies a permutation group element by its domain. Furthermore,\n it only supports permutations of up to 62 objects and labels these by\n `0 \\dots 9`, `a \\dots z`, and `A \\dot...
def _read_nef_x_partitions(data): '\n Read all nef-partitions for one polytope from a string or an open\n file.\n\n ``data`` should be an output of nef.x.\n\n Returns the sequence of nef-partitions. Each nef-partition is given\n as a sequence of integers.\n\n If there are no nef-partitions, retu...
def _read_poly_x_incidences(data, dim): '\n Convert incidence data from binary numbers to sequences.\n\n INPUT:\n\n - ``data`` - an opened file with incidence\n information. The first line will be skipped, each consecutive line\n contains incidence information for all faces of one dimension,...
def all_cached_data(polytopes): '\n Compute all cached data for all given ``polytopes`` and\n their polars.\n\n This functions does it MUCH faster than member functions of\n ``LatticePolytope`` during the first run. So it is recommended to\n use this functions if you work with big sets of data. Non...
def all_nef_partitions(polytopes, keep_symmetric=False): '\n Compute nef-partitions for all given ``polytopes``.\n\n This functions does it MUCH faster than member functions of\n ``LatticePolytope`` during the first run. So it is recommended to\n use this functions if you work with big sets of data.\n...
def all_points(polytopes): '\n Compute lattice points for all given ``polytopes``.\n\n This functions does it MUCH faster than member functions of\n ``LatticePolytope`` during the first run. So it is recommended to\n use this functions if you work with big sets of data.\n\n INPUT: a sequence of lat...
def all_polars(polytopes): '\n Compute polar polytopes for all reflexive and equations of facets\n for all non-reflexive ``polytopes``.\n\n ``all_facet_equations`` and ``all_polars`` are synonyms.\n\n This functions does it MUCH faster than member functions of\n ``LatticePolytope`` during the first...
def convex_hull(points): "\n Compute the convex hull of the given points.\n\n .. note::\n\n ``points`` might not span the space. Also, it fails for large\n numbers of vertices in dimensions 4 or greater\n\n INPUT:\n\n - ``points`` - a list that can be converted into\n vectors of the...
def cross_polytope(dim): '\n Return a cross-polytope of the given dimension.\n\n INPUT:\n\n - ``dim`` -- an integer.\n\n OUTPUT:\n\n - a :class:`lattice polytope <LatticePolytopeClass>`.\n\n EXAMPLES::\n\n sage: o = lattice_polytope.cross_polytope(3)\n sage: o\n 3-d reflexiv...
def minkowski_sum(points1, points2): "\n Compute the Minkowski sum of two convex polytopes.\n\n .. note::\n\n Polytopes might not be of maximal dimension.\n\n INPUT:\n\n - ``points1, points2`` - lists of objects that can be\n converted into vectors of the same dimension, treated as vertic...
def positive_integer_relations(points): '\n Return relations between given points.\n\n INPUT:\n\n - ``points`` - lattice points given as columns of a\n matrix\n\n OUTPUT:\n\n matrix of relations between given points with non-negative\n integer coefficients\n\n EXAMPLES: This is a 3-dimen...
def read_all_polytopes(file_name): '\n Read all polytopes from the given file.\n\n INPUT:\n\n - ``file_name`` -- a string with the name of a file with VERTICES of\n polytopes.\n\n OUTPUT:\n\n - a sequence of polytopes.\n\n EXAMPLES:\n\n We use poly.x to compute two polar polytopes and re...
def read_palp_matrix(data, permutation=False): '\n Read and return an integer matrix from a string or an opened file.\n\n First input line must start with two integers m and n, the number\n of rows and columns of the matrix. The rest of the first line is\n ignored. The next m lines must contain n numb...
def set_palp_dimension(d): '\n Set the dimension for PALP calls to ``d``.\n\n INPUT:\n\n - ``d`` -- an integer from the list [4,5,6,11] or ``None``.\n\n OUTPUT:\n\n - none.\n\n PALP has many hard-coded limits, which must be specified before\n compilation, one of them is dimension. Sage includ...
def skip_palp_matrix(data, n=1): '\n Skip matrix data in a file.\n\n INPUT:\n\n\n - ``data`` - opened file with blocks of matrix data in\n the following format: A block consisting of m+1 lines has the\n number m as the first element of its first line.\n\n - ``n`` - (default: 1) integer, ...
def write_palp_matrix(m, ofile=None, comment='', format=None): '\n Write ``m`` into ``ofile`` in PALP format.\n\n INPUT:\n\n - ``m`` -- a matrix over integers or a\n :class:`point collection <PointCollection>`.\n\n - ``ofile`` -- a file opened for writing (default: stdout)\n\n - ``comment`` --...
class LinearExpression(ModuleElement): '\n A linear expression.\n\n A linear expression is just a linear polynomial in some (fixed)\n variables.\n\n EXAMPLES::\n\n sage: from sage.geometry.linear_expression import LinearExpressionModule\n sage: L.<x,y,z> = LinearExpressionModule(QQ)\n ...
class LinearExpressionModule(Parent, UniqueRepresentation): "\n The module of linear expressions.\n\n This is the module of linear polynomials which is the parent for\n linear expressions.\n\n EXAMPLES::\n\n sage: from sage.geometry.linear_expression import LinearExpressionModule\n sage:...
class NewtonPolygon_element(Element): '\n Class for infinite Newton polygons with last slope.\n ' def __init__(self, polyhedron, parent): '\n Initialize a Newton polygon.\n\n INPUT:\n\n - polyhedron -- a polyhedron defining the Newton polygon\n\n TESTS:\n\n ...
class ParentNewtonPolygon(Parent, UniqueRepresentation): "\n Construct a Newton polygon.\n\n INPUT:\n\n - ``arg`` -- a list/tuple/iterable of vertices or of\n slopes. Currently, slopes must be rational numbers.\n\n - ``sort_slopes`` -- boolean (default: ``True``). Specifying\n whether slopes...
class PolyhedralComplex(GenericCellComplex): '\n A polyhedral complex.\n\n A **polyhedral complex** `PC` is a collection of polyhedra in a certain\n ambient space `\\RR^n` such that the following hold.\n\n - If a polyhedron `P` is in `PC`, then all the faces of `P` are in `PC`.\n\n - If polyhedra `...
def cells_list_to_cells_dict(cells_list): '\n Helper function that returns the dictionary whose keys are the dimensions,\n and the value associated to an integer `d` is the set of `d`-dimensional\n polyhedra in the given list.\n\n EXAMPLES::\n\n sage: p1 = Polyhedron(vertices=[(1, 1), (0, 0), (...
def exploded_plot(polyhedra, *, center=None, explosion_factor=1, sticky_vertices=False, sticky_center=True, point=None, **kwds): '\n Return a plot of several ``polyhedra`` in one figure with extra space between them.\n\n INPUT:\n\n - ``polyhedra`` -- an iterable of :class:`~sage.geometry.polyhedron.base....
class Polyhedron_cdd(Polyhedron_base): '\n Base class for the cdd backend.\n ' def _init_from_Vrepresentation(self, vertices, rays, lines, verbose=False): "\n Construct polyhedron from V-representation data.\n\n INPUT:\n\n - ``vertices`` -- list of point. Each point can be ...
class Polyhedron_QQ_cdd(Polyhedron_cdd, Polyhedron_QQ): "\n Polyhedra over QQ with cdd\n\n INPUT:\n\n - ``parent`` -- the parent, an instance of\n :class:`~sage.geometry.polyhedron.parent.Polyhedra`.\n\n - ``Vrep`` -- a list ``[vertices, rays, lines]`` or ``None``.\n\n - ``Hrep`` -- a list ``[...