Ejemplo n.º 1
0
def RunPropagation():
	"""Perform propagation defined by 'config.ini' file.

	"""

	#Load config
	configFile = "config.ini"
	conf = pyprop.Load(configFile)
	
	#Setup propagation tasks. Initial state = ground state
	qnum = quantumnumbers.HydrogenicQuantumNumbers(2,1,0)
	tasks = [ComputeAtomicInitialState(qnum), ProgressReport(), DisplayGMRESError(), SaveWavefunction(False)]

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

	#Run propagation
	prop.run()

	return prop
Ejemplo n.º 2
0
def FindGroundstate(configFile="groundstate.ini"):
	"""Find groundstate using imaginary time propagation
	
	"""
	timers = pyprop.Timers()

	#Load config
	timers["Setup"].Start()
	conf = pyprop.Load(configFile)

	#Update config
	conf.SetValue("Names", "output_file_name", "./groundstate_fd.h5")
	conf.SetValue("Propagation", "timestep", -0.1j)
	conf.SetValue("Propagation", "duration", 50.0)
	conf.SetValue("Propagation", "renormalization", True)

	try:
		conf.Propagation.grid_potential_list.remove("Absorber")
	except:
		pass

	#Tasks
	tasks = [ProgressReport(), EnergyReport(), DisplayGMRESError()]#, SaveWavefunction(False)]

	#Setup propagation
	prop = Propagate(conf, tasks, 10)
	prop.preprocess()
	timers["Setup"].Stop()


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

	if pyprop.IsMaster():
		print
		print timers

	return prop