I am working with the following wavefuntion which describes two entangled photons. I need to normalize it over the frequency domain, $\omega_\alpha$ and $\omega_\beta$ are the frequency of the entangled photons. which for this functionthe range is from -2 to 4 ev.

\begin{equation} \Phi(\omega_\alpha,\omega_\beta)= \frac{1}{\omega_\alpha-1+0.5i}\frac{1}{\omega_\alpha+\omega_\beta-2+0.5i} \end{equation}

so i tried to do it analytically and it was not possible. now, I am looking for a numerical way to normalize it like using np.sum or any other easy numerical integration. I do not have much experience in numerical integration. I was wondering can someone give me some hints on how to normalize it using np.sum in Python?

  • 1
    $\begingroup$ Normalize over what space? 3D momentum space? Are $\omega_a$ and $\omega_b$ frequencies? $\endgroup$
    – G. Smith
    Commented Mar 1, 2021 at 1:14
  • $\begingroup$ Over frequency, \omega_\alpha and \omega_\beta are the frequency of the entangled photons. which for this function from the range of -2 to 4 ev, I am looking for to normalize it. $\endgroup$
    – Branson
    Commented Mar 1, 2021 at 1:46
  • $\begingroup$ The question is reasonably clear, but this is not really the place for the kind of help with code you're looking for. Computational Science may be appropriate, but be sure to look at their help center to see whether this kind of question is on-topic there. $\endgroup$ Commented Mar 4, 2021 at 11:18

1 Answer 1


If I understood correctly what you want, you need to compute a numeric double integral of the square of the absolute value of that function between -2 < wa, wb < 4 (square integration region).

something like this should work:

wa = np.linspace(-2, 4, 1000)

wb = np.linspace(-2, 4, 1000)

dwa = wa[1] - wa[2]

dwb = wb[2] - wb[1]

wwa, wwb = np.meshgrid(wa, wb)

F = 1/(wwa - 1 + 0.5j)...

F2 = abs(F)**2


  • $\begingroup$ Thank you very much. this is exactly what I was looking for. I am just wondering is there any way to increase the accuracy? I increased the number of steps it doesn't improve $\endgroup$
    – Branson
    Commented Mar 1, 2021 at 18:46
  • 1
    $\begingroup$ If the result does not change when you increase the step size, it may be that the integral has saturated to the actual true value. The function is pretty smooth, so it should get pretty accurate with a reasonable grinding in frequency. $\endgroup$
    – Bondo
    Commented Mar 2, 2021 at 0:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.