def mu_portrait(n): """ returns an encoded scatter plot of the nth roots of unity in the complex plane """ if n <= 120: plot = list_plot([(cos(2*pi*m/n),sin(2*pi*m/n)) for m in range(n)],pointsize=30+60/n, axes=False) else: plot = circle((0,0),1,thickness=3) plot.xmin(-1); plot.xmax(1); plot.ymin(-1); plot.ymax(1) plot.set_aspect_ratio(4.0/3.0) return encode_plot(plot)
def nu1_mu_portrait(n): """ returns an encoded scatter plot of the nth roots of unity in the complex plane """ if n == 1: return db.gps_sato_tate.lookup('1.2.1.2.1a').get('trace_histogram') if n <= 120: plot = sum([ line2d([(-2 * cos(2 * pi * m / n), -2 * sin(2 * pi * m / n)), (2 * cos(2 * pi * m / n), 2 * sin(2 * pi * m / n))], thickness=3) for m in range(n) ]) + circle((0, 0), 0.1, rgbcolor=(0, 0, 0), fill=True) else: plot = circle((0, 0), 2, fill=True) plot.xmin(-2) plot.xmax(2) plot.ymin(-2) plot.ymax(2) plot.set_aspect_ratio(4.0 / 3.0) plot.axes(False) return encode_plot(plot)
def show(self, unit=10, labels=True): from sage.all import circle, text, line, Graphics pos = self.basic_grid_embedding() for v, (a, b) in pos.items(): pos[v] = (unit * a, unit * b) if not labels: verts = [circle(p, 1, fill=True) for p in pos.values()] else: verts = [ text(repr(v), p, fontsize=20, color='black') for v, p in pos.items() ] verts += [circle(p, 1.5, fill=False) for p in pos.values()] edges = [ line([pos[e.tail], pos[e.head]]) for e in self.edges if e not in self.dummy ] G = sum(verts + edges, Graphics()) G.axes(False) return G
def nu1_mu_portrait(n): """ returns an encoded scatter plot of the nth roots of unity in the complex plane """ if n == 1: return db.gps_sato_tate.lookup('1.2.1.2.1a').get('trace_histogram') if n <= 120: plot = sum([line2d([(-2*cos(2*pi*m/n),-2*sin(2*pi*m/n)),(2*cos(2*pi*m/n),2*sin(2*pi*m/n))],thickness=3) for m in range(n)]) + circle((0,0),0.1,rgbcolor=(0,0,0),fill=True) else: plot = circle((0,0),2,fill=True) plot.xmin(-2); plot.xmax(2); plot.ymin(-2); plot.ymax(2) plot.set_aspect_ratio(4.0/3.0) plot.axes(False) return encode_plot(plot)
def su2_mu_portrait(n): """ returns an encoded line plot of SU(2) x mu(n) in the complex plane """ if n == 1: return db.gps_sato_tate.lookup('1.2.3.1.1a').get('trace_histogram') if n <= 120: plot = sum([line2d([(-2*cos(2*pi*m/n),-2*sin(2*pi*m/n)),(2*cos(2*pi*m/n),2*sin(2*pi*m/n))],thickness=3) for m in range(n)]) else: plot = circle((0,0),2,fill=True) plot.xmin(-2); plot.xmax(2); plot.ymin(-2); plot.ymax(2) plot.set_aspect_ratio(4.0/3.0) plot.axes(False) return encode_plot(plot)
def su2_mu_portrait(n): """ returns an encoded line plot of SU(2) x mu(n) in the complex plane """ if n == 1: return db.gps_st.lookup('1.2.A.1.1a').get('trace_histogram') if n <= 120: plot = sum([line2d([(-2*cos(2*pi*m/n),-2*sin(2*pi*m/n)),(2*cos(2*pi*m/n),2*sin(2*pi*m/n))],thickness=3) for m in range(n)]) else: plot = circle((0,0),2,fill=True) plot.xmin(-2); plot.xmax(2); plot.ymin(-2); plot.ymax(2) plot.set_aspect_ratio(4.0/3.0) plot.axes(False) return encode_plot(plot)