Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

GP compiler problem

When I do individual calculations the algorithm seems to be fine but when I do multiple iterations it crashes, any help is super appreciated.

from sage.all_cmdline import * # import sage library

non_square=[2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]

for k in non_square: K=gp.bnfinit(x^2-k) XY=[] Y=[] for i in range(1,100): x=gp.bnrclassno(K,i) XY.append([x,euler_phi(i)])

print(XY)

# scatter_plot(XY, markersize=100, facecolor='green',ymax=100).save('new1.png') list_plot(XY).save('new'+str(k)+'.png') del(K)

GP compiler problem

When I do individual calculations the algorithm seems to be fine fine but when I do multiple iterations it crashes, any help is super appreciated.

from sage.all_cmdline import *   # import sage library

non_square=[2, library non_square = [2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]

99] for k in non_square: K=gp.bnfinit(x^2-k) XY=[] Y=[] K = gp.bnfinit(x^2 - k) XY = [] Y = [] for i in range(1,100): x=gp.bnrclassno(K,i) XY.append([x,euler_phi(i)])

range(1, 100):
        x = gp.bnrclassno(K, i)
        XY.append([x, euler_phi(i)])
print(XY)

# scatter_plot(XY, markersize=100, facecolor='green',ymax=100).save('new1.png') list_plot(XY).save('new'+str(k)+'.png') del(K)

facecolor='green', ymax=100).save('new1.png') list_plot(XY).save('new' + str(k) + '.png') del(K)
click to hide/show revision 3
retagged

GP compiler problem

When I do individual calculations the algorithm seems to be fine but when I do multiple iterations it crashes, any help is super appreciated.

from sage.all_cmdline import *   # import sage library

non_square = [2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]

for k in non_square:
    K = gp.bnfinit(x^2 - k)
    XY = []
    Y = []
    for i in range(1, 100):
        x = gp.bnrclassno(K, i)
        XY.append([x, euler_phi(i)])
print(XY)

# scatter_plot(XY, markersize=100, facecolor='green', ymax=100).save('new1.png')
list_plot(XY).save('new' + str(k) + '.png')
del(K)