mirror of
https://github.com/pfloos/quack
synced 2024-12-22 20:35:36 +01:00
new format for integrals write in file
This commit is contained in:
parent
324298fd84
commit
2ae4f95500
@ -96,7 +96,7 @@ def write_matrix_to_file(matrix,size,file,cutoff=1e-15):
|
|||||||
for i in range(size):
|
for i in range(size):
|
||||||
for j in range(i,size):
|
for j in range(i,size):
|
||||||
if abs(matrix[i][j]) > cutoff:
|
if abs(matrix[i][j]) > cutoff:
|
||||||
f.write(str(i+1)+' '+str(j+1)+' '+"{}".format(matrix[i][j]))
|
f.write(str(i+1)+' '+str(j+1)+' '+"{:.16E}".format(matrix[i][j]))
|
||||||
f.write('\n')
|
f.write('\n')
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ def write_tensor_to_file(tensor,size,file,cutoff=1e-15):
|
|||||||
for k in range(i,size):
|
for k in range(i,size):
|
||||||
for l in range(j,size):
|
for l in range(j,size):
|
||||||
if abs(tensor[i][k][j][l]) > cutoff:
|
if abs(tensor[i][k][j][l]) > cutoff:
|
||||||
f.write(str(i+1)+' '+str(j+1)+' '+str(k+1)+' '+str(l+1)+' '+"{}".format(tensor[i][k][j][l]))
|
f.write(str(i+1)+' '+str(j+1)+' '+str(k+1)+' '+str(l+1)+' '+"{:.16E}".format(tensor[i][k][j][l]))
|
||||||
f.write('\n')
|
f.write('\n')
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user