def monte_carlo_rexy_imxy(mm1, mm2, i22, i33, samples):
    result = 0
    m1, m2 = mm1, mm2
    i2, i3 = i22, i33
    xbsg_list = []
    ybsg_list = []
    xnedm_list = []
    ynedm_list = []
    for _ in range(samples):
        x = random.uniform(-40, 40)
        y = random.uniform(-40, 40)
        if float(bsg.BR_B_Xs_gamma(mb,mw,m1,m2,\
                        i2, complex(x,y) ,\
                        i3, complex(0.1,- y) ) / (1e-4)) >= 2.99 and float(bsg.BR_B_Xs_gamma(mb,mw,m1,m2,\
                        i2, complex(x,y) ,\
                        i3, complex(0.1,- y) ) / (1e-4)) <= 3.55 :
            xbsg_list.append(x)
            ybsg_list.append(y)
        if float(abs(dn(m1,m2, complex(i,j),\
           complex(i,-j) ) / (5.06e13) / 1e-26  )) >=0 and float(abs(dn(m1,m2, complex(i,j),\
                               complex(i,-j) ) / (5.06e13) / 1e-26  )) <=1.1:
            xnedm_list.append(x)
            ynedm_list.append(y)
            result += 1
    fig, ax = plt.subplots()
    ax.set_aspect('equal')
    ax.scatter(xbsg_list, ybsg_list, s=20, c='b')
    ax.scatter(xnedm_list, ynedm_list, s=20, c='r')
    plt.show()
    plt.close()
    return
def Plot_4():  #Andrew and Stefano Paper
    x_axis = np.array([i for i in np.arange(100, 1020, 20)])
    #    print('II 2HDM tanbeta = 2',BR_B_Xs_gamma(mb,mw,x_axis,x_axis + 20,\
    #                                              [1.0/2.0],[1.0],[0],[0])\
    #            )
    theta_c = bsg.PI / 4.0
    tan_beta = 2.0
    Y1_array = -1.0 / tan_beta * np.cos(theta_c)
    X1_array = 1.0 / tan_beta * np.cos(theta_c)
    X2_array = -1.0 / tan_beta * np.sin(theta_c)
    Y2_array = 1.0 / tan_beta * np.sin(theta_c)
    y12_2hdm = np.array(bsg.BR_B_Xs_gamma(mb,mw,x_axis,x_axis + bsg.mass_differ,\
                                      [1.0/2.0],[-1.0/4.0],[0],[0]) )
    y12_3hdm = np.array(bsg.BR_B_Xs_gamma(mb,mw,x_axis,x_axis + bsg.mass_differ,\
                     [Y1_array],[np.array(X1_array) * np.conjugate(Y1_array)],\
                     [Y2_array],[np.array(X2_array) * np.conjugate(Y2_array)]) )
    plt.plot(x_axis, y12_2hdm / (1e-4))
    plt.plot(x_axis, y12_3hdm / (1e-4))
    plt.xlabel('$M_{H^{\pm}_{1}}$')
    plt.ylabel('BR($\\bar{B} \\to X_{s} \gamma$) $\\times 10^{4}$')
    plt.title('Figure 4:$\\theta = \\pi$/4,$M_{H^{\pm}_{2}}$ = $M_{H^{\pm}_{1}}$ +' \
                   + str(bsg.mass_differ)+ ' GeV' )
    plt.legend(('Type I tan$\\beta =$ 2 2HDM', 'Type I tan$\\beta =$ 2 3HDM '))
    #    for n in np.arange(0,len(axs)):

    #        y22_axis3hdm= BR_B_Xs_gamma(mb,mw,x_axis,x_axis + 20,\
    #                        Y2(*array4()[n]),complexyfunction(*array4()[n]),\
    #                        Y3(*array4()[n]),complexyfunction3(*array4()[n]))
    #        plt.plot(x_axis,y22_axis3hdm / (1e-4))
    plt.axis([100.0, 1000.0, 1.0, 7.0])
    plt.show()
    plt.close()
    return
def plt_A_B_bsg(i, j):  # Bsgamma-result in {A,B} plane
    mass_axis1, mass_axis2 = i, j
    print(ABarray4()[0], mass_axis1, len(ABarray4()))
    print(ABarray4()[1], mass_axis2, len(ABarray4()))
    resultb = []
    #B>Xs+gamma SECTION
    for n in np.arange(0, len(ABarray4())):
        y3hdm= bsg.BR_B_Xs_gamma(mb,mw,mass_axis1,mass_axis2,\
                        exe.Y2(*ABarray4()[n] ), exe.complexyfunction(*ABarray4()[n] ),\
                        exe.Y3(*ABarray4()[n] ), exe.complexyfunction3(*ABarray4()[n] ))
        resultb.append(y3hdm / (1e-4))
#########
    bsgamm = plt.contourf(exe.A, exe.B, \
           np.resize(np.array(resultb).flatten()  ,len(np.array(resultb).flatten() ) ).\
          reshape(len(exe.B),len(exe.A)) ,\
          levels = np.array([2.99,3.55]),colors = ['green'] )
    plt.colorbar(bsgamm)
    plt.title('BR($\\bar{B} \\to X_{s} \gamma$) in '\
                    + str("%02d" % mass_axis1) +', ' + str("%02d"% mass_axis2) )
    plt.xlabel(exe.readlist[int(exe.read1)])
    plt.ylabel(exe.readlist[int(exe.read2)])
    plt.axis([0, 6.5, -1.6, 0])
    #    plt.axis([1,60,-1.6,0])
    #    plt.axis([0,60,0,60])
    plt.savefig(
        str("%02d" % mass_axis1) + str("%02d" % mass_axis2) + 'bsg.png')
    plt.show()
    plt.close()
def plot_under_deltascan(i, j, k, l):
    m1_axis = np.array([i for i in np.arange(50, 550, 50)])
    m2_axis = np.array([i for i in np.arange(50, 1050, 50)])
    m2 = m2_axis[0]
    m1 = m1_axis[0]
    #    print('i,j,k,l',i,j,k,l)
    #    xx, yy = np.meshgrid(m1_axis, m2_axis)
    print('i,j,k,l', i, j, k, l)
    empty = []
    for m2 in m2_axis:
        for m1 in m1_axis:
            threehdm = bsg.BR_B_Xs_gamma(mb,mw,m1,m2,\
                        [exe.Y2(i,j,k,l)],[- exe.X2(i,j,k,l) * np.conjugate(exe.Y2(i,j,k,l) )],\
                        [exe.Y3(i,j,k,l)],[- exe.X3(i,j,k,l) * np.conjugate(exe.Y3(i,j,k,l) )])
            empty.append(threehdm)
    result = plt.contourf(m1_axis, m2_axis, \
           np.resize(np.array(empty) / (1e-4),len(np.array(empty) / (1e-4))).\
           reshape(len(m2_axis),len(m1_axis)), \
           colors = ['black','royalblue','purple','darkgreen','brown','red','gray','orange'],\
           levels = np.array([2.99,3.55])
           )
    plt.colorbar(result)
    plt.xlabel('$M_{H^{\pm}_{1}}$')
    plt.ylabel('$M_{H^{\pm}_{2}}$')
    plt.title('BR($\\bar{B} \\to X_{s} \gamma$) $\\times 10^{4}$')
    plt.grid(axis='y', linestyle='-', color='0.75')  # show y-axis grid line
    plt.grid(axis='x', linestyle='-', color='0.75')  # show x-axis grid line
    #    plt.axis([50,200, 50.0, 1000.0])
    plt.axis([0, 500, 0.0, 1000.0])
    plt.show()
    plt.close()
def Plot_5():  #Andrew and Stefano Paper
    x_axis = np.array([i for i in np.arange(100, 1020, 20)])
    #    print('II 2HDM tanbeta = 2',BR_B_Xs_gamma(mb,mw,x_axis,x_axis + 20,\
    #                                              [1.0/2.0],[1.0],[0],[0])\
    #            )
    #    cpphase = np.exp(complex(0,PI))
    y22_2hdm = np.array(bsg.BR_B_Xs_gamma(mb,mw,x_axis,x_axis + bsg.mass_differ,\
                                      [1.0/2.0],[1.0],[0],[0]) )
    plt.plot(x_axis, y22_2hdm / (1e-4))
    theta_c = -bsg.PI / 4.0
    tan_beta = 2
    cos_beta = 1 / np.sqrt(1 + tan_beta**2)
    #    tan_gamma = n
    for n in np.array([2, 4, 7, 10, 20]):

        X1_array = -tan_beta * np.cos(theta_c) - n / (cos_beta) * np.sin(
            theta_c)  #\
        # * cpphase
        Y1_array = -1.0 / tan_beta * np.cos(theta_c)
        X2_array = tan_beta * np.sin(theta_c) - n / (cos_beta) * np.cos(
            theta_c)  #\
        # * cpphase
        Y2_array = 1.0 / tan_beta * np.sin(theta_c)

        y12_3hdm = np.array(bsg.BR_B_Xs_gamma(mb,mw,x_axis,x_axis + bsg.mass_differ,\
                     [Y1_array],[np.array(X1_array) * np.conjugate(Y1_array)],\
                     [Y2_array],[np.array(X2_array) * np.conjugate(Y2_array)]) )
        #        print(y12_3hdm/ (1e-4))
        plt.plot(x_axis, y12_3hdm / (1e-4))
        plt.xlabel('$M_{H^{\pm}_{1}}$')
        plt.ylabel('BR($\\bar{B} \\to X_{s} \gamma$) $\\times 10^{4}$')
        plt.title('Figure 5:$\\theta = -\\pi$/4, $M_{H^{\pm}_{2}}$ = $M_{H^{\pm}_{1}}$ +' \
                   + str(bsg.mass_differ)+ ' GeV' )
    plt.legend(('Type II tan$\\beta =$ 2 2HDM', 'Type II tan$\\gamma =$ 2 3HDM ',\
                    'Type II tan$\\gamma =$ 4 3HDM ','Type II tan$\\gamma =$ 7 3HDM ',\
                    'Type II tan$\\gamma =$ 10 3HDM ','Type II tan$\\gamma =$ 20 3HDM '),\
               loc='upper right', shadow=True,prop={'size': 7.5} )
    #    for n in np.arange(0,len(axs)):

    #        y22_axis3hdm= BR_B_Xs_gamma(mb,mw,x_axis,x_axis + 20,\
    #                        Y2(*array4()[n]),complexyfunction(*array4()[n]),\
    #                        Y3(*array4()[n]),complexyfunction3(*array4()[n]))
    #        plt.plot(x_axis,y22_axis3hdm / (1e-4))
    plt.axis([100.0, 1000.0, 1.0, 6.0])
    plt.show()
    plt.close()
    return
def numerical():
    mass_axis = (80.0, 250.0)
    result = []
    for n in np.arange(0, len(ABarray4())):
        y3hdm= bsg.BR_B_Xs_gamma(mb,mw,mass_axis[0],mass_axis[1],\
                        exe.Y2(*ABarray4()[n] ),- exe.complexyfunction(*ABarray4()[n] ),\
                        exe.Y3(*ABarray4()[n] ),- exe.complexyfunction3(*ABarray4()[n] ))
        #        print(y3hdm / (1e-4),n)
        result.append(y3hdm / (1e-4))
    return np.concatenate(result).ravel()
def Plot_3():  #Figure 3 DOI: 10.1142/S0217751X17501457
    x_axis = np.array([i for i in np.arange(100, 1020, 20)])
    print(x_axis, type(x_axis), x_axis.shape)
    y11_axis = np.array(bsg.BR_B_Xs_gamma(mb,mw,x_axis,x_axis + bsg.mass_differ,\
                                      [1.0],[-1.0],[0],[0]) )
    y12_axis = np.array(bsg.BR_B_Xs_gamma(mb,mw,x_axis,x_axis + bsg.mass_differ,\
                                      [1.0/2.0],[-1.0/4.0],[0],[0]) )
    y130_axis = np.array(bsg.BR_B_Xs_gamma(mb,mw,x_axis,x_axis + bsg.mass_differ,\
                                      [1.0/30.0],[-1.0/900],[0],[0]) )
    y21_axis = np.array(bsg.BR_B_Xs_gamma(mb,mw,x_axis,x_axis + bsg.mass_differ,\
                                      [1.0],[1.0],[0],[0]) )
    y22_axis = np.array(bsg.BR_B_Xs_gamma(mb,mw,x_axis,x_axis + bsg.mass_differ,\
                                      [1.0/2.0],[1.0],[0],[0]) )
    y230_axis = np.array(bsg.BR_B_Xs_gamma(mb,mw,x_axis,x_axis + bsg.mass_differ,\
                                      [1.0/30.0],[1.0],[0],[0]) )
    plt.axis([100.0, 1000.0, 1.0, 7.0])
    plt.plot(x_axis, y11_axis / (1e-4))
    plt.plot(x_axis, y12_axis / (1e-4))
    plt.plot(x_axis, y130_axis / (1e-4))
    plt.plot(x_axis, y21_axis / (1e-4))
    plt.plot(x_axis, y22_axis / (1e-4))
    plt.plot(x_axis, y230_axis / (1e-4))
    print('type I tanbeta = 1', y11_axis / (1e-4))
    print('type I tanbeta = 30', y130_axis / (1e-4))
    plt.xlabel('$M_{H^{\pm}}$')
    plt.ylabel('BR($\\bar{B} \\to X_{s} \gamma$) $\\times 10^{4}$')
    plt.title(
        'Figure 3: BR($\\bar{B} \\to X_{s} \gamma$) VS. $M_{H^{\pm}_{1}}$ ')
    plt.legend(('Type I tan$\\beta =$ 1', 'Type I tan$\\beta =$ 2', 'Type I tan$\\beta =$ 30',\
            'Type II tan$\\beta =$ 1', 'Type II tan$\\beta =$ 2', 'Type II tan$\\beta =$ 30'),
           loc='upper right', shadow=True,prop={'size': 7.8})
    plt.show()
    plt.close
def plt_A_B_bsgnedm(i, j):  # Bsgamma-result and N-EDM in {A,B} plane
    mass_axis1, mass_axis2 = i, j
    print(ABarray4()[0], mass_axis1, len(ABarray4()))
    print(ABarray4()[1], mass_axis2, len(ABarray4()))
    resultb = []
    resultn = []
    resulte = []
    #B>Xs+gamma SECTION
    for n in np.arange(0, len(ABarray4())):
        y3hdm= bsg.BR_B_Xs_gamma(mb,mw,mass_axis1,mass_axis2,\
                        exe.Y2(*ABarray4()[n] ), exe.complexyfunction(*ABarray4()[n] ),\
                        exe.Y3(*ABarray4()[n] ), exe.complexyfunction3(*ABarray4()[n] ))
        resultb.append(y3hdm / (1e-4))
        #Nedm SECTION
        nedm3hdm = abs(dn(mass_axis1,mass_axis2, exe.complexyfunction(*ABarray4()[n]),\
                    exe.complexyfunction3(*ABarray4()[n]) ) / (5.06e13)  )\
                        / 1e-26
        resultn.append(nedm3hdm)
        #eedm SECTION
        eedm3hdm = abs(de(mass_axis1,mass_axis2,exe.yconjz2(*ABarray4()[n]),\
                    exe.yconjz3(*ABarray4()[n]) ) /1e-29  )
        resulte.append(eedm3hdm)


#########
    ned = plt.contourf(exe.A, exe.B, \
           np.resize(np.array(resultn).flatten()  ,len(np.array(resultn).flatten() ) ).\
          reshape(len(exe.B),len(exe.A)) ,\
          levels = np.array([0.0,1.8]),colors = ['red']  )
    #########
    bsgamm = plt.contourf(exe.A, exe.B, \
           np.resize(np.array(resultb).flatten()  ,len(np.array(resultb).flatten() ) ).\
          reshape(len(exe.B),len(exe.A)) ,\
          levels = np.array([2.99,3.55]),colors = ['green'] )
    #########
    #    eed = plt.contourf(exe.A, exe.B, \
    #           np.resize(np.array(resulte).flatten()  ,len(np.array(resulte).flatten() ) ).\
    #          reshape(len(exe.B),len(exe.A)) ,\
    #          levels = np.array([0.0,1.1]),colors = ['blue']  )

    plt.title('BR($\\bar{B} \\to X_{s} \gamma$) and NEDM in '\
                    + str("%02d" % mass_axis1) +', ' + str("%02d"% mass_axis2) )
    plt.xlabel(exe.readlist[int(exe.read1)])
    plt.ylabel(exe.readlist[int(exe.read2)])
    #    plt.axis([0,60,-1.6,0]) #{tanbeta/tangamma,theta} plane
    #    plt.axis([0,2 * PI ,-1.6,0]) #{theta,delta} plane
    plt.axis([0, 60, 0, 60])  # {tanbeta,tangamma} plane
    plt.savefig(
        str("%02d" % mass_axis1) + str("%02d" % mass_axis2) + 'bsg.png')
    plt.show()
    plt.close()
def rexy_imxy_bsg_nedm(mm1, mm2, i22, i33):
    #imn2min,max 0.0 42.9827952239115
    #imn2min,max 0.0 42.9827952239115
    #ren2min,max 0.0008955247801336608 43.58968705776075
    #ren3min,max 0.0013616841467565938 43.32971016574854
    m1, m2 = mm1, mm2
    i2, i3 = i22, i33
    re2 = np.arange(-43.6, 43.3)
    re3 = np.arange(-43.3, 43.6)
    im2 = np.arange(-43, 44)
    im3 = np.arange(-43, 44)
    j2 = re2 + 1j * im2
    j3 = re3 + 1j * im3
    #    print(j2.real,j3)
    resultb = []
    resultn = []
    for j in j2.imag:
        for i in j2.real:
            #B>Xs+gamma SECTION
            y3hdm= bsg.BR_B_Xs_gamma(mb,mw,m1,m2,\
                        i2, complex(i,j) ,\
                        i3, complex(10,-j) )
            resultb.append(y3hdm / (1e-4))
            #Nedm SECTION
            nedm3hdm = abs(dn(m1,m2, complex(i,j),\
                               complex(i,-j) ) / (5.06e13) / 1e-26  )
            resultn.append(nedm3hdm)
#    print(resultn)
#########
    ned = plt.contourf(j2.real, j2.imag, \
           np.resize(np.array(resultn).flatten()  ,len(np.array(resultn).flatten() ) ).\
          reshape(len(j2.imag),len(j2.real)) ,\
          levels = np.array([0.0,1.8]),colors = ['red']  )
    #########
    bsgamm = plt.contourf(j2.real, j2.imag, \
           np.resize(np.array(resultb).flatten()  ,len(np.array(resultb).flatten() ) ).\
          reshape(len(j2.imag),len(j2.real)) ,\
          levels = np.array([2.99,3.55]),colors = ['green'] )
    plt.title('BR($\\bar{B} \\to X_{s} \gamma$) and NEDM in '\
                    + str("%02d" % m1) +', ' + str("%02d"% m2) )
    plt.xlabel('Re$(X_2Y_2^*)$')
    plt.ylabel('Im$(X_2Y_2^*)$')
    #    plt.axis([-40,-15, -10,15])
    #    plt.savefig('rexy2imxy2'+ str("%02d" % m1) + str("%02d"% m2) +'.png')
    plt.show()
    plt.close()
    return
Exemple #10
0
def Plot4_8_9():  #Boltzmati's Paper

    x_axis = np.arange(-10.0, 10.25, 0.25)  # figure 8
    XYimx_axis = [complex(-2, i) * 1.0 for i in x_axis]
    rangephi = np.arange(0, np.pi, 0.01)  # figure 9
    #    print('rangephi', rangephi,len(rangephi))
    XYexpim_axis = [complex(np.cos(j), np.sin(j)) for j in rangephi]
    #    print('REALX,IMX:',[np.complex(-2,i)*1.0 for i in xim_axis],XYimx_axis)
    #    print('X = 2exp(i phi)',XYexpim_axis,len(XYexpim_axis))
    mhch = 100
    y48_axis = bsg.BR_B_Xs_gamma(4.8,mhch,mhch,mhch + bsg.mass_differ ,\
                        [1.0],x_axis ,[0.0],[0.0])
    y24_axis = bsg.BR_B_Xs_gamma(2.4,mhch,mhch,mhch + bsg.mass_differ ,\
                        [1.0],x_axis ,[0.0],[0.0])
    y96_axis = bsg.BR_B_Xs_gamma(9.6,mhch,mhch,mhch + bsg.mass_differ ,\
                        [1.0],x_axis ,[0.0],[0.0])
    y48imx_axis = bsg.BR_B_Xs_gamma(4.8,mhch,mhch,mhch + bsg.mass_differ ,\
                        [1.0],XYimx_axis,[0.0],[0.0])
    y24imx_axis = bsg.BR_B_Xs_gamma(2.4,mhch,mhch,mhch + bsg.mass_differ,\
                        [1.0],XYimx_axis,[0.0],[0.0])
    y96imx_axis = bsg.BR_B_Xs_gamma(9.6,mhch,mhch,mhch + bsg.mass_differ,\
                        [1.0],XYimx_axis,[0.0],[0.0])
    y48phi_axis = bsg.BR_B_Xs_gamma(4.8,mhch,mhch,mhch + bsg.mass_differ ,\
                        [0.5],XYexpim_axis,[0.0],[0.0])
    y24phi_axis = bsg.BR_B_Xs_gamma(2.4,mhch,mhch,mhch + bsg.mass_differ,\
                        [0.5],XYexpim_axis,[0.0],[0.0])
    y96phi_axis = bsg.BR_B_Xs_gamma(9.6,mhch,mhch,mhch + bsg.mass_differ,\
                        [0.5],XYexpim_axis,[0.0],[0.0])
    #    print('----',XYimx_axis)
    #    print(x_axis)
    #    print('48',y48_axis * (1e4))
    #    print('24',y24_axis * (1e4))
    #    print('96',y96_axis * (1e4))
    #    print('48im',y48imx_axis * (1e4) )
    #    print('24im',y24imx_axis * (1e4))
    #    print('96im',y96imx_axis * (1e4))
    plt.xlim(-10, 2)
    plt.ylim(-5, 10)
    plt.plot(x_axis, y48_axis * (1e4))
    plt.plot(x_axis, y24_axis * (1e4))
    plt.plot(x_axis, y96_axis * (1e4))
    plt.grid(axis='x', linestyle='-', color='0.4')  # show x-axis grid line
    plt.grid(axis='y', linestyle='-', color='0.4')  # show x-axis grid line
    plt.xlabel('X')
    plt.ylabel('BR($\\bar{B} \\to X_{s} \gamma$) $\\times 10^{4}$')
    plt.title('Figure4')
    plt.legend(('$\mu = 4.8$ GeV', '$\mu = 2.4$ GeV', '$\mu = 9.6$ GeV '),
               loc='lower left',
               shadow=True,
               prop={'size': 8})
    plt.show()

    plt.xlim(-7, 7)
    plt.ylim(-2, 7)
    plt.plot(x_axis, y48imx_axis * (1e4))
    plt.plot(x_axis, y24imx_axis * (1e4))
    plt.plot(x_axis, y96imx_axis * (1e4))
    #plt.grid(axis='y', linestyle='-', color='0.75') # show y-axis grid line
    plt.grid(axis='x', linestyle='-', color='0.75')  # show x-axis grid line
    plt.grid(axis='y', linestyle='-', color='0.75')  # show x-axis grid line
    plt.xlabel('Im(X)')
    plt.ylabel('BR($\\bar{B} \\to X_{s} \gamma$) $\\times 10^{4}$')
    plt.title('Figure8')
    plt.legend(('$\mu = 4.8$ GeV', '$\mu = 2.4$ GeV', '$\mu = 9.6$ GeV '),
               loc='lower right',
               shadow=True,
               prop={'size': 8})
    plt.show()
    plt.close
    plt.plot(rangephi, y48phi_axis / (1e-4))
    plt.plot(rangephi, y24phi_axis / (1e-4))
    plt.plot(rangephi, y96phi_axis / (1e-4))
    plt.grid(axis='x', linestyle='-', color='0.75')  # show x-axis grid line
    plt.grid(axis='y', linestyle='-', color='0.75')  # show x-axis grid line
    plt.xlabel('$\\phi$')
    plt.ylabel('BR($\\bar{B} \\to X_{s} \gamma$) $\\times 10^{4}$')
    plt.title('Figure9')
    plt.legend(('$\mu = 4.8$ GeV', '$\mu = 2.4$ GeV', '$\mu = 9.6$ GeV '),
               loc='upper right',
               shadow=True,
               prop={'size': 8})
    plt.xlim(0, np.pi)
    plt.ylim(0, 8.0)
    plt.show()
    plt.close