예제 #1
0
def FindGroundstate():
	"""Find groundstate using imaginary time propagation
	
	"""
	timers = pyprop.Timers()

	timers["Setup"].Start()

	#Load config
	conf = pyprop.Load("groundstate.ini")

	#Initialize propagation tasks
	tasks = [ProgressReport(), EnergyReport(), SaveWavefunction(False)]

	#Setup propagation
	prop = Propagate(conf, tasks, 20)

	timers["Setup"].Stop()

	print "psi shape = ", prop.Problem.psi.GetData().shape
	dx = diff(prop.Problem.psi.GetRepresentation().GetGlobalGrid(0))[0]
	pyprop.PrintOut("Radial grid spacing = %1.16f" % dx)

	#Run propagation
	timers["Propagate"].Start()
	prop.run()
	timers["Propagate"].Stop()

	if pyprop.IsMaster():
		print
		print timers

	return prop
예제 #2
0
def RunPropagation(configFile="propagate.ini"):
	"""Perform propagation defined by 'config.ini' file.

	"""
	#Load config
	conf = pyprop.Load(configFile)

	#Setup propagation tasks
	tasks = [ProgressReport(), SaveWavefunction(False)]

	#Setup propagation
	prop = Propagate(conf, tasks, 100)

	#Run propagation
	prop.run()


	return prop