Skip to content

Commit

Permalink
Fixed bug when picking divisor basis and other small bugs. Bumped to …
Browse files Browse the repository at this point in the history
…version 0.3.2
  • Loading branch information
ariostas committed Feb 17, 2022
1 parent 3602848 commit 4ef82d5
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cytools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from cytools.utils import read_polytopes, fetch_polytopes

# Latest version
version = "0.3.1"
version = "0.3.2"
versions_with_serious_bugs = []

# Check for more recent versions of CYTools
Expand Down
6 changes: 2 additions & 4 deletions cytools/calabiyau.py
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ def intersection_numbers(self, in_basis=False, format="dok",
# Let's print the output and see how to interpret it
print(intnum_nobasis)
# {(1, 2, 3): 18, (2, 3, 4): 18, (1, 3, 4): 2, (1, 2, 4): 3, (1, 2, 5): 3, (2, 3, 5): 18, [the output is too long so we truncate it]
# The above output means that the intersection number of divisors 1, 2, 3 is 13, and so on
# The above output means that the intersection number of divisors 1, 2, 3 is 18, and so on
# Let us now compute the intersection numbers in a given basis of divisors
# First, let's check the current basis of divisors
cy.divisor_basis()
Expand Down Expand Up @@ -1489,9 +1489,7 @@ def is_smooth(self):
if self._is_smooth is not None:
return self._is_smooth
if self._is_hypersurface:
sm = (True if self.dim() <= 3 else
all(c.is_smooth() for c in self.ambient_variety().fan_cones(self.dim(),self.dim()-1)))
self._is_smooth = sm
self._is_smooth = self.ambient_variety().canonical_divisor_is_smooth()
else:
self.intersection_numbers() # The variable is set while computing intersection numbers
return self._is_smooth
Expand Down
15 changes: 9 additions & 6 deletions cytools/polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,8 @@ def _points_saturated(self):
- Points are sorted so that interior points are first, and then the
rest are arranged by decreasing number of saturated inequalities and
lexicographically. For reflexive polytopes this is useful since the
origin will be at index 0 and boundary points not interior to facets
will be last.
origin will be at index 0 and boundary points interior to facets will
be last.
- Typically this function should not be called by the user. Instead, it
is called by various other functions in the Polytope class.
:::
Expand Down Expand Up @@ -761,10 +761,11 @@ def points(self, as_indices=False):
Returns the lattice points of the polytope.
:::note
Points are sorted so that interior points are first, and then the rest
are arranged by decreasing number of saturated inequalities.
For reflexive polytopes this is useful since the origin will be at
index 0 and boundary points not interior to facets will be last.
Points are sorted so that interior points are first, and then the
rest are arranged by decreasing number of saturated inequalities and
lexicographically. For reflexive polytopes this is useful since the
origin will be at index 0 and boundary points interior to facets will
be last.
:::
**Arguments:**
Expand Down Expand Up @@ -1811,6 +1812,8 @@ def glsm_charge_matrix(self, include_origin=True,
glsm = np.insert(glsm, pp, extra_columns[p], axis=1)
origin_column = -np.sum(glsm, axis=1)
glsm = np.insert(glsm, 0, origin_column, axis=1)
glsm_rref = fmpz_mat(glsm.tolist()).rref()
glsm = np.array(glsm_rref[0].tolist(),dtype=int) // int(glsm_rref[1])
linear_relations = extra_rows
extra_linear_relation_columns = -1*np.diag(row_scalings)
for p,pp in enumerate(good_lattice_basis):
Expand Down
2 changes: 1 addition & 1 deletion cytools/toricvariety.py
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ def canonical_divisor_is_smooth(self):
pts_mpcp = {tuple(pt) for pt in self.polytope().points_not_interior_to_facets()}
ind_triang = list(set.union(*[set(s) for s in self._triang.simplices()]))
pts_triang = {tuple(pt) for pt in self._triang.points()[ind_triang]}
sm = (pts_triang.issubset(pts_mpcp) and
sm = (pts_mpcp.issubset(pts_triang) and
(True if self.dim() <= 4 else
all(c.is_smooth() for c in self.fan_cones(self.dim()-1,self.dim()-2))))
self._canon_div_is_smooth = sm
Expand Down
6 changes: 3 additions & 3 deletions cytools/triangulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ def __init__(self, triang_pts, poly=None, heights=None, make_star=False,
# A fine, regular, star triangulation of a 4-dimensional point configuration with 7 points in ZZ^4
```
"""
tmp_triang_pts = [tuple(pt) for pt in np.array(triang_pts, dtype=int)]
tmp_triang_pts = {tuple(pt) for pt in np.array(triang_pts, dtype=int)}
heights = copy.deepcopy(heights)
if poly is None:
from cytools.polytope import Polytope
self._poly = Polytope(tmp_triang_pts)
self._poly = Polytope(list(tmp_triang_pts))
else:
self._poly = poly
if (not self._poly.is_solid()
or np.linalg.matrix_rank([pt+(1,) for pt in tmp_triang_pts]) != len(tmp_triang_pts[0])+1):
or np.linalg.matrix_rank([pt+(1,) for pt in tmp_triang_pts]) != len(next(iter(tmp_triang_pts)))+1):
raise Exception("Only triangulations of full-dimensional point "
"configurations are supported.")
# Now we reorder the points to make sure they match the ordering of
Expand Down
2 changes: 1 addition & 1 deletion scripts/linux/cytools
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ cat << EOF
░░█████████ █████ █████ ░░██████ ░░██████ █████ ██████
░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░░░ ░░░░░░
Developed by Liam McAllister's Group | Version 0.3.1
Developed by Liam McAllister's Group | Version 0.3.2
https://cytools.liammcallistergroup.com
EOF
Expand Down
2 changes: 1 addition & 1 deletion scripts/macos/cytools
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ cat << EOF
░░█████████ █████ █████ ░░██████ ░░██████ █████ ██████
░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░░░ ░░░░░░
Developed by Liam McAllister's Group | Version 0.3.1
Developed by Liam McAllister's Group | Version 0.3.2
https://cytools.liammcallistergroup.com
EOF
Expand Down
2 changes: 1 addition & 1 deletion scripts/windows/launcher.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $banner=@"
░░█████████ █████ █████ ░░██████ ░░██████ █████ ██████
░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░░░ ░░░░░░
Developed by Liam McAllister's Group | Version 0.3.1
Developed by Liam McAllister's Group | Version 0.3.2
https://cytools.liammcallistergroup.com
"@
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="cytools",
version="0.3.1",
version="0.3.2",
author="Liam McAllister Group",
author_email="",
description="A software package for analyzing Calabi-Yau hypersurfaces in toric varieties.",
Expand Down

0 comments on commit 4ef82d5

Please sign in to comment.