import numpy as np import pyspawn pyspawn.import_methods.into_simulation(pyspawn.qm_integrator.rk2) pyspawn.import_methods.into_simulation(pyspawn.qm_hamiltonian.adiabatic) pyspawn.import_methods.into_traj(pyspawn.potential.test_cone) pyspawn.import_methods.into_traj(pyspawn.classical_integrator.vv) traj1 = pyspawn.traj() t0 = 0.0 timestep = 0.02 tfinal = 4.0 ndims = 2 nstates = 2 istate = 1 pos = np.random.normal(0.0, 1.0, ndims) mom = np.random.normal(0.0, 0.1, ndims) wid = np.ones(ndims) m = np.ones(ndims)
"qm_amplitudes": np.ones(1, dtype=np.complex128), # energy shift used in quantum propagation "qm_energy_shift": -5.18, } # import routines needed for propagation exec("pyspawn.import_methods.into_simulation(pyspawn.qm_integrator." + qm_prop + ")") exec("pyspawn.import_methods.into_simulation(pyspawn.qm_hamiltonian." + qm_ham + ")") exec("pyspawn.import_methods.into_traj(pyspawn.potential." + potential + ")") exec("pyspawn.import_methods.into_traj(pyspawn.classical_integrator." + clas_prop + ")") # check for the existence of files from a past run pyspawn.general.check_files() # set up first trajectory traj1 = pyspawn.traj(numdims, numstates) traj1.set_numstates(numstates) traj1.set_numdims(numdims) traj1.set_parameters(traj_params) # set up simulation sim = pyspawn.simulation() sim.add_traj(traj1) sim.set_parameters(sim_params) # begin propagation sim.propagate()