├── .gitignore ├── .travis.yml ├── COPYING ├── README ├── docs ├── Makefile ├── database │ ├── average_generator.yml │ ├── basis.yml │ ├── centers.yml │ ├── converter.yml │ ├── cosine.yml │ ├── crystal2qmc.yml │ ├── cubic_spline.yml │ ├── cutoff_cusp.yml │ ├── dmc.yml │ ├── ekt.yml │ ├── gamess2qmc.yml │ ├── gamessci2qmc.yml │ ├── gen_md.py │ ├── hamiltonian.yml │ ├── heg2qmc.yml │ ├── jastrow.yml │ ├── linear.yml │ ├── manybody_pol.yml │ ├── mo_matrix.yml │ ├── molecule.yml │ ├── nwchem2qmc.yml │ ├── optimize.yml │ ├── orbitals.yml │ ├── periodic.yml │ ├── pfaffian.yml │ ├── pfaffian_pair.yml │ ├── plot.yml │ ├── plot_1d.yml │ ├── poly_pade.yml │ ├── postprocess.yml │ ├── pseudopotential.yml │ ├── qmc_method.yml │ ├── region_fluctuation.yml │ ├── rmc.yml │ ├── siesta2qmc.yml │ ├── sk.yml │ ├── slater.yml │ ├── slater_jastrow.yml │ ├── tbdm_basis.yml │ ├── vmc.yml │ ├── wannier.yml │ └── wavefunction.yml └── guide │ ├── BCS_wfDoc.html │ ├── Basis_functionDoc.html │ ├── DynamicsDoc.html │ ├── G032qmcDoc.html │ ├── Local_density_accumulatorDoc.html │ ├── OBDMDoc.html │ ├── One_particle_densityDoc.html │ ├── Pfaff_wfDoc.html │ ├── PropertiesDoc.html │ ├── Pw2lcaoDoc.html │ ├── Rotate_methodDoc.html │ ├── TBDMDoc.html │ └── WavefunctionDoc.html ├── resources └── BFD_Library.xml ├── src ├── Doxyfile ├── Makefile ├── Makefile.gosling ├── Makefile.pw2lcao ├── attic │ ├── Basis_fitter.h │ ├── Binner.cpp │ ├── Binner.h │ ├── Cat_wf.cpp │ ├── Cat_wf.h │ ├── Cat_wf_data.cpp │ ├── Cat_wf_data.h │ ├── Cubic_spline3D.cpp │ ├── Cubic_spline3D.h │ ├── Ext_slat.cpp │ ├── Ext_slat.h │ ├── Ext_slat_data.cpp │ ├── Ext_slat_data.h │ ├── Fitbasis_method.cpp │ ├── Fitbasis_method.h │ ├── Jastrow2_three_diffspin_not_symmetric_version.cpp │ ├── Jastrow_wf.cpp │ ├── Jastrow_wf.h │ ├── Jastrow_wf_calc.cpp │ ├── Jastrow_wf_data.cpp │ ├── Jastrow_wf_data.h │ ├── Levenberg_Marquardt.cpp │ ├── Localize_method.cpp │ ├── Localize_method.h │ ├── MO_1d.cpp │ ├── MO_1d.h │ ├── Makefile.averr │ ├── Md_method.cpp │ ├── Md_method.h │ ├── Md_opt_method.cpp │ ├── Md_opt_method.h │ ├── Mesh_function.cpp │ ├── Mesh_function.h │ ├── Newton_opt_method.cpp │ ├── Newton_opt_method.h │ ├── Onebody_int_method.cpp │ ├── Onebody_int_method.h │ ├── Optimize_method2.cpp │ ├── Optimize_method2.h │ ├── Ring_sample.cpp │ ├── Ring_sample.h │ ├── Ring_system.cpp │ ├── Ring_system.h │ ├── averr.cpp │ ├── cdmc.cpp │ ├── create_mesh_orb.cpp │ ├── dataVis.cpp │ ├── dataVisF.cpp │ ├── dataVisF.h │ ├── elements.h │ ├── gaussian_set.cpp │ ├── gaussian_set.h │ ├── get_pol.pl │ ├── get_zpol.pl │ ├── integrals.h │ ├── jeep2qmc.cpp │ ├── jeep_der.cpp │ ├── jeep_utils.cpp │ ├── jeep_utils.h │ ├── local_moments_from_properties.cpp │ ├── md_drive.py │ ├── obdm_tbdm_from_properties.cpp │ ├── optimize.pl │ ├── overlaps.cpp │ ├── overlaps.h │ ├── pw2lcao.cpp │ ├── pwoverlap.cpp │ ├── sysdef.py │ ├── vecmath.h │ ├── walkerReDist.cpp │ └── wf_generator.pl ├── basis_function │ ├── Basis_function.cpp │ ├── Basis_function.h │ ├── Blochwave_function.cpp │ ├── Blochwave_function.h │ ├── CBasis_function.cpp │ ├── CBasis_function.h │ ├── CPlanewave_function.cpp │ ├── CPlanewave_function.h │ ├── Cosine_function.cpp │ ├── Cosine_function.h │ ├── Cubic_spline.h │ ├── Cubic_spline_build.cpp │ ├── Cubic_spline_calc.cpp │ ├── Cutoff_cusp.cpp │ ├── Cutoff_cusp.h │ ├── Exponent_cusp.cpp │ ├── Exponent_cusp.h │ ├── Gaussian_function.cpp │ ├── Gaussian_function.h │ ├── Gen_pade_function.cpp │ ├── Gen_pade_function.h │ ├── Group_function.cpp │ ├── Group_function.h │ ├── Pade_function.cpp │ ├── Pade_function.h │ ├── Planewave_function.cpp │ ├── Planewave_function.h │ ├── Poly_pade_function.cpp │ ├── Poly_pade_function.h │ ├── Rgaussian_function.cpp │ ├── Rgaussian_function.h │ ├── Spherical_bessel_function.cpp │ ├── Spherical_bessel_function.h │ ├── Spline_fitter.cpp │ ├── Spline_fitter.h │ └── make.include ├── converter │ ├── Blochwave_function.cpp │ ├── CBasis_function.h │ ├── Makefile │ ├── Pseudo_writer.cpp │ ├── Pseudo_writer.h │ ├── abinit2qmc.cpp │ ├── basis_writer.cpp │ ├── basis_writer.h │ ├── converter.cpp │ ├── converter.h │ ├── crystal2qmc.cpp │ ├── elements.h │ ├── g032qmcmain.cpp │ ├── g03tools.cpp │ ├── g03tools.h │ ├── gamess2qmc.cpp │ ├── gamessci2qmc.cpp │ ├── heg2qmc.cpp │ ├── heg2qmcc.cpp │ ├── indexx.cpp │ ├── indexx.h │ ├── nwchem2qmc.cpp │ ├── setk01.f │ ├── siesta2qmc.cpp │ ├── sqd2qmc.cpp │ ├── sqd2qmc.h │ ├── vecmath.h │ ├── wf_writer.cpp │ └── wf_writer.h ├── install.pl ├── macopt │ ├── macopt.cpp │ ├── macopt.h │ ├── make.include │ ├── nrutil.cpp │ ├── nrutil.h │ ├── r.cpp │ ├── r.h │ └── rand.h ├── make.include ├── make.rules ├── make │ ├── AIX-mpi.mk │ ├── AIX.mk │ ├── DEFAULT.mk │ ├── Darwin.mk │ ├── Linux-mpi.mk │ ├── Linux.mk │ ├── Linux_lapack.mk │ ├── Linux_lapack_einspline.mk │ ├── abe.mk │ ├── gcc-debug.mk │ ├── gcc-profile.mk │ ├── icc.mk │ ├── jaguar-head.mk │ └── jaguar.mk ├── method │ ├── Dmc_method.cpp │ ├── Dmc_method.h │ ├── Force_fitter.cpp │ ├── Force_fitter.h │ ├── Generate_sample.cpp │ ├── Generate_sample.h │ ├── Linear_optimization.cpp │ ├── Linear_optimization.h │ ├── Localize_method.cpp │ ├── Localize_method.h │ ├── Lowdin_method.cpp │ ├── Lowdin_method.h │ ├── Maximize_method.cpp │ ├── Maximize_method.h │ ├── Nodes_method.cpp │ ├── Nodes_method.h │ ├── Optimize_method.cpp │ ├── Optimize_method.h │ ├── Plot1d_method.cpp │ ├── Plot1d_method.h │ ├── Plot_method.cpp │ ├── Plot_method.h │ ├── Postprocess_method.cpp │ ├── Postprocess_method.h │ ├── Qmc_method.cpp │ ├── Qmc_method.h │ ├── Reptation_method.cpp │ ├── Reptation_method.h │ ├── Rndmc_method.cpp │ ├── Rndmc_method.h │ ├── Rotate_orbs.cpp │ ├── Rotate_orbs.h │ ├── Shdmc_method.cpp │ ├── Shdmc_method.h │ ├── Split_sample.cpp │ ├── Split_sample.h │ ├── Test_method.cpp │ ├── Test_method.h │ ├── Vmc_method.cpp │ ├── Vmc_method.h │ ├── Wannier_method.cpp │ ├── Wannier_method.h │ └── make.include ├── orbitals │ ├── Center_set.cpp │ ├── Center_set.h │ ├── MO_matrix.cpp │ ├── MO_matrix.h │ ├── MO_matrix_Cbasfunc.cpp │ ├── MO_matrix_Cbasfunc.h │ ├── MO_matrix_basfunc.cpp │ ├── MO_matrix_basfunc.h │ ├── MO_matrix_blas.h │ ├── MO_matrix_cutoff.h │ ├── MO_matrix_einspline.h │ └── make.include ├── program_utils │ ├── Array.h │ ├── Array45.h │ ├── MatrixAlgebra.h │ ├── MatrixAlgebrac.cpp │ ├── Program_options.h │ ├── Qmc_std.cpp │ ├── Qmc_std.h │ ├── average.cpp │ ├── average.h │ ├── cblas.h │ ├── gosling.make │ ├── jsontools.h │ ├── make.include │ ├── ooqmc.cpp │ ├── qmc_io.cpp │ ├── qmc_io.h │ ├── ulec.cpp │ ├── ulec.h │ └── vecmath.h ├── properties │ ├── Average_density_matrix.cpp │ ├── Average_density_matrix.h │ ├── Average_derivative_dm.cpp │ ├── Average_derivative_dm.h │ ├── Average_ekt.cpp │ ├── Average_ekt.h │ ├── Average_enmoment.cpp │ ├── Average_enmoment.h │ ├── Average_generator.cpp │ ├── Average_generator.h │ ├── Average_ldots.cpp │ ├── Average_ldots.h │ ├── Average_quadrupole.cpp │ ├── Average_quadrupole.h │ ├── Average_region_fluctuation.cpp │ ├── Average_region_fluctuation.h │ ├── Average_so.cpp │ ├── Average_so.h │ ├── Properties.cpp │ ├── Properties.h │ ├── Properties_average.cpp │ ├── Properties_average.h │ ├── Properties_block.cpp │ ├── Properties_block.h │ ├── Properties_gather.cpp │ ├── Properties_gather.h │ ├── Properties_point.cpp │ ├── Properties_point.h │ ├── Space_warper.cpp │ ├── Space_warper.h │ ├── gosling.cpp │ └── make.include ├── system │ ├── HEG_sample.cpp │ ├── HEG_sample.h │ ├── HEG_system.cpp │ ├── HEG_system.h │ ├── Molecular_sample.cpp │ ├── Molecular_sample.h │ ├── Molecular_system.cpp │ ├── Molecular_system.h │ ├── Particle_set.cpp │ ├── Particle_set.h │ ├── Pbc_enforcer.cpp │ ├── Pbc_enforcer.h │ ├── Periodic_sample.cpp │ ├── Periodic_sample.h │ ├── Periodic_system.cpp │ ├── Periodic_system.h │ ├── Pseudopotential.cpp │ ├── Pseudopotential.h │ ├── Pseudopotential_so.cpp │ ├── Pseudopotential_so.h │ ├── SHO_sample.cpp │ ├── SHO_sample.h │ ├── SHO_system.cpp │ ├── SHO_system.h │ ├── Sample_point.cpp │ ├── Sample_point.h │ ├── System.cpp │ ├── System.h │ ├── gesqua.cpp │ ├── gesqua.h │ └── make.include └── wavefunction │ ├── BCS_wf.cpp │ ├── BCS_wf.h │ ├── BCS_wf_data.cpp │ ├── BCS_wf_data.h │ ├── Backflow_pf_wf.cpp │ ├── Backflow_pf_wf.h │ ├── Backflow_pf_wf_data.cpp │ ├── Backflow_pf_wf_data.h │ ├── Backflow_wf.cpp │ ├── Backflow_wf.h │ ├── Backflow_wf_data.cpp │ ├── Backflow_wf_data.h │ ├── Concatenate_wf.h │ ├── Concatenate_wf_data.h │ ├── Guiding_function.h │ ├── Jastrow2_one.cpp │ ├── Jastrow2_one.h │ ├── Jastrow2_three.cpp │ ├── Jastrow2_three.h │ ├── Jastrow2_three_diffspin.cpp │ ├── Jastrow2_three_diffspin.h │ ├── Jastrow2_two.cpp │ ├── Jastrow2_two.h │ ├── Jastrow2_wf.cpp │ ├── Jastrow2_wf.h │ ├── Orbital_rotation.cpp │ ├── Orbital_rotation.h │ ├── Pfaff_wf.h │ ├── Pfaff_wf_calc.cpp │ ├── Pfaff_wf_data.cpp │ ├── Pfaff_wf_data.h │ ├── Slat_Jastrow.cpp │ ├── Slat_Jastrow.h │ ├── Slat_Jastrow_data.cpp │ ├── Slat_Jastrow_data.h │ ├── Slat_wf.h │ ├── Slat_wf_data.cpp │ ├── Slat_wf_data.h │ ├── Wavefunction.cpp │ ├── Wavefunction.h │ ├── Wavefunction_data.cpp │ ├── Wavefunction_data.h │ ├── Wf_return.cpp │ ├── Wf_return.h │ ├── clark_updates.cpp │ ├── clark_updates.h │ └── make.include ├── tests ├── Makefile ├── combine_report.sh ├── h │ ├── h.dat │ ├── h.inp │ ├── h.log │ ├── qw.basis │ ├── qw.dmc │ ├── qw.hf │ ├── qw.orb │ ├── qw.slater │ ├── qw.sys │ ├── run_test │ └── run_test.py ├── h2 │ ├── h.dat │ ├── h.inp │ ├── h.log │ ├── jast2.wfin │ ├── qw.basis │ ├── qw.linear │ ├── qw.linear_orbrot │ ├── qw.orb │ ├── qw.slater │ ├── qw.slater_orbrot │ ├── qw.sys │ ├── qw.test │ ├── qw.testder │ ├── qw.testder_orbrot │ ├── run_test │ └── run_test.py ├── n2 │ ├── cidet │ ├── n2.dat │ ├── n2.inp │ ├── n2.log │ ├── n2_ci.dat │ ├── n2_ci.inp │ ├── n2_ci.log │ ├── qw.basis │ ├── qw.ci │ ├── qw.citest │ ├── qw.jast3 │ ├── qw.orb │ ├── qw.sjtest │ ├── qw.slater │ ├── qw.sys │ ├── run_test │ └── run_test.py ├── qwtest.py └── si │ ├── crys.in │ ├── prop.in │ ├── qw.basis │ ├── qw_111.blas.hf │ ├── qw_111.cutoff.hf │ ├── qw_111.orb │ ├── qw_111.slater │ ├── qw_111.sys │ ├── qw_222.blas.hf │ ├── qw_222.cutoff.hf │ ├── qw_222.orb │ ├── qw_222.slater │ ├── qw_222.sys │ └── run_test.py └── utils ├── autogen ├── BFD_Library.xml ├── Specific │ ├── bw.py │ ├── local.py │ ├── mira.py │ ├── taub.py │ └── veritas.py ├── cif2crystal.py ├── crystal2qmc.py ├── gamessbasis2xml.py ├── job_control.py ├── job_prep.py ├── runcrystal.py ├── runqwalk.py ├── schema.json ├── submission_tools.py └── xyz2crystal.py ├── compare_mo.cpp ├── convert_old_trace.cpp ├── crystal2qmc_wrap.py ├── crystal_patch_output.py ├── cubetools.py ├── getpsp.py ├── newk.sh ├── optimize_stars.py ├── orbfile.py ├── readcrys10.f ├── separate_jastrow ├── smooth_cube.cpp └── swap_endian.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | #Other things 35 | *.html 36 | *-Darwin 37 | src/obj/* 38 | src/latex/* 39 | src/html/* 40 | bin/* 41 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | compiler: clang 3 | before_install: sudo apt-get install -y libatlas-dev liblapack-dev 4 | script: cd src && make install PLATFORM=Linux_lapack && make PLATFORM=gcc-debug && cd ../tests && make -k 5 | 6 | env: 7 | global: 8 | - MAKEFLAGS="-j 4" 9 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | #To set up, do pip install mkdocs python-markdown-math 2 | 3 | 4 | all: 5 | mkdir -p mkdocs/docs 6 | cd database; python gen_md.py 7 | cd mkdocs; mkdocs build --clean 8 | 9 | tgz: all 10 | cd mkdocs/site; tar -czf ../../docs.tgz * 11 | 12 | serve: all 13 | cd mkdocs; mkdocs serve 14 | 15 | clean: 16 | rm -rf mkdocs 17 | -------------------------------------------------------------------------------- /docs/database/average_generator.yml: -------------------------------------------------------------------------------- 1 | type: Category 2 | name: Average generator 3 | title: Average generator 4 | -------------------------------------------------------------------------------- /docs/database/basis.yml: -------------------------------------------------------------------------------- 1 | type: Category 2 | name: Basis function 3 | title: Basis function 4 | -------------------------------------------------------------------------------- /docs/database/centers.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: centers 3 | keyword: CENTERS 4 | is_a: Orbital 5 | title: Centers for orbital evaluation 6 | description: > 7 | This object represents centers around which the orbitals should be evaluated. 8 | These correspond to the centers in the ORBFILE, and the labels in the basis function objects also refer to these labels. 9 | 10 | related: [] 11 | required: 12 | - keyword: USEATOMS 13 | type: Keyword 14 | description: Use the atomic coordinates in System. 15 | - keyword: USEGLOBAL 16 | type: Keyword 17 | description: Use the centers generated by the System. In molecular systems, this will be just the atomic centers, but in solids, it will include auxilliary centers around which to calculate the basis functions. 18 | - keyword: READ 19 | type: string 20 | description: > 21 | Read the centers from a file. The format is 22 | 23 | ncenters 24 | 25 | label1 x1 y1 z1 26 | 27 | label2 x2 y2 z2 28 | 29 | and so on. 30 | optional: [] 31 | -------------------------------------------------------------------------------- /docs/database/converter.yml: -------------------------------------------------------------------------------- 1 | type: Category 2 | name: Converter 3 | title: Converters 4 | -------------------------------------------------------------------------------- /docs/database/cosine.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: Cosine functions 3 | keyword: COSINE 4 | title: Cosine basis function 5 | is_a: Basis function 6 | description: > 7 | The function \( f(r)=\cos(g\cdot r) \) , where 8 | required: 9 | - keyword: GVECTOR 10 | type: section 11 | description: A list of the \( g \) vectors this function represents. 12 | optional: [] 13 | -------------------------------------------------------------------------------- /docs/database/crystal2qmc.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: Crystal2qmc 3 | keyword: crystal2qmc 4 | is_a: Converter 5 | title: Crystal to QWalk 6 | description: > 7 | Basic usage: 8 | 9 | 10 | crystal2qmc -o (outputroot) (crystal output file) 11 | 12 | 13 | Note that the current version of crystal2qmc is not tested with versions previous to Crystal2009. It may or may not work properly. There are two main paths to getting CRYSTAL to output the orbitals for crystal2qmc to read. 14 | 15 | 16 | First option, output by the main crystal program. 17 | 18 | PRINTOUT 19 | EIGENVAL 20 | -1 21 | EIGENVEC 22 | -999 23 | END 24 | 25 | in the third section. 26 | CRYSTAL2009 has a bug when run in parallel, in which the eigenvec printout is sometimes corrupted, so this option may not work. 27 | 28 | 29 | Second option, output the orbitals using properties. 30 | 31 | 1. Make sure that you did not run CRYSTAL with the PRINTOUT section above. 32 | 33 | 2. Run properties with the following input 34 | 35 | 36 | NEWK 37 | 4 4 38 | 1 1 39 | 67 999 40 | END 41 | 42 | 43 | Use the Python script utils/crystal_patch_output.py as follows. 44 | 45 | 46 | python crystal_patch_output.py crystal.d12.o properties.d3.o patched.o 47 | 48 | 49 | where crystal.d12.o is the output of the crystal run, properties.d3.o is the output of the properties run, and patched.o will be the file you use with crystal2qmc. 50 | 51 | 52 | required: [] 53 | optional: 54 | - keyword: -c 55 | type: flag 56 | default: off 57 | description: Read in the complex k-point from CRYSTAL. 58 | - keyword: -o 59 | type: filename 60 | default: Name of CRYSTAL file 61 | description: QWalk filenames will start with the value of this option 62 | - keyword: -fort10file 63 | type: filename 64 | default: none 65 | description: > 66 | (depreciated) Read from the output created by the readcrys10.f utility and match the orbitals to the one 67 | in the crystal output file. These are more accurate than the 68 | ones in the text output file. To use the fort10file option with Crystal98 69 | or Crystal2003, one must use NOSYMADA in the last section of the 70 | Crystal's input file. 71 | 72 | 73 | -------------------------------------------------------------------------------- /docs/database/cutoff_cusp.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: Cutoff_cusp 3 | keyword: CUTOFF_CUSP 4 | title: Cutoff cusp function 5 | is_a: Basis function 6 | description: > 7 | The function \( f(r)=c*p/(1+\gamma*p) \), where 8 | \( p=z-z^2+z^3/3 \), \( z=r/{rcut} \), \( \gamma \) is the 9 | curvature, and c is the cusp. \( \gamma \) can be optimized. 10 | required: 11 | - keyword: CUSP 12 | type: float 13 | description: The value of c 14 | - keyword: GAMMA 15 | type: float 16 | description: The value of \( \gamma \) 17 | - keyword: RCUT 18 | type: float 19 | description: The value of \( rcut \) 20 | optional: [] 21 | -------------------------------------------------------------------------------- /docs/database/gamess2qmc.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: GAMESS2qmc 3 | keyword: gamess2qmc 4 | is_a: Converter 5 | title: GAMESS to QWalk 6 | description: > 7 | Basic usage: 8 | 9 | 10 | gamess2qmc -o (outputroot) (gamess output root) 11 | 12 | By default, gamess2qmc will take the last geometry in the .out file and the last set of 13 | molecular orbitals in the .dat file. This is usually the right 14 | behavior. GVB wavefunctions are automatically read in. 15 | 16 | 17 | required: [] 18 | optional: 19 | - keyword: -o 20 | type: filename 21 | default: GAMESS root 22 | description: QWalk filenames will start with the value of this option 23 | - keyword: -virtual 24 | type: integer 25 | default: 10 26 | description: Include this number of virtual orbitals into the orb file. 27 | - keyword: -compare_punch 28 | type: filename 29 | default: do nothing 30 | description: > 31 | Compares the orbitals in the current punch file to the one specified 32 | here. Will print what orbitals have changed/rotated, and if any cannot be 33 | mapped between the two wavefunctions. 34 | 35 | 36 | -------------------------------------------------------------------------------- /docs/database/hamiltonian.yml: -------------------------------------------------------------------------------- 1 | type: Category 2 | name: Hamiltonian 3 | title: Hamiltonians 4 | -------------------------------------------------------------------------------- /docs/database/heg2qmc.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: Heg2qmc 3 | keyword: heg2qmc 4 | is_a: Converter 5 | title: Generate homogeneous electron gas for QWalk 6 | description: > 7 | Basic usage 8 | 9 | heg2qmc -o (outputroot) 10 | heg2qmcc -o (outputroot) 11 | 12 | This program guides you into creating a homogeneous electron gas simulation. 13 | It takes N_up, N_down, and rs from standard input. 'heg2qmc' will only use 14 | real k-points and fixed node, while 'heg2qmcc' will create a k-point mesh. 15 | 16 | The Jastrow factor outputroot.jast2 contains only the short-range part. 17 | outputroot.i.jast2 is k-point dependent with the long-range part expanded 18 | in plane waves as PRB 70, 235119 (2004). 19 | 20 | 21 | 22 | For heg2qmc, the k-points and their weights are given by 23 | 24 | 25 | 26 | Index | Weight 27 | 28 | --- | --- 29 | 30 | 0 | 1/8 31 | 32 | 1 | 3/8 33 | 34 | 2 | 3/8 35 | 36 | 3 | 1/8 37 | 38 | 39 | 40 | For heg2qmcc, the parameter D will correspond to various k-point meshes 41 | 42 | 43 | D | Number of k-points 44 | 45 | --- | --- 46 | 47 | 1 | 4 48 | 49 | 2 | 10 50 | 51 | 3 | 20 52 | 53 | 4 | 35 54 | 55 | 5 | 56 56 | 57 | 58 | The weights are written to the corresponding .sys files as comments. 59 | 60 | required: [] 61 | optional: 62 | - keyword: -bcs 63 | type: flag 64 | default: off 65 | description: Make a BCS wave function. 66 | - keyword: -o 67 | type: filename 68 | default: Name of CRYSTAL file 69 | description: QWalk filenames will start with the value of this option 70 | -------------------------------------------------------------------------------- /docs/database/linear.yml: -------------------------------------------------------------------------------- 1 | is_a: Method 2 | keyword: LINEAR 3 | name: Linear 4 | title: Linear energy optimization 5 | type: Entry 6 | description: Perform energy optimization using the method very similar to the one 7 | described by Umrigar and coworkers in Phys. Rev. Lett. 98, 110201 (2007). 8 | required: [] 9 | optional: 10 | - default: '16384' 11 | description: Total number of VMC steps to perform when calculating the Hamiltonian 12 | matrix. This is the most important variable to increase when improving the accuracy. 13 | keyword: TOTAL_NSTEP 14 | type: Integer 15 | - default: '1024' 16 | description: Number of configurations to use when calculating the step size using 17 | correlated sampling. 18 | keyword: TOTAL_FIT 19 | type: Integer 20 | - default: runid.wfout 21 | description: Choose the filename to place an input deck for the final wavefunction 22 | and intermediate ones as the optimization continues. 23 | keyword: WFOUTPUT 24 | type: String 25 | - default: '30' 26 | description: Number of optimization iterations. 27 | keyword: ITERATIONS 28 | type: Integer 29 | - default: '0.001' 30 | description: Stop run when changes in energy are less than this value (in Hartrees). 31 | keyword: EN_CONVERGENCE 32 | type: Float 33 | related: [] 34 | advanced: 35 | - default: TOTALNSTEP/nprocs 36 | description: Number of VMC steps to perform per processor to collect statistics 37 | on the Hamiltonian matrix. 38 | keyword: VMC_NSTEP 39 | type: Integer 40 | - default: '0.99' 41 | description: Fraction of the original wave function to keep per step. This is a 42 | stabilization parameter. 43 | keyword: MINIMUM_PSI0 44 | type: Float 45 | - default: 4*VMCNSTEP 46 | description: The optimization method will increase VMCNSTEP automatically if certain 47 | significance requirements are not met in the Hamiltonian matrix. This variable 48 | limits how much VMCNSTEP can be increased. 49 | keyword: MAX_VMC_NSTEP 50 | type: Integer 51 | - default: TOTALFIT/nprocs 52 | description: The number of configurations per processor used to evaluate the step 53 | size. This is adjusted automatically to ensure statistical significance. 54 | keyword: FIT_NCONFIG 55 | type: Integer 56 | - default: 8*FITNCONFIG 57 | description: Maximum number of configurations per processor to use to evaluate the 58 | step size. 59 | keyword: MAX_FIT_NCONFIG 60 | type: Integer 61 | 62 | -------------------------------------------------------------------------------- /docs/database/manybody_pol.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: MANYBODY_POL 3 | is_a: Average generator 4 | title: Manybody polarization operator 5 | keyword: MANYBODY_POL 6 | related: [] 7 | description: > 8 | \( z_i=\left\langle \exp(-i{\mathbf k_i} \cdot {\mathbf X}) \right\rangle \), where \( {\mathbf X} = \sum_j {\mathbf r_j} \) and \( {\mathbf k_i} \) is a reciprocal vector of the supercell. 9 | 10 | The magnitude of \( z_i \) is related to the localization length in the direction of the reciprocal lattice vector. 11 | Its phase gives the center of charge in the unit cell. 12 | 13 | required: [] 14 | optional: [] 15 | -------------------------------------------------------------------------------- /docs/database/mo_matrix.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: orbital3d 3 | keyword: CUTOFF_MO, STANDARD_MO, or BLAS_MO 4 | is_a: Orbital 5 | title: Molecular orbital evaluator 6 | description: > 7 | This is a collection of objects that evaluates orbitals as a linear combination of basis functions, as 8 | \( \phi_i({\mathbf r})=\sum_j c_{ij} b_j({\mathbf r}) \). 9 | All of these take the same input; they only differ in how they evaluate the sum. 10 | Typically BLAS_MO is the fastest implemenation if QWalk was compiled with USE_BLAS, followed by CUTOFF_MO. 11 | 12 | 13 | 14 | Since there are often many \( c_{ij} \) coefficients, these are stored in a .orb file. Its format is as follows. 15 | First there is a table with headers MO,AO(on a center),Center, Coefficient number. 16 | AO is corresponds to the basis label on a given center, that is, \( b_j \). 17 | Then the keyword COEFFICIENTS, followed by the \( c_{ij} \) in the order given in the table. 18 | For a complex orbital, the coefficients are in the format (real,imaginary). 19 | 20 | For example, a simple .orb file for H\(_2\) in a minimal basis would be 21 | 22 | 1 1 1 1 23 | 1 1 2 2 24 | 2 1 1 3 25 | 2 1 2 4 26 | COEFFICIENTS 27 | 0.5 0.5 0.5 -0.5 28 | 29 | This defines two molecular orbitals, with orbital 1 bonding and orbital 2 antibonding. 30 | 31 | related: [] 32 | required: 33 | - keyword: ORBFILE 34 | type: string 35 | description: Name of a file containing the orbital coefficients \( c_{ij} \). 36 | - keyword: NMO 37 | type: integer 38 | description: Number of molecular orbitals to read from the .orb file. 39 | - keyword: BASIS 40 | type: section 41 | description: Input for a [Basis function](Basis function). There can be several of these sections in a row (the order matters!) 42 | optional: 43 | - keyword: CENTERS 44 | type: section 45 | default: CENTERS { USEATOMS } 46 | description: Input for a Centers object. Possibilities include USEATOMS, USEGLOBAL (to use a set provided by the Hamiltonian), and READ to read in a centers file. 47 | - keyword: MAGNIFY 48 | type: float 49 | default: 1.0 50 | description: Multiply all \( c_{ij} )\ by this factor. 51 | -------------------------------------------------------------------------------- /docs/database/molecule.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | title: Molecular Hamiltonian (open boundary conditions) 3 | name: Molecule 4 | keyword: MOLECULE 5 | is_a: Hamiltonian 6 | description: > 7 | A molecule with open boundary conditions. 8 | related: [] 9 | required: 10 | - keyword: NSPIN 11 | type: section 12 | description: Two integers, the first the number of spin up electrons and the second the number of spin down. 13 | - keyword: ATOM 14 | type: section 15 | description: > 16 | Add an atom to the system. The format of 17 | the section is label charge COOR x y z . For example, a Lithium atom 18 | with atomic charge 3 at (.5, 0, -.5) would be ATOM \{ Li 3 COOR .5 0 -.5 \}. 19 | optional: [] 20 | experimental: 21 | - keyword: BOUNDING_BOX 22 | type: section 23 | default: None 24 | description: > 25 | If an electron would leave the box defined here, wrap it back around. 26 | 27 | -------------------------------------------------------------------------------- /docs/database/nwchem2qmc.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: NWChem2qmc 3 | keyword: nwchem2qmc 4 | is_a: Converter 5 | title: NWChem to QWalk 6 | description: > 7 | Basic usage: 8 | 9 | 10 | nwchem2qmc -o (outputroot) (nwchem input root) 11 | 12 | Unlike gamess, nwchem prints out orbitals in a binary file called 13 | [input].movecs. So there is an additional step to first convert 14 | the .movecs to ASCII file. Go to nwchem_directory/contrib/mov2asc/, 15 | then make it. We need executable file called "mov2asc". 16 | 17 | Then, run 18 | mov2asc [large number] [input].movecs [input].nw.vecs. 19 | Be sure to name the nwchem output file [input].nw.out. So 20 | [input].nw.vecs and [input].nw.out are the two files we need. Now run 21 | /qwalk_directory/src/converter/nwchem2qmc [input], 22 | this generates all the files needed by qwalk. 23 | 24 | The converter only supports the Cartesian representation of the basis; i.e., 6D, 10F, etc. 25 | 26 | 27 | required: [] 28 | optional: 29 | - keyword: -o 30 | type: filename 31 | default: NWChem root 32 | description: QWalk filenames will start with the value of this option 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/database/optimize.yml: -------------------------------------------------------------------------------- 1 | { 2 | "type":"Entry", 3 | "name":"Optimize", 4 | "is_a":"Method", 5 | "keyword":"OPTIMIZE", 6 | "title":"Optimize (Variance)", 7 | "related":["Linear"], 8 | "description":"On a fixed sample set, optimize one of a number of objective functions with respect to the wave function parameters. Note that energy optimization using this method is typically not efficient or advised. This method is most useful to perform rough variance optimization of a Jastrow factor prior either to performing a DMC calculation or using the LINEAR method to optimize the energy.", 9 | "required":[], 10 | "optional":[ 11 | {"keyword":"READCONFIG","type":"String","default":"","description":"Read configurations from a file. By default, QWalk will generate the configurations automatically."}, 12 | {"keyword":"ITERATIONS","type":"Integer","default":"30 ", 13 | "description":"Number of optimization iterations."}, 14 | {"keyword":"EREF","type":"Float","default":"special","description":"A best guess at the optimized energy. If you don't put this keyword, QWalk will make a good guess at the proper value, which should be good enough unless the system is rather large."}, 15 | {"keyword":"WFOUTPUT","type":"String","default":"runid.wfout", 16 | "description":"Choose the filename to place an input deck for the final wavefunction and intermediate ones as the optimization continues."} 17 | 18 | ], 19 | "experimental":[ 20 | {"keyword":"NCONFIG","type":"Integer","default":"Special","description":"Number of configurations per processor. By default, QWalk will choose a total number close to 2048, spread across all processors."}, 21 | {"keyword":"USE_WEIGHTS","type":"Flag","default":"off", 22 | "description":"Turn on correlated-sampling type reweighting"}, 23 | {"keyword":"MIXING","type":"Float","default":"0.95","description":"For MINFUNCTION MIXED, the mixing weight for energy contribution"}, 24 | {"keyword":"EXTENDED_WFOUTPUT","type":"Flag","default":"off", 25 | "description":"Turn on printout of wavefunction after each step of optimization into a different file"} 26 | ] 27 | } 28 | 29 | -------------------------------------------------------------------------------- /docs/database/orbitals.yml: -------------------------------------------------------------------------------- 1 | type: Category 2 | name: Orbital 3 | title: Orbitals 4 | -------------------------------------------------------------------------------- /docs/database/periodic.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | title: Periodic Hamiltonian 3 | name: Periodic 4 | keyword: PERIODIC 5 | is_a: Hamiltonian 6 | description: > 7 | A bulk material simulated with periodic or twisted boundary conditions. 8 | related: [] 9 | required: 10 | - keyword: NSPIN 11 | type: section 12 | description: Two integers, the first the number of spin up electrons and the second the number of spin down. 13 | - keyword: ATOM 14 | type: section 15 | description: > 16 | Add an atom to the system. The format of 17 | the section is label charge COOR x y z . For example, a Lithium atom 18 | with atomic charge 3 at (.5, 0, -.5) would be ATOM \{ Li 3 COOR .5 0 -.5 \}. 19 | - keyword: LATTICEVEC 20 | type: section 21 | description: > 22 | Enforce the 23 | periodic boundary conditions as a parallelepiped, with three vectors specifying 24 | the edges. For example, a cubic cell with sides 1.0 a.u. is:
25 | LATTICEVEC { 26 | 1.0 0.0 0.0 27 | 0.0 1.0 0.0 28 | 0.0 0.0 1.0 29 | } 30 | optional: 31 | - keyword: KPOINT 32 | type: section 33 | default: { 0 0 0 } 34 | description: > 35 | Specify the k-point (i.e., 36 | boundary conditions) at which the trial wave function is 37 | constructed. For instance, 0 selects periodic and 1 38 | selects anti-periodic boundary condition along the 39 | corresponding lattice vector. 40 | - keyword: CUTOFF_DIVIDER 41 | type: Float 42 | default: 1.0 43 | description: > 44 | Control how many unit cells to generate ghost 45 | centers around the simulation cell. 1 is one unit cell, 2 is one 46 | half a unit cell, and .5 is 2 unit cells. This will often be set correctly by the 47 | conversion program. 48 | - keyword: EWALD_GMAX 49 | type: integer 50 | default: 200 51 | description: > 52 | How far to search to generate the k-mesh for the Ewald summation. Only the vectors with significant weights are kept. If you have a cell with a lattice vector larger than around 300 Bohr, this may need to be increased. 53 | 54 | 55 | -------------------------------------------------------------------------------- /docs/database/pfaffian.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: Pfaffian 3 | keyword: PFAFFIAN 4 | is_a: Wavefunction 5 | title: Pfaffian wave function 6 | description: > 7 | WARNING. This is a development feature. Make sure you know what you're doing before trying to use Pfaffians. 8 | A pfaffian (generalized determinant) or several pfaffians. 9 | See Bajdich et al. Phys. Rev. B 77 115112 (2008) for implementation details. 10 | 11 | Submatrices \( \boldsymbol \xi \), \( \boldsymbol \Phi \) and \( \boldsymbol \varphi \) are defined in Pfaffian group. 12 | and ordered according the ORBITAL_ORDER section. 13 | 14 | 15 | required: 16 | - keyword: NPAIRS 17 | type: section 18 | description: > 19 | Number of spin up, spin down, and unpaired electrons. The sum of these 3 numbers defines the Pfaffian matrix. 20 | - keyword: PFWT 21 | type: section 22 | description: > 23 | List of the weights of the Pfaffians, for a multi-Pfaffian wave function 24 | - keyword: PARIING_ORBITAL 25 | type: section 26 | description: Section for Pfaffian group 27 | - keyword: ORBITALS 28 | type: section 29 | description: Input for a MO Matrix object 30 | optional: 31 | - keyword: ORBITAL_ORDER 32 | type: section 33 | default: ith pairing orbital for ith Pfaffian matrix 34 | description: Contains upper-diagonal of \f( N \times N \f) matrix of pairing occupation numbers 35 | - keyword: OPTIMIZE_PFWT 36 | type: flag 37 | default: off 38 | description: Optimize the Pfaffian weights 39 | 40 | 41 | -------------------------------------------------------------------------------- /docs/database/pfaffian_pair.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: Pfaffian pairing orbital 3 | keyword: PAIRING_ORBITAL 4 | is_a: Orbital 5 | title: Pfaffian pairing orbital 6 | description: > 7 | WARNING. This is a development feature. Make sure you know what you're doing before trying to use Pfaffians. 8 | 9 | Defines the coefficients of linear combinations of one-particle orbitals from which the pairing orbitals are constructed. 10 | The normalization is everywhere such that sum of squares of independent coefficients is equal to 1. 11 | 12 | required: 13 | - keyword: TRIPLET_UU_COEF 14 | type: section 15 | description: N(N-1)/2 normalized coefficients for triplet spin-up spin-up pairs 16 | - keyword: TRIPLET_DD_COEF 17 | type: section 18 | description: Same as TRIPLET_UU_COEF for down-down pairs 19 | - keyword: SINGLET_COEF 20 | type: section 21 | description: N(N+1)/2 normalized coefficients for singlet pairing orbitals 22 | - keyword: UNPAIRED_COEF 23 | type: section 24 | description: Normalized coefficients for unpaired orbitals. 25 | optional: [] 26 | 27 | -------------------------------------------------------------------------------- /docs/database/plot.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: PLOT 3 | keyword: PLOT 4 | is_a: Method 5 | title: Plot orbitals 6 | related: [] 7 | description: > 8 | The PLOT method simply plots the one-particle orbitals and density 9 | of a trial function. These are output in Gaussian CUBE file format. 10 | The density, equal to the sum of squares of the orbitals, is also printed. 11 | This may or may not correspond to the actual electron density of the Slater 12 | determinant, depending on what orbitals were selected. 13 | 14 | There are some useful Python functions to manipulate CUBE files in qwalk/utils/readcube.py 15 | 16 | 17 | required: 18 | - keyword: ORBITALS 19 | type: section 20 | description: A section for [molecular orbitals](Orbital). 21 | optional: 22 | - keyword: RESOLUTION 23 | type: float 24 | default: 0.2 25 | description: The resolution in Bohrs. Smaller is better resolution. 26 | - keyword: PLOTORBITALS 27 | type: section 28 | default: all orbitals 29 | description: Which orbitals to plot. The first orbital starts at 1. 30 | - keyword: MINMAX 31 | type: section 32 | default: special 33 | description: > 34 | { xmin xmax ymin ymax zmin zmax }. 35 | By default, this is automatically set to include the entire system with some padding. 36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/database/plot_1d.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: PLOT1D 3 | keyword: PLOT1D 4 | is_a: Method 5 | title: Plot 1D functions in the wave function 6 | related: [] 7 | description: > 8 | Searches given trial wave function and plots its one-dimensional 9 | components. These are basically only one- and two-body terms in the 10 | Jastrow factor (group resolved). However, since these 11 | Jastrow_groups are used also as pair orbitals in the 12 | BCS wave function and as backflow transformations, the 13 | method is relatively widely applicable. 14 | 15 | The method generates output file with suffix .plt1d (can be overridden 16 | with optional keyword SUFFIX). Discretized independent variable 17 | is the first column and then follow as many columns as plottable 18 | components found in the wave function. Column description is also 19 | included in the header of the output file. It looks something like 20 | 21 | column description 22 | distance 23 | group 0, one-body, center LI 24 | group 1, one-body, center LI 25 | 26 | required: [] 27 | optional: 28 | - keyword: NGRID 29 | type: integer 30 | default: 100 31 | description: Number of grid points to use for the plotting 32 | - keyword: SUFFIX 33 | type: string 34 | default: plt1d 35 | description: Suffix of the output file 36 | 37 | -------------------------------------------------------------------------------- /docs/database/poly_pade.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: Poly_pade 3 | keyword: POLYPADE 4 | title: Polynomial Pade function 5 | is_a: Basis function 6 | description: > 7 | Set of functions of the form 8 | \[ 9 | a_n(r) = \frac{1-z(r/b_0)}{1+\beta_n z(r/b_0)} 10 | \] 11 | where 12 | \[ 13 | z(x)=x^2(6-8x+3x^2) 14 | \] 15 | and 16 | \[ 17 | \beta_n=\exp(\beta_0+1.6*n)-1 18 | \] 19 | 20 | This creates a set of monotonically functions that have zero derivative and value equal to 1 at r=0, as well as zero derivative and zero value at \( r= b_0 \). 21 | \( \beta_0 \) can be optimized and sets the longest distance function. 22 | required: 23 | - keyword: NFUNC 24 | type: integer 25 | description: The number of functions. 26 | - keyword: BETA 27 | type: float 28 | description: The value of \( \beta_0 \) 29 | - keyword: RCUT 30 | type: float 31 | description: The value of \( b_0 \) 32 | optional: [] 33 | -------------------------------------------------------------------------------- /docs/database/postprocess.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: POSTPROCESS 3 | keyword: POSTPROCESS 4 | is_a: Method 5 | title: Postprocess trace files 6 | related: [] 7 | description: > 8 | This method can evaluate operators on a trace file saved by DMC (or some other method). 9 | The trace file is expected to be a binary file laid out simply as the positions of each electron in (x,y,z) or der, followed by a single double that represents the weight of that walker. 10 | The file should be in C binary format (that is, no headers as in Fortran). 11 | 12 | required: 13 | - keyword: READCONFIG 14 | type: string 15 | description: > 16 | The name of the trace file from SAVE_TRACE (DMC) to read from. 17 | optional: 18 | - keyword: AVERAGE 19 | type: section 20 | default: empty 21 | description: Section for an [Average generator](Average generator) 22 | - keyword: NOENERGY 23 | type: flag 24 | default: off 25 | description: Do not calculate the energy of the walkers. This can improve the speed significantly. 26 | - keyword: NSKIP 27 | type: integer 28 | default: 0 29 | description: > 30 | Skip the first NSKIP configurations. This should be set to the number of warmup blocks times the number of configurations in the DMC run. The number of warmup blocks can be gotten by running gosling on the log file and counting how many blocks are thrown out. 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/database/pseudopotential.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: Pseudopotential 3 | keyword: PSEUDO 4 | is_a: Hamiltonian 5 | title: Pseudopotential 6 | description: > 7 | Use an effective nonlocal potential to remove the core electrons from 8 | the system. This is handled more or less as described in 9 | Mitas, Shirley, Ceperly, J. Chem. Phys. 95, 3467 (1991). 10 | The first word in the pseudopotential section must be 11 | the label of the atom to which is corresponds. 12 | required: 13 | - keyword: BASIS 14 | type: section 15 | description: Input for a Basis function for the radial part of the pseudopotential. 16 | optional: 17 | - keyword: AIP 18 | type: integer 19 | default: 6 20 | description: > 21 | Number of atomic integration 22 | points. Available are Gaussian rules with 4, 6, 12, 18, 26 and 32 23 | points. 24 | - keyword: ADD_ZEFF 25 | type: Flag 26 | default: off 27 | description: Add the effective charge while in range of the pseudopotential, for soft psp's that have the effective charge included. 28 | 29 | -------------------------------------------------------------------------------- /docs/database/qmc_method.yml: -------------------------------------------------------------------------------- 1 | type: Category 2 | name: Method 3 | title: Methods 4 | -------------------------------------------------------------------------------- /docs/database/region_fluctuation.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: REGION_FLUCTUATION 3 | keyword: REGION_FLUCTUATION 4 | is_a: Average generator 5 | title: Pairwise region fluctuations 6 | description: > 7 | We define the number operator on as site i for spin \( \sigma \) as 8 | \( n_{i,\sigma}= \sum_{j\in \sigma} \Theta(r_j) \), where j is summed over the electrons in the spin \( \sigma \). 9 | This object calculates the joint probability distribution function between all pairs of sites and spins, \( \rho( n_{i,\sigma},n_{j,\sigma} ) \). 10 | 11 | The output can be read in by the Python functions in utils/read_numberfluct.py. 12 | example_input: > 13 | method { VMC 14 | average { region_fluctuation maxn 4 } 15 | } 16 | include qwalk.sys 17 | trialfunc { include qwalk.slater } 18 | required: [] 19 | optional: 20 | - keyword: MAXN 21 | type: integer 22 | default: 20 23 | description: The maximum number of electrons you expect to see on any atom 24 | 25 | -------------------------------------------------------------------------------- /docs/database/sk.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: SK 3 | is_a: Average generator 4 | title: Static structure factor 5 | keyword: SK 6 | related: [] 7 | description: > 8 | Electronic static structure factor given by 9 | \( S({\bf k})=\frac1N\,\langle\Psi|\hat\rho_{\bf k} 10 | \hat\rho_{-\bf k}|\Psi\rangle \) 11 | where \( \hat\rho_{\mathbf{k}} \) is a Fourier component of the 12 | electron density. The quantity is evaluated either on a full 3D grid 13 | or on a 1D grid along a fixed direction, see keyword DIRECTION. 14 | 15 | 16 | The structure factor \( S({\bf k}) \) can be used to 17 | evaluate finite-size corrections to the Ewald energy, see Chiesa et al. 18 | Phys. Rev. Lett. 97, 076404 (2006). Note that \( S({\bf k}) \) 19 | as calculated contains besides the continuous electronic 20 | component also sharp Bragg peaks, since electronic wave function 21 | follows crystal symmetries. These are the same peaks that X-ray diffraction uses to determine crystal structure. 22 | required: [] 23 | optional: 24 | - keyword: NGRID 25 | type: integer 26 | default: 5 27 | description: > 28 | Number of grid points in one direction. Structure factor is 29 | evaluated on NGRID points if DIRECTION is given and on NGRID\(^3\) points 30 | otherwise. 31 | - keyword: GVEC 32 | type: section 33 | default: reciprocal lattice vectors 34 | description: > 35 | Basis vectors \( {\bf g}_i\) defining the grid. The 36 | section contains a 3x3 matrix of floats. 37 | 38 | - keyword: DIRECTION 39 | type: integer 40 | default: not set 41 | description: > 42 | Selects one of the three basis vectors \( {\bf g}_i \), along 43 | which \( S({\bf k}) \) is evaluated. 44 | -------------------------------------------------------------------------------- /docs/database/slater_jastrow.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: Slater-Jastrow 3 | keyword: SLATER-JASTROW 4 | is_a: Wavefunction 5 | title: Slater-Jastrow (multiply two wave functions) 6 | description: > 7 | Multiply two wave functions; that is \( \Psi = \Psi_1 \Psi_2 \). 8 | required: 9 | - keyword: WF1 10 | type: section 11 | description: > 12 | A section for a Wave function object. Will represent \( \Psi_1 \) 13 | - keyword: WF2 14 | type: section 15 | description: > 16 | A section for a Wave function object. Will represent \( \Psi_2 \) 17 | 18 | optional: [] 19 | -------------------------------------------------------------------------------- /docs/database/tbdm_basis.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: TBDM_BASIS 3 | keyword: TBDM_BASIS 4 | is_a: Average generator 5 | title: Two-body density matrix on a basis 6 | description: > 7 | This object evaluates the one and two-body reduced density matrix on a basis. 8 | The basis can be any set of functions that can be expressed in a \ref MO_matrixDoc object. 9 | Usually this will be a set of orbitals from a mean-field calculation. 10 | The ORBITALS section can often be copied from the .slater file with no changes. 11 | 12 | The output contains the states section and the density matrices. One thing to keep in mind is that the density matrices are always labeled from 0 to nmo, where nmo is the number of orbitals in the STATES section. 13 | 14 | example_input: > 15 | method { VMC 16 | average { 17 | TBDM_BASIS 18 | mode OBDM 19 | states { 3 4 5 6 } 20 | orbitals { 21 | CUTOFF_MO 22 | MAGNIFY 1 23 | NMO 8 24 | ORBFILE qwalk.orb 25 | INCLUDE qwalk.basis 26 | CENTERS { USEATOMS } 27 | } 28 | } 29 | } 30 | include qwalk.sys 31 | trialfunc { include qwalk.slater } 32 | required: 33 | - keyword: ORBITALS/CORBITALS 34 | type: section 35 | description: > 36 | Input for a set of orbitals. When ORBITALS section is used, 37 | a real-valued wave function is constructed. When a CORBITALS section is used, 38 | the orbitals will be complex-valued. 39 | optional: 40 | - keyword: STATES 41 | type: section 42 | default: All the orbitals in the ORBITALS section. 43 | description: A list of the orbitals on which you'd like to evaluate the density matrices. 44 | - keyword: MODE 45 | type: string 46 | default: Evaluate all two-particle density matrix elements. 47 | description: > 48 | Possible values are OBDM and TBDM_DIAGONAL. 49 | experimental: 50 | - keyword: NPOINTS 51 | type: integer 52 | default: 4 53 | description: Number of auxilliary integration points to use. 54 | - keyword: NSTEPS_SAMPLE 55 | type: integer 56 | default: 10 57 | desciption: Number of Monte Carlo steps to use to randomize the auxilliary integration points. 58 | 59 | -------------------------------------------------------------------------------- /docs/database/vmc.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: VMC 3 | keyword: VMC 4 | is_a: Method 5 | title: Variational Monte Carlo 6 | description: > 7 | Evaluates the expectation value \( \langle \Psi | {\cal O} | \Psi \rangle \) stochastically. 8 | related: 9 | - Average generator 10 | required: [] 11 | optional: 12 | - keyword: AVERAGE 13 | type: section 14 | default: empty 15 | description: Section for an [Average generator](Average generator) 16 | 17 | - keyword: NCONFIG 18 | type: integer 19 | default: 1 20 | description: Number of sample points to use at one time per processor 21 | 22 | - keyword: NSTEP 23 | type: integer 24 | default: 100 25 | description: Number of average points to take in a block. 26 | 27 | - keyword: NBLOCK 28 | type: integer 29 | default: 100 30 | description: Number of blocks to take 31 | 32 | - keyword: TIMESTEP 33 | type: float 34 | default: 1.0 35 | description: > 36 | A measure of how large each Metropolis move should be. 37 | Adjust such that the acceptance ratio is somewhat greater than 38 | 0.5. If this is not specified, then the timestep will automatically be adjusted. 39 | 40 | - keyword: NDECORR 41 | type: integer 42 | default: 2 43 | description: > 44 | Number of Metropolis steps to take before evaluating the energy. 45 | Since VMC steps don't require an energy evaluation, this serves 46 | to decorrelate the averaging points before doing an expensive 47 | evaluation of the energy(mostly pseudopotentials). 48 | 49 | - keyword: STORECONFIG 50 | type: string 51 | default: runid.config 52 | description: Write the configurations to this file every block. 53 | 54 | - keyword: READCONFIG 55 | type: string 56 | default: runid.config 57 | description: Read from a configuration file previously written by STORECONFIG. If this file is absent, then new configurations will be generated. 58 | 59 | - keyword: DENSITY 60 | type: section 61 | default: empty 62 | description: Section for the evaluation of a density object 63 | advanced: 64 | - keyword: GUIDETYPE 65 | type: string 66 | default: SUMSQUARES 67 | description: Possible options include SUMSQUARES, FIRST. This only does anything if multiple wave functions are defined in the TRIALFUNC section. 68 | - keyword: DYNAMICS 69 | type: section 70 | default: SPLIT 71 | description: Choose a sampling strategy. Use UNR for all-electron calculations. 72 | 73 | -------------------------------------------------------------------------------- /docs/database/wannier.yml: -------------------------------------------------------------------------------- 1 | type: Entry 2 | name: WANNIER 3 | keyword: WANNIER 4 | is_a: Method 5 | title: Generate Wannier functions 6 | related: [] 7 | description: > 8 | This method attempts to minimize the spread of the orbitals in periodic boundary conditions. It accomplishes this by maximizing the following value 9 | \[ 10 | \sum_i |z_{ij}|^2 11 | \] 12 | where the sum is over all orbitals, and 13 | \[ 14 | z_{ij}=\int{ \exp(-\vec{k_j}\cdot\vec{r}) \phi_i^2(\vec{r}) d\vec{r}}, 15 | \] 16 | where the k's are the reciprocal lattice vectors. 17 | 18 | The orbitals are optimized by rotating the orbitals 19 | \[ 20 | {\boldsymbol \phi}_{new}=M{\boldsymbol \phi}. 21 | \] 22 | The matrix elements of M are allowed to be nonzero only between orbitals that are in the same ORB_GROUP. 23 | 24 | required: 25 | - keyword: ORBITALS 26 | type: section 27 | description: > 28 | A Molecular orbital section 29 | - keyword: ORB_GROUP 30 | type: section 31 | description: > 32 | The orbitals listed in this orbital group are allowed to mix. Can list multiple sections to define multiple mixing sectors. 33 | optional: 34 | - keyword: RESOLUTION 35 | type: float 36 | default: 0.2 37 | description: The pitch (in Bohrs) of the grid used for integration. 38 | - keyword: OUT_ORB 39 | type: string 40 | default: runid+.orb 41 | description: Where the rotated orbitals will be stored. 42 | -------------------------------------------------------------------------------- /docs/database/wavefunction.yml: -------------------------------------------------------------------------------- 1 | type: Category 2 | name: Wavefunction 3 | title: Wavefunctions 4 | -------------------------------------------------------------------------------- /docs/guide/DynamicsDoc.html: -------------------------------------------------------------------------------- 1 | /*! \page DynamicsDoc Dynamics 2 | 3 | \section description Description 4 | 5 | A dynamics generator for monte carlo processes. Different dynamics 6 | are currently somewhat experimental, but the splitting rejection 7 | method is relatively stable, so I'll list it here. (Keyword SPLIT) The 8 | defaults are close to the optimal ones, so it's best to leave this alone 9 | unless you know what you're doing. 10 | 11 | For all-electron atoms, it is best to use the algorithm of Umrigar, 12 | Nightingale, and Runge, 13 | J. Chem. Phys. 99, 2865 14 | (1993), chosen by dynamics { UNR } in the method section. 15 | 16 | \section options Options 17 | 18 | 19 | \subsection optopt Optional 20 | 21 | 22 |
Option Type Default 23 | Description 24 |
DEPTH Integer 1 How many times to try to make a step. 25 |
DIVIDER Float 1.0 26 |
DRIFT_TYPE String CYRUS The drift limiter. Can be either CYRUS or CUTOFF. Note that DMC is much less efficient when used with a CUTOFF 27 | limiter. 28 |
29 | 30 | \subsection expopt Experimental 31 | 32 | 33 | */ 34 | -------------------------------------------------------------------------------- /docs/guide/G032qmcDoc.html: -------------------------------------------------------------------------------- 1 | /*! \page g032qmcDoc Gaussian03 2 | 3 | \section notes Notes on running Gaussian 4 | 5 | Options necessary:
6 | 7 |
iop(3/24=10) Print gaussian functions 8 |
iop(3/18=1) Print pseudopotentials 9 |
6d 10f Use 6d and 10f functions, which is what the converter was written for (this requirement could be removed in the future, if someone has the will) 10 |
11 | 12 | Useful options 13 | 14 |
pseudo=read read in the pseudopotentials 15 |
gen i.e., UHF/gen, etc. Allows you to enter the 16 |
17 | 18 | For example, your com file may look like 19 |
20 | %chk=foo.chk
21 | #P B3LYP/gen 6d 10f scf opt test iop(3/24=10) iop(3/18=1) pseudo=read
22 |  ...
23 | 
24 | After running g03 (g03 foo.com, for example), you must then format the 25 | check file as 26 |
27 | formchk foo.chk foo.fchk
28 | 
29 | and finally you're ready to use the converter. 30 | 31 | \section description Description 32 | 33 | Basic usage: g032qmc -log foo.log fchk foo.fchk -out [outputoot]
34 | Additional options:
35 | 36 |
Option Description 37 |
-out [comfile] Use [outputroot] as the base for the QWalk run. 38 | G032qmc will then create files like outputroot.slater, etc. 39 |
-h print help message for more advanced usage 40 |
41 | 42 | 43 | */ 44 | -------------------------------------------------------------------------------- /docs/guide/Local_density_accumulatorDoc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /*! \page Local_density_accumulatorDoc Local Density accumulator 5 | 6 | 7 | \section description Description 8 | 9 | These are local functions that do not require wave function information and are generally too big to put into the log file and calculate error bars like normal local variables. Examples include the one-particle density, g(r), and S(k). The only well-tested object at the moment is the one-particle density. 10 | 11 | Plugins: 12 | 13 | \ref One_particle_densityDoc 14 | 15 | */ 16 | -------------------------------------------------------------------------------- /docs/guide/OBDMDoc.html: -------------------------------------------------------------------------------- 1 | /*! \page OBDMDoc one-body density matrix 2 | 3 | Keyword: OBDM 4 | 5 | \section description Description 6 | 7 | Spherically averaged one-body density matrix for up-spin electrons 8 | \f$ \rho_{1\uparrow}^{sph}(|{\bf r}|) \f$, 9 | \f[ 10 | \rho_{1\uparrow}({\bf r}_1,{\bf r}_1') 11 | =\int d^3r_2\ldots d^3r_N\, 12 | \Psi^*({\bf r}_1,{\bf r}_2,\ldots,{\bf r}_N) 13 | \Psi({\bf r}_1',{\bf r}_2,\ldots,{\bf r}_N)\,, 14 | \f] 15 | \f[ 16 | \rho_{1\uparrow}^{sph}(|{\bf r}|) = \frac1{4\pi}\int d\Omega_{\bf r}\, 17 | \int d^3r_1 \rho_{1\uparrow}({\bf r}_1+{\bf r},{\bf r}_1)\,, 18 | \f] 19 | calculated on a one-dimensional grid. The many-body wave function \f$ 20 | \Psi \f$ in the above definition is assumed normalized to 21 | unity. Normalization of the density matrix is chosen so that 22 | \f$ \rho_{1\uparrow}^{sph}(0)=1 \f$. In homogeneous and isotropic 23 | systems, such as homogeneous electron gas, the one-body density matrix is a 24 | spherically symmetric function of only one distance, and therefore 25 | \f$ \rho_{1\uparrow}^{sph} \equiv \rho_{1\uparrow} \f$. In polarized cases, 26 | \f$ N_{\uparrow}\not = N_{\downarrow} \f$, the density matrix for 27 | down-electrons differs from the matrix for up-electrons. Quantity 28 | \f$ \rho_{1\downarrow}^{sph} \f$ is not (yet) implemented. 29 | 30 | \section options Options 31 | 32 | \subsection reqopt Required 33 | 34 | None. 35 | 36 | \subsection optopt Optional 37 | 38 | 39 | 40 | 41 | 42 | 43 | 45 | 46 | 47 | 51 | 52 | 53 | 58 |
OptionTypeDefaultDescription
CUTOFFFloathalf of the smallest distance in the simulation cellLargest distance at which the density matrix is calculated. Values 44 | much larger than the default value have little physical meaning.
NGRIDInteger5Number of points in the interval [0;CUTOFF] where the density 48 | matrix is calculated. The first point is CUTOFF/NGRID, the last point 49 | is CUTOFF. 50 |
AIPInteger1Number of directions for spherical averaging using a Gaussian 54 | quadrature rule. Available are Gaussian rules with 4, 6, 12, 18, 26 and 32 55 | points. Value AIP=1 disables spherical averaging and the vector \f$ \bf 56 | r \f$ then points in the x-direction. 57 |
59 | 60 | 61 | */ -------------------------------------------------------------------------------- /docs/guide/One_particle_densityDoc.html: -------------------------------------------------------------------------------- 1 | /*! \page One_particle_densityDoc one-particle density 2 | 3 | Keyword: DENSITY 4 | 5 | \section description Description 6 | 7 | Collects the one-particle density 8 | \f$ \rho(r)=\int dr_2...dr_N \Psi^2(r,r_2,...,r_N) \f$ and 9 | stores it in the Gaussian cube file format readable by VMD or 10 | other quantum chemistry visualization software. 11 | 12 | \section options Options 13 | 14 | \subsection optopt Optional 15 | 16 | 17 |
Option Type Default 18 | Description 19 |
OUTPUTFILE String runid.cube Choose the file name of the cube file. If one the UP/DOWN options below are chosen, then this will default to runid.up.cube or runid.down.cube, as appropriate. 20 |
MIN Section special See MAX 21 |
MAX Section special If MIN and/or MAX is not given, 22 | and the system has open boundary conditions(that is, is a molecule), 23 | they will be set to include all atoms. If 24 | the system has periodic boundary conditions, then they will be set to the 25 | smallest orthorhombic cell that includes the PBC cell. 26 |
RESOLUTION Float .1 Specifies the resolution of the 27 | density accumulation in bohrs. Larger resolutions will save on memory and 28 | the surfaces will look smoother, although the smooth_cube utility will 29 | also improve the appearance of isosurfaces. 30 |
UP Flag off Plot only the spin up electrons 31 |
DOWN Flag off Plot only the spin down electrons 32 |
33 | 34 | */ 35 | -------------------------------------------------------------------------------- /docs/guide/Pw2lcaoDoc.html: -------------------------------------------------------------------------------- 1 | /*! \page pw2lcaoDoc pw2lcao 2 | 3 | 4 | \section description Description 5 | 6 | Basic usage: pw2lcao [inputfile]
7 | 8 | \section howto HOWTO 9 | 10 |

11 | 1) Prepare a basis file in a modified GAMESS format. It should have 12 | a list of sections like: 13 |

14 | BASIS {
15 | C
16 | AOSPLINE
17 |   NORENORMALIZE
18 |   GAMESS {
19 |     S   5
20 |                1        8.13804      0.0117959
21 |                2        3.31518      -0.151981
22 |                3       0.668276       0.275523
23 |                4       0.291768       0.548645
24 |                5       0.114113       0.301215
25 |     S   1
26 |                1         0.9059              1
27 |     S   1
28 |                1         0.1285              1
29 |     P   5
30 |                1        8.52813      0.0235124
31 |                2        2.90145       0.116486
32 |                3       0.943121       0.327774
33 |                4       0.315586       0.492602
34 |                5       0.103936       0.273124
35 |     P   1
36 |                1         0.3827              1
37 |     P   1
38 |               1         0.1209              1
39 |     6D   1
40 |                1           0.55              1
41 |   }
42 | }
43 | 
44 | 45 | Note the NORENORMALIZE; since it is essentially doing a periodic 46 | calculation, the normalization is kind of a nebulous quantity, so 47 | it's best to just take the basis functions as they are. Also, 48 | if it's a solids-type calculation, make sure to be careful about 49 | putting very diffuse Gaussians in. It will really slow down 50 | the fitting process and the QMC run. On the other hand, make sure 51 | that the overlaps printed out have converged with respect to the 52 | basis, especially when doing pressure or force calculations, since 53 | they can be easily biased with a small basis. 54 |

55 | 56 |

57 | 2) Run jeep2qmc with the -lcao option.. For example, for ch4, I 58 | would run

 jeep2qmc -ecut 30 -lcao ch4.basis -o ch4_qmc ch4
59 | 
60 | It should create the normal files, as well as a ch4_qmc.pw2lcao and 61 | ch4.basis.centers . 62 |

63 | 64 |

65 | 3) Run 66 |

67 | pw2lcao  ch4_qmc.pw2lcao
68 | 
69 | After it runs, the qmc run should be set up to go. 70 |

71 | 72 | 73 |

74 | pw2lcao can also be run in parallel, with exactly the same usage. 75 |

76 | 77 | */ 78 | -------------------------------------------------------------------------------- /docs/guide/Rotate_methodDoc.html: -------------------------------------------------------------------------------- 1 | /*! \page Rotate_methodDoc Rotate orbitals 2 | 3 | Keyword: ROTATE_ORBS 4 | 5 | \section description Description 6 | 7 | Rotates a set of orbitals given a rotation matrix. The code works on a subspace of orbitals defined by ORB_GROUP, and outputs only the rotated subset. It essentially performs the operation 8 | \f[ 9 | {\boldsymbol \phi}'=M{\boldsymbol \phi} 10 | \f] 11 | 12 | 13 | The matrix in the rotation file is a list of numbers in C-style indexing. 14 | \section options Options 15 | 16 | \subsection reqopt Required 17 | 18 | 19 |
Option Type Description 20 | 21 |
ORBITALS Section A \ref MO_matrixDoc section 22 |
ORB_GROUP Section A list of the orbital numbers to be rotated. 23 | 24 |
25 | 26 | \subsection optopt Optional 27 | 28 | 29 |
Option Type Default 30 | Description 31 |
ROTATION string rotation The location of the rotation matrix file. 32 |
OUTPUT string runid+.orb Where the rotated orbitals will be stored. 33 | 34 |
35 | 36 | 37 | */ 38 | -------------------------------------------------------------------------------- /docs/guide/WavefunctionDoc.html: -------------------------------------------------------------------------------- 1 | /*! \page WavefunctionDoc Wavefunction 2 | 3 | \section description Description 4 | 5 | A wave function is a function of all the electronic and ionic coordinates 6 | (the many-body wave function). With this section, we can build a trial function. 7 | 8 | \section plugins Plugins 9 | 10 | \subpage Slat_JastrowDoc 11 | 12 | \subpage Slat_wfDoc 13 | 14 | \subpage Pfaff_wfDoc 15 | 16 | \subpage Jastrow2_wfDoc 17 | 18 | \subpage BCS_wfDoc 19 | 20 | \section old Obsolete 21 | 22 | \subpage Cat_wfDoc 23 | 24 | 25 | 26 | */ 27 | 28 | //###################################################################### 29 | 30 | /*! \page Slat_JastrowDoc Slater-Jastrow 31 | 32 | Keyword: SLATER-JASTROW or MULTIPLY 33 | 34 | \section description Description 35 | 36 | Multiply two wave functions 37 | 38 | \section options Options 39 | 40 | \subsection reqopt Required 41 | 42 | 43 |
Option Type Description 44 |
WF1 Section a \ref WavefunctionDoc section 45 |
WF2 Section a \ref WavefunctionDoc section 46 |
47 | 48 | */ 49 | 50 | 51 | //###################################################################### 52 | 53 | /*! \page Cat_wfDoc Concatenate Wave function 54 | 55 | Keyword: CONCATENATE 56 | 57 | \section description Description 58 | 59 | Append wave functions into a vector 60 | 61 | \section options Options 62 | 63 | \subsection reqopt Required 64 | 65 | 66 |
Option Type Description 67 |
WF Section a \ref WavefunctionDoc section 68 |
ORDER Section choose the ordering of the wave functions. 69 | For example, ORDER { 0 0 1 } puts the first function twice and the second one 70 | in the third slot. This is for matching multiplications, for example. 71 |
72 | 73 | */ 74 | -------------------------------------------------------------------------------- /src/Makefile.pw2lcao: -------------------------------------------------------------------------------- 1 | #################################################################### 2 | # Set platform and build specific information 3 | # any of these can be overridden by environment variables of the 4 | # same name, or by command line options "make target PLATFORM=foo" 5 | PLATFORM = $(shell uname -s) 6 | DVLPATH = . 7 | 8 | #################################################################### 9 | # Derived paths, all relative to the base path. These shouldn't 10 | # change without restructuring the make environment 11 | 12 | MAKEPATH:=$(DVLPATH)/make 13 | OBJPATH:=$(DVLPATH)/obj/$(PLATFORM) 14 | SRCPATH:=$(DVLPATH) 15 | PROJECT:=$(DVLPATH)/pw2lcao-$(PLATFORM) 16 | DEPENDFILE:=$(OBJPATH)/depend.pw2lcao 17 | 18 | include make.include 19 | INCLUDEPATH:=$(INCLUDEPATH) -I$(DVLPATH)/pw2lcao 20 | 21 | SOURCES:= \ 22 | pw2lcao/pw2lcao.cpp \ 23 | pw2lcao/pwoverlap.cpp \ 24 | program_utils/qmc_io.cpp \ 25 | pw2lcao/gaussian_set.cpp \ 26 | program_utils/Qmc_std.cpp \ 27 | pw2lcao/JeepBasis.cpp \ 28 | program_utils/jeep_utils.cpp \ 29 | program_utils/MatrixAlgebrac.cpp \ 30 | system/Pbc_enforcer.cpp \ 31 | pw2lcao/overlaps.cpp 32 | 33 | #remove the directory prefix and .cpp extension, and add the .o extension 34 | OBJS:= $(addprefix $(OBJPATH)/,$(addsuffix .o,$(notdir $(basename $(SOURCES))))) 35 | NODEPENDGOALS = depend clean totalclean cleanhtml html all 36 | 37 | #################################################################### 38 | # Special rules 39 | all: $(PROJECT) 40 | .PHONY: clean totalclean depend cleanhtml converter 41 | #.SILENT: 42 | #################################################################### 43 | # Included files for dependency and platform specific defines 44 | include $(MAKEPATH)/$(PLATFORM).mk 45 | include $(DEPENDFILE) 46 | 47 | #################################################################### 48 | # Project and build rules 49 | 50 | $(PROJECT):$(OBJS) 51 | @echo ________________________________________________________________ 52 | @echo Linking $@ 53 | $(CXX) $(DEBUG) $(CXXFLAGS) -o $(PROJECT) $(OBJS) $(LDFLAGS) $(BLAS_LIBS) 54 | 55 | include make.rules 56 | -------------------------------------------------------------------------------- /src/attic/Binner.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | //---------------------------------------------------------------------- 21 | //include/Binner.h 22 | //Author: Lucas Wagner 23 | #ifndef BINNER_H_INCLUDED 24 | #define BINNER_H_INCLUDED 25 | 26 | #include "Qmc_std.h" 27 | #include "Array.h" 28 | 29 | class Sample_point; 30 | class System; 31 | 32 | class Binner { 33 | public: 34 | virtual void read(vector &, System * )=0; 35 | virtual void accumulate(Sample_point *)=0; 36 | virtual void write()=0; 37 | virtual ~Binner() {} 38 | }; 39 | 40 | class EE_bin : public Binner { 41 | public: 42 | EE_bin():nelec(0){} 43 | virtual void read(vector &, System * ); 44 | virtual void accumulate(Sample_point *); 45 | virtual void write(); 46 | private: 47 | Array1 eebin; //A count of the distances that fall in each bin 48 | Array1 eebin_like; //!< For electrons of like spin 49 | Array1 eebin_unlike; //!< For electrons of unlike spin.. 50 | doublevar range; //The maximum range of the bins 51 | doublevar width; //The width of each bin 52 | string output_file; 53 | unsigned long int npoints; //!< number of points that have been accumulated 54 | int nelec; //!< number of electrons 55 | int high_up_spin; //!< number of up spin 56 | 57 | }; 58 | 59 | 60 | void allocate(vector < string> &, Binner * &, System *); 61 | 62 | #endif //BINNER_H_INCLUDED 63 | //---------------------------------------------------------------------- 64 | -------------------------------------------------------------------------------- /src/attic/Cat_wf_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | //------------------------------------------------------------------------ 22 | //Cat_wf_data.h 23 | 24 | #ifndef CAT_WF_DATA_H_INCLUDED 25 | #define CAT_WF_DATA_H_INCLUDED 26 | 27 | #include "Qmc_std.h" 28 | #include "Wavefunction_data.h" 29 | 30 | class Cat_wf; 31 | 32 | class Cat_wf_data : public Wavefunction_data 33 | { 34 | public: 35 | 36 | virtual void read(vector & words, 37 | unsigned int & pos, 38 | System * sys 39 | ); 40 | virtual int supports(wf_support_type ); 41 | void getVarParms(Array1 & ); 42 | void setVarParms(Array1 & ); 43 | 44 | void attachObserver(Wavefunction * wf); 45 | void generateWavefunction(Wavefunction *&); 46 | int nparms(); 47 | 48 | 49 | virtual int valSize(); 50 | 51 | 52 | int showinfo(ostream & os); 53 | int writeinput(string &, ostream &); 54 | 55 | 56 | void renormalize() 57 | { 58 | for(int i=0; i< nUniqueFunc; i++) 59 | { 60 | data_array(i)->renormalize(); 61 | } 62 | } 63 | 64 | void resetNormalization() 65 | { 66 | for(int i=0; i< nUniqueFunc; i++) 67 | { 68 | data_array(i)->resetNormalization(); 69 | } 70 | } 71 | 72 | Cat_wf_data() 73 | {} 74 | ~Cat_wf_data() 75 | { 76 | for(int i=0; i< data_array.GetDim(0); i++) 77 | deallocate(data_array(i)); 78 | } 79 | 80 | 81 | private: 82 | friend class Cat_wf; 83 | int nFunc, nUniqueFunc; 84 | Array1 ordering; 85 | Array1 data_array; 86 | }; 87 | 88 | #endif //CAT_WF_DATA_H_INCLUDED 89 | //------------------------------------------------------------------------ 90 | -------------------------------------------------------------------------------- /src/attic/Cubic_spline3D.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | //---------------------------------------------------------------------- 21 | //include/Cubic_spline3D.h 22 | 23 | 24 | #ifndef CUBIC_SPLINE3D_H_INCLUDED 25 | #define CUBIC_SPLINE3D_H_INCLUDED 26 | 27 | #include "Array.h" 28 | #include "Qmc_std.h" 29 | using namespace std; 30 | 31 | doublevar spline_1D_my(doublevar x,doublevar delta, Array1 & y); 32 | 33 | void splin3_my(Array1 & rmin, doublevar delta, Array3 & yya, 34 | Array1 & xx, doublevar & y); 35 | 36 | void splin3_my(Array1 & rmin, Array1 & delta, Array3 & yya, 37 | Array1 & xx, doublevar & y); 38 | 39 | #endif //CUBIC_SPLINE3D_H_INCLUDED 40 | //---------------------------------------------------------------------- 41 | -------------------------------------------------------------------------------- /src/attic/Fitbasis_method.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | //------------------------------------------------------------------------ 21 | //include/Fitbasis_method.h 22 | 23 | #ifndef FITBASIS_METHOD_H_INCLUDED 24 | #define FITBASIS_METHOD_H_INCLUDED 25 | 26 | #include "Qmc_std.h" 27 | #include "Qmc_method.h" 28 | #include "Basis_function.h" 29 | #include "Center_set.h" 30 | class Program_options; 31 | /*! 32 | 33 | */ 34 | class Fitbasis_method : public Qmc_method 35 | { 36 | public: 37 | void read(vector words, 38 | unsigned int & pos, 39 | Program_options & options); 40 | void run(Program_options & options, ostream & output); 41 | Fitbasis_method() { 42 | sys=NULL; 43 | } 44 | ~Fitbasis_method() 45 | { 46 | if(sys) delete sys; 47 | for(int i=0; i< basis.GetDim(0); i++) { 48 | if(basis(i)) delete basis(i); 49 | } 50 | } 51 | 52 | int showinfo(ostream & os); 53 | private: 54 | 55 | Array1 basis; 56 | Center_set centers; 57 | vector file_list; 58 | 59 | string localize_output; 60 | string orb_out_file; 61 | int totbasis; 62 | 63 | System * sys; 64 | 65 | }; 66 | 67 | #endif //FITBASIS_METHOD_H_INCLUDED 68 | //------------------------------------------------------------------------ 69 | -------------------------------------------------------------------------------- /src/attic/MO_1d.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #ifndef MO_1D_H_INCLUDED 22 | #define MO_1D_H_INCLUDED 23 | 24 | #include "MO_matrix.h" 25 | #include "Spline_fitter.h" 26 | 27 | class MO_1d : public Complex_MO_matrix { 28 | public: 29 | 30 | virtual void buildLists(Array1 > & occupations); 31 | 32 | virtual int getNmo() { return nmo; } 33 | virtual int showinfo(ostream & os); 34 | virtual int writeinput(string &, ostream &); 35 | virtual void read(vector & words, unsigned int & startpos, 36 | System * sys); 37 | 38 | virtual void updateVal(Sample_point * sample,int e, int listnum, 39 | Array2 & newvals); 40 | 41 | virtual void updateLap(Sample_point * sample,int e,int listnum, 42 | Array2 & newvals); 43 | 44 | 45 | private: 46 | int nmo; 47 | Array1 < Array1 > moLists; 48 | Array2 splines; 49 | int npoints; 50 | string readfile; 51 | }; 52 | 53 | #endif //MO_1D_H_INCLUDED 54 | -------------------------------------------------------------------------------- /src/attic/Makefile.averr: -------------------------------------------------------------------------------- 1 | #################################################################### 2 | # Set platform and build specific information 3 | # any of these can be overridden by environment variables of the 4 | # same name, or by command line options "make target PLATFORM=foo" 5 | PLATFORM = $(shell uname -s) 6 | DVLPATH = . 7 | 8 | #################################################################### 9 | # Derived paths, all relative to the base path. These shouldn't 10 | # change without restructuring the make environment 11 | 12 | MAKEPATH:=$(DVLPATH)/make 13 | OBJPATH:=$(DVLPATH)/obj/$(PLATFORM) 14 | SRCPATH:=$(DVLPATH) 15 | PROJECT:=$(DVLPATH)/averr-$(PLATFORM) 16 | DEPENDFILE:=$(OBJPATH)/depend.averr 17 | 18 | include make.include 19 | 20 | SOURCES:=properties/Properties_average.cpp \ 21 | properties/Properties_block.cpp \ 22 | program_utils/Qmc_std.cpp \ 23 | program_utils/qmc_io.cpp \ 24 | properties/averr.cpp 25 | 26 | 27 | #remove the directory prefix and .cpp extension, and add the .o extension 28 | OBJS:= $(addprefix $(OBJPATH)/,$(addsuffix .o,$(notdir $(basename $(SOURCES))))) 29 | NODEPENDGOALS = depend clean totalclean cleanhtml html all 30 | 31 | #################################################################### 32 | # Special rules 33 | DEFAULT: $(PROJECT) 34 | all: $(PROJECT) 35 | .PHONY: clean totalclean depend cleanhtml 36 | #.SILENT: 37 | #################################################################### 38 | # Included files for dependency and platform specific defines 39 | include $(MAKEPATH)/$(PLATFORM).mk 40 | include $(DEPENDFILE) 41 | 42 | #################################################################### 43 | # Project and build rules 44 | 45 | $(PROJECT):$(OBJS) 46 | @echo ________________________________________________________________ 47 | @echo Linking $@ 48 | $(CXX) $(DEBUG) $(CXXFLAGS) -o $(PROJECT) $(OBJS) $(LDFLAGS) $(BLAS_LIBS) 49 | 50 | clean: 51 | @echo ________________________________________________________________ 52 | @echo Cleaning object files... 53 | rm -f $(OBJS) core $(PROJECT) 54 | 55 | include make.rules 56 | -------------------------------------------------------------------------------- /src/attic/Md_method.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | //------------------------------------------------------------------------ 21 | //include/Vmc_method.h 22 | 23 | #ifndef MD_METHOD_H_INCLUDED 24 | #define MD_METHOD_H_INCLUDED 25 | 26 | #include "Qmc_std.h" 27 | #include "Qmc_method.h" 28 | #include "Wavefunction.h" 29 | #include "Wavefunction_data.h" 30 | #include "Sample_point.h" 31 | #include "Guiding_function.h" 32 | #include "System.h" 33 | #include "Properties.h" 34 | 35 | class Program_options; 36 | 37 | 38 | /*! 39 | \brief 40 | Keyword: MD 41 | */ 42 | class Md_method : public Qmc_method 43 | { 44 | public: 45 | 46 | Md_method() { 47 | sys=NULL; 48 | wfdata=NULL; 49 | pseudo=NULL; 50 | qmc_avg=NULL; 51 | } 52 | void read(vector words, 53 | unsigned int & pos, 54 | Program_options & options); 55 | void run(Program_options & options, ostream & output); 56 | 57 | int showinfo(ostream & os); 58 | 59 | int generateVariables(Program_options & options); 60 | 61 | 62 | ~Md_method() 63 | { 64 | if(sys) delete sys; 65 | if(wfdata) delete wfdata; 66 | 67 | if(pseudo) delete pseudo; 68 | 69 | } 70 | 71 | private: 72 | 73 | void read_check(Array3 & last_pos); 74 | void write_check(Array3 & pos, int); 75 | 76 | Array1 atomic_weights; 77 | 78 | string readcheckfile, writecheckfile; 79 | string log_label; 80 | 81 | int nstep; 82 | doublevar tstep; 83 | doublevar damp; 84 | 85 | Array1 restrict_dimension; 86 | 87 | Pseudopotential * pseudo; 88 | System * sys; 89 | Wavefunction_data * wfdata; 90 | 91 | Qmc_avg_method * qmc_avg; 92 | 93 | Properties_manager prop; 94 | 95 | }; 96 | 97 | #endif //MD_METHOD_H_INCLUDED 98 | //------------------------------------------------------------------------ 99 | -------------------------------------------------------------------------------- /src/attic/Md_opt_method.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | //------------------------------------------------------------------------ 21 | //include/Md__opt_method.h 22 | 23 | #ifndef MD_OPT_METHOD_H_INCLUDED 24 | #define MD_OPT_METHOD_H_INCLUDED 25 | 26 | #include "Qmc_std.h" 27 | #include "Qmc_method.h" 28 | #include "Wavefunction.h" 29 | #include "Wavefunction_data.h" 30 | #include "Sample_point.h" 31 | #include "Guiding_function.h" 32 | #include "System.h" 33 | #include "Properties.h" 34 | 35 | class Program_options; 36 | 37 | 38 | /*! 39 | \brief 40 | Keyword: MD 41 | */ 42 | class Md_opt_method : public Qmc_method 43 | { 44 | public: 45 | 46 | Md_opt_method() { 47 | sys=NULL; 48 | wfdata=NULL; 49 | pseudo=NULL; 50 | qmc_avg=NULL; 51 | } 52 | void read(vector words, 53 | unsigned int & pos, 54 | Program_options & options); 55 | void run(Program_options & options, ostream & output); 56 | 57 | int showinfo(ostream & os); 58 | 59 | int generateVariables(Program_options & options); 60 | 61 | 62 | ~Md_opt_method() 63 | { 64 | if(sys) delete sys; 65 | if(wfdata) delete wfdata; 66 | 67 | if(pseudo) delete pseudo; 68 | 69 | } 70 | 71 | private: 72 | 73 | void read_check(Array3 & last_pos); 74 | void write_check(Array3 & pos, int); 75 | 76 | Array1 atomic_weights; 77 | 78 | string readcheckfile, writecheckfile; 79 | 80 | int nstep; 81 | doublevar tstep; 82 | doublevar damp; 83 | 84 | Pseudopotential * pseudo; 85 | System * sys; 86 | Wavefunction_data * wfdata; 87 | 88 | Qmc_avg_method * qmc_avg; 89 | 90 | Properties_manager prop; 91 | 92 | }; 93 | 94 | #endif //MD_OPT_METHOD_H_INCLUDED 95 | //------------------------------------------------------------------------ 96 | -------------------------------------------------------------------------------- /src/attic/Onebody_int_method.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | //------------------------------------------------------------------------ 21 | //include/Onebody_int_method.h 22 | 23 | #ifndef ONEBODY_INT_METHOD_H_INCLUDED 24 | #define ONEBODY_INT_METHOD_H_INCLUDED 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include "Qmc_method.h" 31 | #include "qmc_io.h" 32 | #include "Array.h" 33 | #include "MO_matrix.h" 34 | #include "Sample_point.h" 35 | class System; 36 | class Wavefunction; 37 | class Program_options; 38 | 39 | /*! 40 | */ 41 | class Onebody_int_method : public Qmc_method 42 | { 43 | public: 44 | void read(vector words, 45 | unsigned int & pos, 46 | Program_options & options); 47 | void run(Program_options & options, ostream & output); 48 | int showinfo(ostream & os); 49 | Onebody_int_method():mymomat(NULL), mywalker(NULL) {} 50 | ~Onebody_int_method() 51 | { 52 | if(mymomat!=NULL) delete mymomat; 53 | if(mywalker != NULL) delete mywalker; 54 | } 55 | 56 | private: 57 | Array1 > orbs; //orbital #'s to be plotted(spin up and down) 58 | doublevar resolution; //grid coarsness: 10=coarser 0.1=finer 59 | MO_matrix * mymomat; //will hold MO information 60 | Sample_point * mywalker; //a single configuration/walker 61 | System * sys; 62 | }; 63 | 64 | #endif //ONEBODY_INT_METHOD_H_INCLUDED 65 | //------------------------------------------------------------------------ 66 | -------------------------------------------------------------------------------- /src/attic/create_mesh_orb.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | //---------------------------------------------------------------------- 21 | //utils/create_mesh_orb.cpp 22 | 23 | #include 24 | #include 25 | 26 | using namespace std; 27 | 28 | int main(int argc, char ** argv) { 29 | if(argc < 2) { 30 | cerr << "usage: " << argv[0] << " " 31 | << endl; 32 | exit(1); 33 | } 34 | 35 | int nmo=atoi(argv[1]); 36 | 37 | //We output for one center the mo's 38 | //There are two coefficients: 1 is 0.0 and 2 is 1.0 39 | for(int m=0; m < nmo; m++) { 40 | for(int m2=0; m2 < nmo; m2++) { 41 | int coeff=1; 42 | if(m==m2) coeff=2; 43 | cout << m+1 << " " << m2+1 << " 1 " << coeff << endl; 44 | } 45 | } 46 | 47 | cout << "COEFFICIENTS" << endl; 48 | cout << "0.0 1.0 " << endl; 49 | 50 | 51 | } 52 | 53 | 54 | //---------------------------------------------------------------------- 55 | -------------------------------------------------------------------------------- /src/attic/elements.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | //A lookup table of the atomic numbers and the associated elements. 21 | #ifndef ELEMENTS_H_INCLUDED 22 | #define ELEMENTS_H_INCLUDED 23 | 24 | const char * element_lookup_caps[]= {"NULL", "H", "HE", 25 | "LI", "BE", "B", "C", "N", "O", "F", "NE", 26 | "NA", "MG", "AL", "SI", "P", "S", "CL", "AR", 27 | "K", "CA", "SC", "TI", "V", "CR", "MN", "FE", 28 | "CO", "NI", "CU", "ZN", "GA", "GE", "AS", "SE", "BR", "KR", 29 | "RB", "SR", "Y", "ZR", "NB", "MO", "TC", "RU", "RH", "PD", 30 | "AG", "CD", "IN", "SN", "SB", "TE", "I", "XE", 31 | "CS", "BA", "LA", "CE", "PR", "ND", "PM", "SM", "EU", "GD", "TB", 32 | "DY", "HO", "ER", "TM", "YB", "LU", "HF", "TA", "W", "RE", 33 | "OS", "IR", "PT", "AU", "HG", "TL", "PB", "BI", "PO", "AT", "RN" }; 34 | 35 | 36 | #endif //ELEMENTS_H_INCLUDED 37 | -------------------------------------------------------------------------------- /src/attic/get_pol.pl: -------------------------------------------------------------------------------- 1 | 2 | #get the actual polarization from two sets of files. Uses 3 | #get_zpol.pl; they have to be modified a bit, but hopefully 4 | #these will be improved after some time.. 5 | 6 | $au2Cm=57.216; 7 | $pi=3.14159; 8 | $a=4.00/.529; 9 | $c=4.036/.529; 10 | $base1="centro"; 11 | $base2="dist"; 12 | 13 | 14 | $ion1=`grep "ionic polarization" ${base1}5.vmc.o | awk '{print \$5}'`; 15 | $ion2=`grep "ionic polarization" ${base2}5.vmc.o | awk '{print \$5}'`; 16 | 17 | chomp($ion1); chomp($ion2); 18 | print "ionic contribution : $ion1 $ion2\n"; 19 | 20 | $iondiff=$ion2-$ion1; 21 | 22 | @phase=split(' ', `perl get_zpol.pl | grep angle`); 23 | $phasediff=$phase[1]; #$phase2[1]-$phase1[1]; 24 | $phaseerr=$phase[2]; #sqrt($phase2[3]**2+$phase1[3]**2); 25 | 26 | 27 | $ne=1; 28 | 29 | $vol=$a*$a*$c; 30 | $area=$a*$a; 31 | 32 | 33 | print "volume: $vol area: $area\n"; 34 | $fac=$au2Cm*$ne/(2*$pi*$area); 35 | 36 | $elec_contrib=$phasediff*$fac; 37 | $ion_contrib=$au2Cm*$iondiff/($vol); 38 | $err=$phaseerr*$fac; 39 | 40 | $quantum=2*$pi*$fac; 41 | print "quantum: $quantum \n"; 42 | print "electronic: $elec_contrib C/m^2 ionic: $ion_contrib C/m^2\n"; 43 | $total=$ion_contrib-$elec_contrib; 44 | print "difference: $total +/- $err C/m^2 \n"; 45 | -------------------------------------------------------------------------------- /src/attic/jeep_der.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QWalk/mainline/b12ea3652226caef23c2f5fc7b168746c89096f2/src/attic/jeep_der.cpp -------------------------------------------------------------------------------- /src/attic/optimize.pl: -------------------------------------------------------------------------------- 1 | #!/bin/perl 2 | 3 | $basename="test"; 4 | 5 | $nconfig=10; 6 | $eref=-1052.6; 7 | $nregen=3; 8 | 9 | $niterations=300; 10 | $scrdir="/var/tmp"; 11 | 12 | $nblock=5; 13 | $nstep=10; 14 | $ndecorr=2; 15 | $timestep=1.0; 16 | 17 | $configdir="config"; 18 | $configname="$configdir/$basename.config"; 19 | system("mkdir $configdir"); 20 | 21 | 22 | $sysname=$basename . ".sys"; 23 | $jastname=$basename . ".jast"; 24 | $slatname=$basename . ".slater"; 25 | 26 | open(hfout, ">$basename.hf"); 27 | print hfout 28 | "METHOD { 29 | VMC 30 | NBLOCK $nblock 31 | NSTEP $nstep 32 | NDECORR $ndecorr 33 | TIMESTEP $timestep 34 | NCONFIG $nconfig 35 | STORECONFIG $configname 36 | EREF $eref 37 | } 38 | 39 | 40 | 41 | INCLUDE $sysname 42 | TRIALFUNC { 43 | INCLUDE $slatname 44 | } 45 | "; 46 | close(hfout); 47 | 48 | for($i=0; $i < $nregen; $i++) { 49 | 50 | open(optout, ">$basename.opt$i"); 51 | print optout 52 | "METHOD { 53 | OPTIMIZE 54 | ITERATIONS $niterations 55 | READCONFIG $configname 56 | NCONFIG $nconfig 57 | EREF $eref 58 | MINFUNCTION VARIANCE 59 | PSEUDOTEMP $scrdir/$basename.pseudo 60 | } 61 | 62 | INCLUDE $sysname 63 | "; 64 | if($i==0) { 65 | print optout "TRIALFUNC { \n SLATER-JASTROW \n"; 66 | print optout " WF1 { INCLUDE $slatname } \n"; 67 | print optout " WF2 { INCLUDE $jastname } \n"; 68 | print optout "}\n"; 69 | } 70 | else { 71 | $i2=$i-1; 72 | print optout "TRIALFUNC { INCLUDE $basename.opt$i2.wfout }\n"; 73 | } 74 | 75 | close(optout); 76 | 77 | open(vmcout, ">$basename.vmc$i"); 78 | print vmcout 79 | " 80 | METHOD { 81 | VMC 82 | NBLOCK $nblock 83 | NSTEP $nstep 84 | NDECORR $ndecorr 85 | TIMESTEP $timestep 86 | NCONFIG $nconfig 87 | STORECONFIG $configname 88 | 89 | #uncomment the following to read a configuration 90 | READCONFIG $configname 91 | EREF $eref 92 | } 93 | 94 | 95 | 96 | INCLUDE $sysname 97 | TRIALFUNC { 98 | INCLUDE $basename.opt$i.wfout 99 | } 100 | "; 101 | close(vmcout); 102 | } 103 | 104 | -------------------------------------------------------------------------------- /src/attic/overlaps.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | #ifndef OVERLAPS_H_INCLUDED 21 | #define OVERLAPS_H_INCLUDED 22 | 23 | #include "Array.h" 24 | #include "gaussian_set.h" 25 | 26 | void pw_overlap(string & wfin, //JEEP wave function file 27 | Array2 & gvec, //g-vectors 28 | Array1
& centers, 29 | Array1 & basis, 30 | Gaussian_lookups & lookup, 31 | Array2 & pw_overlap, //return: 32 | Array1 & mos //range of mo's to calculate on this node 33 | ); 34 | 35 | void calculate_overlap(Array2 & latvec, Array1 & origin, 36 | Array1
& centers, Array1 & basis, 37 | Gaussian_lookups & lookup, Array2 & lcao_overlap); 38 | 39 | bool compare_mo(Array2 & oldMOCoeff, 40 | Array2 & newMOCoeff, 41 | Array2 & lcao_overlap, 42 | Array1 compare_list); 43 | 44 | 45 | void read_mo(string & orbin, int nmo, int nfunc, Array2 & moCoeff); 46 | #endif //OVERLAPS_H_INCLUDED 47 | -------------------------------------------------------------------------------- /src/basis_function/CBasis_function.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | 22 | #include "Basis_function.h" 23 | #include "qmc_io.h" 24 | #include "CPlanewave_function.h" 25 | #include "Blochwave_function.h" 26 | 27 | int allocate(vector & basistext, CBasis_function * & bptr) 28 | { 29 | assert( bptr == NULL ); 30 | unsigned int pos=0; 31 | string type; 32 | readnext(basistext, pos, type); 33 | if(caseless_eq(type,"CPLANEWAVE")) 34 | bptr=new CPlanewave_function; 35 | else if(caseless_eq(type,"BLOCHWAVE")) 36 | bptr=new Blochwave_function; 37 | else 38 | error("Didn't understand the basis section type ", type, 39 | " in basis section ", basistext[0]); 40 | 41 | bptr->read(basistext, pos); 42 | return 1; 43 | 44 | } 45 | 46 | int deallocate(CBasis_function * & bptr) 47 | { 48 | if(bptr == NULL) 49 | return 0; 50 | 51 | delete bptr; 52 | bptr=NULL; 53 | return 1; 54 | } 55 | //-------------------------------------------------------------------------- 56 | -------------------------------------------------------------------------------- /src/basis_function/Cutoff_cusp.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #ifndef CUTOFF_CUSP_H_INCLUDED 22 | #define CUTOFF_CUSP_H_INCLUDED 23 | 24 | #include "Basis_function.h" 25 | 26 | /*! 27 | 28 | */ 29 | class Cutoff_cusp: public Basis_function 30 | { 31 | public: 32 | 33 | 34 | //----------------------------------------------------- 35 | 36 | 37 | virtual int read( 38 | vector & words, 39 | //!< The words from the basis section that will create this basis function 40 | unsigned int & pos 41 | 42 | ); 43 | 44 | 45 | 46 | 47 | int nfunc(); 48 | virtual string label() 49 | { 50 | return centername; 51 | } 52 | doublevar cutoff(int ) 53 | { 54 | return rcut; 55 | } 56 | 57 | int showinfo(string & indent, ostream & os); 58 | int writeinput(string &, ostream &); 59 | 60 | void raw_input(ifstream & input); 61 | 62 | void calcVal(const Array1 & r, 63 | Array1 & symvals, 64 | const int startfill=0); 65 | 66 | void calcLap( 67 | const Array1 & r, 68 | Array2 & symvals, 69 | const int startfill=0 70 | ); 71 | 72 | virtual void getVarParms(Array1 & parms); 73 | virtual void setVarParms(Array1 & parms); 74 | virtual int nparms() { 75 | return 1; 76 | } 77 | 78 | private: 79 | 80 | doublevar rcut; 81 | doublevar rcutinv; //inverse of rcut, to save on divisions 82 | string centername; 83 | doublevar gamma; 84 | doublevar cusp; 85 | doublevar pade0; 86 | }; 87 | 88 | #endif // CUTOFF_CUSP_H_INCLUDED 89 | //-------------------------------------------------------------------------- 90 | -------------------------------------------------------------------------------- /src/basis_function/Exponent_cusp.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #ifndef EXPONENT_CUSP_H_INCLUDED 22 | #define EXPONENT_CUSP_H_INCLUDED 23 | 24 | #include "Basis_function.h" 25 | 26 | /*! 27 | 28 | */ 29 | class Exponent_cusp: public Basis_function 30 | { 31 | public: 32 | 33 | 34 | //----------------------------------------------------- 35 | 36 | 37 | virtual int read( 38 | vector & words, 39 | //!< The words from the basis section that will create this basis function 40 | unsigned int & pos 41 | 42 | ); 43 | 44 | 45 | 46 | 47 | int nfunc(); 48 | virtual string label() 49 | { 50 | return centername; 51 | } 52 | doublevar cutoff(int ) 53 | { 54 | return rcut; 55 | } 56 | 57 | int showinfo(string & indent, ostream & os); 58 | int writeinput(string &, ostream &); 59 | 60 | void raw_input(ifstream & input); 61 | 62 | void calcVal(const Array1 & r, 63 | Array1 & symvals, 64 | const int startfill=0); 65 | 66 | void calcLap( 67 | const Array1 & r, 68 | Array2 & symvals, 69 | const int startfill=0 70 | ); 71 | 72 | virtual void getVarParms(Array1 & parms); 73 | virtual void setVarParms(Array1 & parms); 74 | virtual int nparms() { 75 | return 1; 76 | } 77 | 78 | private: 79 | 80 | doublevar rcut; 81 | string centername; 82 | doublevar gamma; 83 | doublevar cusp; 84 | }; 85 | 86 | #endif // EXPONENT_CUSP_H_INCLUDED 87 | //-------------------------------------------------------------------------- 88 | -------------------------------------------------------------------------------- /src/basis_function/Pade_function.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #ifndef PADE_FUNCTION_H_INCLUDED 22 | #define PADE_FUNCTION_H_INCLUDED 23 | 24 | #include "Basis_function.h" 25 | /*! 26 | 27 | */ 28 | 29 | class Pade_function: public Basis_function 30 | { 31 | public: 32 | 33 | Pade_function() 34 | {} 35 | ~Pade_function() 36 | {} 37 | 38 | //----------------------------------------------------- 39 | 40 | 41 | virtual int read( 42 | vector & words, 43 | //!< The words from the basis section that will create this basis function 44 | unsigned int & pos 45 | //!< The current position in the words(important if one basis section makes several functions); will be incremented as the Basis_function reads the words. 46 | ); 47 | 48 | 49 | 50 | 51 | int nfunc(); 52 | virtual string label() 53 | { 54 | return centername; 55 | } 56 | doublevar cutoff(int ) 57 | { 58 | return 1e99; 59 | } 60 | 61 | int showinfo(string & indent, ostream & os); 62 | int writeinput(string &, ostream &); 63 | 64 | void raw_input(ifstream & input); 65 | 66 | void calcVal(const Array1 & r, 67 | Array1 & symvals, 68 | const int startfill=0); 69 | 70 | 71 | void calcLap( 72 | const Array1 & r, 73 | Array2 & symvals, 74 | const int startfill=0 75 | ); 76 | 77 | virtual void getVarParms(Array1 & parms); 78 | virtual void setVarParms(Array1 & parms); 79 | virtual int nparms() { 80 | return 1; 81 | } 82 | 83 | private: 84 | doublevar alpha0; 85 | doublevar rcut; 86 | Array1 alpha; 87 | int nmax; 88 | string centername; 89 | }; 90 | 91 | #endif // PADE_FUNCTION_H_INCLUDED 92 | //-------------------------------------------------------------------------- 93 | -------------------------------------------------------------------------------- /src/basis_function/Poly_pade_function.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #ifndef POLY_PADE_FUNCTION_H_INCLUDED 22 | #define POLY_PADE_FUNCTION_H_INCLUDED 23 | 24 | #include "Basis_function.h" 25 | 26 | /*! 27 | 28 | */ 29 | class Poly_pade_function: public Basis_function 30 | { 31 | public: 32 | 33 | Poly_pade_function() 34 | {} 35 | ~Poly_pade_function() 36 | {} 37 | 38 | //----------------------------------------------------- 39 | 40 | 41 | virtual int read( 42 | vector & words, 43 | unsigned int & pos 44 | ); 45 | 46 | 47 | int nfunc(); 48 | virtual string label() 49 | { 50 | return centername; 51 | } 52 | doublevar cutoff(int ) 53 | { 54 | return rcut; 55 | } 56 | 57 | int showinfo(string & indent, ostream & os); 58 | int writeinput(string &, ostream &); 59 | 60 | void raw_input(ifstream & input); 61 | 62 | void calcVal(const Array1 & r, 63 | Array1 & symvals, 64 | const int startfill=0); 65 | 66 | void calcLap( 67 | const Array1 & r, 68 | Array2 & symvals, 69 | const int startfill=0 70 | ); 71 | 72 | virtual void getVarParms(Array1 & parms); 73 | virtual void setVarParms(Array1 & parms); 74 | virtual int nparms() { 75 | return 1; 76 | } 77 | 78 | private: 79 | doublevar rcut; 80 | Array1 beta; //curvature parameter 81 | int nmax; 82 | string centername; 83 | }; 84 | 85 | #endif // POLY_PADE_FUNCTION_H_INCLUDED 86 | //-------------------------------------------------------------------------- 87 | -------------------------------------------------------------------------------- /src/basis_function/Spherical_bessel_function.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #ifndef SPHERICAL_BESSEL_FUNCTION_H_INCLUDED 22 | #define SPHERICAL_BESSEL_FUNCTION_H_INCLUDED 23 | 24 | #include "Basis_function.h" 25 | 26 | /*! 27 | 28 | */ 29 | class Spherical_bessel_function: public Basis_function 30 | { 31 | public: 32 | 33 | Spherical_bessel_function() 34 | {} 35 | ~Spherical_bessel_function() 36 | {} 37 | 38 | //----------------------------------------------------- 39 | 40 | 41 | virtual int read( 42 | vector & words, 43 | unsigned int & pos 44 | ); 45 | 46 | 47 | int nfunc(); 48 | virtual string label() 49 | { 50 | return centername; 51 | } 52 | doublevar cutoff(int ) 53 | { 54 | return rcut; 55 | } 56 | 57 | int showinfo(string & indent, ostream & os); 58 | int writeinput(string &, ostream &); 59 | 60 | void raw_input(ifstream & input); 61 | 62 | void calcVal(const Array1 & r, 63 | Array1 & symvals, 64 | const int startfill=0); 65 | 66 | void calcLap( 67 | const Array1 & r, 68 | Array2 & symvals, 69 | const int startfill=0 70 | ); 71 | 72 | virtual void getVarParms(Array1 & parms); 73 | virtual void setVarParms(Array1 & parms); 74 | virtual int nparms() { 75 | return 1; 76 | } 77 | 78 | private: 79 | doublevar rcut; 80 | int nmax; 81 | string centername; 82 | }; 83 | 84 | #endif // SPHERICAL_BESSEL_FUNCTION_H_INCLUDED 85 | //-------------------------------------------------------------------------- 86 | -------------------------------------------------------------------------------- /src/basis_function/make.include: -------------------------------------------------------------------------------- 1 | 2 | MY_SOURCES:= Basis_function.cpp \ 3 | Cubic_spline_build.cpp \ 4 | Cubic_spline_calc.cpp \ 5 | Cutoff_cusp.cpp \ 6 | Exponent_cusp.cpp \ 7 | Gaussian_function.cpp \ 8 | Gen_pade_function.cpp \ 9 | Pade_function.cpp \ 10 | Planewave_function.cpp \ 11 | Poly_pade_function.cpp \ 12 | Rgaussian_function.cpp \ 13 | Spline_fitter.cpp \ 14 | CBasis_function.cpp \ 15 | CPlanewave_function.cpp\ 16 | Blochwave_function.cpp \ 17 | Group_function.cpp \ 18 | Cosine_function.cpp \ 19 | Spherical_bessel_function.cpp 20 | 21 | 22 | SOURCES:= $(SOURCES) $(addprefix basis_function/,$(MY_SOURCES)) 23 | 24 | -------------------------------------------------------------------------------- /src/converter/Pseudo_writer.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #ifndef PSEUDO_WRITER_H_INCLUDED 22 | #define PSEUDO_WRITER_H_INCLUDED 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | 29 | class Pseudo_writer { 30 | public: 31 | virtual void print_pseudo(std::ostream & os)=0; 32 | virtual ~Pseudo_writer() {} 33 | }; 34 | 35 | class Gaussian_pseudo_writer { 36 | public: 37 | std::string label; 38 | double effcharge; 39 | int atomnum; 40 | std::vector > exponents; //l-value, then exponents per l. 41 | std::vector > coefficients; 42 | std::vector > nvalue; //the coefficient in r^n 43 | virtual void print_pseudo(std::ostream & os); 44 | }; 45 | 46 | 47 | class Spline_pseudo_writer { 48 | public: 49 | //If spin_dep is true, then the first half of L-values is the down spin, 50 | //and the second is the up spin. 51 | 52 | // Pseudopotential positions. First is for l-value, second for vector.. 53 | std::vector < std::vector > psp_pos; 54 | 55 | // Pseudopotential values. First for l-value. 56 | std::vector > psp_val; 57 | 58 | std::string label; 59 | bool spin_dep; 60 | double effcharge; //Not strictly used, but often in the psp file. 61 | virtual void print_pseudo(std::ostream & os); 62 | Spline_pseudo_writer() { 63 | spin_dep=false; 64 | } 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /src/converter/elements.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | //A lookup table of the atomic numbers and the associated elements. 21 | #ifndef ELEMENTS_H_INCLUDED 22 | #define ELEMENTS_H_INCLUDED 23 | 24 | const char * element_lookup_caps[]= {"NULL", "H", "HE", 25 | "LI", "BE", "B", "C", "N", "O", "F", "NE", 26 | "NA", "MG", "AL", "SI", "P", "S", "CL", "AR", 27 | "K", "CA", "SC", "TI", "V", "CR", "MN", "FE", 28 | "CO", "NI", "CU", "ZN", "GA", "GE", "AS", "SE", "BR", "KR", 29 | "RB", "SR", "Y", "ZR", "NB", "MO", "TC", "RU", "RH", "PD", 30 | "AG", "CD", "IN", "SN", "SB", "TE", "I", "XE", 31 | "CS", "BA", "LA", "CE", "PR", "ND", "PM", "SM", "EU", "GD", "TB", 32 | "DY", "HO", "ER", "TM", "YB", "LU", "HF", "TA", "W", "RE", 33 | "OS", "IR", "PT", "AU", "HG", "TL", "PB", "BI", "PO", "AT", "RN" }; 34 | 35 | 36 | #endif //ELEMENTS_H_INCLUDED 37 | -------------------------------------------------------------------------------- /src/converter/indexx.h: -------------------------------------------------------------------------------- 1 | void indexx(int arr[], int indx[], const int n); 2 | void indexx(double arr[], int indx[], const int n); 3 | -------------------------------------------------------------------------------- /src/converter/sqd2qmc.h: -------------------------------------------------------------------------------- 1 | #ifndef SQD2QMC_H_INCLUDED 2 | #define SQD2QMC_H_INCLUDED 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | using namespace std; 13 | 14 | class group { 15 | public: 16 | int charge; 17 | char* name; 18 | int size; 19 | group (){ 20 | name=""; 21 | charge=0; 22 | size=-1; 23 | } 24 | }; 25 | 26 | 27 | class particleset { 28 | public: 29 | vector g; 30 | char* name; 31 | int size; 32 | particleset() { 33 | name=""; 34 | size=-1; 35 | } 36 | }; 37 | 38 | 39 | class basisGroup{ 40 | public: 41 | char* rid; 42 | char* ds; 43 | int n; 44 | int l; 45 | int m; 46 | int s; 47 | basisGroup(){} 48 | }; 49 | 50 | class atomicBasisSet{ 51 | public: 52 | char* type; 53 | char* elementType; 54 | char* filename; 55 | vector orbs; 56 | atomicBasisSet(){} 57 | }; 58 | 59 | 60 | class wavefunction{ 61 | public: 62 | char* name; 63 | char *target; 64 | atomicBasisSet abs; 65 | wavefunction(){} 66 | }; 67 | 68 | 69 | 70 | class xml_system_data { 71 | public: 72 | vector p; 73 | wavefunction wf; 74 | xml_system_data() { 75 | } 76 | }; 77 | 78 | 79 | class radial_orbital { 80 | public: 81 | vector radial_part; 82 | vector uofr; 83 | vector r_log; 84 | int power; 85 | vector quantum_numbers; 86 | double eigenvalue; 87 | string orb_name; 88 | radial_orbital (){ 89 | radial_part.resize(0); 90 | uofr.resize(0); 91 | r_log.resize(0); 92 | quantum_numbers.resize(0); 93 | eigenvalue=0.0; 94 | power=0; 95 | orb_name=""; 96 | } 97 | }; 98 | 99 | 100 | 101 | bool putContent(vector & in, xmlNodePtr cur) { 102 | //istringstream stream((const char*)(xmlNodeListGetString(cur->doc, cur->xmlChildrenNode, 1))); 103 | //for(int i=0;idoc, cur->xmlChildrenNode, 1))); 105 | for(int i=0;i> in[i]; 107 | //cout < S(nexp, nexp); 30 | Array1 h(nexp); 31 | for(int i=0; i< nexp; i++) { 32 | for(int j=0; j< nexp; j++) { 33 | S(i,j)=pow(cut,m+i+j+1)/(m+i+j+1); 34 | } 35 | h(i)=pow(cut,i+1)/(i+1); 36 | } 37 | 38 | Array2 Sinv(nexp, nexp); 39 | InvertMatrix(S, Sinv, nexp); 40 | 41 | coeff=0; 42 | for(int i=0; i< nexp; i++) 43 | for(int j=0;j< nexp;j++) 44 | coeff(i)+=Sinv(i,j)*h(j); 45 | } 46 | 47 | 48 | void Force_fitter::fit_force(Array1 & r, 49 | Array1 & bare_force, 50 | Array1 & fit_force) { 51 | int ndim=bare_force.GetDim(0); 52 | 53 | fit_force=bare_force; return; 54 | 55 | fit_force.Resize(ndim); 56 | fit_force=0; 57 | 58 | if(r(0) < cut) { 59 | for(int d=0; d< ndim; d++) { 60 | doublevar basis=0; 61 | for(int i=0; i< nexp; i++) { 62 | basis+=coeff(i)*pow(r(0),i+m); 63 | } 64 | fit_force(d)=bare_force(d)*basis; 65 | } 66 | } 67 | else { 68 | fit_force=bare_force; 69 | } 70 | 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/method/Force_fitter.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #ifndef FORCE_FITTER_H_INCLUDED 22 | #define FORCE_FITTER_H_INCLUDED 23 | 24 | 25 | #include "Qmc_std.h" 26 | 27 | class Force_fitter { 28 | public: 29 | void setup(doublevar cut, int nexpansion ); 30 | 31 | doublevar cutoff() { return cut;} 32 | void fit_force(Array1 & r, Array1 & bare_force, 33 | Array1 & fit_force); 34 | 35 | 36 | 37 | private: 38 | int m;//the base expansion 39 | doublevar cut; 40 | int nexp; 41 | Array1 coeff; 42 | 43 | }; 44 | 45 | 46 | #endif //FORCE_FITTER_H_INCLUDED 47 | -------------------------------------------------------------------------------- /src/method/Generate_sample.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | 22 | #ifndef GENERATE_SAMPLE_H_INCLUDED 23 | #define GENERATE_SAMPLE_H_INCLUDED 24 | 25 | 26 | #include "Split_sample.h" 27 | 28 | //The objective of this function is to generate a converged set of samples as 29 | //efficiently as possible. 30 | //It will use the provided system objects to generate nconfig samples, stored in 31 | //the configs variable. 32 | // Returns the optimized timestep. 33 | 34 | doublevar generate_sample(Sample_point * sample, 35 | Wavefunction * wf, 36 | Wavefunction_data * wfdata, 37 | Guiding_function * guidewf, 38 | int nconfig, 39 | Array1 & configs, 40 | int warmup_moves=5, 41 | int decorrelation_moves=3, 42 | doublevar timestep=1.0); 43 | #include "MO_matrix.h" 44 | 45 | void generate_mo_sample(Sample_point * sample, System * sys, 46 | MO_matrix * mo, int list, int nconfig, Array1 > & r); 47 | 48 | #endif //GENERATE_SAMPLE_H_INCLUDED 49 | -------------------------------------------------------------------------------- /src/method/Lowdin_method.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | 22 | #ifndef LOWDIN_METHOD_H_INCLUDED 23 | #define LOWDIN_METHOD_H_INCLUDED 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include "Qmc_method.h" 30 | #include "qmc_io.h" 31 | #include "Array.h" 32 | #include "MO_matrix.h" 33 | #include "Sample_point.h" 34 | #include "Array45.h" 35 | class System; 36 | class Wavefunction; 37 | class Program_options; 38 | 39 | /*! 40 | 41 | */ 42 | class Lowdin_method : public Qmc_method 43 | { 44 | public: 45 | void read(vector words, 46 | unsigned int & pos, 47 | Program_options & options); 48 | void run(Program_options & options, ostream & output); 49 | int showinfo(ostream & os); 50 | Lowdin_method():mymomat(NULL), mywalker(NULL),sys(NULL) {} 51 | ~Lowdin_method() 52 | { 53 | if(mymomat!=NULL) delete mymomat; 54 | if(mywalker != NULL) delete mywalker; 55 | if(sys != NULL) delete sys; 56 | } 57 | 58 | private: 59 | void calculate_overlap(Array2 & S); 60 | doublevar resolution; //grid coarsness: 10=coarser 0.1=finer 61 | MO_matrix * mymomat; //will hold MO information 62 | Sample_point * mywalker; //a single configuration/walker 63 | System * sys; 64 | Array2 LatticeVec; 65 | Array1 origin; 66 | string out_orbs; 67 | }; 68 | 69 | #endif //LOWDIN_METHOD_H_INCLUDED 70 | //------------------------------------------------------------------------ 71 | -------------------------------------------------------------------------------- /src/method/Nodes_method.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Michal Bajdich 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | 22 | #ifndef NODES_METHOD_H_INCLUDED 23 | #define NODES_METHOD_H_INCLUDED 24 | 25 | #include "Array.h" 26 | #include "MO_matrix.h" 27 | #include "Qmc_std.h" 28 | #include "Qmc_method.h" 29 | #include "Wavefunction.h" 30 | #include "Wavefunction_data.h" 31 | #include "Sample_point.h" 32 | #include "System.h" 33 | class System; 34 | class Wavefunction; 35 | class Program_options; 36 | 37 | class Nodes_method : public Qmc_method 38 | { 39 | public: 40 | 41 | void read(vector words, 42 | unsigned int & pos, 43 | Program_options & options); 44 | void run(Program_options & options, ostream & output); 45 | int showinfo(ostream & os); 46 | Nodes_method() { 47 | mywalker=NULL; 48 | wfdata=NULL; 49 | wf=NULL; 50 | sysprop=NULL; 51 | } 52 | ~Nodes_method() 53 | { 54 | if(mywalker != NULL) delete mywalker; 55 | deallocate(wf); 56 | deallocate(wfdata); 57 | // for(int i=0; i< nconfigsread; i++) { delete electrons(i); } 58 | } 59 | 60 | private: 61 | Array1 plots; //3D projections of WF for particular e's to be made 62 | Array1 minmax; //xmin xmax ymin ymax zmin zmax 63 | Array2 dxyz;//shift of second electron to be moved 64 | bool doublemove; //switch for doublemove part 65 | doublevar resolution; //grid coarsness: 10=coarser 0.1=finer 66 | string readconfig; 67 | System * sysprop; 68 | Array1 tmp_configs; 69 | Wavefunction * wf; 70 | Wavefunction_data * wfdata; 71 | Sample_point * mywalker; //a single configuration/walker 72 | 73 | 74 | }; 75 | 76 | #endif //NODES_METHOD_H_INCLUDED 77 | //------------------------------------------------------------------------ 78 | -------------------------------------------------------------------------------- /src/method/Plot1d_method.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Jindrich Kolorenc 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | 22 | #ifndef PLOT1D_METHOD_H_INCLUDED 23 | #define PLOT1D_METHOD_H_INCLUDED 24 | 25 | #include "Qmc_method.h" 26 | #include "Wavefunction.h" 27 | #include "Wavefunction_data.h" 28 | class System; 29 | class Wavefunction; 30 | class Program_options; 31 | 32 | /*! 33 | \brief 34 | Plotting of one-dimensional parts of a wave function (mainly Jastrow). 35 | Functions are plotted from 0 to CUTOFF, number of points is NGRID. 36 | Default output file is runid.plt1d, suffix plt1d can be overriden by 37 | setting SUFFIX. 38 | */ 39 | class Plot1D_method : public Qmc_method 40 | { 41 | public: 42 | 43 | void read(vector words, 44 | unsigned int & pos, 45 | Program_options & options); 46 | int generateVariables(Program_options & options); 47 | void run(Program_options & options, ostream & output); 48 | int showinfo(ostream & os); 49 | Plot1D_method() {} 50 | ~Plot1D_method() {} 51 | 52 | 53 | private: 54 | 55 | System * sysprop; 56 | Wavefunction * wf; 57 | Wavefunction_data * mywfdata; 58 | 59 | int ngrid; 60 | doublevar cutoff; 61 | string suffix; 62 | 63 | }; 64 | 65 | #endif //PLOT1D_METHOD_H_INCLUDED 66 | //------------------------------------------------------------------------ 67 | -------------------------------------------------------------------------------- /src/method/Rotate_orbs.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | 22 | #ifndef ROTATE_ORBS_METHOD_H_INCLUDED 23 | #define ROTATE_ORBS_METHOD_H_INCLUDED 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include "Qmc_method.h" 30 | #include "qmc_io.h" 31 | #include "Array.h" 32 | #include "MO_matrix.h" 33 | #include "Sample_point.h" 34 | #include "Array45.h" 35 | class System; 36 | class Wavefunction; 37 | class Program_options; 38 | 39 | /*! 40 | */ 41 | class Rotate_orbs_method : public Qmc_method 42 | { 43 | public: 44 | void read(vector words, 45 | unsigned int & pos, 46 | Program_options & options); 47 | void run(Program_options & options, ostream & output); 48 | int showinfo(ostream & os); 49 | Rotate_orbs_method():mymomat(NULL), mywalker(NULL),sys(NULL) {} 50 | ~Rotate_orbs_method() 51 | { 52 | if(mymomat!=NULL) delete mymomat; 53 | if(mywalker != NULL) delete mywalker; 54 | if(sys != NULL) delete sys; 55 | } 56 | private: 57 | string rotation_file; 58 | string output_orb; 59 | MO_matrix * mymomat; //will hold MO information 60 | Sample_point * mywalker; //a single configuration/walker 61 | System * sys; 62 | Array1 < Array1 > orbital_groups; //groups of orbitals to localize together 63 | }; 64 | 65 | #endif //ROTATE_ORBS_METHOD_H_INCLUDED 66 | //------------------------------------------------------------------------ 67 | -------------------------------------------------------------------------------- /src/method/Test_method.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | with modifications by Michal Bajdich 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License along 17 | with this program; if not, write to the Free Software Foundation, Inc., 18 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | 20 | */ 21 | 22 | 23 | #ifndef TEST_METHOD_H_INCLUDED 24 | #define TEST_METHOD_H_INCLUDED 25 | 26 | #include "Qmc_std.h" 27 | #include "Qmc_method.h" 28 | #include "Wavefunction.h" 29 | #include "Wavefunction_data.h" 30 | #include "Sample_point.h" 31 | #include "Guiding_function.h" 32 | class Program_options; 33 | #include "Basis_function.h" 34 | #include "Backflow_wf_data.h" 35 | #include "System.h" 36 | /*! 37 | \brief 38 | Do some tests. Used mostly as a development tool. Keyword: TEST 39 | 40 | */ 41 | class Test_method : public Qmc_method 42 | { 43 | public: 44 | void read(vector words, 45 | unsigned int & pos, 46 | Program_options & options); 47 | void run(Program_options & options, ostream & output); 48 | ~Test_method() 49 | { 50 | 51 | deallocate(wfdata); 52 | if(sysprop) delete sysprop; 53 | } 54 | 55 | int showinfo(ostream & os); 56 | private: 57 | void testBackflow(); 58 | void plotCusp(Wavefunction * mywf, Sample_point * sample); 59 | void testParmDeriv(Wavefunction * mywf, Sample_point * sample); 60 | int nelectrons; //!< Number of electrons 61 | string wfoutputfile; 62 | System * sysprop; 63 | string readconfig; 64 | 65 | Wavefunction_data * wfdata; 66 | Pseudopotential * psp; 67 | Basis_function * basis; 68 | 69 | Backflow_wrapper backflow; 70 | int test_backflow; 71 | int plot_cusp; 72 | int parms_ders; 73 | int testhessian; 74 | }; 75 | 76 | #endif //TEST_METHOD_H_INCLUDED 77 | //------------------------------------------------------------------------ 78 | -------------------------------------------------------------------------------- /src/method/make.include: -------------------------------------------------------------------------------- 1 | 2 | MY_SOURCES:= \ 3 | Dmc_method.cpp \ 4 | Force_fitter.cpp \ 5 | Generate_sample.cpp \ 6 | Rndmc_method.cpp \ 7 | Linear_optimization.cpp \ 8 | Localize_method.cpp \ 9 | Lowdin_method.cpp \ 10 | Maximize_method.cpp \ 11 | Nodes_method.cpp \ 12 | Shdmc_method.cpp \ 13 | Optimize_method.cpp \ 14 | Plot_method.cpp \ 15 | Plot1d_method.cpp \ 16 | Postprocess_method.cpp \ 17 | Qmc_method.cpp \ 18 | Reptation_method.cpp \ 19 | Rotate_orbs.cpp \ 20 | Split_sample.cpp \ 21 | Test_method.cpp \ 22 | Vmc_method.cpp \ 23 | Wannier_method.cpp 24 | 25 | 26 | SOURCES:= $(SOURCES) $(addprefix method/,$(MY_SOURCES)) 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/orbitals/make.include: -------------------------------------------------------------------------------- 1 | 2 | MY_SOURCES:= Center_set.cpp \ 3 | MO_matrix.cpp \ 4 | MO_matrix_basfunc.cpp \ 5 | MO_matrix_Cbasfunc.cpp \ 6 | 7 | 8 | SOURCES:= $(SOURCES) $(addprefix orbitals/,$(MY_SOURCES)) 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/program_utils/Program_options.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #ifndef PROGRAM_OPTIONS_H_INCLUDED 22 | #define PROGRAM_OPTIONS_H_INCLUDED 23 | 24 | #include "Qmc_std.h" 25 | 26 | /*! 27 | This is just to hold an atom for the input. 28 | 29 | */ 30 | class Atom 31 | { 32 | public: 33 | 34 | vector coor; 35 | //!< Coordinates of the atom 36 | string name; 37 | //!< An identifier that's used to match with pseudopotentials, basis sets, etc 38 | doublevar charge; 39 | //!< atomic number minus psp removed elecs 40 | 41 | void reset() 42 | { 43 | coor[0]=0; 44 | coor[1]=0; 45 | coor[2]=0; 46 | name=" "; 47 | charge=0; 48 | } 49 | Atom() 50 | { 51 | coor.resize(3); 52 | reset(); 53 | } 54 | 55 | }; 56 | 57 | 58 | /*! 59 | This class is designed to hold all the options given by the user as they 60 | were given, so that various parts of the program can read the options. 61 | */ 62 | class Program_options 63 | { 64 | public: 65 | 66 | string runid; 67 | //!< name of the run 68 | 69 | vector < vector < string > > methodtext; 70 | //! > pseudotext; 73 | vector > systemtext; 74 | //!< SYSTEM text 75 | vector < vector > twftext; 76 | //!< TRIALFUNC text. Since there could be several sections, this is a vector. 77 | int verbose; 78 | //!< Possibly: 0-minimal output, 1-medium output, 2-debug output 79 | 80 | Program_options() 81 | { 82 | verbose=0; 83 | } 84 | }; 85 | 86 | 87 | #endif //PROGRAM_OPTIONS_H_INCLUDED 88 | //-------------------------------------------------------------------------- 89 | -------------------------------------------------------------------------------- /src/program_utils/gosling.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QWalk/mainline/b12ea3652226caef23c2f5fc7b168746c89096f2/src/program_utils/gosling.make -------------------------------------------------------------------------------- /src/program_utils/jsontools.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Array.h" 3 | #include "Array45.h" 4 | 5 | #ifndef JSONTOOLS_H_INCLUDED 6 | #define JSONTOOLS_H_INCLUDED 7 | 8 | template void jsonarray(std::ostream & os, Array1 & arr) { 9 | os << "["; 10 | int npts=arr.GetDim(0); 11 | for(int i=0; i< npts-1; i++) 12 | os << arr[i] << ","; 13 | os << arr[npts-1] << "]"; 14 | } 15 | 16 | template void jsonarray(std::ostream & os, Array2 & arr) { 17 | int nptsi=arr.GetDim(0); 18 | int nptsj=arr.GetDim(1); 19 | os << "["; 20 | 21 | for(int i=0; i< nptsi; i++) { 22 | os << "["; 23 | for(int j=0; j< nptsj-1; j++) 24 | os << arr(i,j) << ","; 25 | os << arr(i,nptsj-1) << "]"; 26 | if(i< nptsi-1) os << ",\n"; 27 | } 28 | os << "\n ] "; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/program_utils/make.include: -------------------------------------------------------------------------------- 1 | 2 | MY_SOURCES:= average.cpp \ 3 | MatrixAlgebrac.cpp \ 4 | ooqmc.cpp \ 5 | qmc_io.cpp \ 6 | Qmc_std.cpp \ 7 | ulec.cpp 8 | 9 | 10 | SOURCES:= $(SOURCES) $(addprefix program_utils/,$(MY_SOURCES)) 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/properties/Average_derivative_dm.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2017 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #ifndef AVERAGE_DERIVATIVE_DM_H_INCLUDED 22 | #define AVERAGE_DERIVATIVE_DM_H_INCLUDED 23 | 24 | #include "Average_generator.h" 25 | #include "Average_density_matrix.h" 26 | 27 | /*! 28 | \brief 29 | Evaluate the correlation of moments of the Hamiltonian with Average_generator objects. 30 | */ 31 | class Average_derivative_dm:public Average_generator { 32 | public: 33 | virtual void evaluate(Wavefunction_data * wfdata, Wavefunction * wf, 34 | System * sys, Sample_point * sample, Average_return & ) { 35 | error("need to use Properties_point version of evaluate"); 36 | } 37 | virtual void evaluate(Wavefunction_data * wfdata, Wavefunction * wf, 38 | System * sys, Sample_point * sample, Properties_point & pt, 39 | Average_return &avg); 40 | 41 | virtual void read(System * sys, Wavefunction_data * wfdata, vector 42 | & words); 43 | virtual void write_init(string & indent, ostream & os); 44 | virtual void randomize(Wavefunction_data * wfdata, Wavefunction * wf, 45 | System * sys, Sample_point * sample) { 46 | dm_eval.randomize(wfdata,wf,sys,sample); 47 | } 48 | virtual void read(vector & words); 49 | virtual void write_summary(Average_return &,Average_return &, ostream & os); 50 | virtual void jsonOutput(Average_return &,Average_return &, ostream & os); 51 | private: 52 | Average_tbdm_basis dm_eval; 53 | int nparms,nmo,ndm_elements; 54 | 55 | }; 56 | 57 | 58 | 59 | 60 | #endif //AVERAGE_DERIVATIVE_DM_H_INCLUDED 61 | -------------------------------------------------------------------------------- /src/properties/Average_enmoment.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #ifndef AVERAGE_ENMOMENT_H_INCLUDED 22 | #define AVERAGE_ENMOMENT_H_INCLUDED 23 | 24 | #include "Average_generator.h" 25 | #include "MO_matrix.h" 26 | 27 | /*! 28 | \brief 29 | Evaluate the correlation of moments of the Hamiltonian with Average_generator objects. 30 | */ 31 | class Average_enmoment:public Average_generator { 32 | public: 33 | virtual void evaluate(Wavefunction_data * wfdata, Wavefunction * wf, 34 | System * sys, Sample_point * sample, Average_return & ) { 35 | error("need to use Properties_point version of evaluate"); 36 | } 37 | virtual void evaluate(Wavefunction_data * wfdata, Wavefunction * wf, 38 | System * sys, Sample_point * sample, Properties_point & pt, 39 | Average_return &avg); 40 | 41 | virtual void read(System * sys, Wavefunction_data * wfdata, vector 42 | & words); 43 | virtual void write_init(string & indent, ostream & os); 44 | virtual void randomize(Wavefunction_data * wfdata, Wavefunction * wf, 45 | System * sys, Sample_point * sample) { 46 | avg_gen->randomize(wfdata,wf,sys,sample); 47 | } 48 | virtual void read(vector & words); 49 | virtual void write_summary(Average_return &,Average_return &, ostream & os); 50 | virtual ~Average_enmoment() { 51 | delete avg_gen; 52 | } 53 | Average_enmoment() { 54 | avg_gen=NULL; 55 | } 56 | private: 57 | Average_generator * avg_gen; 58 | int nmoment; 59 | 60 | }; 61 | 62 | 63 | 64 | 65 | #endif //AVERAGE_ENMOMENT_H_INCLUDED 66 | -------------------------------------------------------------------------------- /src/properties/Average_ldots.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | #ifndef AVERAGE_LDOTS_H_INCLUDED 21 | #define AVERAGE_LDOTS_H_INCLUDED 22 | #include "Average_generator.h" 23 | #include 24 | using namespace std; 25 | class Average_ldots:public Average_generator { 26 | public: 27 | virtual void evaluate(Wavefunction_data * wfdata, Wavefunction * wf, 28 | System * sys, Sample_point * sample, Average_return & ); 29 | 30 | virtual void evaluate(Wavefunction_data * wfdata, Wavefunction * wf, 31 | System * sys, Pseudopotential * psp, Sample_point * sample, Average_return & ){ 32 | error("no psp is needed"); 33 | }; 34 | // virtual void evaluate(Wavefunction_data * wfdata, Wavefunction * wf, 35 | // System * sys, Pseudopotential *psp, Sample_point * sample, Properties_point & pt, Average_return & ); 36 | virtual void read(System * sys, Wavefunction_data * wfdata, vector 37 | & words); 38 | virtual void write_init(string & indent, ostream & os); 39 | //virtual void randomize(Wavefunction_data * wfdata, Wavefunction * wf, 40 | //System * sys, Sample_point * sample); 41 | virtual void read(vector & words); 42 | virtual void write_summary(Average_return &,Average_return &, ostream & os); 43 | virtual void jsonOutput(Average_return &,Average_return &, ostream & os); 44 | virtual ~Average_ldots() { 45 | } 46 | Average_ldots() { 47 | } 48 | 49 | private: 50 | Array1 init_grid; 51 | Array1 del_grid; 52 | Array1 num_grid; 53 | int at_i; 54 | int at_f; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/properties/Average_quadrupole.h: -------------------------------------------------------------------------------- 1 | #include "Average_generator.h" 2 | 3 | #ifndef AVERAGE_QUADRUPOLE_H_INCLUDED 4 | #define AVERAGE_QUADRUPOLE_H_INCLUDED 5 | #include "Array45.h" 6 | /*! 7 | */ 8 | class Average_quadrupole:public Average_generator { 9 | public: 10 | virtual void evaluate(Wavefunction_data * wfdata, Wavefunction * wf, 11 | System * sys, Sample_point * sample, Average_return & avg); 12 | virtual void read(System * sys, Wavefunction_data * wfdata, vector 13 | & words); 14 | virtual void write_init(string & indent, ostream & os); 15 | virtual void read(vector & words); 16 | virtual void write_summary(Average_return &,Average_return &, ostream & os); 17 | virtual void jsonOutput(Average_return &,Average_return &, ostream & ); 18 | 19 | private: 20 | Array2 gvecs; 21 | }; 22 | 23 | 24 | class Average_joint_pbc:public Average_generator { 25 | public: 26 | virtual void evaluate(Wavefunction_data * wfdata, Wavefunction * wf, 27 | System * sys, Sample_point * sample, Average_return & avg); 28 | virtual void read(System * sys, Wavefunction_data * wfdata, vector 29 | & words); 30 | virtual void write_init(string & indent, ostream & os); 31 | virtual void read(vector & words); 32 | virtual void write_summary(Average_return &,Average_return &, ostream & os); 33 | virtual void jsonOutput(Average_return &,Average_return &, ostream & ); 34 | 35 | private: 36 | Array2 gvecs; 37 | }; 38 | 39 | 40 | 41 | #endif //AVERAGE_QUADRUPOLE_H_INCLUDED 42 | 43 | -------------------------------------------------------------------------------- /src/properties/Average_so.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | #ifndef AVERAGE_SO_H_INCLUDED 21 | #define AVERAGE_SO_H_INCLUDED 22 | #include "Average_generator.h" 23 | #include "Pseudopotential_so.h" 24 | #include 25 | using namespace std; 26 | class Average_so:public Average_generator { 27 | public: 28 | virtual void evaluate(Wavefunction_data * wfdata, Wavefunction * wf, 29 | System * sys, Sample_point * sample, Average_return & ); 30 | 31 | virtual void evaluate(Wavefunction_data * wfdata, Wavefunction * wf, 32 | System * sys, Pseudopotential * psp, Sample_point * sample, Average_return & ){ 33 | error("no psp is needed"); 34 | }; 35 | // virtual void evaluate(Wavefunction_data * wfdata, Wavefunction * wf, 36 | // System * sys, Pseudopotential *psp, Sample_point * sample, Properties_point & pt, Average_return & ); 37 | virtual void read(System * sys, Wavefunction_data * wfdata, vector 38 | & words); 39 | virtual void write_init(string & indent, ostream & os); 40 | virtual void randomize(Wavefunction_data * wfdata, Wavefunction * wf, 41 | System * sys, Sample_point * sample); 42 | virtual void read(vector & words); 43 | virtual void write_summary(Average_return &,Average_return &, ostream & os); 44 | virtual void jsonOutput(Average_return &,Average_return &, ostream & os); 45 | virtual ~Average_so() { 46 | } 47 | Average_so() { 48 | } 49 | 50 | private: 51 | Pseudopotential_so * psp_so; 52 | Array1 init_grid; 53 | Array1 del_grid; 54 | Array1 num_grid; 55 | 56 | }; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/properties/Properties_gather.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | #include "Properties_gather.h" 21 | #include "ulec.h" 22 | #include "qmc_io.h" 23 | #include "Wavefunction_data.h" 24 | //---------------------------------------------------------------------- 25 | 26 | Properties_gather::~Properties_gather() { 27 | } 28 | 29 | //---------------------------------------------------------------------- 30 | 31 | void Properties_gather::read(vector < string> & words) { 32 | 33 | } 34 | 35 | 36 | //---------------------------------------------------------------------- 37 | #include "Split_sample.h" 38 | #include "Force_fitter.h" 39 | 40 | void Properties_gather::gatherData(Properties_point & myprop, 41 | Pseudopotential * psp, 42 | System * sys, 43 | Wavefunction_data * wfdata, 44 | Wavefunction * wf, 45 | Sample_point * sample, 46 | Guiding_function * guide) { 47 | int nwf=wf->nfunc(); 48 | 49 | myprop.setSize(nwf); 50 | 51 | 52 | wf->updateLap(wfdata, sample); 53 | wf->getVal(wfdata, 0, myprop.wf_val); 54 | 55 | sys->calcKinetic(wfdata, sample, wf, myprop.kinetic); 56 | myprop.potential=sys->calcLoc(sample); 57 | 58 | for(int w=0; w< nwf; w++) { 59 | myprop.weight(w)=guide->getWeight(myprop.wf_val, 60 | myprop.wf_val, w); 61 | } 62 | 63 | int nrandvar=psp->nTest(); 64 | Array1 rand_num(nrandvar); 65 | for(int i=0; i< nrandvar; i++) 66 | rand_num(i)=rng.ulec(); 67 | 68 | psp->calcNonlocWithTest(wfdata, sys,sample, wf, 69 | rand_num, myprop.nonlocal); 70 | 71 | myprop.count=1; 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/properties/Properties_gather.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | //---------------------------------------------------------------------- 21 | //include/Properties_gather.h 22 | 23 | #ifndef PROPERTIES_GATHER_H_INCLUDED 24 | #define PROPERTIES_GATHER_H_INCLUDED 25 | 26 | #include "Space_warper.h" 27 | #include "Wavefunction.h" 28 | #include "System.h" 29 | #include "Sample_point.h" 30 | #include "Properties_point.h" 31 | #include "Pseudopotential.h" 32 | #include "Guiding_function.h" 33 | class Dynamics_generator; 34 | struct Dynamics_info; 35 | 36 | class Properties_gather { 37 | public: 38 | 39 | Properties_gather() { 40 | } 41 | 42 | ~Properties_gather(); 43 | void read(vector & words); 44 | 45 | void gatherData(Properties_point &, 46 | Pseudopotential *, System *, Wavefunction_data *, 47 | Wavefunction *, Sample_point *, Guiding_function *); 48 | private: 49 | }; 50 | 51 | 52 | 53 | #endif //PROPERTIES_GATHER_H_INCLUDED 54 | 55 | //---------------------------------------------------------------------- 56 | -------------------------------------------------------------------------------- /src/properties/Space_warper.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #ifndef SPACE_WARPER_H_INCLUDED 22 | #define SPACE_WARPER_H_INCLUDED 23 | 24 | #include "Qmc_std.h" 25 | #include "Basis_function.h" 26 | class Sample_point; 27 | 28 | class Space_warper { 29 | public: 30 | Space_warper(); 31 | 32 | ~Space_warper() { 33 | //if(weight_basis) delete weight_basis; 34 | } 35 | 36 | void set_warp(int warp) { 37 | assert(warp==0 || warp==1); 38 | warp_on=warp; 39 | } 40 | 41 | void read(vector & words); 42 | int space_warp(Sample_point * refsample, 43 | Sample_point * sample, 44 | int e, Array1 & R_old, 45 | Array1 & R_new, 46 | doublevar & jacobian ); 47 | //set all electrons in sample to the warped coordinates from refsample 48 | doublevar warp_all(Sample_point * refsample,Sample_point * sample); 49 | private: 50 | Basis_function * weight_basis; 51 | int warp_on; 52 | int ex; //!< exponent of warping transformation 53 | }; 54 | 55 | #endif //SPACE_WARPER_H_INCLUDED 56 | 57 | //---------------------------------------------------------------------- 58 | -------------------------------------------------------------------------------- /src/properties/make.include: -------------------------------------------------------------------------------- 1 | 2 | MY_SOURCES:= \ 3 | Average_density_matrix.cpp \ 4 | Average_derivative_dm.cpp \ 5 | Average_enmoment.cpp \ 6 | Average_generator.cpp \ 7 | Average_ldots.cpp \ 8 | Average_so.cpp \ 9 | Average_ekt.cpp \ 10 | Average_region_fluctuation.cpp \ 11 | Average_quadrupole.cpp \ 12 | Properties.cpp \ 13 | Properties_point.cpp \ 14 | Properties_average.cpp \ 15 | Properties_gather.cpp \ 16 | Properties_block.cpp \ 17 | Space_warper.cpp \ 18 | 19 | 20 | 21 | SOURCES:= $(SOURCES) $(addprefix properties/,$(MY_SOURCES)) 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/system/Particle_set.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #ifndef PARTICLE_SET_H_INCLUDED 22 | #define PARTICLE_SET_H_INCLUDED 23 | #include "Array.h" 24 | #include "Program_options.h" 25 | 26 | 27 | 28 | //enum particle_type {electron, ion, positron}; 29 | 30 | /*! 31 | A set of particles, which could be electrons, ions, etc 32 | */ 33 | class Particle_set 34 | { 35 | public: 36 | 37 | Array1 charge; 38 | //!< Charge of each of the particles 39 | Array2 r; 40 | //!< position, of form (dimension, particle) 41 | 42 | Particle_set() 43 | {} 44 | 45 | Particle_set(Particle_set & x) { 46 | charge.Resize(x.charge.GetDim(0)); 47 | charge=x.charge; 48 | r.Resize(x.r.GetDim(0), x.r.GetDim(1)); 49 | r=x.r; 50 | labels=x.labels; 51 | } 52 | 53 | 54 | Particle_set & operator=(Particle_set & x) { 55 | charge.Resize(x.charge.GetDim(0)); 56 | charge=x.charge; 57 | r.Resize(x.r.GetDim(0), x.r.GetDim(1)); 58 | r=x.r; 59 | labels=x.labels; 60 | return *this; 61 | } 62 | 63 | 64 | int size() const 65 | { 66 | return r.GetDim(1); 67 | } 68 | 69 | //void build(Program_options & options, particle_type t); 70 | int read(vector & words, unsigned int pos); 71 | 72 | string getLabel(unsigned int at) { 73 | assert(at < labels.size()); 74 | return labels[at]; 75 | } 76 | 77 | 78 | 79 | ~Particle_set() 80 | {} 81 | 82 | int showinfo(ostream & os); 83 | private: 84 | vector labels; 85 | }; 86 | 87 | #endif // PARTICLE_SET_H_INCLUDED 88 | //-------------------------------------------------------------------------- 89 | -------------------------------------------------------------------------------- /src/system/gesqua.h: -------------------------------------------------------------------------------- 1 | #ifndef GESQUA_H_INCLUDED 2 | #define GESQUA_H_INCLUDED 3 | 4 | /*! 5 | Computes the integration points for a quadrature for spherical harmonics 6 | */ 7 | void gesqua(int & nq, Array1 & xq,Array1 & yq, 8 | Array1 & zq, Array1 & wq); 9 | 10 | #endif // GESQUA_H_INCLUDED 11 | -------------------------------------------------------------------------------- /src/system/make.include: -------------------------------------------------------------------------------- 1 | 2 | MY_SOURCES:= gesqua.cpp \ 3 | Molecular_sample.cpp \ 4 | Molecular_system.cpp \ 5 | Particle_set.cpp \ 6 | Pbc_enforcer.cpp \ 7 | Periodic_sample.cpp \ 8 | Periodic_system.cpp \ 9 | Pseudopotential_so.cpp \ 10 | Pseudopotential.cpp \ 11 | Sample_point.cpp \ 12 | SHO_system.cpp \ 13 | SHO_sample.cpp \ 14 | System.cpp \ 15 | HEG_sample.cpp \ 16 | HEG_system.cpp 17 | 18 | 19 | SOURCES:= $(SOURCES) $(addprefix system/,$(MY_SOURCES)) 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/wavefunction/Concatenate_wf_data.h: -------------------------------------------------------------------------------- 1 | #include "Wavefunction_data.h" 2 | #include 3 | 4 | class Concatenate_wf; 5 | 6 | class Concatenate_wf_data: public Wavefunction_data { 7 | public: 8 | Concatenate_wf_data(vector wf_data_in):wf_datas(wf_data_in){} 9 | 10 | virtual ~Concatenate_wf_data(){ 11 | for(int i=0;isupports(support)) 20 | return 0; 21 | } 22 | return 1; 23 | } 24 | 25 | //Unimplemented and unused methods 26 | void read(vector & words, unsigned int & pos, System * sys){error("read not impl in Concatenate");} 27 | void getVarParms(Array1 &){error("getVarParms not impl in Concatenate");} 28 | void setVarParms(Array1 &){error("setVarParms not impl in Concatenate");} 29 | int nparms(){error("nparms not impl in concatenate");return 0;} 30 | int valSize(){error("valSize not impl in concatenate");return 0;} 31 | int writeinput(string &, ostream &){error("writeinput not imp in cocatenate");return 0;} 32 | void generateWavefunction(Wavefunction * &){error("generateWaveFunction not impl in cocatenate");} 33 | Concatenate_wf_data * clone() const{error("clonse not impl in concatenate");return NULL;} 34 | 35 | private: 36 | vector wf_datas; 37 | friend class Concatenate_wf; 38 | }; 39 | 40 | -------------------------------------------------------------------------------- /src/wavefunction/Wavefunction_data.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2007 Lucas K. Wagner 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | */ 20 | 21 | #include "Wavefunction_data.h" 22 | #include "Slat_wf_data.h" 23 | #include "Program_options.h" 24 | #include "Slat_Jastrow_data.h" 25 | #include "Jastrow2_wf.h" 26 | #include "Backflow_wf_data.h" 27 | #include "Backflow_pf_wf_data.h" 28 | #include "Pfaff_wf_data.h" 29 | #include "BCS_wf_data.h" 30 | #include "qmc_io.h" 31 | 32 | int allocate(vector & wftext, System * sys, Wavefunction_data * & wfptr) 33 | { 34 | assert(wfptr == NULL); 35 | if(wftext.size() < 1) error("Empty wavefunction section"); 36 | if(caseless_eq(wftext[0],"SLATER")) 37 | wfptr=new Slat_wf_data; 38 | else if(caseless_eq(wftext[0],"JASTROW2") 39 | || caseless_eq(wftext[0], "JASTROW")) 40 | wfptr=new Jastrow2_wf_data; 41 | else if(caseless_eq(wftext[0],"SLATER-JASTROW")) 42 | wfptr=new Slat_Jastrow_data; 43 | else if(caseless_eq(wftext[0],"BACKFLOW")) 44 | wfptr=new Backflow_wf_data; 45 | else if(caseless_eq(wftext[0],"BACKFLOW-PFAFFIAN")) 46 | wfptr=new Backflow_pf_wf_data; 47 | else if(caseless_eq(wftext[0],"PFAFFIAN")) 48 | wfptr=new Pfaff_wf_data; 49 | else if(caseless_eq(wftext[0],"BCS")) 50 | wfptr=new BCS_wf_data; 51 | else 52 | error("Error parsing the trial wavefunction section; unknown keyword ", 53 | wftext[0]); 54 | 55 | 56 | unsigned int pos=1; 57 | wfptr->read(wftext,pos,sys); 58 | return 1; 59 | } 60 | 61 | int deallocate(Wavefunction_data * & wfptr) 62 | { 63 | if(wfptr == NULL) 64 | return 0; 65 | 66 | delete wfptr; 67 | wfptr=NULL; 68 | return 1; 69 | } 70 | 71 | Wavefunction_data * duplicate(Wavefunction_data * wfdata){ 72 | return wfdata->clone(); 73 | } 74 | 75 | //------------------------------------------------------------------------ 76 | -------------------------------------------------------------------------------- /src/wavefunction/make.include: -------------------------------------------------------------------------------- 1 | 2 | MY_SOURCES:= \ 3 | clark_updates.cpp \ 4 | Backflow_wf.cpp \ 5 | Backflow_wf_data.cpp \ 6 | Backflow_pf_wf.cpp \ 7 | Backflow_pf_wf_data.cpp \ 8 | BCS_wf.cpp \ 9 | BCS_wf_data.cpp \ 10 | Jastrow2_wf.cpp \ 11 | Jastrow2_one.cpp \ 12 | Jastrow2_two.cpp \ 13 | Jastrow2_three.cpp \ 14 | Jastrow2_three_diffspin.cpp \ 15 | Pfaff_wf_calc.cpp \ 16 | Pfaff_wf_data.cpp \ 17 | Slat_Jastrow.cpp \ 18 | Slat_Jastrow_data.cpp \ 19 | Slat_wf_data.cpp \ 20 | Wavefunction.cpp \ 21 | Wavefunction_data.cpp \ 22 | Wf_return.cpp \ 23 | Orbital_rotation.cpp 24 | 25 | 26 | SOURCES:= $(SOURCES) $(addprefix wavefunction/,$(MY_SOURCES)) 27 | 28 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | all: h.test h2.test n2.test si.test 2 | 3 | clean: 4 | rm -f *.test report.csv 5 | 6 | h.test: 7 | cd h && ./run_test.py 8 | 9 | h2.test: 10 | cd h2 && ./run_test.py 11 | 12 | n2.test: 13 | cd n2 && ./run_test.py 14 | 15 | si.test: 16 | cd si && ./run_test.py 17 | -------------------------------------------------------------------------------- /tests/combine_report.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cat h/report.csv > report.csv 3 | tail -n +2 h2/report.csv >> report.csv 4 | tail -n +2 n2/report.csv >> report.csv 5 | -------------------------------------------------------------------------------- /tests/h/h.dat: -------------------------------------------------------------------------------- 1 | $DATA 2 | 3 | DNH 4 4 | 5 | H 1.0 0.0000000000 0.0000000000 0.0000000000 6 | S 3 7 | 1 33.8700000000 0.00606800 8 | 2 5.0950000000 0.04530800 9 | 3 1.1590000000 0.20282200 10 | S 1 11 | 1 0.3258000000 1.00000000 12 | S 1 13 | 1 0.1027000000 1.00000000 14 | 15 | $END 16 | --- OPEN SHELL ORBITALS --- GENERATED AT Mon Jul 11 09:51:42 2016 17 | 18 | E(ROHF)= -0.4998098113, E(NUC)= 0.0000000000, 8 ITERS 19 | $VEC 20 | 1 1 2.38008339E-01 5.03905396E-01 3.83418499E-01 21 | 2 1-9.55183817E-02-1.31803902E+00 1.55753565E+00 22 | 3 1-1.53695161E+00 1.88168238E+00-8.05583016E-01 23 | $END 24 | POPULATION ANALYSIS 25 | H 1.00000 0.00000 1.00000 0.00000 26 | MOMENTS AT POINT 1 X,Y,Z= 0.000000 0.000000 0.000000 27 | DIPOLE 0.000000 0.000000 0.000000 28 | -------------------------------------------------------------------------------- /tests/h/h.inp: -------------------------------------------------------------------------------- 1 | $CONTRL SCFTYP=ROHF MULT=2 $END 2 | $DATA 3 | 4 | DNH 4 5 | 6 | H 1 0. 0. 0. 7 | S 3 8 | 1 33.8700000 0.0060680 9 | 2 5.0950000 0.0453080 10 | 3 1.1590000 0.2028220 11 | S 1 12 | 1 0.3258000 1.0000000 13 | S 1 14 | 1 0.1027000 1.0000000 15 | 16 | $END 17 | -------------------------------------------------------------------------------- /tests/h/qw.basis: -------------------------------------------------------------------------------- 1 | BASIS { 2 | H 3 | AOSPLINE 4 | 5 | 6 | GAMESS { 7 | S 3 8 | 1 33.87 0.006068 9 | 2 5.095 0.045308 10 | 3 1.159 0.202822 11 | S 1 12 | 1 0.3258 1 13 | S 1 14 | 1 0.1027 1 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/h/qw.dmc: -------------------------------------------------------------------------------- 1 | 2 | method { DMC timestep 0.005 nblock 80 } 3 | include qw.sys 4 | trialfunc { include qw.slater } 5 | 6 | -------------------------------------------------------------------------------- /tests/h/qw.hf: -------------------------------------------------------------------------------- 1 | method { VMC nstep 1000 } 2 | include qw.sys 3 | trialfunc { include qw.slater } 4 | 5 | -------------------------------------------------------------------------------- /tests/h/qw.orb: -------------------------------------------------------------------------------- 1 | 1 1 1 1 2 | 1 2 1 2 3 | 1 3 1 3 4 | 2 1 1 4 5 | 2 2 1 5 6 | 2 3 1 6 7 | 3 1 1 7 8 | 3 2 1 8 9 | 3 3 1 9 10 | COEFFICIENTS 11 | 0.0671409128316 0.14214908776 0.108160361639 -0.0269452379966 -0.371811942902 12 | 0.439372694873 -0.433566044396 0.530812799178 -0.227250773158 -------------------------------------------------------------------------------- /tests/h/qw.slater: -------------------------------------------------------------------------------- 1 | SLATER 2 | ORBITALS { 3 | CUTOFF_MO 4 | MAGNIFY 1 5 | NMO 1 6 | ORBFILE qw.orb 7 | INCLUDE qw.basis 8 | CENTERS { USEGLOBAL } 9 | } 10 | 11 | DETWT { 1.0 } 12 | STATES { 13 | #Spin up orbitals 14 | 1 15 | #Spin down orbitals 16 | } 17 | -------------------------------------------------------------------------------- /tests/h/qw.sys: -------------------------------------------------------------------------------- 1 | SYSTEM { MOLECULE 2 | NSPIN { 1 0 } 3 | ATOM { H 1 COOR 0 0 0 } 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/h/run_test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | import subprocess 4 | import json 5 | import sys 6 | 7 | sys.path.append("../") 8 | from qwtest import * 9 | QW="../../bin/qwalk" 10 | GOS="../../bin/gosling" 11 | 12 | def check_errorbars(a,b,berr,sigma=3): 13 | if abs(a-b)/berr > sigma: 14 | return False 15 | return True 16 | 17 | def check_sane(a,b,berr,sigma=3): 18 | if berr > 0.1: 19 | return False 20 | return True 21 | 22 | print("""########################################### 23 | Checking VMC and Slater determinant for the H atom. 24 | This tests the orbital evaluation routine and the VMC method. 25 | The reference is the Hartree-Fock result from GAMESS. 26 | ################################################""") 27 | 28 | try: 29 | subprocess.check_output(['rm','qw.hf.log','qw.hf.config']) 30 | except: 31 | pass 32 | subprocess.check_output([QW,'qw.hf']) 33 | json_str=subprocess.check_output([GOS,'-json','qw.hf.log']) 34 | 35 | dat=json.loads(json_str) 36 | 37 | ref_data={'total_energy':-0.4998098113, 38 | 'kinetic':0.4997883996, 39 | 'potential':-0.9995982109 40 | } 41 | 42 | 43 | success={} 44 | for k in ref_data.keys(): 45 | success[k]=check_errorbars(ref_data[k], 46 | dat['properties'][k]['value'][0], 47 | dat['properties'][k]['error'][0]) 48 | for k in ref_data.keys(): 49 | success[k+'sane']=check_sane(ref_data[k], 50 | dat['properties'][k]['value'][0], 51 | dat['properties'][k]['error'][0]) 52 | 53 | allsuc=[] 54 | for k,v in success.items(): 55 | allsuc.append(v) 56 | print(k,v) 57 | if False in allsuc: 58 | exit(1) 59 | 60 | 61 | print("""########################################### 62 | Checking DMC for the H atom. 63 | This tests the basic DMC algorithm. 64 | The reference is the exact result. 65 | ################################################""") 66 | try: 67 | subprocess.check_output(['rm','qw.dmc.log','qw.dmc.config']) 68 | except: 69 | pass 70 | subprocess.check_output([QW,'qw.dmc']) 71 | 72 | json_str=subprocess.check_output([GOS,'-json','qw.dmc.log']) 73 | dat=json.loads(json_str) 74 | 75 | en=dat['properties']['total_energy']['value'][0] 76 | err=dat['properties']['total_energy']['error'][0] 77 | 78 | print("Exact: -0.5") 79 | print("Data: ",en,"+/-",err) 80 | if not check_errorbars(-0.5,en,err): 81 | print("FAILED") 82 | exit(1) 83 | print("PASSED") 84 | exit(0) 85 | -------------------------------------------------------------------------------- /tests/h2/h.dat: -------------------------------------------------------------------------------- 1 | $DATA 2 | 3 | DNH 4 4 | 5 | H 1.0 0.0000000000 0.0000000000 0.7000000000 6 | S 3 7 | 1 33.8700000000 0.00606800 8 | 2 5.0950000000 0.04530800 9 | 3 1.1590000000 0.20282200 10 | S 1 11 | 1 0.3258000000 1.00000000 12 | S 1 13 | 1 0.1027000000 1.00000000 14 | 15 | $END 16 | --- CLOSED SHELL ORBITALS --- GENERATED AT Mon Jul 11 11:10:01 2016 17 | 18 | E(RHF)= -1.0186461403, E(NUC)= 0.3779837495, 7 ITERS 19 | $VEC 20 | 1 1 1.39551659E-01 2.89519279E-01 2.36689595E-01 1.39551659E-01 2.89519279E-01 21 | 1 2 2.36689595E-01 22 | 2 1 1.32068775E-01 1.68886011E-01 9.66934730E-01-1.32068775E-01-1.68886011E-01 23 | 2 2-9.66934730E-01 24 | 3 1 4.58795329E-02 9.72492005E-01-9.42834657E-01 4.58795329E-02 9.72492005E-01 25 | 3 2-9.42834657E-01 26 | 4 1-9.64299311E-02-1.08714367E+00 1.60751667E+00 9.64299311E-02 1.08714367E+00 27 | 4 2-1.60751667E+00 28 | 5 1-1.08582753E+00 1.18640961E+00-4.53784058E-01-1.08582753E+00 1.18640961E+00 29 | 5 2-4.53784058E-01 30 | 6 1-1.11707258E+00 1.53167882E+00-8.99615324E-01 1.11707258E+00-1.53167882E+00 31 | 6 2 8.99615324E-01 32 | $END 33 | POPULATION ANALYSIS 34 | H 1.00000 0.00000 1.00000 0.00000 35 | H 1.00000 0.00000 1.00000 0.00000 36 | MOMENTS AT POINT 1 X,Y,Z= 0.000000 0.000000 0.000000 37 | DIPOLE 0.000000 0.000000 0.000000 38 | -------------------------------------------------------------------------------- /tests/h2/h.inp: -------------------------------------------------------------------------------- 1 | $CONTRL SCFTYP=RHF MULT=1 $END 2 | $DATA 3 | 4 | DNH 4 5 | 6 | H 1 0. 0. 0.7 7 | S 3 8 | 1 33.8700000 0.0060680 9 | 2 5.0950000 0.0453080 10 | 3 1.1590000 0.2028220 11 | S 1 12 | 1 0.3258000 1.0000000 13 | S 1 14 | 1 0.1027000 1.0000000 15 | 16 | $END 17 | -------------------------------------------------------------------------------- /tests/h2/jast2.wfin: -------------------------------------------------------------------------------- 1 | JASTROW2 2 | 3 | GROUP { 4 | EEBASIS { 5 | EE 6 | CUTOFF_CUSP 7 | GAMMA 24.0 8 | CUSP 1.0 9 | CUTOFF 7.5 10 | } 11 | EEBASIS { 12 | EE 13 | CUTOFF_CUSP 14 | GAMMA 24.0 15 | CUSP 1.0 16 | CUTOFF 7.5 17 | } 18 | TWOBODY_SPIN { 19 | FREEZE 20 | LIKE_COEFFICIENTS { 0.25 0.0 } 21 | UNLIKE_COEFFICIENTS { 0.0 0.5 } 22 | } 23 | } 24 | GROUP { 25 | EIBASIS { 26 | H 27 | POLYPADE 28 | BETA0 0.2 29 | NFUNC 3 30 | RCUT 7.5 31 | } 32 | ONEBODY { 33 | COEFFICIENTS { H 0.0 0.0 0.0 } 34 | } 35 | EEBASIS { 36 | EE 37 | POLYPADE 38 | BETA0 0.5 39 | NFUNC 3 40 | RCUT 7.5 41 | } 42 | TWOBODY { 43 | COEFFICIENTS { 0.0 0.0 0.0 } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tests/h2/qw.basis: -------------------------------------------------------------------------------- 1 | BASIS { 2 | 3 | H 4 | 5 | AOSPLINE 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | GAMESS { 14 | 15 | S 3 16 | 17 | 1 33.87 0.006068 18 | 19 | 2 5.095 0.045308 20 | 21 | 3 1.159 0.202822 22 | 23 | S 1 24 | 25 | 1 0.3258 1 26 | 27 | S 1 28 | 29 | 1 0.1027 1 30 | 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /tests/h2/qw.linear: -------------------------------------------------------------------------------- 1 | method { linear total_nstep 1000 total_fit 10000 minimum_psi0 0.5 iterations 2 } 2 | method { linear total_nstep 4000 total_fit 10000 minimum_psi0 0.5 iterations 2 } 3 | method { linear total_nstep 8000 total_fit 10000 minimum_psi0 0.5 iterations 2 } 4 | method { linear total_nstep 16000 total_fit 10000 minimum_psi0 0.5 iterations 2 } 5 | include qw.sys 6 | 7 | trialfunc { 8 | slater-jastrow 9 | wf1 { include qw.slater } 10 | wf2 { include jast2.wfin } 11 | } 12 | -------------------------------------------------------------------------------- /tests/h2/qw.linear_orbrot: -------------------------------------------------------------------------------- 1 | method { linear total_nstep 1000 total_fit 1000 } 2 | 3 | include qw.sys 4 | 5 | trialfunc { 6 | slater-jastrow 7 | wf1 { include qw.slater_orbrot } 8 | wf2 { include jast2.wfin } 9 | } 10 | -------------------------------------------------------------------------------- /tests/h2/qw.orb: -------------------------------------------------------------------------------- 1 | 1 1 1 1 2 | 1 2 1 2 3 | 1 3 1 3 4 | 1 1 2 4 5 | 1 2 2 5 6 | 1 3 2 6 7 | 2 1 1 7 8 | 2 2 1 8 9 | 2 3 1 9 10 | 2 1 2 10 11 | 2 2 2 11 12 | 2 3 2 12 13 | 3 1 1 13 14 | 3 2 1 14 15 | 3 3 1 15 16 | 3 1 2 16 17 | 3 2 2 17 18 | 3 3 2 18 19 | 4 1 1 19 20 | 4 2 1 20 21 | 4 3 1 21 22 | 4 1 2 22 23 | 4 2 2 23 24 | 4 3 2 24 25 | 5 1 1 25 26 | 5 2 1 26 27 | 5 3 1 27 28 | 5 1 2 28 29 | 5 2 2 29 30 | 5 3 2 30 31 | 6 1 1 31 32 | 6 2 1 32 33 | 6 3 1 33 34 | 6 1 2 34 35 | 6 2 2 35 36 | 6 3 2 36 37 | COEFFICIENTS 38 | 0.0393667961879 0.0816718807252 0.0667689020175 0.0393667961879 0.0816718807252 39 | 0.0667689020175 0.037255913584 0.0476418641072 0.272767251322 -0.037255913584 40 | -0.0476418641072 -0.272767251322 0.0129423772803 0.274334929656 -0.265968746247 41 | 0.0129423772803 0.274334929656 -0.265968746247 -0.0272023813348 -0.306677567221 42 | 0.453472080303 0.0272023813348 0.306677567221 -0.453472080303 -0.306306290982 43 | 0.334679971896 -0.128010119354 -0.306306290982 0.334679971896 -0.128010119354 44 | -0.315120356856 0.432078617799 -0.253776797504 0.315120356856 -0.432078617799 45 | 0.253776797504 -------------------------------------------------------------------------------- /tests/h2/qw.slater: -------------------------------------------------------------------------------- 1 | SLATER 2 | ORBITALS { 3 | CUTOFF_MO 4 | MAGNIFY 1 5 | NMO 1 6 | ORBFILE qw.orb 7 | INCLUDE qw.basis 8 | CENTERS { USEGLOBAL } 9 | } 10 | 11 | DETWT { 1.0 } 12 | STATES { 13 | #Spin up orbitals 14 | 1 15 | #Spin down orbitals 16 | 1 } 17 | -------------------------------------------------------------------------------- /tests/h2/qw.slater_orbrot: -------------------------------------------------------------------------------- 1 | SLATER 2 | ORBITALS { 3 | CUTOFF_MO 4 | MAGNIFY 1 5 | NMO 6 6 | ORBFILE qw.orb 7 | INCLUDE qw.basis 8 | CENTERS { USEGLOBAL } 9 | } 10 | 11 | DETWT { 1.0 1.0 } 12 | STATES { 13 | #DET 1 14 | 2 1 15 | #DET 2 16 | 2 3 17 | } 18 | 19 | OPTIMIZE_MO 20 | OPTIMIZE_DATA { 21 | #DET 1 22 | DET { 23 | #Orbitals that can mix 24 | ORB_GROUP { 1 2 4 } 25 | } 26 | #DET 2 27 | DET { 28 | ORB_GROUP { 2 1 3 6 } 29 | #Initial parameter(s) for above orb_group 30 | PARAMETERS { 0.1 -0.1 0.1 0 0 0 -0.1 0.2 -0.2 0 0 0 } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/h2/qw.sys: -------------------------------------------------------------------------------- 1 | SYSTEM { MOLECULE 2 | NSPIN { 1 1 } 3 | ATOM { H 1 COOR 0 0 -1.322808191 } 4 | ATOM { H 1 COOR 0 0 1.322808191 } 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/h2/qw.test: -------------------------------------------------------------------------------- 1 | METHOD { 2 | TEST 3 | TEST_PARMS_DERS { } 4 | } 5 | 6 | INCLUDE qw.sys 7 | TRIALFUNC{ 8 | #INCLUDE qw.slater 9 | #INCLUDE jast2.wfin 10 | SLATER-JASTROW 11 | WF1 { INCLUDE qw.slater } 12 | WF2 { INCLUDE jast2.wfin } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/h2/qw.testder: -------------------------------------------------------------------------------- 1 | method { test TEST_PARMS_DERS { } } 2 | 3 | include qw.sys 4 | 5 | trialfunc { slater-jastrow 6 | wf1 { include qw.slater } 7 | wf2 { include jast2.wfin } 8 | } 9 | -------------------------------------------------------------------------------- /tests/h2/qw.testder_orbrot: -------------------------------------------------------------------------------- 1 | method { test TEST_PARMS_DERS { } } 2 | 3 | include qw.sys 4 | 5 | trialfunc { slater-jastrow 6 | wf1 { include qw.slater_orbrot } 7 | wf2 { include jast2.wfin } 8 | } 9 | -------------------------------------------------------------------------------- /tests/h2/run_test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | import subprocess 4 | import json 5 | import sys 6 | import math 7 | 8 | sys.path.append("../") 9 | from qwtest import * 10 | print("""########################################### 11 | Checking the linear method for the H2 molecule. 12 | This tests the LINEAR method, the Jastrow factor, analytic parameter derivatives.. 13 | The reference is a previous QWalk run. 14 | ################################################""") 15 | 16 | try: 17 | subprocess.check_output(['rm','qw.linear.o','qw.linear.config']) 18 | except: 19 | pass 20 | subprocess.check_output([QW,'qw.linear']) 21 | 22 | 23 | ref_data=[-1.068309651,0.0009113787988] 24 | 25 | run_data=[0.0,0.0] 26 | with open("qw.linear.o") as f: 27 | for line in f: 28 | if 'current energy' in line: 29 | spl=line.split() 30 | run_data[0]=float(spl[4]) 31 | run_data[1]=float(spl[6]) 32 | 33 | print("Reference data:",ref_data) 34 | print("This run:",run_data) 35 | #I added a factor of 2 fudge factor to account for differences in optimization. 36 | if check_errorbars(ref_data[0],run_data[0],2.*math.sqrt(ref_data[1]**2+run_data[1]**2)): 37 | print("PASSED") 38 | sys.exit(0) 39 | print("FAILED") 40 | sys.exit(1) 41 | -------------------------------------------------------------------------------- /tests/n2/n2.inp: -------------------------------------------------------------------------------- 1 | $CONTRL EXETYP=RUN RUNTYP=ENERGY $END 2 | $CONTRL ICHARG=0 MULT=1 SCFTYP=RHF PP=READ $END 3 | $CONTRL UNITS=ANGS $END 4 | $SCF DIRSCF=.TRUE. MVOQ=6 $END 5 | $DATA 6 | 7 | DNH 4 8 | 9 | N 7. 0.000000 0.000000 0.85 10 | S 9 11 | 1 0.0988690 0.0672660 12 | 2 0.2114430 0.3342900 13 | 3 0.4521970 0.4542570 14 | 4 0.9670800 0.2678610 15 | 5 2.0682210 0.0002480 16 | 6 4.4231500 -0.1326060 17 | 7 9.4594620 0.0144370 18 | 8 20.2302460 0.0003590 19 | 9 43.2649190 -0.0000940 20 | S 1 21 | 1 1.2021830 1.0000000 22 | S 1 23 | 1 0.1632430 1.0000000 24 | P 9 25 | 1 0.0732340 0.0357580 26 | 2 0.1458670 0.1539450 27 | 3 0.2905350 0.2776560 28 | 4 0.5786830 0.2976760 29 | 5 1.1526120 0.2344030 30 | 6 2.2957560 0.1403210 31 | 7 4.5726520 0.0672190 32 | 8 9.1077390 0.0315940 33 | 9 18.1406570 0.0033010 34 | P 1 35 | 1 0.1701040 1.0000000 36 | P 1 37 | 1 0.5175470 1.0000000 38 | D 1 39 | 1 0.4835670 1.0000000 40 | D 1 41 | 1 1.7124160 1.0000000 42 | F 1 43 | 1 1.0930970 1.0000000 44 | 45 | $END 46 | $ECP 47 | N-ECP GEN 2 1 48 | 3 ----- N local ----- 49 | 5.0000000 1 9.2350101 50 | 46.1750503 3 7.6683001 51 | -30.1889353 2 7.3448607 52 | 1 ----- N nonlocal 0 ----- 53 | 31.6972041 2 6.9953654 54 | N-ECP 55 | $END 56 | 57 | -------------------------------------------------------------------------------- /tests/n2/qw.basis: -------------------------------------------------------------------------------- 1 | BASIS { 2 | N 3 | AOSPLINE 4 | 5 | 6 | GAMESS { 7 | S 9 8 | 1 0.098869 0.067266 9 | 2 0.211443 0.33429 10 | 3 0.452197 0.454257 11 | 4 0.96708 0.267861 12 | 5 2.06822 0.000248 13 | 6 4.42315 -0.132606 14 | 7 9.45946 0.014437 15 | 8 20.2302 0.000359 16 | 9 43.2649 -9.4e-05 17 | S 1 18 | 1 1.20218 1 19 | S 1 20 | 1 0.163243 1 21 | P 9 22 | 1 0.073234 0.035758 23 | 2 0.145867 0.153945 24 | 3 0.290535 0.277656 25 | 4 0.578683 0.297676 26 | 5 1.15261 0.234403 27 | 6 2.29576 0.140321 28 | 7 4.57265 0.067219 29 | 8 9.10774 0.031594 30 | 9 18.1407 0.003301 31 | P 1 32 | 1 0.170104 1 33 | P 1 34 | 1 0.517547 1 35 | 6D 1 36 | 1 0.483567 1 37 | 6D 1 38 | 1 1.71242 1 39 | 10F 1 40 | 1 1.0931 1 41 | } 42 | } 43 | 44 | 45 | -------------------------------------------------------------------------------- /tests/n2/qw.ci: -------------------------------------------------------------------------------- 1 | method { vmc nblock 1000 } 2 | 3 | include qw.sys 4 | 5 | trialfunc { 6 | SLATER 7 | ORBITALS { 8 | CUTOFF_MO 9 | MAGNIFY 1 10 | NMO 8 11 | ORBFILE qw.orb 12 | INCLUDE qw.basis 13 | CENTERS { USEGLOBAL } 14 | } 15 | include cidet 16 | } 17 | -------------------------------------------------------------------------------- /tests/n2/qw.citest: -------------------------------------------------------------------------------- 1 | method { test test_parms_ders { } } 2 | 3 | include qw.sys 4 | 5 | trialfunc { 6 | SLATER 7 | ORBITALS { 8 | CUTOFF_MO 9 | MAGNIFY 1 10 | NMO 8 11 | ORBFILE qw.orb 12 | INCLUDE qw.basis 13 | CENTERS { USEGLOBAL } 14 | } 15 | optimize_det 16 | include cidet 17 | } 18 | 19 | -------------------------------------------------------------------------------- /tests/n2/qw.jast3: -------------------------------------------------------------------------------- 1 | JASTROW2 2 | GROUP { 3 | 4 | EEBASIS { EE CUTOFF_CUSP GAMMA 24.0 CUSP 1.0 CUTOFF 7.5 } 5 | EEBASIS { EE CUTOFF_CUSP GAMMA 24.0 CUSP 1.0 CUTOFF 7.5 } 6 | TWOBODY_SPIN { FREEZE 7 | LIKE_COEFFICIENTS { 0.25 0.0 } 8 | UNLIKE_COEFFICIENTS { 0.0 0.5 } 9 | } 10 | } 11 | GROUP { 12 | 13 | EEBASIS { EE POLYPADE BETA0 0.5 NFUNC 3 RCUT 7.5 } 14 | EIBASIS { N POLYPADE BETA0 0.2 NFUNC 4 RCUT 7.5 } 15 | ONEBODY { 16 | COEFFICIENTS { N 0 0 0 0 } 17 | } 18 | TWOBODY { 19 | COEFFICIENTS { 0 0 0 } 20 | } 21 | # THREEBODY { 22 | # COEFFICIENTS { N 0 0 0 0 0 0 0 0 0 0 0 0 } 23 | # } 24 | } 25 | -------------------------------------------------------------------------------- /tests/n2/qw.sjtest: -------------------------------------------------------------------------------- 1 | method { test test_parms_ders { } } 2 | 3 | include qw.sys 4 | 5 | trialfunc { slater-jastrow 6 | wf1 { 7 | SLATER 8 | ORBITALS { 9 | CUTOFF_MO 10 | MAGNIFY 1 11 | NMO 8 12 | ORBFILE qw.orb 13 | INCLUDE qw.basis 14 | CENTERS { USEGLOBAL } 15 | } 16 | optimize_det 17 | include cidet 18 | } 19 | wf2 { include qw.jast3 } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /tests/n2/qw.slater: -------------------------------------------------------------------------------- 1 | SLATER 2 | ORBITALS { 3 | CUTOFF_MO 4 | MAGNIFY 1 5 | NMO 8 6 | ORBFILE qw.orb 7 | INCLUDE qw.basis 8 | CENTERS { USEGLOBAL } 9 | } 10 | include cidet 11 | -------------------------------------------------------------------------------- /tests/n2/qw.sys: -------------------------------------------------------------------------------- 1 | SYSTEM { MOLECULE 2 | NSPIN { 5 5 } 3 | ATOM { N 5 COOR 0 0 -1.60626709 } 4 | ATOM { N 5 COOR 0 0 1.60626709 } 5 | } 6 | 7 | 8 | PSEUDO { 9 | N 10 | AIP 6 11 | BASIS { N 12 | RGAUSSIAN 13 | OLDQMC { 14 | 0.0 2 15 | 1 3 16 | 2 6.99537 31.6972 17 | 1 9.235010000000001 5 18 | 3 7.6683 46.17505 19 | 2 7.34486 -30.18894 20 | } 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /tests/n2/run_test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | import subprocess 4 | import json 5 | import sys 6 | 7 | sys.path.append("../") 8 | from qwtest import * 9 | 10 | print("""########################################### 11 | Checking VMC and Slater determinant for the stretched N2 dimer. 12 | This tests the orbital evaluation routine, the VMC method, ECPs, and multiple determinants. 13 | The reference is the CI result from GAMESS. 14 | ################################################""") 15 | 16 | try: 17 | subprocess.check_output(['rm','qw.ci.log','qw.ci.config']) 18 | except: 19 | pass 20 | subprocess.check_output([QW,'qw.ci']) 21 | json_str=subprocess.check_output([GOS,'-json','qw.ci.log']) 22 | 23 | dat=json.loads(json_str) 24 | 25 | ref_data={'total_energy': -19.3080264611, 26 | 'kinetic':12.2497549662, 27 | } 28 | 29 | 30 | success={} 31 | for k in ref_data.keys(): 32 | success[k]=check_errorbars(ref_data[k], 33 | dat['properties'][k]['value'][0], 34 | dat['properties'][k]['error'][0]) 35 | for k in ref_data.keys(): 36 | success[k+'sane']=check_sane(ref_data[k], 37 | dat['properties'][k]['value'][0], 38 | dat['properties'][k]['error'][0]) 39 | 40 | allsuc=[] 41 | for k,v in success.items(): 42 | allsuc.append(v) 43 | print(k,v) 44 | if False in allsuc: 45 | exit(1) 46 | 47 | -------------------------------------------------------------------------------- /tests/n2/run_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | import subprocess 4 | import json 5 | import sys 6 | import os 7 | 8 | sys.path.append("../") 9 | from qwtest import * 10 | 11 | reports=[] 12 | allsuc=[] 13 | 14 | print("""########################################### 15 | Checking VMC and Slater determinant for the stretched N2 dimer. 16 | This tests the orbital evaluation routine, the VMC method, ECPs, and multiple determinants. 17 | The reference is the CI result from GAMESS. 18 | ################################################""") 19 | 20 | ref_data={'total_energy': [-19.3080264611,0.0], 21 | 'kinetic':[12.2497549662,0.0], 22 | } 23 | systems={} 24 | methods={} 25 | descriptions={} 26 | sigmas={} 27 | for k in ref_data.keys(): 28 | systems[k]='n2' 29 | methods[k]='vmcci' 30 | descriptions[k]='Checking VMC and Slater determinant for the stretched N2 dimer. This tests the orbital evaluation routine, the VMC method, ECPs, and multiple determinants. The reference is the CI result from GAMESS.' 31 | sigmas[k]=3.0 32 | 33 | try: 34 | subprocess.check_output(['rm','qw.ci.log','qw.ci.config']) 35 | except: 36 | pass 37 | 38 | subprocess.check_output([QW,'qw.ci']) 39 | 40 | json_str=subprocess.check_output([GOS,'-json','qw.ci.log']) 41 | dat=json.loads(json_str) 42 | dat_properties=dat['properties'] 43 | 44 | success=compare_result_ref(ref_data,dat_properties,sigmas) 45 | for k,v in success.items(): 46 | allsuc.append(v) 47 | 48 | reports.extend(summarize_results(ref_data,dat_properties,success,systems,methods,descriptions)) 49 | 50 | print_results(reports) 51 | save_results(reports) 52 | 53 | if False in allsuc: 54 | sys.exit(1) 55 | sys.exit(0) 56 | -------------------------------------------------------------------------------- /tests/qwtest.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import csv 3 | import math 4 | 5 | QW="../../bin/qwalk" 6 | GOS="../../bin/gosling" 7 | 8 | def check_errorbars(a,aerr,b,berr,sigma=3): 9 | if abs(a-b)/math.sqrt(aerr**2+berr**2) > sigma: 10 | return False 11 | return True 12 | 13 | def check_sane(berr): 14 | if berr > 0.1: 15 | return False 16 | return True 17 | 18 | def print_results(reports): 19 | for report in reports: 20 | print("%10s %15s %5s %6r %f+/-%f %f+/-%f"%(report['method'],report['quantity'],report['system'],report['passed'],report['result'],report['error'],report['reference'],report['err_ref'])) 21 | 22 | def save_results(reports): 23 | fieldnames = ['method','quantity','system','description','passed','result','error','reference','err_ref'] 24 | with open('report.csv','w') as csvfile: 25 | writer = csv.DictWriter(csvfile, fieldnames=fieldnames) 26 | writer.writerow(dict(zip(fieldnames,fieldnames))) 27 | writer = csv.DictWriter(csvfile, fieldnames=fieldnames) 28 | writer.writerows(reports) 29 | 30 | def compare_result_ref(ref_data,dat_properties,sigmas): 31 | success={} 32 | for k in ref_data.keys(): 33 | success[k]=check_errorbars(ref_data[k][0], 34 | ref_data[k][1], 35 | dat_properties[k]['value'][0], 36 | dat_properties[k]['error'][0], 37 | sigmas[k]) 38 | success[k+'sane']=check_sane(dat_properties[k]['error'][0]) 39 | return success 40 | 41 | def summarize_results(ref_data,dat_properties,success,systems,methods,descriptions): 42 | reports=[] 43 | for k in ref_data.keys(): 44 | report={} 45 | report['system']=systems[k] 46 | report['method']=methods[k] 47 | report['description']=descriptions[k] 48 | report['quantity']=k 49 | report['result']=dat_properties[k]['value'][0] 50 | report['error']=dat_properties[k]['error'][0] 51 | report['reference']=ref_data[k][0] 52 | report['err_ref']=ref_data[k][1] 53 | report['passed']=success[k] and success[k+'sane'] 54 | reports.append(report) 55 | return reports 56 | -------------------------------------------------------------------------------- /tests/si/crys.in: -------------------------------------------------------------------------------- 1 | Generated by CrystalWriter 2 | CRYSTAL 3 | 0 0 0 4 | 1 5 | 3.83996 3.83996 3.83996 60 60 60 6 | 2 7 | 214 0.75 0.75 0.75 8 | 214 0 0 0 9 | SUPERCEL 10 | 1.0 0.0 0.0 11 | 0.0 1.0 0.0 12 | 0.0 0.0 1.0 13 | END 14 | 214 4 15 | INPUT 16 | 4 3 1 1 0 0 0 17 | 1.80721061 4.00000000 -1 18 | 9.99633089 7.22884246 1 19 | 2.50043232 -13.06725590 0 20 | 2.26686403 21.20531613 0 21 | 2.11659661 15.43693603 0 22 | 0 0 9 2 1 23 | 0.059887 0.167492 24 | 0.130108 0.532550 25 | 0.282668 0.464290 26 | 0.614115 -0.002322 27 | 1.334205 -0.268234 28 | 2.898645 0.031921 29 | 6.297493 -0.000106 30 | 13.681707 -0.000145 31 | 29.724387 0.000067 32 | 0 2 9 2 1 33 | 0.036525 0.078761 34 | 0.076137 0.308331 35 | 0.158712 0.417773 36 | 0.330843 0.281676 37 | 0.689658 0.069876 38 | 1.437625 -0.056306 39 | 2.996797 0.000744 40 | 6.246966 -0.000259 41 | 13.022097 -0.000022 42 | 0 3 1 0 1 43 | 0.170395 1.000000 44 | 0 4 1 0 1 45 | 0.352999 1.000000 46 | 99 0 47 | CHARGED 48 | END 49 | SHRINK 50 | 4 16 51 | DFT 52 | EXCHANGE 53 | PBE 54 | CORRELAT 55 | PBE 56 | END 57 | SCFDIR 58 | END 59 | -------------------------------------------------------------------------------- /tests/si/prop.in: -------------------------------------------------------------------------------- 1 | NEWK 2 | 4 16 3 | 1 0 4 | CRYAPI_OUT 5 | END 6 | 7 | -------------------------------------------------------------------------------- /tests/si/qw.basis: -------------------------------------------------------------------------------- 1 | basis { 2 | si 3 | aospline 4 | normtype CRYSTAL 5 | gamess { 6 | S 9 7 | 1 0.059887 0.035146291882536 8 | 2 0.130108 0.19997440547947 9 | 3 0.282668 0.31198437138528 10 | 4 0.614115 -0.0027921292542228 11 | 5 1.334205 -0.5771873090292 12 | 6 2.898645 0.12291610374088 13 | 7 6.297493 -0.00073041159673491 14 | 8 13.681707 -0.0017879659380895 15 | 9 29.724387 0.0014784120970724 16 | P 9 17 | 1 0.036525 0.0043597871678212 18 | 2 0.076137 0.042749218371353 19 | 3 0.158712 0.1450837795444 20 | 4 0.330843 0.24501550552764 21 | 5 0.689658 0.15224272386355 22 | 6 1.437625 -0.30727553465315 23 | 7 2.996797 0.010169764089045 24 | 8 6.246966 -0.0088675261595849 25 | 9 13.022097 -0.0018866447213124 26 | 5D 1 27 | 1 0.170395 0.18089855907388 28 | 7F_crystal 1 29 | 1 0.352999 0.34389110133976 30 | } 31 | } 32 | basis { 33 | si 34 | aospline 35 | normtype CRYSTAL 36 | gamess { 37 | S 9 38 | 1 0.059887 0.035146291882536 39 | 2 0.130108 0.19997440547947 40 | 3 0.282668 0.31198437138528 41 | 4 0.614115 -0.0027921292542228 42 | 5 1.334205 -0.5771873090292 43 | 6 2.898645 0.12291610374088 44 | 7 6.297493 -0.00073041159673491 45 | 8 13.681707 -0.0017879659380895 46 | 9 29.724387 0.0014784120970724 47 | P 9 48 | 1 0.036525 0.0043597871678212 49 | 2 0.076137 0.042749218371353 50 | 3 0.158712 0.1450837795444 51 | 4 0.330843 0.24501550552764 52 | 5 0.689658 0.15224272386355 53 | 6 1.437625 -0.30727553465315 54 | 7 2.996797 0.010169764089045 55 | 8 6.246966 -0.0088675261595849 56 | 9 13.022097 -0.0018866447213124 57 | 5D 1 58 | 1 0.170395 0.18089855907388 59 | 7F_crystal 1 60 | 1 0.352999 0.34389110133976 61 | } 62 | } -------------------------------------------------------------------------------- /tests/si/qw_111.blas.hf: -------------------------------------------------------------------------------- 1 | method { vmc } 2 | 3 | include qw_111.sys 4 | 5 | trialfunc { 6 | slater 7 | corbitals { 8 | blas_mo 9 | magnify 1 10 | nmo 4 11 | orbfile qw_111.orb 12 | include qw.basis 13 | centers { useglobal } 14 | } 15 | detwt { 1.0 } 16 | states { 17 | # Spin up orbitals. 18 | 1 2 3 4 19 | # Spin down orbitals. 20 | 1 2 3 4 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/si/qw_111.cutoff.hf: -------------------------------------------------------------------------------- 1 | method { vmc } 2 | 3 | include qw_111.sys 4 | 5 | trialfunc { 6 | slater 7 | corbitals { 8 | cutoff_mo 9 | magnify 1 10 | nmo 4 11 | orbfile qw_111.orb 12 | include qw.basis 13 | centers { useglobal } 14 | } 15 | detwt { 1.0 } 16 | states { 17 | # Spin up orbitals. 18 | 1 2 3 4 19 | # Spin down orbitals. 20 | 1 2 3 4 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/si/qw_111.slater: -------------------------------------------------------------------------------- 1 | slater 2 | corbitals { 3 | cutoff_mo 4 | magnify 1 5 | nmo 4 6 | orbfile qw_111.orb 7 | include qw.basis 8 | centers { useglobal } 9 | } 10 | detwt { 1.0 } 11 | states { 12 | # Spin up orbitals. 13 | 1 2 3 4 14 | # Spin down orbitals. 15 | 1 2 3 4 16 | } -------------------------------------------------------------------------------- /tests/si/qw_111.sys: -------------------------------------------------------------------------------- 1 | system { periodic 2 | nspin { 4 4 } 3 | latticevec { 4 | 6.2842897565437 3.6282363826061 0.0 5 | 0.0 7.2564727652122 0.0 6 | 2.0947632521812 3.6282363826061 5.924885202391 7 | } 8 | origin { 0 0 0 } 9 | cutoff_divider 0.26382867563501017 10 | kpoint { 0.5 0.5 0.5 } 11 | atom { si 4.0 coor -2.0947632521812 -3.6282363826061 -1.4812213005977 } 12 | atom { si 4.0 coor 0.0 0.0 0.0 } 13 | } 14 | pseudo { 15 | si 16 | aip 12 17 | basis { si 18 | rgaussian 19 | oldqmc { 20 | 0.0 3 21 | 1 1 3 22 | 2 2.26686403 21.20531613 23 | 2 2.11659661 15.43693603 24 | 1 1.80721061 4.0 25 | 3 9.99633089 7.22884246 26 | 2 2.50043232 -13.0672559 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /tests/si/qw_222.blas.hf: -------------------------------------------------------------------------------- 1 | method { vmc } 2 | 3 | include qw_222.sys 4 | 5 | trialfunc { 6 | slater 7 | corbitals { 8 | blas_mo 9 | magnify 1 10 | nmo 4 11 | orbfile qw_222.orb 12 | include qw.basis 13 | centers { useglobal } 14 | } 15 | detwt { 1.0 } 16 | states { 17 | # Spin up orbitals. 18 | 1 2 3 4 19 | # Spin down orbitals. 20 | 1 2 3 4 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/si/qw_222.cutoff.hf: -------------------------------------------------------------------------------- 1 | method { vmc } 2 | 3 | include qw_222.sys 4 | 5 | trialfunc { 6 | slater 7 | corbitals { 8 | cutoff_mo 9 | magnify 1 10 | nmo 4 11 | orbfile qw_222.orb 12 | include qw.basis 13 | centers { useglobal } 14 | } 15 | detwt { 1.0 } 16 | states { 17 | # Spin up orbitals. 18 | 1 2 3 4 19 | # Spin down orbitals. 20 | 1 2 3 4 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/si/qw_222.slater: -------------------------------------------------------------------------------- 1 | slater 2 | orbitals { 3 | cutoff_mo 4 | magnify 1 5 | nmo 4 6 | orbfile qw_222.orb 7 | include qw.basis 8 | centers { useglobal } 9 | } 10 | detwt { 1.0 } 11 | states { 12 | # Spin up orbitals. 13 | 1 2 3 4 14 | # Spin down orbitals. 15 | 1 2 3 4 16 | } -------------------------------------------------------------------------------- /tests/si/qw_222.sys: -------------------------------------------------------------------------------- 1 | system { periodic 2 | nspin { 4 4 } 3 | latticevec { 4 | 6.2842897565437 3.6282363826061 0.0 5 | 0.0 7.2564727652122 0.0 6 | 2.0947632521812 3.6282363826061 5.924885202391 7 | } 8 | origin { 0 0 0 } 9 | cutoff_divider 0.26382867563501017 10 | kpoint { 1.0 1.0 1.0 } 11 | atom { si 4.0 coor -2.0947632521812 -3.6282363826061 -1.4812213005977 } 12 | atom { si 4.0 coor 0.0 0.0 0.0 } 13 | } 14 | pseudo { 15 | si 16 | aip 12 17 | basis { si 18 | rgaussian 19 | oldqmc { 20 | 0.0 3 21 | 1 1 3 22 | 2 2.26686403 21.20531613 23 | 2 2.11659661 15.43693603 24 | 1 1.80721061 4.0 25 | 3 9.99633089 7.22884246 26 | 2 2.50043232 -13.0672559 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /tests/si/run_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | import subprocess 4 | import json 5 | import sys 6 | import os 7 | 8 | sys.path.append("../") 9 | from qwtest import * 10 | 11 | reports=[] 12 | allsuc=[] 13 | 14 | print("""########################################### 15 | Silicon Slater determinant 16 | ################################################""") 17 | 18 | ref_data={} 19 | ref_data['111']={'total_energy': [-7.538,0.02], 20 | 'kinetic':[3.38,0.02], 21 | } 22 | ref_data['222']={'total_energy': [-7.71,0.02], 23 | 'kinetic':[3.12,0.02], 24 | } 25 | 26 | for bc in ['111','222']: 27 | for orb in ['blas','cutoff']: 28 | fname='qw_'+bc+'.'+orb+'.hf' 29 | systems={} 30 | methods={} 31 | descriptions={} 32 | sigmas={} 33 | for k in ref_data[bc].keys(): 34 | systems[k]='silicon' 35 | methods[k]='vmc' 36 | descriptions[k]='PBCs and k-points' 37 | sigmas[k]=3.0 38 | 39 | try: 40 | subprocess.check_output(['rm',fname+'.log']) 41 | except: 42 | pass 43 | 44 | subprocess.check_output([QW,fname]) 45 | json_str=subprocess.check_output([GOS,'-json',fname+'.log']) 46 | dat=json.loads(json_str) 47 | dat_properties=dat['properties'] 48 | 49 | success=compare_result_ref(ref_data[bc],dat_properties,sigmas) 50 | for k,v in success.items(): 51 | allsuc.append(v) 52 | 53 | reports.extend(summarize_results(ref_data[bc],dat_properties,success,systems,methods,descriptions)) 54 | 55 | print_results(reports) 56 | save_results(reports) 57 | 58 | if False in allsuc: 59 | sys.exit(1) 60 | sys.exit(0) 61 | -------------------------------------------------------------------------------- /utils/autogen/gamessbasis2xml.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import sys 3 | 4 | f=open(sys.argv[1],'r') 5 | 6 | for line in f: 7 | spl=line.split() 8 | 9 | if len(spl) > 1 and ("S" in spl[0] or "s" in spl[0] \ 10 | or "P" in spl[0] or "p" in spl[0] \ 11 | or "D" in spl[0] or "d" in spl[0] \ 12 | or "F" in spl[0] or "f" in spl[0]): 13 | print('') 14 | print(''%(spl[1],spl[0].lower())) 15 | elif len(spl) > 1: 16 | print(''%(spl[0],spl[1])) 17 | 18 | 19 | print('') 20 | 21 | -------------------------------------------------------------------------------- /utils/autogen/job_prep.py: -------------------------------------------------------------------------------- 1 | from pymatgen.io.cifio import CifParser,CifWriter 2 | import numpy as np 3 | 4 | def move_atom(input_cif, output_cif, atom_idx, displacement_vec): 5 | """ 6 | Reads input cif (as file name), moves atom by displacement vector (in 7 | angstroms), and writes to output_cif (as file name). 8 | 9 | Currently, doesn't take into account the symmetry operations. This is 10 | theoretically possible with PyMatGen, although I found it to be buggy so 11 | decided it might not be worth it. 12 | Useful things to look up for implementing this: 13 | 14 | pymatgen.symmetry.analyzer.SpacegroupAnalyzer.get_symmetrized_structure 15 | 16 | and its resulting method 17 | 18 | find_equivalent_sites() 19 | """ 20 | parser = CifParser(input_cif) 21 | struct = parser.get_structures()[0] 22 | lat_const = np.array(struct.lattice.abc) 23 | frac_pos = struct[atom_idx].frac_coords 24 | new_pos = frac_pos + displacement_vec/lat_const 25 | struct[atom_idx] = struct[atom_idx].species_and_occu.elements[0], new_pos 26 | writer = CifWriter(struct) 27 | writer.write_file(output_cif) 28 | -------------------------------------------------------------------------------- /utils/convert_old_trace.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | 8 | double checksum(double * a, int n) { 9 | //Here we just take the average of the array. 10 | double check=0; 11 | for(int i=0; i< n; i++) 12 | check+=a[i]/n; 13 | return check; 14 | } 15 | 16 | int binary_write_checksum(double * a, int n, FILE * f) { 17 | double n_d=n; 18 | double zero=0.0; 19 | fwrite(&zero,sizeof(double),1,f); 20 | fwrite(&zero,sizeof(double),1,f); 21 | fwrite(&n_d,sizeof(double),1,f); 22 | double check=checksum(a,n); 23 | fwrite(a,sizeof(double),n,f); 24 | fwrite(&check,sizeof(double),1,f); 25 | if(ferror(f)) { 26 | return 0; 27 | } 28 | return 1; 29 | } 30 | 31 | int main(int argc, char ** argv) { 32 | if(argc < 4) { 33 | cout << "Swap from the old trace files to the new, checksummed ones" << endl; 34 | cout << "The old files are binary files with the electron positions and then the weights." < 2: 26 | naip = 12 27 | else: 28 | naip = 6 29 | print "PSEUDO {\n %s"%alabel + "\n AIP %s"%naip +"\n BASIS { %s " %alabel+"\n RGAUSSIAN\n OLDQMC {" 30 | print "0.0 %s" %len(psp) 31 | str="" 32 | 33 | for i in range(1, len(psp)): 34 | str = str + "%s " %lst[i] 35 | print str+ "%s" %lst[0] 36 | 37 | for i in range(1, len(psp)): 38 | a=psp[i] 39 | for j in range(len(a)): 40 | if a[j][2]=='0': 41 | print " 2 %s %s" %(a[j][0], a[j][1]) 42 | elif a[j][2] == "1": 43 | print " 3 %s %s" %(a[j][0], a[j][1]) 44 | else: 45 | print " 1 %s %s" %(a[j][0], a[j][1]) 46 | a=psp[0] 47 | for j in range(len(a)): 48 | if a[j][2]=='0': 49 | print " 2 %s %s" %(a[j][0], a[j][1]) 50 | elif a[j][2] == "1": 51 | print " 3 %s %s" %(a[j][0], a[j][1]) 52 | else: 53 | print " 1 %s %s" %(a[j][0], a[j][1]) 54 | print " }\n }\n}" 55 | 56 | print "\n" 57 | -------------------------------------------------------------------------------- /utils/newk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ $# -lt 3 ]; then 3 | echo "Syntax: newk.sh crystal_out newk_out output" 4 | exit 1 5 | fi 6 | head -50000 $1 > $1.tmp 7 | sed -n -e '1,/FINAL EIGENVECTORS/p' $1.tmp | sed 's/FINAL EIGENVECTORS/NEWK EIGENVECTORS/g' > $3 8 | sed -n -e '/HAMILTONIAN EIGENVECTORS/, $p' $2 >> $3 9 | -------------------------------------------------------------------------------- /utils/orbfile.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | class Orbfile: 4 | ################### 5 | def __init__(self,f): 6 | """Only works for a 'flat' .orb file, in which all coefficients, all basis functions, 7 | all centers are listed. Needs extension otherwise.""" 8 | in_coeff=False 9 | self.mo=[] 10 | self.center=[] 11 | self.basis=[] 12 | self.index=[] 13 | coeffs_linear=[] 14 | for line in f: 15 | #line=f.readline() 16 | if in_coeff: 17 | coeffs_linear.extend(map(float,line.split())) 18 | if "COEFFICIENTS" in line: 19 | in_coeff=True 20 | elif not in_coeff: 21 | spl=line.split() 22 | self.mo.append(int(spl[0])-1) 23 | self.basis.append(int(spl[1])-1) 24 | self.center.append(int(spl[2])-1) 25 | self.index.append(int(spl[3])-1) 26 | 27 | self.nmo=np.max(self.mo)+1 28 | ncoeff=len(coeffs_linear) 29 | print("Nmo",self.nmo, "ncoeff",len(coeffs_linear), "nfunc",len(coeffs_linear)/self.nmo) 30 | if(ncoeff%self.nmo==0): 31 | self.nfunc=int(ncoeff/self.nmo) 32 | else: 33 | print("Can't read this file because it is kind of non-standard.") 34 | 35 | #Should be fixed if we support general .orb files 36 | self.coeff_mat=np.array(coeffs_linear) 37 | self.coeff_mat=self.coeff_mat.reshape((self.nmo,self.nfunc)) 38 | ########################## 39 | def rotate(self,orb_group,rotation): 40 | tmp=np.copy(self.coeff_mat) 41 | for ii,i in enumerate(orb_group): 42 | for ji,j in enumerate(orb_group): 43 | tmp[i,j]=0 44 | for ki,k in enumerate(orb_group): 45 | tmp[i,j]+=rotation[ii,ki]*self.coeff_mat[k,j] 46 | self.coeff_mat=np.copy(tmp) 47 | pass 48 | 49 | ######################### 50 | def write(self,f): 51 | for m,c,b,i in zip(self.mo,self.center,self.basis,self.index): 52 | f.write("%i %i %i %i\n"%(m+1,b+1,c+1,i+1)) 53 | f.write("COEFFICIENTS\n") 54 | count=0 55 | for i in self.coeff_mat.flatten(): 56 | f.write(" %.15f "%i) 57 | count+=1 58 | if count%5==0: 59 | f.write("\n") 60 | ###################### 61 | 62 | 63 | -------------------------------------------------------------------------------- /utils/readcrys10.f: -------------------------------------------------------------------------------- 1 | ! Copyright (C) 2007 Lucas K. Wagner 2 | ! This program is free software; you can redistribute it and/or modify 3 | ! it under the terms of the GNU General Public License as published by 4 | ! the Free Software Foundation; either version 2 of the License, or 5 | ! (at your option) any later version. 6 | ! 7 | ! This program is distributed in the hope that it will be useful, 8 | ! but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | ! GNU General Public License for more details. 11 | ! 12 | ! You should have received a copy of the GNU General Public License along 13 | ! with this program; if not, write to the Free Software Foundation, Inc., 14 | ! 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 15 | 16 | ! Read the fortran unit 10 file that crystal puts out 17 | ! and write to stdout the MO's. size should be the number 18 | ! of functions per molecular orbital, and this will not work 19 | ! if you used symmetry adapted functions(NOSYMADA must have 20 | ! been set for Crystal version 98 and higher) 21 | program read10 22 | implicit double precision (A-H, O-Z) 23 | integer kpoint 24 | parameter (size=104) 25 | DIMENSION A(size*size) 26 | iniz=0 27 | istart=0 28 | nspin=1 29 | read(*,*) kpoint 30 | do k=1, kpoint-1 31 | read(10)A 32 | enddo 33 | do spin=1,nspin 34 | write(*,*) "---------Spin ", spin 35 | read(10)A 36 | do i=1,size 37 | write(*,*) "=====================" 38 | write(*,*) "CO ", i 39 | do j=1,size 40 | write(*,*) j,A((istart+i-1)*size+j) 41 | enddo 42 | enddo 43 | istart=istart+size 44 | enddo 45 | end 46 | -------------------------------------------------------------------------------- /utils/separate_jastrow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | f=open(sys.argv[1],'r') 5 | tokens=f.readlines() 6 | in_jastrow=False 7 | nopen=0 8 | nclose=0 9 | for line in tokens: 10 | if line.find("JASTROW2") != -1: 11 | in_jastrow=True 12 | if in_jastrow: 13 | nopen+=line.count("{") 14 | nclose+=line.count("}") 15 | if in_jastrow and nopen >= nclose: 16 | print line, 17 | 18 | -------------------------------------------------------------------------------- /utils/swap_endian.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | using namespace std; 5 | double swap(double d){ 6 | double a; 7 | unsigned char *dst = (unsigned char *)&a; 8 | unsigned char *src = (unsigned char *)&d; 9 | 10 | dst[0] = src[7]; 11 | dst[1] = src[6]; 12 | dst[2] = src[5]; 13 | dst[3] = src[4]; 14 | dst[4] = src[3]; 15 | dst[5] = src[2]; 16 | dst[6] = src[1]; 17 | dst[7] = src[0]; 18 | 19 | return a; 20 | } 21 | 22 | int main(int argc, char ** argv) { 23 | if(argc < 3) { 24 | cout << "Swap from big-endian to little endian and vice-versa" << endl; 25 | cout << "Usage : " << argv[0] << " infile outfile " << endl; 26 | return 1; 27 | } 28 | FILE * fin=fopen(argv[1],"r"); 29 | FILE * fout=fopen(argv[2],"w"); 30 | double tmp; 31 | while(fread(&tmp, sizeof(double),1,fin)) { 32 | double tmp2=swap(tmp); 33 | fwrite(&tmp2,sizeof(double),1,fout); 34 | } 35 | fclose(fin); 36 | fclose(fout); 37 | return 0; 38 | } 39 | 40 | --------------------------------------------------------------------------------