mirror of
https://github.com/QuantumPackage/qp2.git
synced 2025-04-26 02:04:45 +02:00
Change for Powell in geom_opt
This commit is contained in:
parent
ad0c807a53
commit
69d5811d14
@ -80,10 +80,16 @@ def get_coordinates():
|
|||||||
return np.array(ezfio.get_nuclei_nucl_coord())
|
return np.array(ezfio.get_nuclei_nucl_coord())
|
||||||
|
|
||||||
|
|
||||||
|
memo_energy = {}
|
||||||
def energy_function(coord, file, state, arguments):
|
def energy_function(coord, file, state, arguments):
|
||||||
"""Wrapper for the energy calculation, ensuring coordinates are updated."""
|
"""Wrapper for the energy calculation, ensuring coordinates are updated."""
|
||||||
|
h = np.array_str(coord)
|
||||||
|
if h in memo_energy:
|
||||||
|
return memo_energy[h]
|
||||||
|
|
||||||
set_coordinates(coord)
|
set_coordinates(coord)
|
||||||
energy = get_energy(file, state, arguments)
|
energy = get_energy(file, state, arguments)
|
||||||
|
memo_energy[h] = energy
|
||||||
|
|
||||||
label = ezfio.get_nuclei_nucl_label()
|
label = ezfio.get_nuclei_nucl_label()
|
||||||
num_atoms = len(label)
|
num_atoms = len(label)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user