# Import the KohnSham module from ATK from ATK.KohnSham import * # Set up elements and positions elm = [ Hydrogen, Hydrogen ] pos = [ ( +0.4, 0.0, 0.0)*Angstrom, ( -0.4, 0.0, 0.0)*Angstrom ] # Add them to a configuration h2 = MoleculeConfiguration(elm,pos) # Setup Kohn-Sham method dft_method = KohnShamMethod() # Set name of check point file params = runtimeParameters( verbosity_level=10, checkpoint_filename='h2.nc' ) # Calculate the optimized atomic geometry h2_opt = calculateOptimizedAtomicGeometry( atomic_configuration=h2, method=dft_method, runtime_parameters=params ) # Print the coordinates of the individual atoms print '\nAtom coordinates\n---------------------------' for coord in h2_opt.cartesianCoordinates(): for c in coord: print '%7.4f' % (c.inUnitsOf(Angstrom)), print