ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 26 Jun 2023 07:10:33 +0200hyperplane arrangement algorithm and complexityhttps://ask.sagemath.org/question/69506/hyperplane-arrangement-algorithm-and-complexity/ Hi there,
I wonder what kind of the algorithm the hyperplane arrangement algorithm is using and what's the complexity with regarding to the number of hyperplanes. Specifically, the bounded_region method. Suppose we are in d-dimension with n hyperplanes.
I check the source code and can only find
" This module implements hyperplane arrangements defined over the
rationals or over finite fields. The original motivation was to make
a companion to Richard Stanley's notes [Sta2007]_ on hyperplane
arrangements."
Thanks so much for your time and help!Wings6796Mon, 26 Jun 2023 07:10:33 +0200https://ask.sagemath.org/question/69506/How can I create a hyperplane arrangement within a finite region?https://ask.sagemath.org/question/68723/how-can-i-create-a-hyperplane-arrangement-within-a-finite-region/ Hi, I want to create a hyperplane arrangement within a finite region. For example, within the region defined by x > 0, y > 0, and x + y <= 1, I want to create an arrangement of hyperplanes x + 2y = 0 and x + 3y = 0. I haven't found information on how to achieve this. Can you provide guidance on how to do it?NorahThu, 25 May 2023 14:36:25 +0200https://ask.sagemath.org/question/68723/Equation for hyperplane of a reflection - Try to do TODO on reflection group sage pagehttps://ask.sagemath.org/question/61105/equation-for-hyperplane-of-a-reflection-try-to-do-todo-on-reflection-group-sage-page/Hello everyone, I hope you are well.
I'm working with finite complex reflection group. And I'm having a hard time getting the equation of a given hyperplane of a reflection.
First: a reflection $r$ is a map onto a finite-dimensional vector space $V$
so that $\dim \operatorname{fix} r = \dim V - 1$.
Second: a reflection group is a group generated by such reflections.
Third: A hyperplane is the eigenspace associated with the eigenvalue $1$ of $r$,
that is, vectors of the form $r(v) = v$.
Sage has a function called `reflection_hyperplanes()`
which returns all hyperplanes of a given group.
And it also has the `reflection_hyperplane(i)` function
that returns the i-th hyperplane of the group in question.
But the idea is to be able to associate each reflection
with its respective hyperplane.
My attempt: At first given a reflection `r` we use `r.to_matrix()`
to transform `r` into a matrix. The idea would be to have a function
that returns the hyperplane of `r`. But `r` belongs
in a different class from matrices.
Is it possible to create a function that makes `r.to_matrix()`
a de facto matrix and that manages to return the equation
of the respective hyperplane of r?
Thank you for your attention.
Note: This issue refers to TODO (linear forms for hyperplanes) at
- [SageMath documentation: Finite complex reflection groups](https://doc.sagemath.org/html/en/reference/combinat/sage/combinat/root_system/reflection_group_complex.html)rafaelTue, 15 Feb 2022 05:16:36 +0100https://ask.sagemath.org/question/61105/Ranging the Z axishttps://ask.sagemath.org/question/55355/ranging-the-z-axis/I am plotting arrangements of hyperplanes. Like this one:
H3.<x, y, z> = HyperplaneArrangements(QQ)
A = H3([(1, 2, 1), 0],
[(-4, -3, -2), 0],
[(3, 3, -2), 0],
[(1, -4, 3), 0],
[(-2, 2, 1), 0])
A.plot(ranges=[(-1, 1), (-1, 1)], aspect_ratio=(1, 1, 0.25))
![Hyperplane arrangement](/upfiles/16110758982120743.png)
The problem is I need the z axis to range from -1 to 1 rather than from -4 to 4.
Is there a way to change that?LarsTue, 19 Jan 2021 15:36:01 +0100https://ask.sagemath.org/question/55355/Systematically outputting sign vectors of restricted hyperplane arrangementhttps://ask.sagemath.org/question/50139/systematically-outputting-sign-vectors-of-restricted-hyperplane-arrangement/ I have a way of constructing hyperplane arrangements, which involves taking the restriction of a larger arrangement to one of the hyperplanes in it. I want to output a list of the sign vectors of the regions of this arrangement, where the order of the coordinates in the sign vector corresponds to a specific order I want to impose on the hyperplanes. This has turned out surprisingly tricky, because of a couple of seemingly arbitrary decisions Sage's hyperplane arrangement package makes:
- The hyperplane arrangement constructor seems to not preserve the order of the hyperplanes fed into it, so if I just run the built-in sign_vector method, the coordinates of the resulting vectors may be rearranged from how I want them.
- On the other hand, I'm not sure how to go about manually determining the sign vector, because I'm not sure how Sage decides to coordinatize the hyperplanes in the restricted arrangement. So while I have equations for the hyperplanes in the original ambient space, I'm not sure how I could automatically turn them into equations in the hyperplane I'm restricting to.
Does anyone have advice on how to systematically resolve either of these arbitrary decisions, or how to find a different workaround?Will DanaMon, 02 Mar 2020 18:41:23 +0100https://ask.sagemath.org/question/50139/Export a Plot as Tikz to Latexhttps://ask.sagemath.org/question/55592/export-a-plot-as-tikz-to-latex/Hello,
a couple of days ago I drew a Polyhedra in sage cell Server and exported it as a Tikz file.
like this:
P1 = Polyhedron(vertices = [[0,0,0], [1,2,1], [-4,-3,-2],[3,3,-2],[1,-4,3],[-2,2,1]])
P1.tikz([-0.0946,-0.4796,-0.8724],160.47, axis=true, opacity=0.25)
Now I got an Arrangement of Hyperplanes like:
H3.<x,y,z> = HyperplaneArrangements(QQ)
A = H3([(1,2,1), 0], [(-4,-3,-2), 0],[(3,3,-2), 0], [(1,-4,3), 0],[(-2,2,1), 0])
that I want to export as a Tikz file but it seems that this is not possible. Or am I just doesnt find it?
Anyone there that can maybe help me?
Best regards
Lars KrollLarsFri, 05 Feb 2021 22:27:03 +0100https://ask.sagemath.org/question/55592/hyperplane arrangements raises error on regionshttps://ask.sagemath.org/question/49755/hyperplane-arrangements-raises-error-on-regions/Dear all,
When computing the regions of a hyperplane arrangements, it fails and raises the following:
ValueError: *Input Error: Input format is not correct.
*Format:
begin
m n NumberType(real, rational or integer)
b -A
end
Yet when running the command vertices, it computes it which is confusing!
The full code is:
P = [[-0.48, 0.83], [-5.33, 9.23]]
Q = [[0.43, 0. ], [9.04, 0. ]]
Z = [[-0.35, -0.60], [-1.44, -2.49]]
V = VoronoiDiagram(P)
R = [r for r in V.regions().items()]
s = R[0][1].hyperplane_arrangement()
V = VoronoiDiagram(Q)
R = [r for r in V.regions().items()]
s = s.add_hyperplane(R[0][1].hyperplane_arrangement())
V = VoronoiDiagram(Z)
R = [r for r in V.regions().items()]
s = s.add_hyperplane(R[0][1].hyperplane_arrangement())
s.regions()
How can I overcome this eerie bug?
This means that there is an intersection but the sage cant attain the regions which is weird as stated before!
P.s. The full traceback:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-6-4ba993d8025f> in <module>()
----> 1 s.regions()
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/misc/cachefunc.pyx in sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__ (build/cythonized/sage/misc/cachefunc.c:12712)()
2308 if self.cache is None:
2309 f = self.f
-> 2310 self.cache = f(self._instance)
2311 return self.cache
2312
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/geometry/hyperplane_arrangement/arrangement.py in regions(self)
1608 R = self.base_ring()
1609 dim = self.dimension()
-> 1610 universe = Polyhedron(eqns=[[0] + [0] * dim], base_ring=R)
1611 regions = [universe]
1612 for hyperplane in self:
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/geometry/polyhedron/constructor.py in Polyhedron(vertices, rays, lines, ieqs, eqns, ambient_dim, base_ring, minimize, verbose, backend)
660 if got_Vrep:
661 Vrep = [vertices, rays, lines]
--> 662 return parent(Vrep, Hrep, convert=convert, verbose=verbose)
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/structure/parent.pyx in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9245)()
900 return mor._call_(x)
901 else:
--> 902 return mor._call_with_args(x, args, kwds)
903
904 raise TypeError(_LazyString(_lazy_format, ("No conversion defined from %s to %s", R, self), {}))
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/structure/coerce_maps.pyx in sage.structure.coerce_maps.DefaultConvertMap_unique._call_with_args (build/cythonized/sage/structure/coerce_maps.c:5081)()
178 print(type(C), C)
179 print(type(C._element_constructor), C._element_constructor)
--> 180 raise
181
182
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/structure/coerce_maps.pyx in sage.structure.coerce_maps.DefaultConvertMap_unique._call_with_args (build/cythonized/sage/structure/coerce_maps.c:4969)()
173 return C._element_constructor(x, *args)
174 else:
--> 175 return C._element_constructor(x, *args, **kwds)
176 except Exception:
177 if print_warnings:
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/geometry/polyhedron/parent.py in _element_constructor_(self, *args, **kwds)
523 if convert and Vrep:
524 Vrep = [convert_base_ring(_) for _ in Vrep]
--> 525 return self.element_class(self, Vrep, Hrep, **kwds)
526 if nargs == 1 and is_Polyhedron(args[0]):
527 polyhedron = args[0]
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/geometry/polyhedron/backend_cdd.py in __init__(self, parent, Vrep, Hrep, **kwds)
459 sage: TestSuite(p).run()
460 """
--> 461 Polyhedron_cdd.__init__(self, parent, Vrep, Hrep, **kwds)
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/geometry/polyhedron/base.py in __init__(self, parent, Vrep, Hrep, **kwds)
125 elif Hrep is not None:
126 ieqs, eqns = Hrep
--> 127 self._init_from_Hrepresentation(ieqs, eqns, **kwds)
128 else:
129 self._init_empty_polyhedron()
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/geometry/polyhedron/backend_cdd.py in _init_from_Hrepresentation(self, ieqs, eqns, verbose)
114 s = cdd_Hrepresentation(self._cdd_type, ieqs, eqns)
115 s = self._run_cdd(s, '--redcheck', verbose=verbose)
--> 116 s = self._run_cdd(s, '--repall', verbose=verbose)
117 self._init_from_cdd_output(s)
118 if not self.base_ring().is_exact():
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/geometry/polyhedron/backend_cdd.py in _run_cdd(self, cdd_input_string, cmdline_arg, verbose)
163 if 'Error:' in ans + err:
164 # cdd reports errors on stdout and misc information on stderr
--> 165 raise ValueError(ans.strip())
166 return ans
167
ValueError: *Input Error: Input format is not correct.
*Format:
begin
m n NumberType(real, rational or integer)
b -A
endmuradtukMon, 03 Feb 2020 02:59:28 +0100https://ask.sagemath.org/question/49755/Concern about output from intersection_poset methodhttps://ask.sagemath.org/question/46499/concern-about-output-from-intersection_poset-method/ The output from the intersection_poset command concerns me. I typed the following
H5 = HyperplaneArrangements(QQ, ('x1', 'x2', 'x3', 'x4', 'x5'))
C5 = H5([(1, -2, 1, 0, 0), 0],[(1, -1, -1, 1, 0), 0], [(1, -1, 0, -1, 1), 0],[(0, 1, -2, 1, 0),0],[(0,1,-1,-1,1),0],[(0,0,1,-2,1),0],[(1,0,-2,0,1),0]);C5
p5 = C5.intersection_poset()
p5.plot()
where the last command prints out the (Hasse diagram of) intersection poset of C5. My direct calculation tells me that all of the rank-2 elements should be the joins of 3 atoms (rank-1 elements). Perhaps the discrepancy is due to linear dependence between the hyperplanes in C5. For instance, note that the second coefficient vector is the sum of the first and fourth.
I running SageMath 8.0. Perhaps this was fixed in some later version--I will seek an upgrade.
bill235711Mon, 13 May 2019 03:03:43 +0200https://ask.sagemath.org/question/46499/