Adding class for projective ambient spaces (#9)
--------- Co-authored-by: Julian Piribauer <julian.piribauer@gmail.com> Reviewed-on: #9
This commit was merged in pull request #9.
This commit is contained in:
+32
-1
@@ -739,4 +739,35 @@ class ToricPolytopeCICY(ToricPolytope):
|
|||||||
nef_partition=nef_partition,
|
nef_partition=nef_partition,
|
||||||
lvec=lvec
|
lvec=lvec
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class ToricPolytopeProjectiveSpace(ToricPolytope):
|
||||||
|
"""
|
||||||
|
Computes topological data for hypersurfaces in toric ambient spaces.
|
||||||
|
"""
|
||||||
|
def _compute_points_from_weights(self, weights):
|
||||||
|
# Convert the weights of the projective space to the corresponding points
|
||||||
|
dimension = len(weights) - 1
|
||||||
|
points = identity_matrix(dimension)
|
||||||
|
try:
|
||||||
|
weights.remove(1)
|
||||||
|
except ValueError:
|
||||||
|
raise ValueError("The weights must include a 1 for the projective space.")
|
||||||
|
|
||||||
|
points = points.insert_row(0, [-w for w in weights])
|
||||||
|
return list(points)
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
weights,
|
||||||
|
no_triangulation = 0,
|
||||||
|
model_name = None,
|
||||||
|
nef_partition = None,
|
||||||
|
lvec = None, # Note that the inner point is the last entry
|
||||||
|
):
|
||||||
|
super().__init__(
|
||||||
|
self._compute_points_from_weights(weights),
|
||||||
|
no_triangulation=no_triangulation,
|
||||||
|
model_name=model_name,
|
||||||
|
nef_partition=nef_partition,
|
||||||
|
lvec=lvec
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user