From 1927882c2a7ead8743e6a5179d073b1b391d106c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 8 Aug 2022 23:13:45 -0700 Subject: [PATCH] Replace '# optional - polymake' with '# optional - jupymake' --- .../geometry/polyhedra_tutorial.rst | 4 +- .../combinat/root_system/associahedron.py | 2 +- .../geometry/polyhedron/backend_polymake.py | 194 ++++----- src/sage/geometry/polyhedron/base.py | 36 +- src/sage/geometry/polyhedron/base0.py | 4 +- src/sage/geometry/polyhedron/face.py | 2 +- src/sage/geometry/polyhedron/parent.py | 2 +- src/sage/interfaces/polymake.py | 400 +++++++++--------- src/sage/matrix/matrix1.pyx | 4 +- src/sage/matrix/matrix_space.py | 4 +- src/sage/rings/integer_ring.pyx | 2 +- src/sage/rings/number_field/number_field.py | 2 +- .../number_field_element_quadratic.pyx | 10 +- src/sage/rings/rational_field.py | 2 +- src/sage/rings/real_double.pyx | 2 +- 15 files changed, 335 insertions(+), 335 deletions(-) diff --git a/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst b/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst index cb4ad1faa2e..b7d689e5ca3 100644 --- a/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst +++ b/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst @@ -646,7 +646,7 @@ for sage is installed. :: - sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], # optional - polymake + sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], # optional - jupymake ....: rays=[(1,1)], lines=[], ....: backend='polymake', base_ring=QQ) @@ -657,7 +657,7 @@ An example with quadratic field: :: sage: V = polytopes.dodecahedron().vertices_list() # optional - sage.rings.number_field - sage: Polyhedron(vertices=V, backend='polymake') # optional - polymake # optional - sage.rings.number_field + sage: Polyhedron(vertices=V, backend='polymake') # optional - jupymake # optional - sage.rings.number_field A 3-dimensional polyhedron in (Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?)^3 diff --git a/src/sage/combinat/root_system/associahedron.py b/src/sage/combinat/root_system/associahedron.py index 66b134a35e7..c6765e71eb9 100644 --- a/src/sage/combinat/root_system/associahedron.py +++ b/src/sage/combinat/root_system/associahedron.py @@ -288,7 +288,7 @@ def Associahedra(base_ring, ambient_dim, backend='ppl'): sage: Associahedra(QQ, 4, 'normaliz').parent() # optional - pynormaliz - sage: Associahedra(QQ, 4, 'polymake').parent() # optional - polymake + sage: Associahedra(QQ, 4, 'polymake').parent() # optional - jupymake sage: Associahedra(QQ, 4, 'field').parent() diff --git a/src/sage/geometry/polyhedron/backend_polymake.py b/src/sage/geometry/polyhedron/backend_polymake.py index 97dfdc2c63e..36ccc33c39f 100644 --- a/src/sage/geometry/polyhedron/backend_polymake.py +++ b/src/sage/geometry/polyhedron/backend_polymake.py @@ -56,48 +56,48 @@ class Polyhedron_polymake(Polyhedron_base): EXAMPLES:: - sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], rays=[(1,1)], # optional - polymake + sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], rays=[(1,1)], # optional - jupymake ....: lines=[], backend='polymake') - sage: TestSuite(p).run() # optional - polymake + sage: TestSuite(p).run() # optional - jupymake A lower-dimensional affine cone; we test that there are no mysterious inequalities coming in from the homogenization:: - sage: P = Polyhedron(vertices=[(1, 1)], rays=[(0, 1)], # optional - polymake + sage: P = Polyhedron(vertices=[(1, 1)], rays=[(0, 1)], # optional - jupymake ....: backend='polymake') - sage: P.n_inequalities() # optional - polymake + sage: P.n_inequalities() # optional - jupymake 1 - sage: P.equations() # optional - polymake + sage: P.equations() # optional - jupymake (An equation (1, 0) x - 1 == 0,) The empty polyhedron:: - sage: Polyhedron(eqns=[[1, 0, 0]], backend='polymake') # optional - polymake + sage: Polyhedron(eqns=[[1, 0, 0]], backend='polymake') # optional - jupymake The empty polyhedron in QQ^2 It can also be obtained differently:: - sage: P=Polyhedron(ieqs=[[-2, 1, 1], [-3, -1, -1], [-4, 1, -2]], # optional - polymake + sage: P=Polyhedron(ieqs=[[-2, 1, 1], [-3, -1, -1], [-4, 1, -2]], # optional - jupymake ....: backend='polymake') - sage: P # optional - polymake + sage: P # optional - jupymake The empty polyhedron in QQ^2 - sage: P.Vrepresentation() # optional - polymake + sage: P.Vrepresentation() # optional - jupymake () - sage: P.Hrepresentation() # optional - polymake + sage: P.Hrepresentation() # optional - jupymake (An equation -1 == 0,) The full polyhedron:: - sage: Polyhedron(eqns=[[0, 0, 0]], backend='polymake') # optional - polymake + sage: Polyhedron(eqns=[[0, 0, 0]], backend='polymake') # optional - jupymake A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 1 vertex and 2 lines - sage: Polyhedron(ieqs=[[0, 0, 0]], backend='polymake') # optional - polymake + sage: Polyhedron(ieqs=[[0, 0, 0]], backend='polymake') # optional - jupymake A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 1 vertex and 2 lines Quadratic fields work:: sage: V = polytopes.dodecahedron().vertices_list() # optional - sage.rings.number_field - sage: Polyhedron(vertices=V, backend='polymake') # optional - polymake # optional - sage.rings.number_field + sage: Polyhedron(vertices=V, backend='polymake') # optional - jupymake # optional - sage.rings.number_field A 3-dimensional polyhedron in (Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?)^3 @@ -107,31 +107,31 @@ class Polyhedron_polymake(Polyhedron_base): Tests copied from various methods in :mod:`sage.geometry.polyhedron.base`:: - sage: p = Polyhedron(vertices = [[1,0,0], [0,1,0], [0,0,1]], # optional - polymake + sage: p = Polyhedron(vertices = [[1,0,0], [0,1,0], [0,0,1]], # optional - jupymake ....: backend='polymake') - sage: p.n_equations() # optional - polymake + sage: p.n_equations() # optional - jupymake 1 - sage: p.n_inequalities() # optional - polymake + sage: p.n_inequalities() # optional - jupymake 3 - sage: p = Polyhedron(vertices = [[t,t^2,t^3] for t in range(6)], # optional - polymake + sage: p = Polyhedron(vertices = [[t,t^2,t^3] for t in range(6)], # optional - jupymake ....: backend='polymake') - sage: p.n_facets() # optional - polymake + sage: p.n_facets() # optional - jupymake 8 - sage: p = Polyhedron(vertices = [[1,0],[0,1],[1,1]], rays=[[1,1]], # optional - polymake + sage: p = Polyhedron(vertices = [[1,0],[0,1],[1,1]], rays=[[1,1]], # optional - jupymake ....: backend='polymake') - sage: p.n_vertices() # optional - polymake + sage: p.n_vertices() # optional - jupymake 2 - sage: p = Polyhedron(vertices = [[1,0],[0,1]], rays=[[1,1]], # optional - polymake + sage: p = Polyhedron(vertices = [[1,0],[0,1]], rays=[[1,1]], # optional - jupymake ....: backend='polymake') - sage: p.n_rays() # optional - polymake + sage: p.n_rays() # optional - jupymake 1 - sage: p = Polyhedron(vertices = [[0,0]], rays=[[0,1],[0,-1]], # optional - polymake + sage: p = Polyhedron(vertices = [[0,0]], rays=[[0,1],[0,-1]], # optional - jupymake ....: backend='polymake') - sage: p.n_lines() # optional - polymake + sage: p.n_lines() # optional - jupymake 1 """ @@ -150,10 +150,10 @@ def _is_zero(self, x): EXAMPLES:: - sage: p = Polyhedron([(0,0)], backend='polymake') # optional - polymake - sage: p._is_zero(0) # optional - polymake + sage: p = Polyhedron([(0,0)], backend='polymake') # optional - jupymake + sage: p._is_zero(0) # optional - jupymake True - sage: p._is_zero(1/100000) # optional - polymake + sage: p._is_zero(1/100000) # optional - jupymake False """ return x == 0 @@ -172,10 +172,10 @@ def _is_nonneg(self, x): EXAMPLES:: - sage: p = Polyhedron([(0,0)], backend='polymake') # optional - polymake - sage: p._is_nonneg(1) # optional - polymake + sage: p = Polyhedron([(0,0)], backend='polymake') # optional - jupymake + sage: p._is_nonneg(1) # optional - jupymake True - sage: p._is_nonneg(-1/100000) # optional - polymake + sage: p._is_nonneg(-1/100000) # optional - jupymake False """ return x >= 0 @@ -194,10 +194,10 @@ def _is_positive(self, x): EXAMPLES:: - sage: p = Polyhedron([(0,0)], backend='polymake') # optional - polymake - sage: p._is_positive(1) # optional - polymake + sage: p = Polyhedron([(0,0)], backend='polymake') # optional - jupymake + sage: p._is_positive(1) # optional - jupymake True - sage: p._is_positive(0) # optional - polymake + sage: p._is_positive(0) # optional - jupymake False """ return x > 0 @@ -211,29 +211,29 @@ def __init__(self, parent, Vrep, Hrep, polymake_polytope=None, **kwds): TESTS: - sage: p = Polyhedron(backend='polymake') # optional - polymake - sage: TestSuite(p).run() # optional - polymake - sage: p = Polyhedron(vertices=[(1, 1)], rays=[(0, 1)], # optional - polymake + sage: p = Polyhedron(backend='polymake') # optional - jupymake + sage: TestSuite(p).run() # optional - jupymake + sage: p = Polyhedron(vertices=[(1, 1)], rays=[(0, 1)], # optional - jupymake ....: backend='polymake') - sage: TestSuite(p).run() # optional - polymake + sage: TestSuite(p).run() # optional - jupymake We skip the Lawrence test because it involves numerically unstable floating point arithmetic:: - sage: p = Polyhedron(vertices=[(-1,-1), (1,0), (1,1), (0,1)], # optional - polymake + sage: p = Polyhedron(vertices=[(-1,-1), (1,0), (1,1), (0,1)], # optional - jupymake ....: backend='polymake') - sage: TestSuite(p).run(skip='_test_lawrence') # optional - polymake + sage: TestSuite(p).run(skip='_test_lawrence') # optional - jupymake :: - sage: p = Polyhedron(rays=[[1,1]], backend='polymake') # optional - polymake - sage: TestSuite(p).run() # optional - polymake - sage: p = Polyhedron(rays=[[1]], backend='polymake') # optional - polymake - sage: TestSuite(p).run() # optional - polymake - sage: p = Polyhedron(rays=[[1,1,1]], lines=[[1,0,0]], backend='polymake') # optional - polymake - sage: TestSuite(p).run() # optional - polymake - sage: p = Polyhedron(vertices=[[]], backend='polymake') # optional - polymake - sage: TestSuite(p).run() # optional - polymake + sage: p = Polyhedron(rays=[[1,1]], backend='polymake') # optional - jupymake + sage: TestSuite(p).run() # optional - jupymake + sage: p = Polyhedron(rays=[[1]], backend='polymake') # optional - jupymake + sage: TestSuite(p).run() # optional - jupymake + sage: p = Polyhedron(rays=[[1,1,1]], lines=[[1,0,0]], backend='polymake') # optional - jupymake + sage: TestSuite(p).run() # optional - jupymake + sage: p = Polyhedron(vertices=[[]], backend='polymake') # optional - jupymake + sage: TestSuite(p).run() # optional - jupymake """ if polymake_polytope is not None: if Hrep is not None or Vrep is not None: @@ -249,9 +249,9 @@ def _init_from_polymake_polytope(self, polymake_polytope): TESTS:: - sage: p = Polyhedron(backend='polymake') # optional - polymake - sage: from sage.geometry.polyhedron.backend_polymake import Polyhedron_polymake # optional - polymake - sage: Polyhedron_polymake._init_from_Hrepresentation(p, [], []) # indirect doctest # optional - polymake + sage: p = Polyhedron(backend='polymake') # optional - jupymake + sage: from sage.geometry.polyhedron.backend_polymake import Polyhedron_polymake # optional - jupymake + sage: Polyhedron_polymake._init_from_Hrepresentation(p, [], []) # indirect doctest # optional - jupymake """ self._polymake_polytope = polymake_polytope self._init_Vrepresentation_from_polymake() @@ -280,9 +280,9 @@ def _init_from_Vrepresentation(self, vertices, rays, lines, minimize=True, verbo EXAMPLES:: - sage: p = Polyhedron(backend='polymake') # optional - polymake - sage: from sage.geometry.polyhedron.backend_polymake import Polyhedron_polymake # optional - polymake - sage: Polyhedron_polymake._init_from_Vrepresentation(p, [], [], []) # optional - polymake + sage: p = Polyhedron(backend='polymake') # optional - jupymake + sage: from sage.geometry.polyhedron.backend_polymake import Polyhedron_polymake # optional - jupymake + sage: Polyhedron_polymake._init_from_Vrepresentation(p, [], [], []) # optional - jupymake """ from sage.interfaces.polymake import polymake data = self._polymake_Vrepresentation_data(vertices, rays, lines) @@ -347,9 +347,9 @@ def _init_from_Hrepresentation(self, ieqs, eqns, minimize=True, verbose=False): EXAMPLES:: - sage: p = Polyhedron(backend='polymake') # optional - polymake - sage: from sage.geometry.polyhedron.backend_polymake import Polyhedron_polymake # optional - polymake - sage: Polyhedron_polymake._init_from_Hrepresentation(p, [], []) # optional - polymake + sage: p = Polyhedron(backend='polymake') # optional - jupymake + sage: from sage.geometry.polyhedron.backend_polymake import Polyhedron_polymake # optional - jupymake + sage: Polyhedron_polymake._init_from_Hrepresentation(p, [], []) # optional - jupymake """ from sage.interfaces.polymake import polymake data = self._polymake_Hrepresentation_data(ieqs, eqns) @@ -420,9 +420,9 @@ def _init_from_Vrepresentation_and_Hrepresentation(self, Vrep, Hrep): sage: parent = Polyhedra_polymake(ZZ, 1, 'polymake') sage: Vrep = [[[0], [1]], [], []] sage: Hrep = [[[0, 1], [1, -1]], []] - sage: p = Polyhedron_polymake(parent, Vrep, Hrep, # indirect doctest # optional - polymake + sage: p = Polyhedron_polymake(parent, Vrep, Hrep, # indirect doctest # optional - jupymake ....: Vrep_minimal=True, Hrep_minimal=True) - sage: p # optional - polymake + sage: p # optional - jupymake A 1-dimensional polyhedron in ZZ^1 defined as the convex hull of 2 vertices """ Vrep = [list(x) for x in Vrep] @@ -482,13 +482,13 @@ def _init_Vrepresentation_from_polymake(self): EXAMPLES:: - sage: p = Polyhedron(vertices=[(0,1/2),(2,0),(4,5/6)], # indirect doctest # optional - polymake + sage: p = Polyhedron(vertices=[(0,1/2),(2,0),(4,5/6)], # indirect doctest # optional - jupymake ....: backend='polymake') - sage: set(p.Hrepresentation()) # optional - polymake + sage: set(p.Hrepresentation()) # optional - jupymake {An inequality (1, 4) x - 2 >= 0, An inequality (1, -12) x + 6 >= 0, An inequality (-5, 12) x + 10 >= 0} - sage: set(p.Vrepresentation()) # optional - polymake + sage: set(p.Vrepresentation()) # optional - jupymake {A vertex at (0, 1/2), A vertex at (2, 0), A vertex at (4, 5/6)} """ @@ -517,13 +517,13 @@ def _init_Hrepresentation_from_polymake(self): EXAMPLES:: - sage: p = Polyhedron(vertices=[(0,1/2), (2,0), (4,5/6)], # indirect doctest # optional - polymake + sage: p = Polyhedron(vertices=[(0,1/2), (2,0), (4,5/6)], # indirect doctest # optional - jupymake ....: backend='polymake') - sage: set(p.Hrepresentation()) # optional - polymake + sage: set(p.Hrepresentation()) # optional - jupymake {An inequality (1, 4) x - 2 >= 0, An inequality (1, -12) x + 6 >= 0, An inequality (-5, 12) x + 10 >= 0} - sage: set(p.Vrepresentation()) # optional - polymake + sage: set(p.Vrepresentation()) # optional - jupymake {A vertex at (0, 1/2), A vertex at (2, 0), A vertex at (4, 5/6)} """ @@ -553,9 +553,9 @@ def _from_polymake_polytope(cls, parent, polymake_polytope): sage: from sage.geometry.polyhedron.backend_polymake import Polyhedron_polymake sage: from sage.geometry.polyhedron.parent import Polyhedra sage: P=Polyhedron(ieqs=[[1, 0, 2], [3, 0, -2], [3, 2, -2]]) - sage: PP = polymake(P) # optional - polymake - sage: parent = Polyhedra(QQ, 2, backend='polymake') # optional - polymake - sage: Q=Polyhedron_polymake._from_polymake_polytope(parent, PP) # optional - polymake + sage: PP = polymake(P) # optional - jupymake + sage: parent = Polyhedra(QQ, 2, backend='polymake') # optional - jupymake + sage: Q=Polyhedron_polymake._from_polymake_polytope(parent, PP) # optional - jupymake """ if parent is None: from .parent import Polyhedra @@ -584,9 +584,9 @@ def _polymake_(self, polymake): EXAMPLES:: - sage: P = Polyhedron(vertices=[[1, 0], [0, 1], [0, 0]], backend='polymake') # optional - polymake - sage: PP = polymake(P) # optional - polymake - sage: PP.N_VERTICES # optional - polymake + sage: P = Polyhedron(vertices=[[1, 0], [0, 1], [0, 0]], backend='polymake') # optional - jupymake + sage: PP = polymake(P) # optional - jupymake + sage: PP.N_VERTICES # optional - jupymake 3 """ if self._polymake_polytope.parent() is polymake: @@ -600,8 +600,8 @@ def __getstate__(self): TESTS:: - sage: P = polytopes.simplex(backend='polymake') # optional - polymake - sage: P.__getstate__() # optional - polymake + sage: P = polytopes.simplex(backend='polymake') # optional - jupymake + sage: P.__getstate__() # optional - jupymake (Polyhedra in QQ^4, {'_Hrepresentation': (An inequality (0, -1, -1, -1) x + 1 >= 0, An inequality (0, 1, 0, 0) x + 0 >= 0, @@ -644,31 +644,31 @@ def __setstate__(self, state): Test that the obtained cone is valid:: - sage: from sage.geometry.polyhedron.backend_polymake import Polyhedron_polymake # optional - polymake - sage: P = polytopes.permutahedron(4, backend='polymake') # optional - polymake - sage: P1 = loads(dumps(P)) # optional - polymake - sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope) # optional - polymake - sage: P._test_polymake_pickling(other=P2) # optional - polymake + sage: from sage.geometry.polyhedron.backend_polymake import Polyhedron_polymake # optional - jupymake + sage: P = polytopes.permutahedron(4, backend='polymake') # optional - jupymake + sage: P1 = loads(dumps(P)) # optional - jupymake + sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope) # optional - jupymake + sage: P._test_polymake_pickling(other=P2) # optional - jupymake - sage: P = Polyhedron(lines=[[1,0], [0,1]], backend='polymake') # optional - polymake - sage: P1 = loads(dumps(P)) # optional - polymake - sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope) # optional - polymake - sage: P._test_polymake_pickling(other=P2) # optional - polymake + sage: P = Polyhedron(lines=[[1,0], [0,1]], backend='polymake') # optional - jupymake + sage: P1 = loads(dumps(P)) # optional - jupymake + sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope) # optional - jupymake + sage: P._test_polymake_pickling(other=P2) # optional - jupymake - sage: P = Polyhedron(backend='polymake') # optional - polymake - sage: P1 = loads(dumps(P)) # optional - polymake - sage: P._test_polymake_pickling(other=P1) # optional - polymake + sage: P = Polyhedron(backend='polymake') # optional - jupymake + sage: P1 = loads(dumps(P)) # optional - jupymake + sage: P._test_polymake_pickling(other=P1) # optional - jupymake - sage: P = polytopes.permutahedron(4, backend='polymake') * Polyhedron(lines=[[1]], backend='polymake') # optional - polymake - sage: P1 = loads(dumps(P)) # optional - polymake - sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope) # optional - polymake - sage: P._test_polymake_pickling(other=P2) # optional - polymake + sage: P = polytopes.permutahedron(4, backend='polymake') * Polyhedron(lines=[[1]], backend='polymake') # optional - jupymake + sage: P1 = loads(dumps(P)) # optional - jupymake + sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope) # optional - jupymake + sage: P._test_polymake_pickling(other=P2) # optional - jupymake - sage: print("Possible output"); P = polytopes.dodecahedron(backend='polymake') # optional - polymake # optional - sage.rings.number_field + sage: print("Possible output"); P = polytopes.dodecahedron(backend='polymake') # optional - jupymake # optional - sage.rings.number_field Possible output... - sage: P1 = loads(dumps(P)) # optional - polymake # optional - sage.rings.number_field - sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope) # optional - polymake # optional - sage.rings.number_field - sage: P._test_polymake_pickling(other=P2) # optional - polymake # optional - sage.rings.number_field + sage: P1 = loads(dumps(P)) # optional - jupymake # optional - sage.rings.number_field + sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope) # optional - jupymake # optional - sage.rings.number_field + sage: P._test_polymake_pickling(other=P2) # optional - jupymake # optional - sage.rings.number_field """ if "_pickle_vertices" in state[1]: vertices = state[1].pop("_pickle_vertices") @@ -703,7 +703,7 @@ def _test_polymake_pickling(self, tester=None, other=None, **options): TESTS:: - sage: polytopes.cross_polytope(3, backend='polymake')._test_polymake_pickling() # optional - polymake + sage: polytopes.cross_polytope(3, backend='polymake')._test_polymake_pickling() # optional - jupymake """ if tester is None: tester = self._tester(**options) @@ -739,10 +739,10 @@ class Polyhedron_QQ_polymake(Polyhedron_polymake, Polyhedron_QQ): EXAMPLES:: - sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], # optional - polymake + sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], # optional - jupymake ....: rays=[(1,1)], lines=[], ....: backend='polymake', base_ring=QQ) - sage: TestSuite(p).run() # optional - polymake + sage: TestSuite(p).run() # optional - jupymake """ pass @@ -759,9 +759,9 @@ class Polyhedron_ZZ_polymake(Polyhedron_polymake, Polyhedron_ZZ): EXAMPLES:: - sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], # optional - polymake + sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], # optional - jupymake ....: rays=[(1,1)], lines=[], ....: backend='polymake', base_ring=ZZ) - sage: TestSuite(p).run() # optional - polymake + sage: TestSuite(p).run() # optional - jupymake """ pass diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 576e073a825..9a21159f322 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -1116,35 +1116,35 @@ def _polymake_init_(self): EXAMPLES:: sage: P = polytopes.cube() - sage: PP = polymake(P) # optional - polymake - sage: PP.N_VERTICES # optional - polymake + sage: PP = polymake(P) # optional - jupymake + sage: PP.N_VERTICES # optional - jupymake 8 Lower-dimensional polyhedron:: sage: P = Polyhedron(vertices=[[1, 0], [0, 1]]) - sage: PP = polymake(P) # optional - polymake - sage: PP.COMBINATORIAL_DIM # optional - polymake + sage: PP = polymake(P) # optional - jupymake + sage: PP.COMBINATORIAL_DIM # optional - jupymake 1 - sage: PP.AFFINE_HULL # optional - polymake + sage: PP.AFFINE_HULL # optional - jupymake -1 1 1 Empty polyhedron:: sage: P = Polyhedron(ambient_dim=2, vertices=[]) - sage: PP = polymake(P) # optional - polymake - sage: PP.COMBINATORIAL_DIM # optional - polymake + sage: PP = polymake(P) # optional - jupymake + sage: PP.COMBINATORIAL_DIM # optional - jupymake -1 Pointed unbounded polyhedron:: sage: P = Polyhedron(vertices=[[1, 0], [0, 1]], rays=[[1, 0]]) - sage: PP = polymake(P) # optional - polymake - sage: PP.VERTICES # optional - polymake + sage: PP = polymake(P) # optional - jupymake + sage: PP.VERTICES # optional - jupymake 1 0 1 1 1 0 0 1 0 - sage: PP.FACETS # optional - polymake + sage: PP.FACETS # optional - jupymake 1 0 -1 -1 1 1 0 0 1 @@ -1152,14 +1152,14 @@ def _polymake_init_(self): Non-pointed polyhedron:: sage: P = Polyhedron(vertices=[[1, 0], [0, 1]], lines=[[1, 0]]) - sage: PP = polymake(P) # optional - polymake - sage: PP.VERTICES # optional - polymake + sage: PP = polymake(P) # optional - jupymake + sage: PP.VERTICES # optional - jupymake 1 0 1 1 0 0 - sage: PP.FACETS # optional - polymake + sage: PP.FACETS # optional - jupymake 1 0 -1 0 0 1 - sage: PP.LINEALITY_SPACE # optional - polymake + sage: PP.LINEALITY_SPACE # optional - jupymake 0 1 0 Algebraic polyhedron:: @@ -1169,20 +1169,20 @@ def _polymake_init_(self): in (Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?)^3 defined as the convex hull of 20 vertices - sage: print("There may be a recompilation warning"); PP = polymake(P); PP # optional - polymake # optional - sage.rings.number_field + sage: print("There may be a recompilation warning"); PP = polymake(P); PP # optional - jupymake # optional - sage.rings.number_field There may be a recompilation warning... Polytope>[...] - sage: sorted(PP.VERTICES[:], key=repr)[0] # optional - polymake # optional - sage.rings.number_field + sage: sorted(PP.VERTICES[:], key=repr)[0] # optional - jupymake # optional - sage.rings.number_field 1 -1+1r5 -4+2r5 0 Floating-point polyhedron:: sage: P = polytopes.dodecahedron(exact=False); P A 3-dimensional polyhedron in RDF^3 defined as the convex hull of 20 vertices - sage: print("There may be a recompilation warning"); PP = polymake(P); PP # optional - polymake + sage: print("There may be a recompilation warning"); PP = polymake(P); PP # optional - jupymake There may be a recompilation warning... Polytope[...] - sage: sorted(PP.VERTICES[:], key=repr)[0] # optional - polymake + sage: sorted(PP.VERTICES[:], key=repr)[0] # optional - jupymake 1 -0.472135955 0 -1.236067978 """ diff --git a/src/sage/geometry/polyhedron/base0.py b/src/sage/geometry/polyhedron/base0.py index 2e0f6a716cf..44182e0f9e4 100644 --- a/src/sage/geometry/polyhedron/base0.py +++ b/src/sage/geometry/polyhedron/base0.py @@ -315,8 +315,8 @@ def _sage_input_(self, sib, coerced): sage: P = Polyhedron(vertices = [[1, 0], [0, 1]], rays = [[1, 1]], backend='normaliz') # optional - pynormaliz sage: sage_input(P) # optional - pynormaliz Polyhedron(backend='normaliz', base_ring=QQ, rays=[(QQ(1), QQ(1))], vertices=[(QQ(0), QQ(1)), (QQ(1), QQ(0))]) - sage: P = Polyhedron(vertices = [[1, 0], [0, 1]], rays = [[1, 1]], backend='polymake') # optional - polymake - sage: sage_input(P) # optional - polymake + sage: P = Polyhedron(vertices = [[1, 0], [0, 1]], rays = [[1, 1]], backend='polymake') # optional - jupymake + sage: sage_input(P) # optional - jupymake Polyhedron(backend='polymake', base_ring=QQ, rays=[(QQ(1), QQ(1))], vertices=[(QQ(1), QQ(0)), (QQ(0), QQ(1))]) """ kwds = dict() diff --git a/src/sage/geometry/polyhedron/face.py b/src/sage/geometry/polyhedron/face.py index 52304d08d75..d9dd5a6c4d6 100644 --- a/src/sage/geometry/polyhedron/face.py +++ b/src/sage/geometry/polyhedron/face.py @@ -1056,7 +1056,7 @@ def combinatorial_face_to_polyhedral_face(polyhedron, combinatorial_face): 4 sage: polytopes.simplex(backend='normaliz').equations()[0].index() # optional - pynormaliz 4 - sage: polytopes.simplex(backend='polymake').equations()[0].index() # optional - polymake + sage: polytopes.simplex(backend='polymake').equations()[0].index() # optional - jupymake 4 """ V_indices = combinatorial_face.ambient_V_indices() diff --git a/src/sage/geometry/polyhedron/parent.py b/src/sage/geometry/polyhedron/parent.py index 881c614238a..3eee9514560 100644 --- a/src/sage/geometry/polyhedron/parent.py +++ b/src/sage/geometry/polyhedron/parent.py @@ -109,7 +109,7 @@ def Polyhedra(ambient_space_or_base_ring=None, ambient_dim=None, backend=None, * Traceback (most recent call last): ... ValueError: invalid base ring: Number Field in I with defining polynomial x^2 + 1 with I = 1*I cannot be coerced to a real field - sage: Polyhedra(AA, 3, backend='polymake') # optional - polymake + sage: Polyhedra(AA, 3, backend='polymake') # optional - jupymake Traceback (most recent call last): ... ValueError: the 'polymake' backend for polyhedron cannot be used with Algebraic Real Field diff --git a/src/sage/interfaces/polymake.py b/src/sage/interfaces/polymake.py index c34e72a21c7..c459a7268e6 100644 --- a/src/sage/interfaces/polymake.py +++ b/src/sage/interfaces/polymake.py @@ -65,7 +65,7 @@ class PolymakeError(RuntimeError): TESTS:: - sage: polymake.eval('print foo;') # optional polymake + sage: polymake.eval('print foo;') # optional - jupymake Traceback (most recent call last): ... PolymakeError: Unquoted string "foo" may clash with future reserved word... @@ -155,7 +155,7 @@ def version(self): EXAMPLES:: - sage: polymake.version() # optional - polymake # random + sage: polymake.version() # optional - jupymake # random '4...' """ return self.get('$Polymake::Version') @@ -178,10 +178,10 @@ def _object_class(self): TESTS:: - sage: C = polymake('cube(3)') # indirect doctest # optional - polymake - sage: C # optional - polymake + sage: C = polymake('cube(3)') # indirect doctest # optional - jupymake + sage: C # optional - jupymake cube of dimension 3 - sage: type(C) # optional - polymake + sage: type(C) # optional - jupymake """ @@ -196,10 +196,10 @@ def _function_element_class(self): We use ellipses in the tests, to make it more robust against future changes in polymake:: - sage: p = polymake.rand_sphere(4, 20, seed=5) # optional - polymake - sage: p.get_schedule # optional - polymake # indirect doctest + sage: p = polymake.rand_sphere(4, 20, seed=5) # optional - jupymake + sage: p.get_schedule # optional - jupymake # indirect doctest Member function 'get_schedule' of Polymake::polytope::Polytope__Rational object - sage: p.get_schedule('"F_VECTOR"') # optional - polymake # random + sage: p.get_schedule('"F_VECTOR"') # optional - jupymake # random CONE_DIM : RAYS | INPUT_RAYS precondition : BOUNDED ( POINTED : ) POINTED : @@ -229,7 +229,7 @@ def function_call(self, function, args=None, kwds=None): """ EXAMPLES:: - sage: polymake.rand_sphere(4, 30, seed=15) # optional - polymake # indirect doctest + sage: polymake.rand_sphere(4, 30, seed=15) # optional - jupymake # indirect doctest Random spherical polytope of dimension 4; seed=15... """ @@ -246,15 +246,15 @@ def _function_call_string(self, function, args, kwds): EXAMPLES:: - sage: polymake._function_call_string('cube', ['2','7','3'], ['group=>1']) # optional - polymake + sage: polymake._function_call_string('cube', ['2','7','3'], ['group=>1']) # optional - jupymake 'cube(2,7,3, group=>1);' - sage: c = polymake('cube(2,7,3, group=>1)') # optional - polymake - sage: c.VERTICES # optional - polymake + sage: c = polymake('cube(2,7,3, group=>1)') # optional - jupymake + sage: c.VERTICES # optional - jupymake 1 3 3 1 7 3 1 3 7 1 7 7 - sage: c.GROUP # optional - polymake + sage: c.GROUP # optional - jupymake full combinatorial group """ @@ -273,10 +273,10 @@ def _coerce_impl(self, x, use_special=True): Test that dictionaries are converted to hashes:: - sage: h = polymake({'"a"': 1, '"b"': 2}) # optional - polymake - sage: h # optional - polymake + sage: h = polymake({'"a"': 1, '"b"': 2}) # optional - jupymake + sage: h # optional - jupymake HASH(0x...) - sage: h['"a"'] # optional - polymake + sage: h['"a"'] # optional - jupymake 1 """ if isinstance(x, dict): @@ -384,13 +384,13 @@ def _start(self): TESTS:: - sage: polymake._start() # optional - polymake + sage: polymake._start() # optional - jupymake Since 'normal_fan' is not defined in the polymake application 'polytope', we now get :: - sage: 'normal_fan' in dir(polymake) # optional - polymake + sage: 'normal_fan' in dir(polymake) # optional - jupymake False """ @@ -425,14 +425,14 @@ def _read_in_file_command(self, filename): Force use of file:: - sage: L = polymake([42] * 400) # optional - polymake - sage: len(L) # optional - polymake + sage: L = polymake([42] * 400) # optional - jupymake + sage: len(L) # optional - jupymake 400 Just below standard file cutoff of 1024:: - sage: L = polymake([42] * 84) # optional - polymake - sage: len(L) # optional - polymake + sage: L = polymake([42] * 84) # optional - jupymake + sage: len(L) # optional - jupymake 84 """ return 'eval read_file "{}";\n'.format(filename) @@ -464,13 +464,13 @@ def clear(self, var): TESTS:: - sage: c = polymake.cube(15) # optional - polymake - sage: polymake._available_vars = [] # optional - polymake - sage: old = c._name # optional - polymake - sage: del c # optional - polymake # indirect doctest - sage: len(polymake._available_vars) # optional - polymake + sage: c = polymake.cube(15) # optional - jupymake + sage: polymake._available_vars = [] # optional - jupymake + sage: old = c._name # optional - jupymake + sage: del c # optional - jupymake # indirect doctest + sage: len(polymake._available_vars) # optional - jupymake 1 - sage: polymake._next_var_name() in old # optional - polymake + sage: polymake._next_var_name() in old # optional - jupymake True """ @@ -503,13 +503,13 @@ def _create(self, value, name=None): EXAMPLES:: - sage: polymake._create("('foo', 'bar')", name="my_array") # optional - polymake + sage: polymake._create("('foo', 'bar')", name="my_array") # optional - jupymake '@my_array' - sage: print(polymake.eval('print join(", ", @my_array);')) # optional - polymake + sage: print(polymake.eval('print join(", ", @my_array);')) # optional - jupymake foo, bar - sage: polymake._create('"foobar"', name="my_string") # optional - polymake + sage: polymake._create('"foobar"', name="my_string") # optional - jupymake '$my_string[0]' - sage: print(polymake.eval('print $my_string[0];')) # optional - polymake + sage: print(polymake.eval('print $my_string[0];')) # optional - jupymake foobar """ @@ -551,18 +551,18 @@ def set(self, var, value): EXAMPLES:: - sage: c = polymake('cube(3)') # optional - polymake # indirect doctest - sage: d = polymake.cube(3) # optional - polymake + sage: c = polymake('cube(3)') # optional - jupymake # indirect doctest + sage: d = polymake.cube(3) # optional - jupymake Equality is, for "big" objects such as polytopes, comparison by identity:: - sage: c == d # optional - polymake + sage: c == d # optional - jupymake False However, the list of vertices is equal:: - sage: c.VERTICES == d.VERTICES # optional - polymake + sage: c.VERTICES == d.VERTICES # optional - jupymake True TESTS: @@ -571,13 +571,13 @@ def set(self, var, value): It should, however, **never** be needed to do the following *explicitly*:: - sage: polymake.set('myvar', 'cube(3)') # optional - polymake - sage: polymake.get('$myvar[0]') # optional - polymake + sage: polymake.set('myvar', 'cube(3)') # optional - jupymake + sage: polymake.get('$myvar[0]') # optional - jupymake 'Polymake::polytope::Polytope__Rational=ARRAY(...)' The following tests against :trac:`22658`:: - sage: P = polymake.new_object("Polytope", FACETS=[[12, -2, -3, -5, -8, -13, -21, -34, -55], # optional - polymake + sage: P = polymake.new_object("Polytope", FACETS=[[12, -2, -3, -5, -8, -13, -21, -34, -55], # optional - jupymake ....: [0, 1, 0, 0, 0, 0, 0, 0, 0], ....: [0, 0, 0, 0, 0, 0, 0, 0, 1], ....: [0, 0, 0, 0, 0, 0, 0, 1, 0], @@ -586,7 +586,7 @@ def set(self, var, value): ....: [0, 0, 0, 0, 1, 0, 0, 0, 0], ....: [0, 0, 0, 1, 0, 0, 0, 0, 0], ....: [0, 0, 1, 0, 0, 0, 0, 0, 0]]) - sage: P.VERTICES # optional - polymake + sage: P.VERTICES # optional - jupymake 1 6 0 0 0 0 0 0 0 1 0 4 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 @@ -596,7 +596,7 @@ def set(self, var, value): 1 0 0 0 0 0 4/7 0 0 1 0 0 0 0 12/13 0 0 0 1 0 0 0 3/2 0 0 0 0 - sage: P.F_VECTOR # optional - polymake + sage: P.F_VECTOR # optional - jupymake 9 36 84 126 126 84 36 9 """ @@ -611,13 +611,13 @@ def get(self, cmd): EXAMPLES:: - sage: polymake.get('cube(3)') # optional - polymake + sage: polymake.get('cube(3)') # optional - jupymake 'Polymake::polytope::Polytope__Rational=ARRAY(...)' Note that the above string representation is what polymake provides. In our interface, we use what polymake calls a "description":: - sage: polymake('cube(3)') # optional - polymake + sage: polymake('cube(3)') # optional - jupymake cube of dimension 3 @@ -635,7 +635,7 @@ def help(self, topic, pager=True): EXAMPLES:: - sage: print(polymake.help('Polytope', pager=False)) # optional - polymake # random + sage: print(polymake.help('Polytope', pager=False)) # optional - jupymake # random objects/Polytope: Not necessarily bounded or unbounded polyhedron. Nonetheless, the name "Polytope" is used for two reasons: @@ -650,7 +650,7 @@ def help(self, topic, pager=True): and the available help topics are displayed resp. printed, without user interaction:: - sage: polymake.help('TRIANGULATION') # optional - polymake # random + sage: polymake.help('TRIANGULATION') # optional - jupymake # random doctest:warning ... UserWarning: Polymake expects user interaction. We abort and return the options that Polymake provides. @@ -664,7 +664,7 @@ def help(self, topic, pager=True): If an unknown help topic is requested, a :class:`PolymakeError` results:: - sage: polymake.help('Triangulation') # optional - polymake + sage: polymake.help('Triangulation') # optional - jupymake Traceback (most recent call last): ... PolymakeError: unknown help topic 'Triangulation' @@ -691,25 +691,25 @@ def _tab_completion(self): TESTS:: - sage: polymake.application('fan') # optional - polymake - sage: 'normal_fan' in dir(polymake) # optional - polymake # indirect doctest + sage: polymake.application('fan') # optional - jupymake + sage: 'normal_fan' in dir(polymake) # optional - jupymake # indirect doctest True - sage: polymake.application('polytope') # optional - polymake + sage: polymake.application('polytope') # optional - jupymake Since ``'normal_fan'`` is not defined in the polymake application ``'polytope'``, we now get:: - sage: 'normal_fan' in dir(polymake) # optional - polymake + sage: 'normal_fan' in dir(polymake) # optional - jupymake False Global functions from ``'core'`` are available:: - sage: 'show_credits' in dir(polymake) # optional - polymake + sage: 'show_credits' in dir(polymake) # optional - jupymake True Global functions from ``'common'`` are available:: - sage: 'lex_ordered' in dir(polymake) # optional - polymake + sage: 'lex_ordered' in dir(polymake) # optional - jupymake True """ if not self.is_running(): @@ -746,20 +746,20 @@ def application(self, app): terms of inequalities. Polymake knows to compute the f- and h-vector and finds that the polytope is very ample:: - sage: q = polymake.new_object("Polytope", INEQUALITIES=[[5,-4,0,1],[-3,0,-4,1],[-2,1,0,0],[-4,4,4,-1],[0,0,1,0],[8,0,0,-1],[1,0,-1,0],[3,-1,0,0]]) # optional - polymake - sage: q.H_VECTOR # optional - polymake + sage: q = polymake.new_object("Polytope", INEQUALITIES=[[5,-4,0,1],[-3,0,-4,1],[-2,1,0,0],[-4,4,4,-1],[0,0,1,0],[8,0,0,-1],[1,0,-1,0],[3,-1,0,0]]) # optional - jupymake + sage: q.H_VECTOR # optional - jupymake 1 5 5 1 - sage: q.F_VECTOR # optional - polymake + sage: q.F_VECTOR # optional - jupymake 8 14 8 - sage: q.VERY_AMPLE # optional - polymake + sage: q.VERY_AMPLE # optional - jupymake true In the application 'fan', polymake can now compute the normal fan of `q` and its (primitive) rays:: - sage: polymake.application('fan') # optional - polymake - sage: g = q.normal_fan() # optional - polymake - sage: g.RAYS # optional - polymake + sage: polymake.application('fan') # optional - jupymake + sage: g = q.normal_fan() # optional - jupymake + sage: g.RAYS # optional - jupymake -1 0 1/4 0 -1 1/4 1 0 0 @@ -768,7 +768,7 @@ def application(self, app): 0 0 -1 0 -1 0 -1 0 0 - sage: g.RAYS.primitive() # optional - polymake + sage: g.RAYS.primitive() # optional - jupymake -4 0 1 0 -4 1 1 0 0 @@ -787,20 +787,20 @@ def application(self, app): but only in 'tropical', the following shows the effect of changing the application. :: - sage: polymake.application('polytope') # optional - polymake - sage: 'trop_witness' in dir(polymake) # optional - polymake + sage: polymake.application('polytope') # optional - jupymake + sage: 'trop_witness' in dir(polymake) # optional - jupymake False - sage: polymake.application('tropical') # optional - polymake - sage: 'trop_witness' in dir(polymake) # optional - polymake + sage: polymake.application('tropical') # optional - jupymake + sage: 'trop_witness' in dir(polymake) # optional - jupymake True - sage: polymake.application('polytope') # optional - polymake - sage: 'trop_witness' in dir(polymake) # optional - polymake + sage: polymake.application('polytope') # optional - jupymake + sage: 'trop_witness' in dir(polymake) # optional - jupymake False For completeness, we show what happens when asking for an application that doesn't exist:: - sage: polymake.application('killerapp') # optional - polymake + sage: polymake.application('killerapp') # optional - jupymake Traceback (most recent call last): ... ValueError: Unknown polymake application 'killerapp' @@ -808,7 +808,7 @@ def application(self, app): Of course, a different error results when we send an explicit command in polymake to change to an unknown application:: - sage: polymake.eval('application "killerapp";') # optional - polymake + sage: polymake.eval('application "killerapp";') # optional - jupymake Traceback (most recent call last): ... PolymakeError: Unknown application killerapp @@ -830,17 +830,17 @@ def new_object(self, name, *args, **kwds): EXAMPLES:: - sage: q = polymake.new_object("Polytope", INEQUALITIES=[[4,-4,0,1],[-4,0,-4,1],[-2,1,0,0],[-4,4,4,-1],[0,0,1,0],[8,0,0,-1]]) # optional - polymake - sage: q.N_VERTICES # optional - polymake + sage: q = polymake.new_object("Polytope", INEQUALITIES=[[4,-4,0,1],[-4,0,-4,1],[-2,1,0,0],[-4,4,4,-1],[0,0,1,0],[8,0,0,-1]]) # optional - jupymake + sage: q.N_VERTICES # optional - jupymake 4 - sage: q.BOUNDED # optional - polymake + sage: q.BOUNDED # optional - jupymake true - sage: q.VERTICES # optional - polymake + sage: q.VERTICES # optional - jupymake 1 2 0 4 1 3 0 8 1 2 1 8 1 3 1 8 - sage: q.full_typename() # optional - polymake + sage: q.full_typename() # optional - jupymake 'Polytope' """ @@ -866,15 +866,15 @@ class PolymakeElement(ExtraTabCompletion, InterfaceElement): We support all "big" polymake types, Perl arrays of length different from one, and Perl scalars:: - sage: p = polymake.rand_sphere(4, 20, seed=5) # optional - polymake - sage: p.typename() # optional - polymake + sage: p = polymake.rand_sphere(4, 20, seed=5) # optional - jupymake + sage: p.typename() # optional - jupymake 'Polytope' - sage: p # optional - polymake + sage: p # optional - jupymake Random spherical polytope of dimension 4; seed=5... Now, one can work with that element in Python syntax, for example:: - sage: p.VERTICES[2][2] # optional - polymake + sage: p.VERTICES[2][2] # optional - jupymake 1450479926727001/2251799813685248 """ @@ -888,21 +888,21 @@ def _repr_(self): of the object that is not longer than single line, it is used for printing:: - sage: p = polymake.rand_sphere(3, 12, seed=15) # optional - polymake - sage: p # optional - polymake + sage: p = polymake.rand_sphere(3, 12, seed=15) # optional - jupymake + sage: p # optional - jupymake Random spherical polytope of dimension 3; seed=15... - sage: c = polymake.cube(4) # optional - polymake - sage: c # optional - polymake + sage: c = polymake.cube(4) # optional - jupymake + sage: c # optional - jupymake cube of dimension 4 We use the print representation of scalars to display scalars:: - sage: p.N_VERTICES # optional - polymake + sage: p.N_VERTICES # optional - jupymake 12 The items of a Perl arrays are shown separated by commas:: - sage: p.get_member('list_properties') # optional - polymake # random + sage: p.get_member('list_properties') # optional - jupymake # random POINTS, CONE_AMBIENT_DIM, BOUNDED, FEASIBLE, N_POINTS, POINTED, CONE_DIM, FULL_DIM, LINEALITY_DIM, LINEALITY_SPACE, COMBINATORIAL_DIM, AFFINE_HULL, VERTICES, N_VERTICES @@ -910,8 +910,8 @@ def _repr_(self): We chose to print rule chains explicitly, so that the user doesn't need to know how to list the rules using polymake commands:: - sage: r = p.get_schedule('"H_VECTOR"') # optional - polymake - sage: r # optional - polymake # random + sage: r = p.get_schedule('"H_VECTOR"') # optional - jupymake + sage: r # optional - jupymake # random precondition : N_RAYS | N_INPUT_RAYS ( ppl.convex_hull.primal: FACETS, LINEAR_SPAN : RAYS | INPUT_RAYS ) sensitivity check for FacetPerm ppl.convex_hull.primal: FACETS, LINEAR_SPAN : RAYS | INPUT_RAYS @@ -922,16 +922,16 @@ def _repr_(self): F_VECTOR : N_FACETS, N_RAYS, COMBINATORIAL_DIM precondition : SIMPLICIAL ( H_VECTOR : F_VECTOR ) H_VECTOR : F_VECTOR - sage: r.typeof() # optional - polymake + sage: r.typeof() # optional - jupymake ('Polymake::Core::Scheduler::RuleChain', 'ARRAY') Similarly, polymake matrices and vectors are explicitly listed:: - sage: c.VERTICES.typename() # optional - polymake + sage: c.VERTICES.typename() # optional - jupymake 'Matrix' - sage: c.VERTICES[0].typename() # optional - polymake + sage: c.VERTICES[0].typename() # optional - jupymake 'Vector' - sage: c.VERTICES # optional - polymake # random + sage: c.VERTICES # optional - jupymake # random 1 -1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 -1 -1 @@ -948,15 +948,15 @@ def _repr_(self): 1 1 -1 1 1 1 -1 1 1 1 1 1 1 1 1 - sage: c.VERTICES[0] # optional - polymake + sage: c.VERTICES[0] # optional - jupymake 1 -1 -1 -1 -1 For other types, we simply use the print representation offered by polymake:: - sage: p.TWO_FACE_SIZES.typename() # optional - polymake + sage: p.TWO_FACE_SIZES.typename() # optional - jupymake 'Map' - sage: p.TWO_FACE_SIZES # optional - polymake + sage: p.TWO_FACE_SIZES # optional - jupymake {(3 20)} """ @@ -999,25 +999,25 @@ def _richcmp_(self, other, op): The default for comparing equality for polytopes is *identity*:: - sage: p1 = polymake.rand_sphere(3, 12, seed=15) # optional - polymake - sage: p2 = polymake.rand_sphere(3, 12, seed=15) # optional - polymake - sage: p1 == p2 # optional - polymake + sage: p1 = polymake.rand_sphere(3, 12, seed=15) # optional - jupymake + sage: p2 = polymake.rand_sphere(3, 12, seed=15) # optional - jupymake + sage: p1 == p2 # optional - jupymake False However, other data types are compared by equality, not identity:: - sage: p1.VERTICES == p2.VERTICES # optional - polymake + sage: p1.VERTICES == p2.VERTICES # optional - jupymake True A computation applied to a polytope can change the available properties, and thus we have :: - sage: p1.get_member('list_properties') == p2.get_member('list_properties') # optional - polymake + sage: p1.get_member('list_properties') == p2.get_member('list_properties') # optional - jupymake True - sage: p1.F_VECTOR # optional - polymake + sage: p1.F_VECTOR # optional - jupymake 12 30 20 - sage: p1.get_member('list_properties') == p2.get_member('list_properties') # optional - polymake + sage: p1.get_member('list_properties') == p2.get_member('list_properties') # optional - jupymake False """ @@ -1037,9 +1037,9 @@ def __bool__(self): EXAMPLES:: sage: from sage.interfaces.polymake import polymake - sage: bool(polymake(0)) # optional polymake + sage: bool(polymake(0)) # optional - jupymake False - sage: bool(polymake(1)) # optional polymake + sage: bool(polymake(1)) # optional - jupymake True """ @@ -1061,23 +1061,23 @@ def known_properties(self): EXAMPLES:: - sage: c = polymake.cube(4) # optional - polymake - sage: c.known_properties() # optional - polymake + sage: c = polymake.cube(4) # optional - jupymake + sage: c.known_properties() # optional - jupymake ['AFFINE_HULL', 'BOUNDED', 'CONE_AMBIENT_DIM', 'CONE_DIM', ... 'VERTICES_IN_FACETS'] - sage: c.list_properties() # optional - polymake + sage: c.list_properties() # optional - jupymake CONE_AMBIENT_DIM, CONE_DIM, FACETS, AFFINE_HULL, VERTICES_IN_FACETS, BOUNDED... A computation can change the list of known properties:: - sage: c.F_VECTOR # optional - polymake + sage: c.F_VECTOR # optional - jupymake 16 32 24 8 - sage: c.known_properties() # optional - polymake + sage: c.known_properties() # optional - jupymake ['AFFINE_HULL', 'BOUNDED', 'COMBINATORIAL_DIM', @@ -1102,8 +1102,8 @@ def _member_list(self): TESTS:: - sage: c = polymake.cube(4) # optional - polymake - sage: c._member_list() # optional - polymake + sage: c = polymake.cube(4) # optional - jupymake + sage: c._member_list() # optional - jupymake ['AFFINE_HULL', ... 'WEAKLY_CENTERED', @@ -1130,10 +1130,10 @@ def typename(self): EXAMPLES:: - sage: c = polymake.cube(4) # optional - polymake - sage: c.typename() # optional - polymake + sage: c = polymake.cube(4) # optional - jupymake + sage: c.typename() # optional - jupymake 'Polytope' - sage: c.VERTICES.typename() # optional - polymake + sage: c.VERTICES.typename() # optional - jupymake 'Matrix' """ @@ -1149,10 +1149,10 @@ def full_typename(self): EXAMPLES:: - sage: c = polymake.cube(4) # optional - polymake - sage: c.full_typename() # optional - polymake + sage: c = polymake.cube(4) # optional - jupymake + sage: c.full_typename() # optional - jupymake 'Polytope' - sage: c.VERTICES.full_typename() # optional - polymake + sage: c.VERTICES.full_typename() # optional - jupymake 'Matrix' """ @@ -1168,10 +1168,10 @@ def qualified_typename(self): EXAMPLES:: - sage: c = polymake.cube(4) # optional - polymake - sage: c.qualified_typename() # optional - polymake + sage: c = polymake.cube(4) # optional - jupymake + sage: c.qualified_typename() # optional - jupymake 'polytope::Polytope' - sage: c.VERTICES.qualified_typename() # optional - polymake + sage: c.VERTICES.qualified_typename() # optional - jupymake 'common::Matrix' """ @@ -1196,8 +1196,8 @@ def _tab_completion(self): EXAMPLES:: - sage: c = polymake.cube(4) # optional - polymake - sage: c._tab_completion() # optional - polymake + sage: c = polymake.cube(4) # optional - jupymake + sage: c._tab_completion() # optional - jupymake ['AFFINE_HULL', ... 'zero_vector', @@ -1228,34 +1228,34 @@ def __getattr__(self, attrname): A property:: - sage: c = polymake.cube(3) # optional - polymake - sage: c.H_VECTOR # optional - polymake + sage: c = polymake.cube(3) # optional - jupymake + sage: c.H_VECTOR # optional - jupymake 1 5 5 1 - sage: c.N_VERTICES # optional - polymake + sage: c.N_VERTICES # optional - jupymake 8 - sage: d = polymake.cross(3) # optional - polymake - sage: d.N_VERTICES # optional - polymake + sage: d = polymake.cross(3) # optional - jupymake + sage: d.N_VERTICES # optional - jupymake 6 A function:: - sage: c.minkowski_sum_fukuda # optional - polymake + sage: c.minkowski_sum_fukuda # optional - jupymake minkowski_sum_fukuda (bound to Polymake::polytope::Polytope__Rational object) - sage: s = c.minkowski_sum_fukuda(d) # optional - polymake - sage: s.N_VERTICES # optional - polymake + sage: s = c.minkowski_sum_fukuda(d) # optional - jupymake + sage: s.N_VERTICES # optional - jupymake 24 - sage: s # optional - polymake + sage: s # optional - jupymake Polytope[SAGE...] A member function:: - sage: c = polymake.cube(2) # optional - polymake - sage: V = polymake.new_object('Vector', [1,0,0]) # optional - polymake - sage: V # optional - polymake + sage: c = polymake.cube(2) # optional - jupymake + sage: V = polymake.new_object('Vector', [1,0,0]) # optional - jupymake + sage: V # optional - jupymake 1 0 0 - sage: c.contains # optional - polymake + sage: c.contains # optional - jupymake Member function 'contains' of Polymake::polytope::Polytope__Rational object - sage: c.contains(V) # optional - polymake + sage: c.contains(V) # optional - jupymake true """ @@ -1284,21 +1284,21 @@ def get_member_function(self, attrname): EXAMPLES:: - sage: c = polymake.cube(2) # optional - polymake - sage: c.contains # optional - polymake + sage: c = polymake.cube(2) # optional - jupymake + sage: c.contains # optional - jupymake Member function 'contains' of Polymake::polytope::Polytope__Rational object - sage: V = polymake.new_object('Vector', [1,0,0]) # optional - polymake - sage: V # optional - polymake + sage: V = polymake.new_object('Vector', [1,0,0]) # optional - jupymake + sage: V # optional - jupymake 1 0 0 - sage: c.contains(V) # optional - polymake + sage: c.contains(V) # optional - jupymake true Whether a member function of the given name actually exists for that object will only be clear when calling it:: - sage: c.get_member_function("foo") # optional - polymake + sage: c.get_member_function("foo") # optional - jupymake Member function 'foo' of Polymake::polytope::Polytope__Rational object - sage: c.get_member_function("foo")() # optional - polymake + sage: c.get_member_function("foo")() # optional - jupymake Traceback (most recent call last): ... TypeError: Can't locate object method "foo" via package "Polymake::polytope::Polytope__Rational" @@ -1318,31 +1318,31 @@ def get_member(self, attrname): EXAMPLES:: - sage: p = polymake.rand_sphere(4, 20, seed=5) # optional - polymake + sage: p = polymake.rand_sphere(4, 20, seed=5) # optional - jupymake Normally, a property would be accessed as follows:: - sage: p.F_VECTOR # optional - polymake + sage: p.F_VECTOR # optional - jupymake 20 94 148 74 However, explicit access is possible as well:: - sage: p.get_member('F_VECTOR') # optional - polymake + sage: p.get_member('F_VECTOR') # optional - jupymake 20 94 148 74 In some cases, the explicit access works better:: - sage: p.type # optional - polymake + sage: p.type # optional - jupymake Member function 'type' of Polymake::polytope::Polytope__Rational object - sage: p.get_member('type') # optional - polymake + sage: p.get_member('type') # optional - jupymake Polytope[SAGE...] - sage: p.get_member('type').get_member('name') # optional - polymake + sage: p.get_member('type').get_member('name') # optional - jupymake Polytope Note that in the last example calling the erroneously constructed member function ``type`` still works:: - sage: p.type() # optional - polymake + sage: p.type() # optional - jupymake Polytope[SAGE...] """ @@ -1357,19 +1357,19 @@ def __getitem__(self, key): EXAMPLES:: - sage: p = polymake.rand_sphere(3, 12, seed=15) # optional - polymake - sage: p.VERTICES[3] # optional - polymake + sage: p = polymake.rand_sphere(3, 12, seed=15) # optional - jupymake + sage: p.VERTICES[3] # optional - jupymake 1 7977905618560809/18014398509481984 -1671539598851959/144115188075855872 8075083879632623/9007199254740992 - sage: p.list_properties()[2] # optional - polymake + sage: p.list_properties()[2] # optional - jupymake BOUNDED Slicing:: - sage: p.F_VECTOR[:] # optional - polymake + sage: p.F_VECTOR[:] # optional - jupymake [12, 30, 20] - sage: p.F_VECTOR[0:1] # optional - polymake + sage: p.F_VECTOR[0:1] # optional - jupymake [12] - sage: p.F_VECTOR[0:3:2] # optional - polymake + sage: p.F_VECTOR[0:3:2] # optional - jupymake [12, 20] """ P = self._check_valid() @@ -1400,8 +1400,8 @@ def __iter__(self): EXAMPLES:: - sage: p = polymake.rand_sphere(3, 12, seed=15) # optional - polymake - sage: [ x for x in p.VERTICES[3] ] # optional - polymake + sage: p = polymake.rand_sphere(3, 12, seed=15) # optional - jupymake + sage: [ x for x in p.VERTICES[3] ] # optional - jupymake [1, 7977905618560809/18014398509481984, -1671539598851959/144115188075855872, 8075083879632623/9007199254740992] """ for i in range(len(self)): @@ -1411,10 +1411,10 @@ def __len__(self): """ EXAMPLES:: - sage: p = polymake.rand_sphere(3, 12, seed=15) # optional - polymake - sage: len(p.FACETS) # optional - polymake + sage: p = polymake.rand_sphere(3, 12, seed=15) # optional - jupymake + sage: len(p.FACETS) # optional - jupymake 20 - sage: len(p.list_properties()) >= 12 # optional - polymake + sage: len(p.list_properties()) >= 12 # optional - jupymake True """ @@ -1441,19 +1441,19 @@ def typeof(self): EXAMPLES:: - sage: p = polymake.rand_sphere(3, 13, seed=12) # optional - polymake - sage: p.typeof() # optional - polymake + sage: p = polymake.rand_sphere(3, 13, seed=12) # optional - jupymake + sage: p.typeof() # optional - jupymake ('Polymake::polytope::Polytope__Rational', 'ARRAY') - sage: p.VERTICES.typeof() # optional - polymake + sage: p.VERTICES.typeof() # optional - jupymake ('Polymake::common::Matrix_A_Rational_I_NonSymmetric_Z', 'ARRAY') - sage: p.get_schedule('"F_VECTOR"').typeof() # optional - polymake + sage: p.get_schedule('"F_VECTOR"').typeof() # optional - jupymake ('Polymake::Core::Scheduler::RuleChain', 'ARRAY') On "small" objects, it just returns empty strings:: - sage: p.N_VERTICES.typeof() # optional - polymake + sage: p.N_VERTICES.typeof() # optional - jupymake ('', '') - sage: p.list_properties().typeof() # optional - polymake + sage: p.list_properties().typeof() # optional - jupymake ('', '') """ P = self._check_valid() @@ -1469,50 +1469,50 @@ def _sage_(self): EXAMPLES:: - sage: a = polymake(1/2); a # optional - polymake + sage: a = polymake(1/2); a # optional - jupymake 1/2 - sage: a.sage() # optional - polymake + sage: a.sage() # optional - jupymake 1/2 - sage: _.parent() # optional - polymake + sage: _.parent() # optional - jupymake Rational Field Quadratic extensions:: sage: K. = QuadraticField(5) - sage: polymake(K(0)).sage() # optional - polymake + sage: polymake(K(0)).sage() # optional - jupymake 0 - sage: _.parent() # optional - polymake + sage: _.parent() # optional - jupymake Rational Field - sage: polymake(sqrt5).sage() # optional - polymake + sage: polymake(sqrt5).sage() # optional - jupymake a - sage: polymake(-sqrt5).sage() # optional - polymake + sage: polymake(-sqrt5).sage() # optional - jupymake -a - sage: polymake(1/3-1/2*sqrt5).sage() # optional - polymake + sage: polymake(1/3-1/2*sqrt5).sage() # optional - jupymake -1/2*a + 1/3 - sage: polymake(-1+sqrt5).sage() # optional - polymake + sage: polymake(-1+sqrt5).sage() # optional - jupymake a - 1 Vectors:: - sage: PP = polymake.cube(3) # optional - polymake - sage: PP.F_VECTOR.sage() # optional - polymake + sage: PP = polymake.cube(3) # optional - jupymake + sage: PP.F_VECTOR.sage() # optional - jupymake (8, 12, 6) - sage: _.parent() # optional - polymake + sage: _.parent() # optional - jupymake Ambient free module of rank 3 over the principal ideal domain Integer Ring Matrices:: - sage: polymake.unit_matrix(2).sage() # optional - polymake + sage: polymake.unit_matrix(2).sage() # optional - jupymake [1 0] [0 1] - sage: _.parent() # optional - polymake + sage: _.parent() # optional - jupymake Full MatrixSpace of 2 by 2 dense matrices over Integer Ring Polytopes:: - sage: polymake.cube(3).sage() # optional - polymake + sage: polymake.cube(3).sage() # optional - jupymake A 3-dimensional polyhedron in QQ^3 defined as the convex hull of 8 vertices - sage: polymake.icosahedron().sage() # optional - polymake + sage: polymake.icosahedron().sage() # optional - jupymake A 3-dimensional polyhedron in (Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790?)^3 defined as the convex hull of 12 vertices @@ -1596,8 +1596,8 @@ def _sage_doc_(self): """ EXAMPLES:: - sage: c = polymake.cube(3) # optional - polymake - sage: print(c._sage_doc_()) # optional - polymake # random + sage: c = polymake.cube(3) # optional - jupymake + sage: print(c._sage_doc_()) # optional - jupymake # random objects/Polytope: Not necessarily bounded or unbounded polyhedron. Nonetheless, the name "Polytope" is used for two reasons: @@ -1609,7 +1609,7 @@ def _sage_doc_(self): objects/Polytope/specializations/Polytope: A rational polyhedron realized in Q^d - sage: print(c.FACETS._sage_doc_()) # optional - polymake # random + sage: print(c.FACETS._sage_doc_()) # optional - jupymake # random property_types/Algebraic Types/SparseMatrix: A SparseMatrix is a two-dimensional associative array with row and column indices as keys; elements equal to the default value (ElementType(), which is 0 for most numerical types) are not stored, but implicitly encoded by the gaps in the key set. Each row and column is organized as an AVL-tree. @@ -1669,13 +1669,13 @@ class PolymakeFunctionElement(InterfaceFunctionElement): EXAMPLES:: - sage: c = polymake.cube(2) # optional - polymake - sage: V = polymake.new_object('Vector', [1,0,0]) # optional - polymake - sage: V # optional - polymake + sage: c = polymake.cube(2) # optional - jupymake + sage: V = polymake.new_object('Vector', [1,0,0]) # optional - jupymake + sage: V # optional - jupymake 1 0 0 - sage: c.contains # optional - polymake + sage: c.contains # optional - jupymake Member function 'contains' of Polymake::polytope::Polytope__Rational object - sage: c.contains(V) # optional - polymake + sage: c.contains(V) # optional - jupymake true """ @@ -1691,10 +1691,10 @@ def __init__(self, obj, name, memberfunction=False): EXAMPLES:: - sage: p = polymake.rand_sphere(3, 13, seed=12) # optional - polymake - sage: p.minkowski_sum_fukuda # optional - polymake + sage: p = polymake.rand_sphere(3, 13, seed=12) # optional - jupymake + sage: p.minkowski_sum_fukuda # optional - jupymake minkowski_sum_fukuda (bound to Polymake::polytope::Polytope__Rational object) - sage: p.get_schedule # optional - polymake + sage: p.get_schedule # optional - jupymake Member function 'get_schedule' of Polymake::polytope::Polytope__Rational object """ @@ -1706,10 +1706,10 @@ def _repr_(self): """ EXAMPLES:: - sage: p = polymake.rand_sphere(3, 13, seed=12) # optional - polymake - sage: p.minkowski_sum_fukuda # optional - polymake + sage: p = polymake.rand_sphere(3, 13, seed=12) # optional - jupymake + sage: p.minkowski_sum_fukuda # optional - jupymake minkowski_sum_fukuda (bound to Polymake::polytope::Polytope__Rational object) - sage: p.contains # optional - polymake + sage: p.contains # optional - jupymake Member function 'contains' of Polymake::polytope::Polytope__Rational object """ @@ -1724,11 +1724,11 @@ def __call__(self, *args, **kwds): We consider both member functions of an element and global functions bound to an element:: - sage: p = polymake.rand_sphere(3, 13, seed=12) # optional - polymake - sage: p.get_schedule('"VERTICES"') # optional - polymake # random + sage: p = polymake.rand_sphere(3, 13, seed=12) # optional - jupymake + sage: p.get_schedule('"VERTICES"') # optional - jupymake # random sensitivity check for VertexPerm cdd.convex_hull.canon: POINTED, RAYS, LINEALITY_SPACE : INPUT_RAYS - sage: p.minkowski_sum_fukuda(p).F_VECTOR # optional - polymake # not tested + sage: p.minkowski_sum_fukuda(p).F_VECTOR # optional - jupymake # not tested 13 33 22 """ @@ -1747,8 +1747,8 @@ def _sage_doc_(self): EXAMPLES:: - sage: p = polymake.rand_sphere(3, 13, seed=12) # optional - polymake - sage: print(p.get_schedule._sage_doc_()) # optional - polymake # random + sage: p = polymake.rand_sphere(3, 13, seed=12) # optional - jupymake + sage: print(p.get_schedule._sage_doc_()) # optional - jupymake # random objects/Core::Object/methods/get_schedule: get_schedule(request; ... ) -> Core::RuleChain @@ -1764,7 +1764,7 @@ def _sage_doc_(self): Several requests may be listed. Returns Core::RuleChain - sage: print(p.minkowski_sum_fukuda._sage_doc_()) # optional - polymake # random + sage: print(p.minkowski_sum_fukuda._sage_doc_()) # optional - jupymake # random functions/Producing a polytope from polytopes/minkowski_sum_fukuda: minkowski_sum_fukuda(summands) -> Polytope diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx index 287d58886d4..1f109a2e3cc 100644 --- a/src/sage/matrix/matrix1.pyx +++ b/src/sage/matrix/matrix1.pyx @@ -404,12 +404,12 @@ cdef class Matrix(Matrix0): EXAMPLES:: sage: M = matrix(ZZ,2,range(4)) - sage: polymake(M) # optional - polymake + sage: polymake(M) # optional - jupymake 0 1 2 3 sage: K. = QuadraticField(5) sage: M = matrix(K, [[1, 2], [sqrt5, 3]]) - sage: polymake(M) # optional - polymake + sage: polymake(M) # optional - jupymake 1 2 0+1r5 3 """ diff --git a/src/sage/matrix/matrix_space.py b/src/sage/matrix/matrix_space.py index c29bcc64260..0a76510a895 100644 --- a/src/sage/matrix/matrix_space.py +++ b/src/sage/matrix/matrix_space.py @@ -2338,9 +2338,9 @@ def _polymake_init_(self): EXAMPLES:: - sage: polymake(MatrixSpace(QQ,3)) # optional - polymake + sage: polymake(MatrixSpace(QQ,3)) # optional - jupymake Matrix - sage: polymake(MatrixSpace(QuadraticField(5),3)) # optional - polymake + sage: polymake(MatrixSpace(QuadraticField(5),3)) # optional - jupymake Matrix """ from sage.interfaces.polymake import polymake diff --git a/src/sage/rings/integer_ring.pyx b/src/sage/rings/integer_ring.pyx index 889a16295a7..7ba77ca2aa2 100644 --- a/src/sage/rings/integer_ring.pyx +++ b/src/sage/rings/integer_ring.pyx @@ -1506,7 +1506,7 @@ cdef class IntegerRing_class(PrincipalIdealDomain): EXAMPLES:: - sage: polymake(ZZ) # optional - polymake # indirect doctest + sage: polymake(ZZ) # optional - jupymake # indirect doctest Integer """ diff --git a/src/sage/rings/number_field/number_field.py b/src/sage/rings/number_field/number_field.py index 66dddb5597e..330afb77af5 100644 --- a/src/sage/rings/number_field/number_field.py +++ b/src/sage/rings/number_field/number_field.py @@ -11957,7 +11957,7 @@ def _polymake_init_(self): EXAMPLES:: sage: Z = QuadraticField(7) - sage: polymake(Z) # optional - polymake # indirect doctest + sage: polymake(Z) # optional - jupymake # indirect doctest QuadraticExtension """ diff --git a/src/sage/rings/number_field/number_field_element_quadratic.pyx b/src/sage/rings/number_field/number_field_element_quadratic.pyx index 0cea74a50eb..24fc7db909e 100644 --- a/src/sage/rings/number_field/number_field_element_quadratic.pyx +++ b/src/sage/rings/number_field/number_field_element_quadratic.pyx @@ -314,12 +314,12 @@ cdef class NumberFieldElement_quadratic(NumberFieldElement_absolute): EXAMPLES:: sage: K. = QuadraticField(5) - sage: polymake(3+2*sqrt5) # optional - polymake + sage: polymake(3+2*sqrt5) # optional - jupymake 3+2r5 - sage: polymake(2**100/7 - 2*sqrt5/3**50) # optional - polymake + sage: polymake(2**100/7 - 2*sqrt5/3**50) # optional - jupymake 1267650600228229401496703205376/7-2/717897987691852588770249r5 sage: K. = QuadraticField(-1) - sage: polymake(i) # optional - polymake + sage: polymake(i) # optional - jupymake Traceback (most recent call last): ... TypeError: Negative values for the root of the extension ... Bad Thing... @@ -331,9 +331,9 @@ cdef class NumberFieldElement_quadratic(NumberFieldElement_absolute): sage: x = polygen(QQ, 'x') sage: K = NumberField(x^2 - x -1, 'a', embedding=(1-AA(5).sqrt())/2) sage: L = NumberField(x^2 - x -1, 'a', embedding=(1+AA(5).sqrt())/2) - sage: polymake(K.gen()) # optional - polymake + sage: polymake(K.gen()) # optional - jupymake 1/2-1/2r5 - sage: polymake(L.gen()) # optional - polymake + sage: polymake(L.gen()) # optional - jupymake 1/2+1/2r5 """ cdef Integer a = Integer.__new__(Integer) diff --git a/src/sage/rings/rational_field.py b/src/sage/rings/rational_field.py index ca84b20e165..55e7a46319d 100644 --- a/src/sage/rings/rational_field.py +++ b/src/sage/rings/rational_field.py @@ -1575,7 +1575,7 @@ def _polymake_init_(self): EXAMPLES:: - sage: polymake(QQ) #optional - polymake # indirect doctest + sage: polymake(QQ) #optional - jupymake # indirect doctest Rational """ diff --git a/src/sage/rings/real_double.pyx b/src/sage/rings/real_double.pyx index c641eb3f710..fa121ddf547 100644 --- a/src/sage/rings/real_double.pyx +++ b/src/sage/rings/real_double.pyx @@ -421,7 +421,7 @@ cdef class RealDoubleField_class(sage.rings.abc.RealDoubleField): EXAMPLES:: - sage: polymake(RDF) #optional - polymake # indirect doctest + sage: polymake(RDF) #optional - jupymake # indirect doctest Float """ return '"Float"'