Commit c746a478 authored by Roland Haas's avatar Roland Haas

POWER: use sqrt rather than x**(1/2)

this is faster and also safer if anyone uses python2
parent 00398f21
......@@ -461,11 +461,11 @@ if __name__ == "__main__":
mp_psi4_vars[i][:, 2] *= radii[i]
#Check for psi4 amplitude going to zero
cur_psi4_amp = (mp_psi4_vars[i][0, 1]**2 + mp_psi4_vars[i][0, 2]**2)**(1/2)
cur_psi4_amp = np.sqrt(mp_psi4_vars[i][0, 1]**2 + mp_psi4_vars[i][0, 2]**2)
min_psi4_amp = cur_psi4_amp
# TODO: use array notatino for this since it finds the minimum amplitude
for j in range(0, len(mp_psi4_vars[i][:, 0])):
cur_psi4_amp = (mp_psi4_vars[i][j, 1]**2 + mp_psi4_vars[i][j, 2]**2)**(1/2)
cur_psi4_amp = np.sqrt(mp_psi4_vars[i][j, 1]**2 + mp_psi4_vars[i][j, 2]**2)
if(cur_psi4_amp < min_psi4_amp):
min_psi4_amp = cur_psi4_amp
if(min_psi4_amp < np.finfo(float).eps and l >= 2):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment