Convergence with iDEA¶
Introduction¶
In the many-body interacting quantum particle system, there are what is known as convergence parameters. As the wavefunction is propagated, these values need to ‘settle’ on a result before they can be considered useful; they need to be slightly adjusted either way to assess their stability.
How to converge¶
To test whether the parameter in question has been conserved, it needs to be reasonably concluded that after adjusting the initial parameters ever so slightly that the final result does not change a significant amount.
In this notebook, we will use the example of the total energy to test convergence. Firstly, we need to set up the environment, as normal:
[2]:
from iDEA.input import Input
# import plotting software
import matplotlib.pyplot as plt
# import parameters file into an object
pm = Input()
pm.run.NON = True
pm.run.name = "convNotebook"
pm.check()
Create a loop which runs the code for different values of xmax.
[3]:
pm.run.verbosity = 'low'
# Converging xmax parameter
for xmax in [4,6,8,10]:
# Note: the dependent sys.deltax is automatically updated
pm.sys.xmax = xmax
pm.sys.grid = 401
# perform checks on input parameters
pm.check()
results = pm.execute()
E = results.non.gs_non_E
print(" xmax = {:4.1f}, E = {:6.4f} Ha".format(xmax,E))
xmax = 4.0, E = 0.5733 Ha
xmax = 6.0, E = 0.5015 Ha
xmax = 8.0, E = 0.5000 Ha
xmax = 10.0, E = 0.5000 Ha
The Energy has remained the same for the last two outputs and can be said to have converged.
[ ]: