Looking for efficient python program for this following python script
I noticed one of your issues is that you are calculating the same thing over and over again when it is possible to pre-calculate the values before looping. First of all:
x = sqrt(d0(m[i], m[i]))

and:
y = sqrt(d0(m[j], m[j]))

are doing the exact same thing. You are calculating the sqrt() of dot product of the entire length of the vector length^2 times! For your 5000 element vector list, that's 25,000,000 times.
When it comes to iterating over giant mounds of data, try to pre-calculate as much as possible. Try this:
pre_sqrt = [sqrt(d0(elem, elem)) for elem in m]
pre_d0 = [d0(i, j) for i in m for j in m]

Then, to reduce the amount of repetitive calls to len() and range():
vectorLength = len(vector)
iterRange = range(vectorLength)

Finally, this is how your for loops should look:
for i in iterRange:

    tmp = []    
    x = pre_sqrt[i]
    
    for j in iterRange:

        y = pre_sqrt[j]
        z = pre_d0[i*vectorLength + j]
                    
        w = z / (x * y)

        tmp.append(w)

    corr_matrix.append(tmp)

When I timed your implementation vs mine these were the average speeds over 10000 repetitions:

Old: .150 ms
Mine: .021 ms

That's about a 7 fold increase over your small sample vector. I imagine the speed increase will be even better when you enter the 5000 element vector.
You should also be aware that there could be some Python specific improvements to be made. For example, using lists vs numpy arrays to store large amounts of data. Perhaps someone else can elaborate further on those types of speed increases.