@@ -91,7 +91,7 @@ and some rays.
9191
9292::
9393
94-     sage: P1 = Polyhedron(vertices =  [[1, 0], [0, 1]], rays =  [[1, 1]]) 
94+     sage: P1 = Polyhedron(vertices= [[1, 0], [0, 1]], rays= [[1, 1]]) 
9595    sage: P1 
9696    A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 2 vertices and 1 ray 
9797
@@ -118,9 +118,9 @@ We can also add a lineality space.
118118
119119::
120120
121-     sage: P2 = Polyhedron(vertices =  [[1/2, 0, 0], [0, 1/2, 0]], 
122-     ....:                 rays =  [[1, 1, 0]], 
123-     ....:                 lines =  [[0, 0, 1]]) 
121+     sage: P2 = Polyhedron(vertices= [[1/2, 0, 0], [0, 1/2, 0]], 
122+     ....:                 rays= [[1, 1, 0]], 
123+     ....:                 lines= [[0, 0, 1]]) 
124124    sage: P2 
125125    A 3-dimensional polyhedron in QQ^3 defined as the convex hull of 2 vertices, 1 ray, 1 line 
126126    sage: P2.plot() 
@@ -144,7 +144,7 @@ The chosen ring depends on the input format.
144144
145145::
146146
147-     sage: P3 = Polyhedron(vertices =  [[0.5, 0], [0, 0.5]]) 
147+     sage: P3 = Polyhedron(vertices= [[0.5, 0], [0, 0.5]]) 
148148    sage: P3 
149149    A 1-dimensional polyhedron in RDF^2 defined as the convex hull of 2 vertices 
150150    sage: P3.parent() 
@@ -163,22 +163,22 @@ The following example demonstrates the limitations of :code:`RDF`.
163163
164164::
165165
166-     sage: D = polytopes.dodecahedron()                                        # optional -  sage.rings.number_field 
167-     sage: D                                                                   # optional -  sage.rings.number_field 
166+     sage: D = polytopes.dodecahedron()                                                  # needs  sage.rings.number_field 
167+     sage: D                                                                             # needs  sage.rings.number_field 
168168    A 3-dimensional polyhedron 
169169     in (Number Field in sqrt5 with defining polynomial x^2 - 5 
170170         with sqrt5 = 2.236067977499790?)^3 
171171     defined as the convex hull of 20 vertices 
172172
173-     sage: vertices_RDF = [n(v.vector(),digits=6) for v in D.vertices()]       # optional -  sage.rings.number_field 
174-     sage: D_RDF = Polyhedron(vertices=vertices_RDF, base_ring=RDF)            # optional -  sage.rings.number_field 
173+     sage: vertices_RDF = [n(v.vector(),digits=6) for v in D.vertices()]                 # needs  sage.rings.number_field 
174+     sage: D_RDF = Polyhedron(vertices=vertices_RDF, base_ring=RDF)                      # needs  sage.rings.number_field 
175175    doctest:warning 
176176    ... 
177177    UserWarning: This polyhedron data is numerically complicated; cdd 
178178    could not convert between the inexact V and H representation 
179179    without loss of data. The resulting object might show 
180180    inconsistencies. 
181-     sage: D_RDF = Polyhedron(vertices=sorted(vertices_RDF), base_ring=RDF)    # optional -  sage.rings.number_field 
181+     sage: D_RDF = Polyhedron(vertices=sorted(vertices_RDF), base_ring=RDF)              # needs  sage.rings.number_field 
182182    Traceback (most recent call last): 
183183    ... 
184184    ValueError: *Error: Numerical inconsistency is found.  Use the GMP exact arithmetic. 
@@ -199,11 +199,12 @@ It is also possible to define a polyhedron over algebraic numbers.
199199
200200::
201201
202-     sage: sqrt_2 = AA(2)^(1/2)                                                # optional - sage.rings.number_field 
203-     sage: cbrt_2 = AA(2)^(1/3)                                                # optional - sage.rings.number_field 
204-     sage: timeit('Polyhedron(vertices = [[sqrt_2, 0], [0, cbrt_2]])')         # optional - sage.rings.number_field  # random 
202+     sage: # needs sage.rings.number_field 
203+     sage: sqrt_2 = AA(2)^(1/2) 
204+     sage: cbrt_2 = AA(2)^(1/3) 
205+     sage: timeit('Polyhedron(vertices=[[sqrt_2, 0], [0, cbrt_2]])')     # random 
205206    5 loops, best of 3: 43.2 ms per loop 
206-     sage: P4 = Polyhedron(vertices =  [[sqrt_2, 0], [0, cbrt_2]]); P4          # optional - sage.rings.number_field  
207+     sage: P4 = Polyhedron(vertices= [[sqrt_2, 0], [0, cbrt_2]]); P4 
207208    A 1-dimensional polyhedron in AA^2 defined as the convex hull of 2 vertices 
208209
209210..  end of output
@@ -212,11 +213,12 @@ There is another way to create a polyhedron over algebraic numbers:
212213
213214::
214215
215-     sage: K.<a> = NumberField(x^2 - 2, embedding=AA(2)**(1/2))                # optional - sage.rings.number_field 
216-     sage: L.<b> = NumberField(x^3 - 2, embedding=AA(2)**(1/3))                # optional - sage.rings.number_field 
217-     sage: timeit('Polyhedron(vertices = [[a, 0], [0, b]])')                   # optional - sage.rings.number_field  # random 
216+     sage: # needs sage.rings.number_field 
217+     sage: K.<a> = NumberField(x^2 - 2, embedding=AA(2)**(1/2)) 
218+     sage: L.<b> = NumberField(x^3 - 2, embedding=AA(2)**(1/3)) 
219+     sage: timeit('Polyhedron(vertices=[[a, 0], [0, b]])')               # random 
218220    5 loops, best of 3: 39.9 ms per loop 
219-     sage: P5 = Polyhedron(vertices =  [[a, 0], [0, b]]); P5                    # optional - sage.rings.number_field  
221+     sage: P5 = Polyhedron(vertices= [[a, 0], [0, b]]); P5 
220222    A 1-dimensional polyhedron in AA^2 defined as the convex hull of 2 vertices 
221223
222224..  end of output
@@ -225,10 +227,11 @@ If the base ring is known it may be a good option to use the proper :meth:`sage.
225227
226228::
227229
228-     sage: J = K.composite_fields(L)[0]                                        # optional - sage.rings.number_field 
229-     sage: timeit('Polyhedron(vertices = [[J(a), 0], [0, J(b)]])')             # optional - sage.rings.number_field  # random 
230+     sage: # needs sage.rings.number_field 
231+     sage: J = K.composite_fields(L)[0] 
232+     sage: timeit('Polyhedron(vertices=[[J(a), 0], [0, J(b)]])')         # random 
230233    25 loops, best of 3: 9.8 ms per loop 
231-     sage: P5_comp = Polyhedron(vertices =  [[J(a), 0], [0, J(b)]]); P5_comp    # optional - sage.rings.number_field  
234+     sage: P5_comp = Polyhedron(vertices= [[J(a), 0], [0, J(b)]]); P5_comp 
232235    A 1-dimensional polyhedron 
233236     in (Number Field in ab with defining polynomial 
234237         x^6 - 6*x^4 - 4*x^3 + 12*x^2 - 24*x - 4 
@@ -242,9 +245,9 @@ It is not possible to define a polyhedron over it:
242245
243246::
244247
245-     sage: sqrt_2s = sqrt(2)                                                   # optional -  sage.symbolic 
246-     sage: cbrt_2s = 2^(1/3)                                                   # optional -  sage.symbolic 
247-     sage: Polyhedron(vertices =  [[sqrt_2s, 0], [0, cbrt_2s]])                 # optional -  sage.symbolic 
248+     sage: sqrt_2s = sqrt(2)                                                             # needs  sage.symbolic 
249+     sage: cbrt_2s = 2^(1/3)                                                             # needs  sage.symbolic 
250+     sage: Polyhedron(vertices= [[sqrt_2s, 0], [0, cbrt_2s]])                             # needs  sage.symbolic 
248251    Traceback (most recent call last): 
249252    ... 
250253    ValueError: no default backend for computations with Symbolic Ring 
@@ -389,7 +392,7 @@ inequalities and equalities as objects.
389392
390393::
391394
392-     sage: P3_QQ = Polyhedron(vertices =  [[0.5, 0], [0, 0.5]], base_ring=QQ) 
395+     sage: P3_QQ = Polyhedron(vertices= [[0.5, 0], [0, 0.5]], base_ring=QQ) 
393396    sage: HRep = P3_QQ.Hrepresentation() 
394397    sage: H1 = HRep[0]; H1 
395398    An equation (2, 2) x - 1 == 0 
@@ -527,7 +530,7 @@ In order to use a specific backend, we specify the :code:`backend` parameter.
527530
528531::
529532
530-     sage: P1_cdd = Polyhedron(vertices =  [[1, 0], [0, 1]], rays =  [[1, 1]], backend='cdd') 
533+     sage: P1_cdd = Polyhedron(vertices= [[1, 0], [0, 1]], rays= [[1, 1]], backend='cdd') 
531534    sage: P1_cdd 
532535    A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 2 vertices and 1 ray 
533536
@@ -567,7 +570,7 @@ The :code:`cdd` backend accepts also entries in :code:`RDF`:
567570
568571::
569572
570-     sage: P3_cdd = Polyhedron(vertices =  [[0.5, 0], [0, 0.5]], backend='cdd') 
573+     sage: P3_cdd = Polyhedron(vertices= [[0.5, 0], [0, 0.5]], backend='cdd') 
571574    sage: P3_cdd 
572575    A 1-dimensional polyhedron in RDF^2 defined as the convex hull of 2 vertices 
573576
@@ -577,12 +580,12 @@ but not algebraic or symbolic values:
577580
578581::
579582
580-     sage: P4_cdd = Polyhedron(vertices =  [[sqrt_2, 0], [0, cbrt_2]], backend='cdd')            # optional -  sage.rings.number_field 
583+     sage: P4_cdd = Polyhedron(vertices= [[sqrt_2, 0], [0, cbrt_2]], backend='cdd')       # needs  sage.rings.number_field 
581584    Traceback (most recent call last): 
582585    ... 
583586    ValueError: No such backend (=cdd) implemented for given basering (=Algebraic Real Field). 
584587
585-     sage: P5_cdd = Polyhedron(vertices =  [[sqrt_2s, 0], [0, cbrt_2s]], backend='cdd')          # optional -  sage.symbolic 
588+     sage: P5_cdd = Polyhedron(vertices= [[sqrt_2s, 0], [0, cbrt_2s]], backend='cdd')     # needs  sage.symbolic 
586589    Traceback (most recent call last): 
587590    ... 
588591    ValueError: No such backend (=cdd) implemented for given basering (=Symbolic Ring). 
@@ -656,8 +659,8 @@ An example with quadratic field:
656659
657660::
658661
659-     sage: V = polytopes.dodecahedron().vertices_list()                                    # optional -  sage.rings.number_field 
660-     sage: Polyhedron(vertices=V, backend='polymake')                # optional - jupymake  # optional -  sage.rings.number_field 
662+     sage: V = polytopes.dodecahedron().vertices_list()                                  # needs  sage.rings.number_field 
663+     sage: Polyhedron(vertices=V, backend='polymake')    # optional - jupymake            # needs  sage.rings.number_field 
661664    A 3-dimensional polyhedron 
662665     in (Number Field in sqrt5 with defining polynomial x^2 - 5 
663666     with sqrt5 = 2.236067977499790?)^3 
@@ -681,7 +684,7 @@ examples.
681684
682685::
683686
684-     sage: type(D)                                                                         # optional -  sage.rings.number_field 
687+     sage: type(D)                                                                       # needs  sage.rings.number_field 
685688    <class 'sage.geometry.polyhedron.parent.Polyhedra_field_with_category.element_class'> 
686689
687690..  end of output
@@ -691,13 +694,14 @@ backend :code:`field` is called.
691694
692695::
693696
694-     sage: P4.parent()                                                                     # optional - sage.rings.number_field 
697+     sage: # needs sage.rings.number_field 
698+     sage: P4.parent() 
695699    Polyhedra in AA^2 
696-     sage: P5.parent()                                                                     # optional - sage.rings.number_field  
700+     sage: P5.parent() 
697701    Polyhedra in AA^2 
698-     sage: type(P4)                                                                        # optional - sage.rings.number_field  
702+     sage: type(P4) 
699703    <class 'sage.geometry.polyhedron.parent.Polyhedra_field_with_category.element_class'> 
700-     sage: type(P5)                                                                        # optional - sage.rings.number_field  
704+     sage: type(P5) 
701705    <class 'sage.geometry.polyhedron.parent.Polyhedra_field_with_category.element_class'> 
702706
703707..  end of output
@@ -709,13 +713,15 @@ The fourth backend is :code:`normaliz` and is an optional Sage package.
709713
710714::
711715
712-     sage: P1_normaliz = Polyhedron(vertices = [[1, 0], [0, 1]], rays = [[1, 1]], backend='normaliz')  # optional - pynormaliz 
713-     sage: type(P1_normaliz)                                                                           # optional - pynormaliz 
716+     sage: # optional - pynormaliz 
717+     sage: P1_normaliz = Polyhedron(vertices=[[1, 0], [0, 1]], rays=[[1, 1]], 
718+     ....:                          backend='normaliz') 
719+     sage: type(P1_normaliz) 
714720    <class 'sage.geometry.polyhedron.parent.Polyhedra_QQ_normaliz_with_category.element_class'> 
715-     sage: P2_normaliz = Polyhedron(vertices =  [[1/2, 0, 0], [0, 1/2, 0]],                             # optional - pynormaliz  
716-     ....:                 rays =  [[1, 1, 0]], 
717-     ....:                 lines =  [[0, 0, 1]], backend='normaliz') 
718-     sage: type(P2_normaliz)                                                                           # optional - pynormaliz  
721+     sage: P2_normaliz = Polyhedron(vertices= [[1/2, 0, 0], [0, 1/2, 0]], 
722+     ....:                          rays= [[1, 1, 0]], 
723+     ....:                          lines= [[0, 0, 1]], backend='normaliz') 
724+     sage: type(P2_normaliz) 
719725    <class 'sage.geometry.polyhedron.parent.Polyhedra_QQ_normaliz_with_category.element_class'> 
720726
721727..  end of output
@@ -724,7 +730,7 @@ This backend does not work with :code:`RDF` or other inexact fields.
724730
725731::
726732
727-     sage: P3_normaliz = Polyhedron(vertices =  [[0.5, 0], [0, 0.5]], backend='normaliz')              # optional - pynormaliz 
733+     sage: P3_normaliz = Polyhedron(vertices= [[0.5, 0], [0, 0.5]], backend='normaliz')   # optional - pynormaliz 
728734    Traceback (most recent call last): 
729735    ... 
730736    ValueError: No such backend (=normaliz) implemented for given basering (=Real Double Field). 
@@ -738,12 +744,14 @@ the computation is done using an embedded number field.
738744
739745::
740746
741-     sage: P4_normaliz = Polyhedron(vertices = [[sqrt_2, 0], [0, cbrt_2]], backend='normaliz')       # optional - pynormaliz 
742-     sage: P4_normaliz                                                                               # optional - pynormaliz 
747+     sage: # optional - pynormaliz 
748+     sage: P4_normaliz = Polyhedron(vertices=[[sqrt_2, 0], [0, cbrt_2]], 
749+     ....:                          backend='normaliz') 
750+     sage: P4_normaliz 
743751    A 1-dimensional polyhedron in AA^2 defined as the convex hull of 2 vertices 
744- 
745-     sage: P5_normaliz = Polyhedron(vertices = [[sqrt_2s, 0], [0, cbrt_2s]], backend='normaliz')      # optional - pynormaliz  
746-     sage: P5_normaliz                                                                               # optional - pynormaliz  
752+     sage: P5_normaliz = Polyhedron(vertices=[[sqrt_2s, 0], [0, cbrt_2s]], 
753+     ....:                           backend='normaliz')  
754+     sage: P5_normaliz 
747755    A 1-dimensional polyhedron in (Symbolic Ring)^2 defined as the convex hull of 2 vertices 
748756
749757..  end of output
@@ -753,12 +761,14 @@ The backend :code:`normaliz` provides other methods such as
753761
754762::
755763
756-     sage: P6 = Polyhedron(vertices = [[0, 0], [3/2, 0], [3/2, 3/2], [0, 3]], backend='normaliz')  # optional - pynormaliz 
757-     sage: IH = P6.integral_hull(); IH                                                             # optional - pynormaliz 
764+     sage: # optional - pynormaliz 
765+     sage: P6 = Polyhedron(vertices=[[0, 0], [3/2, 0], [3/2, 3/2], [0, 3]], 
766+     ....:                 backend='normaliz') 
767+     sage: IH = P6.integral_hull(); IH 
758768    A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 4 vertices 
759-     sage: P6.plot(color='blue')+ IH.plot(color='red')                                              # optional - pynormaliz  
769+     sage: P6.plot(color='blue') +  IH.plot(color='red') 
760770    Graphics object consisting of 12 graphics primitives 
761-     sage: P1_normaliz.integral_hull()                                                             # optional - pynormaliz  
771+     sage: P1_normaliz.integral_hull() 
762772    A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 2 vertices and 1 ray 
763773
764774..  end of output
@@ -788,7 +798,7 @@ polytope is already defined!
788798
789799::
790800
791-     sage: A = polytopes.buckyball(); A  # can take long                       # optional -  sage.rings.number_field 
801+     sage: A = polytopes.buckyball(); A  # can take long                                 # needs  sage.rings.number_field 
792802    A 3-dimensional polyhedron 
793803     in (Number Field in sqrt5 with defining polynomial x^2 - 5 
794804         with sqrt5 = 2.236067977499790?)^3 
0 commit comments