def energy_density_on_line(k, x0, y0, z0, axis, end):
    if (axis not in ['x','y','z']):
        raise ValueError("Invalid axis given. Must be one of 'x', 'y', or 'z'")

    step_size = 0.02
    if (axis == 'x'):
        start = x0
    elif (axis == 'y'):
        start = y0
    elif (axis == 'z'):
        start = z0
    intervals = int(math.ceil((end - start)/step_size))


    points = []
    for a in range(-2, intervals + 2, 1):
        points_y = []
        for b in range(-2, 3, 1):
            points_z = []
            for c in range(-2, 3, 1):
                if(b == 0 or c == 0):
                    if (axis == 'x'):
                        points_z.append(higgs_squared(k, float(x0 + a * step_size), float(y0 + b * step_size), float(z0 + c * step_size)))
                    elif (axis == 'y'):
                        points_z.append(higgs_squared(k, float(x0 + b * step_size), float(y0 + a * step_size), float(z0 + c * step_size)))
                    elif (axis == 'z'):
                        points_z.append(higgs_squared(k, float(x0 + c * step_size), float(y0 + b * step_size), float(z0 + a * step_size)))
                else:
                    points_z.append(0) # Value is not used in laplace calculation
            points_y.append(points_z)
        points.append(points_y)

    return five_point_laplace(points, step_size)[0][0]
Ejemplo n.º 2
0
def higgs_on_line(k, x0, x1, y, z, partition_size):

    x_step = (x1 - x0) / partition_size

    for i in range(0, partition_size):
        x=x0+i*x_step
        print higgs_squared(k,x,y,z)

    return
Ejemplo n.º 3
0
def higgs_on_line(k, x0, x1, y, z, partition_size):

    x_step = (x1 - x0) / partition_size

    for i in range(0, partition_size):
        x = x0 + i * x_step
        print higgs_squared(k, x, y, z)

    return
Ejemplo n.º 4
0
def test_higgs_exceptional(k):
    kk = "%1.2f" % k

    points = get_point_tuples(kk, 253, 256)

    exceptional=[]

    for p in points:
        value = higgs_squared(k, p[1], p[0], p[2])
        if (value > 1.0 or value <0.0):
            exceptional.append(p)
            print "Exceptional", p

    write_file = '/Users/hwb/Desktop/numerical monopoles/formaple/higgs_' + str(kk)  +'.txt'

    fo = open(os.path.expanduser(write_file), 'w+')
    for i, point in enumerate(exceptional):
        point_string =  str(point[0]) +' '+ str(point[1]) + ' ' + str(point[2]) +'\n'
        if (i != (len(points) - 1)):
            point_string = point_string
        fo.write(point_string)

    fo.close()

    return
Ejemplo n.º 5
0
def higgs_squared_on_xy_plane(
    k, x0, x1, y0, y1, z, partition_size
):  # If this falls outside of [0,1) an value of maxint-1 will be returned; maxint is globally set.

    x_step = (x1 - x0) / partition_size
    y_step = (y1 - y0) / partition_size

    points = []

    for j in xrange(0, partition_size):
        # if j % 10 == 0 and j > 0:
        #     eprint("- rendered %s lines..." % j)

        for i in xrange(0, partition_size):
            x = x0 + i * x_step
            y = y0 + j * y_step

            value = higgs_squared(k, x, y, z)
            bucket_value = int(floor(maxint * value))
            if (bucket_value > maxintr or bucket_value < 0):
                print i, j, bucket_value
                bucket_value = maxintr
            points.append(bucket_value)

    return points
Ejemplo n.º 6
0
def test_higgs_exceptional(k):
    kk = "%1.2f" % k

    points = get_point_tuples(kk, 253, 256)

    exceptional = []

    for p in points:
        value = higgs_squared(k, p[1], p[0], p[2])
        if (value > 1.0 or value < 0.0):
            exceptional.append(p)
            print "Exceptional", p

    write_file = '/Users/hwb/Desktop/numerical monopoles/formaple/higgs_' + str(
        kk) + '.txt'

    fo = open(os.path.expanduser(write_file), 'w+')
    for i, point in enumerate(exceptional):
        point_string = str(point[0]) + ' ' + str(point[1]) + ' ' + str(
            point[2]) + '\n'
        if (i != (len(points) - 1)):
            point_string = point_string
        fo.write(point_string)

    fo.close()

    return
def energy_density_on_line(k, x0, y0, z0, axis, end):
    if (axis not in ['x', 'y', 'z']):
        raise ValueError("Invalid axis given. Must be one of 'x', 'y', or 'z'")

    step_size = 0.02
    if (axis == 'x'):
        start = x0
    elif (axis == 'y'):
        start = y0
    elif (axis == 'z'):
        start = z0
    intervals = int(math.ceil((end - start) / step_size))

    points = []
    for a in range(-2, intervals + 2, 1):
        points_y = []
        for b in range(-2, 3, 1):
            points_z = []
            for c in range(-2, 3, 1):
                if (b == 0 or c == 0):
                    if (axis == 'x'):
                        points_z.append(
                            higgs_squared(k, float(x0 + a * step_size),
                                          float(y0 + b * step_size),
                                          float(z0 + c * step_size)))
                    elif (axis == 'y'):
                        points_z.append(
                            higgs_squared(k, float(x0 + b * step_size),
                                          float(y0 + a * step_size),
                                          float(z0 + c * step_size)))
                    elif (axis == 'z'):
                        points_z.append(
                            higgs_squared(k, float(x0 + c * step_size),
                                          float(y0 + b * step_size),
                                          float(z0 + a * step_size)))
                else:
                    points_z.append(
                        0)  # Value is not used in laplace calculation
            points_y.append(points_z)
        points.append(points_y)

    return five_point_laplace(points, step_size)[0][0]
Ejemplo n.º 8
0
def test_on_line(k, x0, x1, y, z, partition_size):

    k1 = sqrt(1 - k**2)
    a = k1 + complex(0, 1) * k
    b = k1 - complex(0, 1) * k

    x_step = (x1 - x0) / partition_size

    for i in range(0, partition_size):
        x = x0 + i * x_step
        zeta = calc_zeta(k, x, y, z)
        eta = calc_eta(k, x, y, z)
        abel = calc_abel(k, zeta, eta)
        mu = calc_mu(k, x, y, z, zeta, abel)

        print "zeta/a", zeta[0] / a, zeta[1] / a, zeta[2] / a, zeta[3] / a, '\n'
        print "eta", eta[0], eta[1], eta[2], eta[3], '\n'
        print "abel", abel[0], abel[1], abel[2], abel[3], '\n'

        abel_tmp= map(lambda zetai : \
                complex(0, 1) * 1/(complex64(ellipk(k**2))*2*b) \
                * complex64(ellipf( asin( (zetai )/a), mfrom(k=a/b))) \
                - taufrom(k=k)/2,
                zeta)
        print "abel_tmp", abel_tmp[0], abel_tmp[1], abel_tmp[2], abel_tmp[
            3], '\n'

        print abel[0] + conj(abel[2]), abel[1] + conj(abel[3]), '\n'
        print -taufrom(k=k) / 2, '\n'
        for l in range(0, 4):
            tmp = abs(complex64(calc_eta_by_theta(k, abel[l])) - eta[l])
            print tmp

        value = higgs_squared(k, x, y, z)
        print "higgs", higgs_squared(k, x, y, z)
        if (value > 1.0 or value < 0.0):
            print "Exception"

        print '\n'
        # print mu[0]+mu[2], mu[1]+mu[3], '\n'

    return
Ejemplo n.º 9
0
def test_on_line(k, x0, x1, y, z, partition_size):

    k1 = sqrt(1-k**2)
    a=k1+complex(0, 1)*k
    b=k1-complex(0, 1)*k

    x_step = (x1 - x0) / partition_size

    for i in range(0, partition_size):
        x=x0+i*x_step
        zeta = calc_zeta(k ,x, y, z)
        eta = calc_eta(k, x, y, z)
        abel = calc_abel(k, zeta, eta)
        mu = calc_mu(k, x, y, z, zeta, abel)

        print "zeta/a", zeta[0]/a, zeta[1]/a, zeta[2]/a, zeta[3]/a, '\n'
        print "eta", eta[0], eta[1], eta[2], eta[3], '\n'
        print "abel",  abel[0], abel[1],abel[2],abel[3],'\n'

        abel_tmp= map(lambda zetai : \
                complex(0, 1) * 1/(complex64(ellipk(k**2))*2*b) \
                * complex64(ellipf( asin( (zetai )/a), mfrom(k=a/b))) \
                - taufrom(k=k)/2,
                zeta)
        print "abel_tmp",  abel_tmp[0], abel_tmp[1],abel_tmp[2],abel_tmp[3],'\n'

        print  abel[0]+conj(abel[2]), abel[1]+conj(abel[3]), '\n'
        print - taufrom(k=k)/2, '\n'
        for l in range(0,4):
            tmp= abs(complex64(calc_eta_by_theta(k, abel[l])) - eta[l])
            print tmp

        value = higgs_squared(k, x, y, z)
        print "higgs", higgs_squared(k,x,y,z)
        if (value > 1.0 or value <0.0):
            print "Exception"

        print '\n'
        # print mu[0]+mu[2], mu[1]+mu[3], '\n'

    return
def energy_density_numerical(k, x1, x2, x3):
    step_size = 0.02

    points = []
    for a in range(-2, 3, 1):
        points_y = []
        for b in range(-2, 3, 1):
            points_z = []
            for c in range(-2, 3, 1):
                points_z.append(higgs_squared(k, float(x1 + a * step_size), float(x2 + b * step_size), float(x3 + c * step_size)))
            points_y.append(points_z)
        points.append(points_y)

    return five_point_laplace(points, step_size)[0][0]
Ejemplo n.º 11
0
def xhiggs_on_line(k, x0, x1, y, z, partition_size):

    x_step = (x1 - x0) / partition_size

    points = []

    for i in range(0, partition_size):
        x = x0 + i * x_step
        value = higgs_squared(k, x, y, z)
        bucket_value = int(floor(maxint * value))
        points.append(bucket_value)
        # print higgs_squared(k,x,y,z)

    return points
Ejemplo n.º 12
0
def xhiggs_on_line(k, x0, x1, y, z, partition_size):

    x_step = (x1 - x0) / partition_size

    points = []

    for i in range(0, partition_size):
        x=x0+i*x_step
        value = higgs_squared(k, x, y, z)
        bucket_value = int(floor(maxint * value))
        points.append(bucket_value)
        # print higgs_squared(k,x,y,z)

    return points
Ejemplo n.º 13
0
def test_on_line(k, x0, x1, y, z, partition_size):

    k1 = sqrt(1-k**2)
    a=k1+complex(0, 1)*k
    b=k1-complex(0, 1)*k

    # x_step = (x1 - x0) / partition_size
    x_step = 0.05

    for i in range(0, partition_size):
        x=x0+i*x_step
        zeta = calc_zeta(k ,x, y, z)
        eta = calc_eta(k, x, y, z)
        abel = calc_abel(k, zeta, eta)
        mu = calc_mu(k, x, y, z, zeta, abel)

        print i,'\n'

        print "zeta", zeta[0], zeta[1], zeta[2], zeta[3], '\n'
        # print "eta", eta[0], eta[1], eta[2], eta[3], '\n'
        # print "mu", mu[0], mu[1], mu[2], mu[3], '\n'
        # print  mu[0]+conj(mu[2]), mu[1]+conj( mu[3]), '\n'
        # print "abel",  abel[0], abel[1],abel[2],abel[3],'\n'

        # abel_tmp= map(lambda zetai : \
        #                   complex(0, 1) * 1/(complex64(ellipk(k**2))*2*b) \
        #                   * complex64(ellipf( asin( (zetai )/a), mfrom(k=a/b))) \
        #                   - taufrom(k=k)/2,
        #               zeta)
        # print "abel_tmp",  abel_tmp[0], abel_tmp[1],abel_tmp[2],abel_tmp[3],'\n'
        #
        # print  abel[0]+conj(abel[2]), abel[1]+conj(abel[3]), '\n'
        # print - taufrom(k=k)/2, '\n'
        # for l in range(0,4):
        #     tmp= abs(complex64(calc_eta_by_theta(k, abel[l])) - eta[l])
        #     print tmp

        value = higgs_squared(k, x, y, z)
        print "higgs", value, int(floor(maxint *value))
        # if (value > 1.0 or value <0.0):
        #     print "Exception"
        #
        print '\n'
        # # print mu[0]+mu[2], mu[1]+mu[3], '\n'

    return
def energy_density_numerical(k, x1, x2, x3):
    step_size = 0.02

    points = []
    for a in range(-2, 3, 1):
        points_y = []
        for b in range(-2, 3, 1):
            points_z = []
            for c in range(-2, 3, 1):
                points_z.append(
                    higgs_squared(k, float(x1 + a * step_size),
                                  float(x2 + b * step_size),
                                  float(x3 + c * step_size)))
            points_y.append(points_z)
        points.append(points_y)

    return five_point_laplace(points, step_size)[0][0]
Ejemplo n.º 15
0
def test_on_line(k, x0, x1, y, z, partition_size):

    k1 = sqrt(1 - k**2)
    a = k1 + complex(0, 1) * k
    b = k1 - complex(0, 1) * k

    # x_step = (x1 - x0) / partition_size
    x_step = 0.05

    for i in range(0, partition_size):
        x = x0 + i * x_step
        zeta = calc_zeta(k, x, y, z)
        eta = calc_eta(k, x, y, z)
        abel = calc_abel(k, zeta, eta)
        mu = calc_mu(k, x, y, z, zeta, abel)

        print i, '\n'

        print "zeta", zeta[0], zeta[1], zeta[2], zeta[3], '\n'
        # print "eta", eta[0], eta[1], eta[2], eta[3], '\n'
        # print "mu", mu[0], mu[1], mu[2], mu[3], '\n'
        # print  mu[0]+conj(mu[2]), mu[1]+conj( mu[3]), '\n'
        # print "abel",  abel[0], abel[1],abel[2],abel[3],'\n'

        # abel_tmp= map(lambda zetai : \
        #                   complex(0, 1) * 1/(complex64(ellipk(k**2))*2*b) \
        #                   * complex64(ellipf( asin( (zetai )/a), mfrom(k=a/b))) \
        #                   - taufrom(k=k)/2,
        #               zeta)
        # print "abel_tmp",  abel_tmp[0], abel_tmp[1],abel_tmp[2],abel_tmp[3],'\n'
        #
        # print  abel[0]+conj(abel[2]), abel[1]+conj(abel[3]), '\n'
        # print - taufrom(k=k)/2, '\n'
        # for l in range(0,4):
        #     tmp= abs(complex64(calc_eta_by_theta(k, abel[l])) - eta[l])
        #     print tmp

        value = higgs_squared(k, x, y, z)
        print "higgs", value, int(floor(maxint * value))
        # if (value > 1.0 or value <0.0):
        #     print "Exception"
        #
        print '\n'
        # # print mu[0]+mu[2], mu[1]+mu[3], '\n'

    return
def energy_density_volume(k, x0, x1, y0, y1, z0, z1):
    step_size = 0.02

    xintervals = int(math.ceil((x1 - x0)/step_size))
    yintervals = int(math.ceil((y1 - y0)/step_size))
    zintervals = int(math.ceil((z1 - z0)/step_size))

    points = []
    for a in range(-2, xintervals + 2, 1):
        points_y = []
        for b in range(-2, yintervals + 2, 1):
            points_z = []
            for c in range(-2, zintervals + 2, 1):
                points_z.append(higgs_squared(k, float(x0 + a * step_size), float(y0 + b * step_size), float(z0 + c * step_size)))
            points_y.append(points_z)
        points.append(points_y)

    return five_point_laplace(points, step_size)
Ejemplo n.º 17
0
def higgs_squared_on_yz_plane(k, y0, y1, z0, z1, x, partition_size):   # If this falls outside of [0,1) an value of maxint-1 will be returned; maxint is globally set.

    y_step = (y1 - y0) / partition_size
    z_step = (z1 - z0) / partition_size

    points = []
    for j in range(0, partition_size):
        for i in range(0, partition_size):
            y = y0 + i * y_step
            z = z0 + j * z_step

            value = higgs_squared(k, x, y, z)
            bucket_value = int(floor(maxint * value))
            if(bucket_value > maxintr or bucket_value < 0):
                print i, j, bucket_value
                bucket_value = maxintr
            points.append(bucket_value)


    return points
Ejemplo n.º 18
0
def higgs_squared_on_yz_plane(
    k, y0, y1, z0, z1, x, partition_size
):  # If this falls outside of [0,1) an value of maxint-1 will be returned; maxint is globally set.

    y_step = (y1 - y0) / partition_size
    z_step = (z1 - z0) / partition_size

    points = []
    for j in range(0, partition_size):
        for i in range(0, partition_size):
            y = y0 + i * y_step
            z = z0 + j * z_step

            value = higgs_squared(k, x, y, z)
            bucket_value = int(floor(maxint * value))
            if (bucket_value > maxintr or bucket_value < 0):
                print i, j, bucket_value
                bucket_value = maxintr
            points.append(bucket_value)

    return points
def energy_density_volume(k, x0, x1, y0, y1, z0, z1):
    step_size = 0.02

    xintervals = int(math.ceil((x1 - x0) / step_size))
    yintervals = int(math.ceil((y1 - y0) / step_size))
    zintervals = int(math.ceil((z1 - z0) / step_size))

    points = []
    for a in range(-2, xintervals + 2, 1):
        points_y = []
        for b in range(-2, yintervals + 2, 1):
            points_z = []
            for c in range(-2, zintervals + 2, 1):
                points_z.append(
                    higgs_squared(k, float(x0 + a * step_size),
                                  float(y0 + b * step_size),
                                  float(z0 + c * step_size)))
            points_y.append(points_z)
        points.append(points_y)

    return five_point_laplace(points, step_size)
Ejemplo n.º 20
0
def higgs_squared_on_xy_plane(k, x0, x1, y0, y1, z, partition_size):  # If this falls outside of [0,1) an value of maxint-1 will be returned; maxint is globally set.

    x_step = (x1 - x0) / partition_size
    y_step = (y1 - y0) / partition_size

    points = []

    for j in xrange(0, partition_size):
        # if j % 10 == 0 and j > 0:
        #     eprint("- rendered %s lines..." % j)

        for i in xrange(0, partition_size):
            x = x0 + i * x_step
            y = y0 + j * y_step

            value = higgs_squared(k, x, y, z)
            bucket_value = int(floor(maxint * value))
            if(bucket_value > maxintr or bucket_value < 0):
                print i, j, bucket_value
                bucket_value = maxintr
            points.append(bucket_value)

    return points