def galois_group_search(info, query): def includes_composite(s): s = s.replace(' ','').replace('..','-') for interval in s.split(','): if '-' in interval[1:]: ix = interval.index('-',1) a,b = int(interval[:ix]), int(interval[ix+1:]) if b == a: if a != 1 and not a.is_prime(): return True if b > a and b > 3: return True else: a = ZZ(interval) if a != 1 and not a.is_prime(): return True parse_ints(info,query,'n','degree') parse_ints(info,query,'t') parse_ints(info,query,'order') parse_bracketed_posints(info, query, qfield='gapidfull', split=False, exactlength=2, keepbrackets=True, name='GAP id', field='gapid') for param in ('cyc', 'solv', 'prim'): parse_bool(info, query, param, process=int, blank=['0','Any']) parse_restricted(info,query,'parity',allowed=[1,-1],process=int,blank=['0','Any']) if 'order' in query and 'n' not in query: query['__sort__'] = ['order', 'gapid', 'n', 't'] degree_str = prep_ranges(info.get('n')) info['show_subs'] = degree_str is None or (LIST_RE.match(degree_str) and includes_composite(degree_str)) info['group_display'] = group_display_pretty info['yesno'] = yesno info['wgg'] = WebGaloisGroup.from_data
def galois_group_search(info, query): def includes_composite(s): s = s.replace(' ','').replace('..','-') for interval in s.split(','): if '-' in interval[1:]: ix = interval.index('-',1) a,b = int(interval[:ix]), int(interval[ix+1:]) if b == a: if a != 1 and not a.is_prime(): return True if b > a and b > 3: return True else: a = ZZ(interval) if a != 1 and not a.is_prime(): return True parse_ints(info,query,'n','degree') parse_ints(info,query,'t') parse_ints(info,query,'order') parse_ints(info,query,'nilpotency') parse_bracketed_posints(info, query, qfield='gapidfull', split=False, exactlength=2, keepbrackets=True, name='GAP id', field='gapid') for param in ('cyc', 'solv', 'prim'): parse_bool(info, query, param, process=int, blank=['0','Any']) parse_restricted(info,query,'parity',allowed=[1,-1],process=int,blank=['0','Any']) if 'order' in query and 'n' not in query: query['__sort__'] = ['order', 'gapid', 'n', 't'] degree_str = prep_ranges(info.get('n')) info['show_subs'] = degree_str is None or (LIST_RE.match(degree_str) and includes_composite(degree_str)) info['group_display'] = group_display_short info['yesno'] = yesno info['wgg'] = WebGaloisGroup.from_data
def galois_group_search(info, query): def includes_composite(s): s = s.replace(' ', '').replace('..', '-') for interval in s.split(','): if '-' in interval[1:]: ix = interval.index('-', 1) a, b = int(interval[:ix]), int(interval[ix + 1:]) if b == a: if a != 1 and not a.is_prime(): return True if b > a and b > 3: return True else: a = ZZ(interval) if a != 1 and not a.is_prime(): return True if info.get('jump', '').strip(): jump_list = [ "1T1", "2T1", "3T1", "4T1", "4T2", "5T1", "6T1", "7T1", "8T1", "8T2", "8T3", "8T5", "9T1", "9T2", "10T1", "11T1", "12T1", "12T2", "12T5", "13T1", "14T1", "15T1", "16T1", "16T2", "16T3", "16T4", "16T5", "16T7", "16T8", "16T14", "17T1", "18T1", "18T2", "19T1", "20T1", "20T2", "20T3", "21T1", "22T1", "23T1", "24T1", "24T2", "24T3", "24T4", "24T5", "24T6", "24T8", "25T1", "25T2", "26T1", "27T1", "27T2", "27T4", "28T1", "28T2", "28T3", "29T1", "30T1", "31T1", "32T32", "32T33", "32T34", "32T35", "32T36", "32T37", "32T38", "32T39", "32T40", "32T41", "32T42", "32T43", "32T44", "32T45", "32T46", "32T47", "32T48", "32T49", "32T50", "32T51", "33T1", "34T1", "35T1", "36T1", "36T2", "36T3", "36T4", "36T7", "36T9", "37T1", "38T1", "39T1", "40T1", "40T2", "40T3", "40T4", "40T5", "40T7", "40T8", "40T13", "41T1", "42T1", "43T1", "44T1", "44T2", "44T3", "45T1", "45T2", "46T1", "47T1" ] strip_label = info.get('jump', '').strip().upper() # If the user entered a simple label if re.match(r'^\d+T\d+$', strip_label): return redirect(url_for('.by_label', label=strip_label), 301) try: parse_galgrp( info, query, qfield=['label', 'n'], name='a Galois group label', field='jump', list_ok=False, err_msg= "It needs to be a transitive group in nTj notation, such as 5T1, a GAP id, such as [4,1], or a <a title = 'Galois group labels' knowl='nf.galois_group.name'>group label</a>" ) except ValueError: return redirect(url_for('.index')) if query.get('label', '') in jump_list: return redirect(url_for('.by_label', label=query['label']), 301) else: # convert this to a regular search info['gal'] = info['jump'] parse_ints(info, query, 'n', 'degree') parse_ints(info, query, 't') parse_ints(info, query, 'order') parse_ints(info, query, 'arith_equiv') parse_ints(info, query, 'nilpotency') parse_galgrp(info, query, qfield=['label', 'n'], name='Galois group', field='gal') for param in ('cyc', 'solv', 'prim'): parse_bool(info, query, param, process=int, blank=['0', 'Any']) if info.get("parity") == "even": query["parity"] = 1 elif info.get("parity") == "odd": query["parity"] = -1 #parse_restricted(info,query,'parity',allowed=[1,-1],process=int,blank=['0','Any']) if 'order' in query and 'n' not in query: query['__sort__'] = ['order', 'gapid', 'n', 't'] degree_str = prep_ranges(info.get('n')) info['show_subs'] = degree_str is None or (LIST_RE.match(degree_str) and includes_composite(degree_str)) info['group_display'] = group_display_short info['yesno'] = yesno info['wgg'] = WebGaloisGroup.from_data