diff --git a/lmfdb/classical_modular_forms/main.py b/lmfdb/classical_modular_forms/main.py index 8d2a2561f5..8a8e0d8f3a 100644 --- a/lmfdb/classical_modular_forms/main.py +++ b/lmfdb/classical_modular_forms/main.py @@ -740,11 +740,13 @@ def common_parse(info, query, na_check=False): elif parity == 'odd': query['char_parity'] = -1 if info.get('level_type'): - if info['level_type'] == 'divides': + if info['level_type'] in ['divides', 'multiple']: if not isinstance(query.get('level'), int): raise ValueError("You must specify a single level") - else: + elif info['level_type'] == 'divides': query['level'] = {'$in': integer_divisors(ZZ(query['level']))} + else: + query['level'] = {'$mod': [0, ZZ(query['level'])]} else: query['level_is_' + info['level_type']] = True parse_floats(info, query, 'analytic_conductor', name="Analytic conductor") @@ -1476,6 +1478,7 @@ def __init__(self): ('squarefree', 'squarefree'), ('powerful', 'powerful'), ('divides','divides'), + ('multiple','multiple of'), ], min_width=110) level = TextBoxWithSelect( diff --git a/lmfdb/elliptic_curves/elliptic_curve.py b/lmfdb/elliptic_curves/elliptic_curve.py index 40a97201ec..419f14b506 100644 --- a/lmfdb/elliptic_curves/elliptic_curve.py +++ b/lmfdb/elliptic_curves/elliptic_curve.py @@ -515,13 +515,15 @@ def elliptic_curve_search(info, query): query['num_bad_primes'] = 1 elif info['conductor_type'] == 'squarefree': query['semistable'] = True - elif info['conductor_type'] == 'divides': + elif info['conductor_type'] in ['divides', 'multiple']: if not isinstance(query.get('conductor'), int): err = "You must specify a single conductor" flash_error(err) raise ValueError(err) - else: + elif info['conductor_type'] == 'divides': query['conductor'] = {'$in': integer_divisors(ZZ(query['conductor']))} + else: + query['conductor'] = {'$mod': [0, ZZ(query['conductor'])]} parse_signed_ints(info, query, 'discriminant', qfield=('signD', 'absD')) parse_ints(info,query,'rank') parse_ints(info,query,'adelic_level') @@ -1170,6 +1172,7 @@ def __init__(self): ('prime_power', 'p-power'), ('squarefree', 'sq-free'), ('divides','divides'), + ('multiple','multiple of'), ], min_width=85) cond = TextBoxWithSelect( diff --git a/lmfdb/modl_galois_representations/main.py b/lmfdb/modl_galois_representations/main.py index 28639d8f87..45fd9254dd 100644 --- a/lmfdb/modl_galois_representations/main.py +++ b/lmfdb/modl_galois_representations/main.py @@ -184,13 +184,15 @@ def modlgal_search(info, query): query['conductor_num_primes'] = 1 elif info['conductor_type'] == 'squarefree': query['conductor_is_squarefree'] = True - elif info['conductor_type'] == 'divides': + elif info['conductor_type'] in ['divides', 'multiple']: if not isinstance(query.get('conductor'), int): err = "You must specify a single level" flash_error(err) raise ValueError(err) - else: + elif info['conductor_type'] == 'divides': query['conductor'] = {'$in': integer_divisors(ZZ(query['conductor']))} + else: + query['conductor'] = {'$mod': [0, ZZ(query['conductor'])]} parse_primes(info, query, 'conductor_primes', name='ramified primes', mode=info.get('conductor_primes_quantifier')) parse_rats(info, query,'top_slope', qfield='top_slope_real',name='Top slope') if 'top_slope_real' in query and '/' in info['top_slope']: @@ -228,6 +230,7 @@ def __init__(self): ('prime_power', 'p-power'), ('squarefree', 'sq-free'), ('divides','divides'), + ('multiple','multiple of'), ], ) conductor = TextBoxWithSelect( diff --git a/lmfdb/modular_curves/main.py b/lmfdb/modular_curves/main.py index 59c6cea01b..cf643574e4 100644 --- a/lmfdb/modular_curves/main.py +++ b/lmfdb/modular_curves/main.py @@ -679,13 +679,15 @@ def modcurve_search(info, query): query['num_bad_primes'] = 1 elif info['level_type'] == 'squarefree': query['level_is_squarefree'] = True - elif info['level_type'] == 'divides': + elif info['level_type'] in ['divides', 'multiple']: if not isinstance(query.get('level'), int): err = "You must specify a single level" flash_error(err) raise ValueError(err) - else: + elif info['level_type'] == 'divides': query['level'] = {'$in': integer_divisors(ZZ(query['level']))} + else: + query['level'] = {'$mod': [0, ZZ(query['level'])]} parse_family(info, query, "family", qfield="name") parse_ints(info, query, "index") parse_ints(info, query, "genus") @@ -757,6 +759,7 @@ def __init__(self): ('prime_power', 'p-power'), ('squarefree', 'sq-free'), ('divides', 'divides'), + ('multiple', 'multiple of'), ], min_width=85) level = TextBoxWithSelect(