Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions lmfdb/hypergm/hodge.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
def mu_nu(hodge, signature):
"""
Computes the mu and nu given hodge numbers and signature
"""
# hodge = [int(a) for a in hodge.split(',')]
motivic_weight = len(hodge) - 1
def hodge_index(p): return hodge[p]
# The hodge number p,q
from itertools import repeat
from sage.rings.integer import Integer

def q(p): return motivic_weight - p

assert len(hodge) == motivic_weight + 1
def mu_nu(hodge, signature) -> tuple[list, list]:
"""
Compute ``mu`` and ``nu`` given Hodge numbers and signature.
tmp = [[(q(p) - p) / 2.] * int(hodge_index(p)) for p in range((motivic_weight + 1) // 2)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how this code is supposed to be used, but (motivic_weight - 2 * p) / 2 won't have the same type as (motivic_weight - 2 * p) / 2. Did you change this on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made sure that everything is either a sage integer of a sage rational.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that rational numbers and float don't display the same, and I'm not sure where this is used. Can you track down what webpages these are displayed on, and see if they're currently shown as floats?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue needs to be clarified before we can merge this PR. I'm going to close for now, but am happy to reopen if you address this.

nu = sum(tmp, [])
Here ``hodge[p]`` is the Hodge number `h_{p,q}`.
"""
motivic_weight = Integer(len(hodge) - 1)

if motivic_weight % 2 == 0:
a = (hodge_index(motivic_weight // 2) - abs(signature)) // 2
tmp = [0] * a
nu += tmp
nu = []
for p in range((motivic_weight + 1) // 2):
q_p = (motivic_weight - 2 * p) / 2
nu.extend(repeat(q_p, int(hodge[p])))
if not motivic_weight % 2:
a = (hodge[motivic_weight // 2] - abs(signature)) // 2
nu.extend(repeat(0, a))

if signature <= 0:
mu = [1] * abs(signature)
Expand Down
26 changes: 13 additions & 13 deletions lmfdb/hypergm/test_hgm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_random_family(self):
self.check_args("/Motive/Hypergeometric/Q/random_family", ["Hypergeometric motive family", "Defining parameters"])

def test_by_family_label(self):
self.check_args("/Motive/Hypergeometric/Q/A4.4_B1.1.1.1", ["[4, 4]", "[1, 1, 1, 1]", "[-2, -2, -1, -1, -1, -1, 4, 4]"]) # As, Bs, gamma
self.check_args("/Motive/Hypergeometric/Q/A4.4_B1.1.1.1", ["[4, 4]", "[1, 1, 1, 1]", "[-2, -2, -1, -1, -1, -1, 4, 4]"]) # As, Bs, gamma

def test_type(self):
self.check_args("/Motive/Hypergeometric/Q/A18.12_B8.3.2.1.1.1", "Orthogonal")
Expand All @@ -35,14 +35,14 @@ def test_monodromy(self):
def test_good_euler(self):
self.check_args("/Motive/Hypergeometric/Q/A6.4.4.3_B12.2.2.2.1", "1 + 6 T - 45 p T^{2} - 2130 p^{2} T^{3} + 268 p^{4} T^{4} - 2130 p^{6} T^{5} - 45 p^{9} T^{6} + 6 p^{12} T^{7} + p^{16} T^{8}")

### motive pages
# ## motive pages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you inserting spaces in these kinds of comments? I find # ## motive pages a lot less appealing than ### motive pages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a codestyle suggestion by pycodestyle. Very low priority, of course.


def test_random_motive(self):
self.check_args("/Motive/Hypergeometric/Q/random_motive", "Local information")
self.not_check_args("/Motive/Hypergeometric/Q/random_motive", "Hypergeometric motive family")

def test_by_motive_label(self):
self.check_args("/Motive/Hypergeometric/Q/A2.2.2_B4.1/t9.8", ["[2, 2, 2]", "[4, 1]", "[-4, -1, -1, -1, -1, 2, 2, 2, 2]"]) # As, Bs, gamma
self.check_args("/Motive/Hypergeometric/Q/A2.2.2_B4.1/t9.8", ["[2, 2, 2]", "[4, 1]", "[-4, -1, -1, -1, -1, 2, 2, 2, 2]"]) # As, Bs, gamma

def test_type_motive(self):
self.check_args("/Motive/Hypergeometric/Q/A4.4_B1.1.1.1/t-8.1", "Symplectic")
Expand All @@ -56,12 +56,12 @@ def test_conductor(self):
def test_local_information(self):
self.check_args("/Motive/Hypergeometric/Q/A4.2.2_B1.1.1.1/t1.9", ["3737281794192", "8013465013431125"])

### searches
# ## searches

### family searches
# ## family searches

def test_search_degree(self):
self.check_args("/Motive/Hypergeometric/Q/?degree=4&search_type=Family", ["A5_B3.2.1","A10_B4.2.1"])
self.check_args("/Motive/Hypergeometric/Q/?degree=4&search_type=Family", ["A5_B3.2.1", "A10_B4.2.1"])
self.not_check_args("/Motive/Hypergeometric/Q/?degree=4&search_type=Family", "A2_B1")

def test_search_weight(self):
Expand Down Expand Up @@ -96,7 +96,7 @@ def test_search_Bp_perp(self):
self.check_args("/Motive/Hypergeometric/Q/?p=7&Bpperp=[4%2C2%2C1%2C1%2C1]&search_type=Family", "A9_B4.2.1.1.1")
self.not_check_args("/Motive/Hypergeometric/Q/?p=7&Bpperp=[4%2C2%2C1%2C1%2C1]&search_type=Family", "A2.2.2.2.2.2_B14")

### motive searches
# ## motive searches

def test_search_conductor(self):
self.check_args("/Motive/Hypergeometric/Q/?conductor=32&search_type=Motive", "A4_B2.1_t-8.1")
Expand All @@ -114,17 +114,17 @@ def test_search_root_number(self):
self.check_args("/Motive/Hypergeometric/Q/?sign=-1&search_type=Motive", "A4_B1.1_t-1.1")
self.not_check_args("/Motive/Hypergeometric/Q/?sign=-1&search_type=Motive", "A4_B2.1_t-1.1")

### downloads
# ## downloads

### friends
# ## friends

### for families
# ## for families

def test_friends_family(self):
self.check_args("/Motive/Hypergeometric/Q/A12.6.6.6_B3.2.2.2.2.2.2.1.1", "Motives in the family")

### for motives
# ## for motives

def test_friends_motive(self):
self.check_args("/Motive/Hypergeometric/Q/A2.2.2_B4.1/t2.1", "Motive family A2.2.2 B4.1") # containing family
self.check_args("/Motive/Hypergeometric/Q/A2.2.2_B4.1/t2.1", "/L/Motive/Hypergeometric/Q/A2.2.2_B4.1/t2.1") # L-function
self.check_args("/Motive/Hypergeometric/Q/A2.2.2_B4.1/t2.1", "Motive family A2.2.2 B4.1") # containing family
self.check_args("/Motive/Hypergeometric/Q/A2.2.2_B4.1/t2.1", "/L/Motive/Hypergeometric/Q/A2.2.2_B4.1/t2.1") # L-function
2 changes: 1 addition & 1 deletion lmfdb/lfunctions/Lfunctionutilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def display_isogeny_label(L):
elif g == 5:
return any(p not in bad_primes for p in [2, 3])
else: # g == 6
return not (2 in bad_primes)
return 2 not in bad_primes


def lfuncDShtml(L, fmt):
Expand Down
1 change: 1 addition & 0 deletions lmfdb/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def http_error_308(self, req, fp, code, msg, headers):
# by passing the code 307.
return self.http_error_307(req, fp, 307, msg, headers)


class LmfdbTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
Expand Down
Loading