├── .gitignore ├── .gitmodules ├── CMake ├── CMakeLists.txt.BryanMac ├── CMakeLists.txt.Ethan ├── CMakeLists.txt.chama ├── CMakeLists.txt.sierra ├── FindBlitz++.cmake ├── FindFFTW.cmake ├── FindGSL.cmake ├── FindHDF5.cmake ├── FindLapack.cmake ├── FindSPRNG.cmake └── cmakecommand ├── CMakeLists.txt ├── Examples ├── ElectronGas │ ├── data │ │ └── .placeholder │ ├── inputs │ │ ├── heg-4.0-1.0-1-33-64-64.sq.PairAction │ │ ├── heg-4.0-1.0-1-33-64-64.sq.bf │ │ ├── heg-4.0-1.0-1-33-64-64.sq.ch │ │ ├── heg-4.0-1.0-1-33-64-64.sq.dg │ │ ├── heg-4.0-1.0-1-33-64-64.sq.dm │ │ ├── heg-4.0-1.0-1-33-64-64.sq.h5 │ │ ├── heg-4.0-1.0-1-33-64-64.sq.in │ │ ├── heg-4.0-1.0-1-33-64-64.sq.potential.dat │ │ ├── heg-4.0-1.0-1-33-64-64.sq.vk │ │ ├── heg-4.0-1.0-1-33-64-64.sq.yk │ │ ├── heg-4.0-1.0-1-33-64.in │ │ └── heg-4.0-1.0-1-33-64.ins │ ├── outputs │ │ └── .placeholder │ ├── rawdata │ │ └── .placeholder │ └── scripts │ │ ├── HEGInput.py │ │ ├── HF.py │ │ ├── dmparse.py │ │ └── gen-heg-inputs.py ├── Hydrogen │ ├── .gitignore │ ├── inputs │ │ ├── H.in │ │ ├── e-e.sq.PairAction │ │ ├── e-e.sq.bf │ │ ├── e-e.sq.ch │ │ ├── e-e.sq.dg │ │ ├── e-e.sq.dm │ │ ├── e-e.sq.h5 │ │ ├── e-e.sq.in │ │ ├── e-e.sq.potential.dat │ │ ├── e-p.sq.PairAction │ │ ├── e-p.sq.bf │ │ ├── e-p.sq.ch │ │ ├── e-p.sq.dg │ │ ├── e-p.sq.dm │ │ ├── e-p.sq.h5 │ │ ├── e-p.sq.in │ │ ├── e-p.sq.potential.dat │ │ ├── p-p.sq.PairAction │ │ ├── p-p.sq.bf │ │ ├── p-p.sq.ch │ │ ├── p-p.sq.dg │ │ ├── p-p.sq.dm │ │ ├── p-p.sq.h5 │ │ ├── p-p.sq.in │ │ └── p-p.sq.potential.dat │ └── jobs │ │ └── job.sub ├── ParticleInABox │ ├── ParticleInABox.in │ └── zero.PairAction └── SimpleHarmonicOscillator │ ├── SHO.in │ └── zero.PairAction ├── README.md ├── Scripts ├── Analysis.py ├── C-input.py ├── Cusp.py ├── Energy.py ├── H-box-input.py ├── H-input.py ├── Li-input.py ├── MPIClass.py ├── NodalModel.py ├── SHO.py ├── Stats.py ├── dmparse.py ├── genDM.py ├── heg-input.py ├── printdm.py └── units.py └── src ├── Actions ├── ActionBase.cc ├── ActionBase.h ├── ActionsClass.cc ├── ActionsClass.h ├── BlendActions.cc ├── BlendActions.h ├── CummingsWaterPotential.cc ├── CummingsWaterPotential.h ├── DavidLongRangeClass.cc ├── DavidLongRangeClass.h ├── DavidLongRangeClassYk.cc ├── DavidLongRangeClassYk.h ├── DeterminantGradient.tex ├── DiagonalActionClass.cc ├── DiagonalActionClass.h ├── EAMClass.cc ├── EAMClass.h ├── FixedPhase.tex ├── FreeNodalActionClass.cc ├── FreeNodalActionClass.h ├── HarmonicPotential.cc ├── HarmonicPotential.h ├── KineticClass.cc ├── KineticClass.h ├── LongRangeClass.cc ├── LongRangeClass.h ├── LongRangeCoulombClass.cc ├── LongRangeCoulombClass.h ├── LongRangePotClass.cc ├── LongRangePotClass.h ├── LongRangeRPAClass.cc ├── LongRangeRPAClass.h ├── MoleculeInteractionsClass.cc ├── MoleculeInteractionsClass.h ├── Mu.cc ├── Mu.h ├── NodalActionClass.cc ├── NodalActionClass.h ├── OpenLoopImportance.cc ├── OpenLoopImportance.h ├── ParametrizedFreeNodalActionClass.cc ├── ParametrizedFreeNodalActionClass.h ├── ParamsClass.h ├── QMCSamplingClass.cc ├── QMCSamplingClass.h ├── ReadAction.cc ├── ReadAction.h ├── SHONodalActionClass.cc ├── SHONodalActionClass.h ├── ST2WaterClass.cc ├── ST2WaterClass.h ├── Sal.cc ├── Sal.h ├── ShortRangeApproximateClass.cc ├── ShortRangeApproximateClass.h ├── ShortRangeClass.cc ├── ShortRangeClass.h ├── ShortRangeOnClass.cc ├── ShortRangeOnClass.h ├── ShortRangeOn_diagonal_Class.cc ├── ShortRangeOn_diagonal_Class.h ├── ShortRangeOn_diagonal_displace_Class.cc ├── ShortRangeOn_diagonal_displace_Class.h ├── ShortRangePotClass.cc ├── ShortRangePotClass.h ├── ShortRangePrimitive.cc ├── ShortRangePrimitive.h ├── StructureReject.cc ├── StructureReject.h ├── SystemClass.h ├── TIP5PWaterClass.cc ├── TIP5PWaterClass.h ├── Tether.cc ├── Tether.h ├── Timer.h ├── WaterClass.cc ├── WaterFast.cc ├── WaterFast.h ├── dVec.cc ├── dVec.h ├── det_calc_uekt.c ├── det_calc_uekt.h ├── exec_pwscf.py └── pwscf.py ├── Blitz.h ├── Common.cc ├── Common.h ├── Communication ├── Communication.cc └── Communication.h ├── EventClass.cc ├── EventClass.h ├── Ewald ├── OptimizedBreakup.cc ├── OptimizedBreakup.h └── ewald.cc ├── Fitting └── Ellipsoid.cc ├── FreeParticles.cc ├── GridClass.cc ├── GridClass.h ├── IO ├── FileExpand.h ├── IO.cc ├── IO.h ├── IOASCII.cc ├── IOASCII.h ├── IOBase.h ├── IOHDF5.cc ├── IOHDF5.h ├── IOVar.h ├── IOVarASCII.h ├── IOVarBase.h ├── IOVarHDF5.cc ├── IOVarHDF5.h ├── InputFile.cc ├── InputFile.h ├── InputOutput.cc ├── InputOutput.h ├── InputOutputASCII.cc ├── InputOutputASCII.h ├── InputOutputBase.h ├── InputOutputHDF5.cc └── InputOutputHDF5.h ├── InitPaths.cc ├── Integration ├── GKIntegration.cc ├── GKIntegration.h ├── HermiteQuad.cc ├── HermiteQuad.h ├── Integrate.cc ├── Integrate.h ├── RungeKutta.h ├── Standard.h ├── TestHermite.cc └── TestIntegrate.cc ├── LoopClass.cc ├── LoopClass.h ├── Main.cc ├── MatrixOps ├── GJ.m ├── GJblock.m ├── MatrixOps.cc └── MatrixOps.h ├── MirroredClass.cc ├── MirroredClass.h ├── MoleculeHelper.cc ├── MoleculeHelper.h ├── Moves ├── AVBMove.cc ├── AVBMove.h ├── BisectionBlock.cc ├── BisectionBlock.h ├── BisectionJosephsonStage.cc ├── BisectionJosephsonStage.h ├── BisectionSphereBlock.cc ├── BisectionSphereBlock.h ├── BisectionSphereStage.cc ├── BisectionSphereStage.h ├── BisectionStage.cc ├── BisectionStage.h ├── CenterDropletMove.cc ├── CenterDropletMove.h ├── CenterofMassMove.cc ├── CenterofMassMove.h ├── CentroidMove.cc ├── CentroidMove.h ├── ClusterMove.cc ├── ClusterMove.h ├── CorrelatedBisectionBlock.cc ├── CorrelatedBisectionBlock.h ├── CoupledPermuteStage.cc ├── CoupledPermuteStage.h ├── CouplingMove.cc ├── CouplingMove.h ├── CouplingStage.cc ├── CouplingStage.h ├── DisplaceMove.cc ├── DisplaceMove.h ├── DisplaceMoveFast.cc ├── DisplaceMoveFast.h ├── EmptyStage.cc ├── EmptyStage.h ├── EndStage.cc ├── EndStage.h ├── IonMoveManager.cc ├── IonMoveManager.h ├── IonMoveStage.cc ├── IonMoveStage.h ├── LeviFlightStage.cc ├── LeviFlightStage.h ├── MetaMoves.cc ├── MetaMoves.h ├── MoleculeBias.cc ├── MoleculeBias.h ├── MoleculeMove.cc ├── MoleculeMove.h ├── MoleculeMove.input ├── MoleculeMoveBase.cc ├── MoleculeMoveBase.h ├── MoleculeMoveManager.cc ├── MoleculeMoveManager.h ├── MoveBase.cc ├── MoveBase.h ├── MoveClass.h ├── MoveUtils.cc ├── MoveUtils.h ├── MultiStage.cc ├── MultiStage.h ├── NoPermuteClass.cc ├── NoPermuteStage.h ├── NodalModelMove.cc ├── NodalModelMove.h ├── OpenEndMove.cc ├── OpenEndMove.h ├── OpenStage.cc ├── OpenStage.h ├── PermuteStage.cc ├── PermuteStage.h ├── PermuteTableClass.cc ├── PermuteTableClass.h ├── PermuteTableOnClass.cc ├── PermuteTableOnClass.h ├── PreSampling.cc ├── PreSampling.h ├── RandomPermClass.cc ├── RandomPermClass.h ├── RandomPermMove.h ├── ReadPath.cc ├── ReadPath.h ├── RefSliceMove.cc ├── RefSliceMove.h ├── RefSliceShift.cc ├── RefSliceShift.h ├── SPS.cc ├── SPS.h ├── SpaceWarp.cc ├── SpaceWarp.h ├── StageClass.cc ├── StageClass.h ├── StructureRejectStage.cc ├── StructureRejectStage.h ├── SwapMove.cc ├── SwapMove.h ├── TablePermuteStage.cc ├── TablePermuteStage.h ├── WormClose.cc ├── WormClose.h ├── WormGrow.cc ├── WormGrow.h ├── WormPermuteStage.cc ├── WormPermuteStage.h ├── WormRemove.cc ├── WormRemove.h ├── WormStage.cc ├── WormStage.h └── deprecated │ ├── BisectionMoveClass.cc │ ├── BisectionMoveClass.h │ ├── OpenBisectionMoveClass.cc │ └── OpenBisectionMoveClass.h ├── Observables ├── Angular.cc ├── Angular.h ├── Centroid.cc ├── Centroid.h ├── Coupling.cc ├── Coupling.h ├── DistanceToHead.cc ├── DistanceToHead.h ├── DynamicStructureFactor.cc ├── DynamicStructureFactor.h ├── Forces.cc ├── Forces.h ├── HBond.cc ├── HBond.h ├── Hexatic.cc ├── Hexatic.h ├── HistogramClass.h ├── ImportanceWeight.cc ├── ImportanceWeight.h ├── JosephsonPathDump.cc ├── JosephsonPathDump.h ├── NodalModelTime.cc ├── NodalModelTime.h ├── ObservableBase.cc ├── ObservableBase.h ├── ObservableClass.h ├── ObservableCorrelation.cc ├── ObservableCorrelation.h ├── ObservableDiffusion.cc ├── ObservableDiffusion.h ├── ObservableEnergy.cc ├── ObservableEnergy.h ├── ObservableRefCorrelation.cc ├── ObservableRefCorrelation.h ├── ObservableVar.cc ├── ObservableVar.h ├── OpenOrientation.cc ├── OpenOrientation.h ├── PairCorrelationReweighting.cc ├── PairCorrelationReweighting.h ├── ParticleAverageLoc.cc ├── ParticleAverageLoc.h ├── PathDump.cc ├── PathDump.h ├── PermutationCount.cc ├── PermutationCount.h ├── Phik.cc ├── Phik.h ├── PlaneDensity.cc ├── PlaneDensity.h ├── Pressure.cc ├── Pressure.h ├── RefStructureFactor.cc ├── RefStructureFactor.h ├── Sign.cc ├── Sign.h ├── SpecificHeat.cc ├── SpecificHeat.h ├── SpecificHeatA.cc ├── SpecificHeatA.h ├── StructureFactor.cc ├── StructureFactor.h ├── SuperfluiDrop.cc ├── SuperfluiDrop.h ├── SuperfluidFraction.cc ├── SuperfluidFraction.h ├── SuperfluidFractionPerLayer.cc ├── SuperfluidFractionPerLayer.h ├── Time.cc ├── Time.h ├── TimeHexatic.cc ├── TimeHexatic.h ├── TimeLindenman.cc ├── TimeLindenman.h ├── Weight.cc ├── Weight.h ├── WindingNumber.cc ├── WindingNumber.h └── lsapr48.f ├── PIMCClass.cc ├── PIMCClass.h ├── PairAction ├── DavidPAClass.cc ├── DavidPAClass.h ├── GeneralPot.h ├── PAFit.h ├── PAFitBase.h ├── PAclassicalFit.cc ├── PAclassicalFit.h ├── PAzeroFit.cc ├── PAzeroFit.h ├── Particle.h ├── Potential.cc ├── Potential.h ├── PotentialBase.h ├── dmparse.py └── old │ ├── PAFit.cc │ ├── PAcoulombFit.cc │ ├── PAcoulombFit.h │ ├── PAsFit.cc │ ├── PAsFit.h │ ├── PAszFit.cc │ └── PAszFit.h ├── ParseCommand.cc ├── ParseCommand.h ├── PathClass.cc ├── PathClass.h ├── PathDataClass.cc ├── PathDataClass.h ├── QMCWrapper.cc ├── QMCWrapper.h ├── Random └── Random.h ├── RunInfoClass.h ├── SpeciesClass.cc ├── SpeciesClass.h ├── Splines ├── BicubicSpline.cc ├── BicubicSpline.h ├── CubicSpline.cc ├── CubicSpline.h ├── Grid.cc ├── Grid.h ├── LinearSpline.h ├── QuinticSpline.cc └── QuinticSpline.h ├── SwitchClass.cc ├── SwitchClass.h ├── WormHelper.cc ├── WriteData.cc ├── WriteData.h ├── config.h ├── det_calc_uekt.h └── nan.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.vim 2 | *.swp 3 | *.h5 4 | *.swo 5 | *.png 6 | bin/ 7 | CMakeFiles/ 8 | *.o 9 | build/ 10 | src/Scripts/*.txt 11 | *.tags 12 | *.cscope* 13 | *.pyc 14 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkclark/pimcpp/83a6fd7f81cf80f192bd5d0eae3dff0259b02291/.gitmodules -------------------------------------------------------------------------------- /CMake/FindBlitz++.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # this module look for blitz++ (http://www.oonumerics.org/blitz) support 3 | # it will define the following values 4 | # 5 | # BLITZ_INCLUDE_DIR = where blitz/blitz.h can be found 6 | # 7 | # May want to define this but seldom required 8 | # BLITZ_LIBRARY = where blitz library can be found (reserved) 9 | # 10 | #IF(EXISTS ${PROJECT_CMAKE}/BlitzppConfig.cmake) 11 | # INCLUDE(${PROJECT_CMAKE}/BlitzppConfig.cmake) 12 | #ENDIF(EXISTS ${PROJECT_CMAKE}/BlitzppConfig.cmake) 13 | 14 | SET(Libblitz blitz) 15 | IF(QMC_BUILD_STATIC) 16 | SET(Libblitz libblitz.a) 17 | ENDIF(QMC_BUILD_STATIC) 18 | 19 | SET(TRIAL_LIBRARY_PATHS 20 | /usr/local/lib 21 | /sw/lib 22 | ${CMAKE_SOURCE_DIR}/lib 23 | $ENV{BLITZ_HOME}/lib 24 | ) 25 | 26 | SET(TRIAL_INCLUDE_PATHS 27 | /usr/local/include 28 | /sw/include 29 | ${CMAKE_SOURCE_DIR}/include 30 | $ENV{BLITZ_HOME}/include 31 | ) 32 | 33 | FIND_PATH(BLITZ_INCLUDE_DIR blitz/blitz.h ${TRIAL_INCLUDE_PATHS}) 34 | FIND_LIBRARY(BLITZ_LIBRARIES ${Libblitz} ${TRIAL_LIBRARY_PATHS}) 35 | 36 | IF(BLITZ_INCLUDE_DIR) 37 | SET(BLITZ_FOUND 1 CACHE BOOL "Found blitz++ library") 38 | MESSAGE(STATUS "BLITZ_INCLUDE_DIR=${BLITZ_INCLUDE_DIR}") 39 | MESSAGE(STATUS "BLITZ_LIBRARIES=${BLITZ_LIBRARIES}") 40 | ELSE(BLITZ_INCLUDE_DIR) 41 | SET(BLITZ_FOUND 0 CACHE BOOL "Found blitz++ library") 42 | ENDIF(BLITZ_INCLUDE_DIR) 43 | 44 | MARK_AS_ADVANCED( 45 | BLITZ_INCLUDE_DIR 46 | BLITZ_FOUND 47 | ) 48 | -------------------------------------------------------------------------------- /CMake/FindFFTW.cmake: -------------------------------------------------------------------------------- 1 | # FFTW_INCLUDE_DIR = fftw3.h 2 | # FFTW_LIBRARIES = libfftw3.a 3 | # FFTW_FOUND = true if FFTW3 is found 4 | 5 | SET(Libfftw fftw3) 6 | IF(QMC_BUILD_STATIC) 7 | SET(Libfftw libfftw3.a) 8 | ENDIF(QMC_BUILD_STATIC) 9 | 10 | IF(FFTW_INCLUDE_DIRS) 11 | FIND_PATH(FFTW_INCLUDE_DIR fftw3.h ${FFTW_INCLUDE_DIRS}) 12 | FIND_LIBRARY(FFTW_LIBRARY ${Libfftw} ${FFTW_LIBRARY_DIRS}) 13 | ELSE(FFTW_INCLUDE_DIRS) 14 | FIND_PATH(FFTW_INCLUDE_DIR fftw3.h ${FFTW_HOME}/include $ENV{FFTW_HOME}/include) 15 | FIND_LIBRARY(FFTW_LIBRARIES ${Libfftw} ${FFTW_HOME}/lib $ENV{FFTW_HOME}/lib) 16 | ENDIF(FFTW_INCLUDE_DIRS) 17 | 18 | SET(FFTW_FOUND FALSE) 19 | IF(FFTW_INCLUDE_DIR AND FFTW_LIBRARIES) 20 | MESSAGE(STATUS "FFTW_INCLUDE_DIR=${FFTW_INCLUDE_DIR}") 21 | MESSAGE(STATUS "FFTW_LIBRARIES=${FFTW_LIBRARIES}") 22 | SET(FFTW_FOUND TRUE) 23 | ENDIF(FFTW_INCLUDE_DIR AND FFTW_LIBRARIES) 24 | 25 | MARK_AS_ADVANCED( 26 | FFTW_INCLUDE_DIR 27 | FFTW_LIBRARIES 28 | FFTW_FOUND 29 | ) 30 | -------------------------------------------------------------------------------- /CMake/FindGSL.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # this module look for gsl (http://www.gnu.org/software/gsl) support 3 | # it will define the following values 4 | # 5 | # GSL_INCLUDE_DIR = where gsl/gsl_version.h can be found 6 | # GSL_LIBRARY = the library to link against libgsl 7 | # GSL_FOUND = set to 1 if gsl is found 8 | # 9 | 10 | IF(EXISTS ${PROJECT_CMAKE}/GslConfig.cmake) 11 | INCLUDE(${PROJECT_CMAKE}/GslConfig.cmake) 12 | ENDIF(EXISTS ${PROJECT_CMAKE}/GslConfig.cmake) 13 | 14 | IF(Gsl_INCLUDE_DIRS) 15 | 16 | FIND_PATH(GSL_INCLUDE_DIR gsl/gsl_version.h ${Gsl_INCLUDE_DIRS}) 17 | FIND_LIBRARY(GSL_LIBRARY gsl ${Gsl_LIBRARY_DIRS}) 18 | 19 | ELSE(Gsl_INCLUDE_DIRS) 20 | 21 | SET(TRIAL_LIBRARY_PATHS 22 | $ENV{GSL_HOME}/lib 23 | /usr/lib 24 | /usr/local/lib 25 | /opt/lib 26 | /sw/lib 27 | ) 28 | 29 | SET(TRIAL_INCLUDE_PATHS 30 | $ENV{GSL_HOME}/include 31 | /usr/include 32 | /opt/include 33 | /usr/local/include 34 | /sw/include 35 | ) 36 | 37 | FIND_LIBRARY(GSL_LIBRARY gsl ${TRIAL_LIBRARY_PATHS}) 38 | FIND_PATH(GSL_INCLUDE_DIR gsl/gsl_version.h ${TRIAL_INCLUDE_PATHS} ) 39 | 40 | ENDIF(Gsl_INCLUDE_DIRS) 41 | 42 | IF(GSL_INCLUDE_DIR AND GSL_LIBRARY) 43 | SET(GSL_FOUND 1 CACHE BOOL "Found gsl library") 44 | IF(QMC_BUILD_STATIC) 45 | SET(GSL_LIBRARY ${GSL_LIBRARY}) 46 | ELSE(QMC_BUILD_STATIC) 47 | SET(GSL_LIBRARY ${GSL_LIBRARY} -lgslcblas) 48 | ENDIF(QMC_BUILD_STATIC) 49 | MESSAGE(STATUS "GSL_INCLUDE_DIR=${GSL_INCLUDE_DIR}") 50 | MESSAGE(STATUS "GSL_LIBRARY=${GSL_LIBRARY}") 51 | ELSE(GSL_INCLUDE_DIR AND GSL_LIBRARY) 52 | MESSAGE(STATUS "Did not find GSL Library") 53 | SET(GSL_FOUND 0 CACHE BOOL "Not found gsl library") 54 | ENDIF(GSL_INCLUDE_DIR AND GSL_LIBRARY) 55 | 56 | MARK_AS_ADVANCED( 57 | GSL_INCLUDE_DIR 58 | GSL_LIBRARY 59 | GSL_FOUND 60 | ) 61 | -------------------------------------------------------------------------------- /CMake/FindHDF5.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # this module look for HDF5 (http://hdf.ncsa.uiuc.edu) support 3 | # it will define the following values 4 | # 5 | # HDF5_INCLUDE_DIR = where hdf5.h can be found 6 | # HDF5_LIBRARY = the library to link against (hdf5 etc) 7 | # HDF5_FOUND = set to true after finding the library 8 | # 9 | 10 | set(Libhdf5 hdf5) 11 | # IF(BUILD_STATIC) 12 | # set(Libhdf5 libhdf5.a) 13 | # ENDIF(BUILD_STATIC) 14 | 15 | IF(EXISTS ${PROJECT_CMAKE}/Hdf5Config.cmake) 16 | INCLUDE(${PROJECT_CMAKE}/Hdf5Config.cmake) 17 | ENDIF(EXISTS ${PROJECT_CMAKE}/Hdf5Config.cmake) 18 | 19 | IF(Hdf5_INCLUDE_DIRS) 20 | 21 | FIND_PATH(HDF5_INCLUDE_DIR hdf5.h ${Hdf5_INCLUDE_DIRS}) 22 | FIND_LIBRARY(HDF5_LIBRARY ${Libhdf5} ${Hdf5_LIBRARY_DIRS}) 23 | 24 | ELSE(Hdf5_INCLUDE_DIRS) 25 | 26 | FIND_PATH(HDF5_INCLUDE_DIR hdf5.h ${HDF5_HOME}/include $ENV{HDF5_HOME}/include) 27 | FIND_LIBRARY(HDF5_LIBRARIES ${Libhdf5} ${HDF5_HOME}/lib $ENV{HDF5_HOME}/lib) 28 | 29 | ENDIF(Hdf5_INCLUDE_DIRS) 30 | 31 | IF(HDF5_INCLUDE_DIR AND HDF5_LIBRARIES) 32 | MESSAGE(STATUS "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") 33 | MESSAGE(STATUS "HDF5_LIBRARIES=${HDF5_LIBRARIES}") 34 | SET(HDF5_FOUND TRUE) 35 | ELSE(HDF5_INCLUDE_DIR AND HDF5_LIBRARIES) 36 | SET(HDF5_FOUND FALSE) 37 | ENDIF(HDF5_INCLUDE_DIR AND HDF5_LIBRARIES) 38 | 39 | MARK_AS_ADVANCED( 40 | HDF5_INCLUDE_DIR 41 | HDF5_LIBRARIES 42 | HDF5_FOUND 43 | ) 44 | -------------------------------------------------------------------------------- /CMake/FindSPRNG.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # this module look for SPRNG (http://hdf.ncsa.uiuc.edu) support 3 | # it will define the following values 4 | # 5 | # SPRNG_INCLUDE_PATH = where sprng.h can be found 6 | # SPRNG_LIBRARY = the library to link against (sprng etc) 7 | # 8 | 9 | SET(TRIAL_LIBRARY_PATHS 10 | /usr/local/lib 11 | /sw/lib 12 | ${CMAKE_SOURCE_DIR}/lib 13 | $ENV{SPRNG_HOME}/lib 14 | ) 15 | 16 | SET(TRIAL_INCLUDE_PATHS 17 | /usr/local/include 18 | /sw/include 19 | ${CMAKE_SOURCE_DIR}/include 20 | $ENV{SPRNG_HOME}/include 21 | ) 22 | 23 | FIND_LIBRARY(SPRNG_LIBRARY sprng ${TRIAL_LIBRARY_PATHS}) 24 | FIND_PATH(SPRNG_INCLUDE_DIR sprng.h ${TRIAL_INCLUDE_PATHS}) 25 | 26 | IF(SPRNG_INCLUDE_DIR AND SPRNG_LIBRARY) 27 | SET(SPRNG_FOUND 1 CACHE BOOL "Found sprng library") 28 | MESSAGE(STATUS "SPRNG_INCLUDE_DIR=${SPRNG_INCLUDE_DIR}") 29 | MESSAGE(STATUS "SPRNG_LIBRARY=${SPRNG_LIBRARY}") 30 | ELSE(SPRNG_INCLUDE_DIR AND SPRNG_LIBRARY) 31 | SET(SPRNG_FOUND 0 CACHE BOOL "Not found sprng library") 32 | ENDIF(SPRNG_INCLUDE_DIR AND SPRNG_LIBRARY) 33 | 34 | MARK_AS_ADVANCED( 35 | SPRNG_INCLUDE_DIR 36 | SPRNG_LIBRARY 37 | SPRNG_FOUND 38 | ) 39 | -------------------------------------------------------------------------------- /CMake/cmakecommand: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | cd build 3 | module load intel mkl openmpi-intel 4 | setenv BLITZ_HOME /usr/gapps/qmc/pimc++ 5 | setenv SPRNG_HOME /usr/gapps/qmc/pimc++ 6 | setenv MKL_HOME /usr/local/tools/mkl-11.0.0 7 | 8 | cmake -DCMAKE_CXX_COMPILER=/opt/openmpi-1.6-intel/bin/mpic++ -DCMAKE_C_COMPILER=/opt/openmpi-1.6-intel/bin/mpicc -DCMAKE_Fortran_COMPILER=/opt/openmpi-1.6-intel/bin/mpif77 .. 9 | make -j 16 10 | 11 | cd .. 12 | chown -R :qmc * >& /dev/null 13 | chmod -R 0770 * >& /dev/null 14 | -------------------------------------------------------------------------------- /Examples/ElectronGas/data/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkclark/pimcpp/83a6fd7f81cf80f192bd5d0eae3dff0259b02291/Examples/ElectronGas/data/.placeholder -------------------------------------------------------------------------------- /Examples/ElectronGas/inputs/heg-4.0-1.0-1-33-64-64.sq.PairAction: -------------------------------------------------------------------------------- 1 | Section (Fits) 2 | { 3 | string Type="DavidFit"; 4 | int NumOffDiagonalTerms = 3; 5 | Section (Particle1) 6 | { 7 | string Name = "e"; 8 | double lambda =0.0625; 9 | int Ndim = 3; 10 | } 11 | Section (Particle2) 12 | { 13 | string Name = "e"; 14 | double lambda =0.0625; 15 | int Ndim = 3; 16 | } 17 | string Daviddmfile = "inputs/heg-4.0-1.0-1-33-64-64.sq.h5"; 18 | } -------------------------------------------------------------------------------- /Examples/ElectronGas/inputs/heg-4.0-1.0-1-33-64-64.sq.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkclark/pimcpp/83a6fd7f81cf80f192bd5d0eae3dff0259b02291/Examples/ElectronGas/inputs/heg-4.0-1.0-1-33-64-64.sq.h5 -------------------------------------------------------------------------------- /Examples/ElectronGas/inputs/heg-4.0-1.0-1-33-64-64.sq.in: -------------------------------------------------------------------------------- 1 | UNITS r a 2 | TYPE e 0.062500 3 | TYPE e 0.062500 4 | GRID 450 LOG 0.0001 5.170520 5 | SQUARER 23.386663 1 3 3 30 14 6 | POT COULOPT 2.533564 4.860777 0.500000 3 0.D0 1.0 5.17051953218 5.17051953218 5.17051953218 7 | -------------------------------------------------------------------------------- /Examples/ElectronGas/inputs/heg-4.0-1.0-1-33-64-64.sq.vk: -------------------------------------------------------------------------------- 1 | RANK 1 15 2 | BEGIN k-space potential 3 | -1.12147770688591150E-002 2.12660366817814077E-002 7.26133214091426171E-003 3.26386821270148973E-003 1.62721392288058160E-003 8.51735617650977404E-004 4.56177913248490170E-004 1.32530704962638673E-004 7.04927925580384196E-005 3.67325453112287217E-005 1.85683192191051991E-005 8.99213668222390017E-006 4.09710685322049739E-006 1.70502185208899759E-006 1.61511343917553757E-007 4 | -------------------------------------------------------------------------------- /Examples/ElectronGas/inputs/heg-4.0-1.0-1-33-64.ins: -------------------------------------------------------------------------------- 1 | heg-4.0-1.0-1-33-64.in 1 2 | -------------------------------------------------------------------------------- /Examples/ElectronGas/outputs/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkclark/pimcpp/83a6fd7f81cf80f192bd5d0eae3dff0259b02291/Examples/ElectronGas/outputs/.placeholder -------------------------------------------------------------------------------- /Examples/ElectronGas/rawdata/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkclark/pimcpp/83a6fd7f81cf80f192bd5d0eae3dff0259b02291/Examples/ElectronGas/rawdata/.placeholder -------------------------------------------------------------------------------- /Examples/ElectronGas/scripts/gen-heg-inputs.py: -------------------------------------------------------------------------------- 1 | import HEGInput as hi 2 | 3 | prefix = 'heg' 4 | Ns = [33] 5 | D = 3 6 | rss = [4.0] 7 | ts = [1.0] 8 | pols = [1] 9 | nMax = 4 10 | nTemp = 1 11 | RefToTF = 1.0 12 | RefMs = { 4.0:64 } 13 | MinM = 16 14 | ParticleType = 1 # 2 - boltzmannon, 1 - fermion, 0 - boson 15 | TrackSign = 0 16 | restart = 0 17 | PPC = 1 18 | PPNODE = 16 19 | 20 | for N in Ns: 21 | for rs in rss: 22 | for t in ts: 23 | for pol in pols: 24 | RefM = RefMs[rs] 25 | hi.main(['nada',prefix,N,D,rs,t,pol,nMax,nTemp,RefToTF,RefM,MinM,ParticleType,TrackSign,restart,PPC,PPNODE]) 26 | -------------------------------------------------------------------------------- /Examples/Hydrogen/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.btr 3 | rawdata/ 4 | outputs/ 5 | -------------------------------------------------------------------------------- /Examples/Hydrogen/inputs/e-e.sq.PairAction: -------------------------------------------------------------------------------- 1 | Section (Fits) 2 | { 3 | string Type="DavidFit"; 4 | int NumOffDiagonalTerms = 3; 5 | Section (Particle1) 6 | { 7 | string Name = "e"; 8 | double lambda =0.5; 9 | int Ndim = 3; 10 | } 11 | Section (Particle2) 12 | { 13 | string Name = "e"; 14 | double lambda =0.5; 15 | int Ndim = 3; 16 | } 17 | string Daviddmfile = "inputs/e-e.sq.h5"; 18 | } 19 | -------------------------------------------------------------------------------- /Examples/Hydrogen/inputs/e-e.sq.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkclark/pimcpp/83a6fd7f81cf80f192bd5d0eae3dff0259b02291/Examples/Hydrogen/inputs/e-e.sq.h5 -------------------------------------------------------------------------------- /Examples/Hydrogen/inputs/e-e.sq.in: -------------------------------------------------------------------------------- 1 | UNITS H A 2 | TYPE e 0.500000 3 | TYPE e 0.500000 4 | GRID 100 LOG 0.000100 17.320508 5 | SQUARER 8.000000 1 3 3 30 14 6 | POT COUL 17.320508 1.000000 0.D0 7 | -------------------------------------------------------------------------------- /Examples/Hydrogen/inputs/e-e.sq.potential.dat: -------------------------------------------------------------------------------- 1 | 10000.0 2 | 8852.893633 3 | 7837.372567 4 | 6938.342569 5 | 6142.440875 6 | 5437.837571 7 | 4814.059761 8 | 4261.835901 9 | 3772.957991 10 | 3340.159577 11 | 2957.007745 12 | 2617.807504 13 | 2317.517138 14 | 2051.673272 15 | 1816.324524 16 | 1607.972782 17 | 1423.5212 18 | 1260.228177 19 | 1115.6666 20 | 987.687774 21 | 874.3894806 22 | 774.0877065 23 | 685.2916128 24 | 606.6813755 25 | 537.0885686 26 | 475.4787969 27 | 420.9363214 28 | 372.6504479 29 | 329.9034778 30 | 292.0600398 31 | 258.5576466 32 | 228.8983344 33 | 202.6412607 34 | 179.3961526 35 | 158.8175057 36 | 140.5994485 37 | 124.4711963 38 | 110.1930261 39 | 97.5527139 40 | 86.36237997 41 | 76.45569637 42 | 67.68541476 43 | 59.92117773 44 | 53.04758128 45 | 46.96245946 46 | 41.57536583 47 | 36.80622914 48 | 32.58416316 49 | 28.84641306 50 | 25.53742265 51 | 22.60800863 52 | 20.01462957 53 | 17.71873867 54 | 15.68621087 55 | 13.88683563 56 | 12.29386788 57 | 10.88363046 58 | 9.635162284 59 | 8.529906683 60 | 7.551435656 61 | 6.685205664 62 | 5.918341465 63 | 5.239444747 64 | 4.638424704 65 | 4.106348053 66 | 3.635306253 67 | 3.218297958 68 | 2.84912495 69 | 2.522300013 70 | 2.232965372 71 | 1.976820493 72 | 1.750058155 73 | 1.54930787 74 | 1.371585778 75 | 1.2142503 76 | 1.074962875 77 | 0.9516531989 78 | 0.8424884545 79 | 0.7458460674 80 | 0.6602895901 81 | 0.5845473508 82 | 0.517493552 83 | 0.4581315371 84 | 0.4055789768 85 | 0.3590547541 86 | 0.3178673546 87 | 0.281404588 88 | 0.2491244885 89 | 0.2205472598 90 | 0.1952481432 91 | 0.1728511044 92 | 0.1530232441 93 | 0.1354698504 94 | 0.1199300176 95 | 0.1061727689 96 | 0.09399362296 97 | 0.08321155462 98 | 0.07366630421 99 | 0.06521599555 100 | 0.05773502717 101 | -------------------------------------------------------------------------------- /Examples/Hydrogen/inputs/e-p.sq.PairAction: -------------------------------------------------------------------------------- 1 | Section (Fits) 2 | { 3 | string Type="DavidFit"; 4 | int NumOffDiagonalTerms = 3; 5 | Section (Particle1) 6 | { 7 | string Name = "e"; 8 | double lambda =0.5; 9 | int Ndim = 3; 10 | } 11 | Section (Particle2) 12 | { 13 | string Name = "p"; 14 | double lambda =0.000272308907224; 15 | int Ndim = 3; 16 | } 17 | string Daviddmfile = "inputs/e-p.sq.h5"; 18 | } 19 | -------------------------------------------------------------------------------- /Examples/Hydrogen/inputs/e-p.sq.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkclark/pimcpp/83a6fd7f81cf80f192bd5d0eae3dff0259b02291/Examples/Hydrogen/inputs/e-p.sq.h5 -------------------------------------------------------------------------------- /Examples/Hydrogen/inputs/e-p.sq.in: -------------------------------------------------------------------------------- 1 | UNITS H A 2 | TYPE e 0.500000 3 | TYPE p 0.000272 4 | GRID 100 LOG 0.000100 17.320508 5 | SQUARER 8.000000 1 3 3 30 14 6 | POT COUL 17.320508 -1.000000 0.D0 7 | -------------------------------------------------------------------------------- /Examples/Hydrogen/inputs/e-p.sq.potential.dat: -------------------------------------------------------------------------------- 1 | -10000.0 2 | -8852.893633 3 | -7837.372567 4 | -6938.342569 5 | -6142.440875 6 | -5437.837571 7 | -4814.059761 8 | -4261.835901 9 | -3772.957991 10 | -3340.159577 11 | -2957.007745 12 | -2617.807504 13 | -2317.517138 14 | -2051.673272 15 | -1816.324524 16 | -1607.972782 17 | -1423.5212 18 | -1260.228177 19 | -1115.6666 20 | -987.687774 21 | -874.3894806 22 | -774.0877065 23 | -685.2916128 24 | -606.6813755 25 | -537.0885686 26 | -475.4787969 27 | -420.9363214 28 | -372.6504479 29 | -329.9034778 30 | -292.0600398 31 | -258.5576466 32 | -228.8983344 33 | -202.6412607 34 | -179.3961526 35 | -158.8175057 36 | -140.5994485 37 | -124.4711963 38 | -110.1930261 39 | -97.5527139 40 | -86.36237997 41 | -76.45569637 42 | -67.68541476 43 | -59.92117773 44 | -53.04758128 45 | -46.96245946 46 | -41.57536583 47 | -36.80622914 48 | -32.58416316 49 | -28.84641306 50 | -25.53742265 51 | -22.60800863 52 | -20.01462957 53 | -17.71873867 54 | -15.68621087 55 | -13.88683563 56 | -12.29386788 57 | -10.88363046 58 | -9.635162284 59 | -8.529906683 60 | -7.551435656 61 | -6.685205664 62 | -5.918341465 63 | -5.239444747 64 | -4.638424704 65 | -4.106348053 66 | -3.635306253 67 | -3.218297958 68 | -2.84912495 69 | -2.522300013 70 | -2.232965372 71 | -1.976820493 72 | -1.750058155 73 | -1.54930787 74 | -1.371585778 75 | -1.2142503 76 | -1.074962875 77 | -0.9516531989 78 | -0.8424884545 79 | -0.7458460674 80 | -0.6602895901 81 | -0.5845473508 82 | -0.517493552 83 | -0.4581315371 84 | -0.4055789768 85 | -0.3590547541 86 | -0.3178673546 87 | -0.281404588 88 | -0.2491244885 89 | -0.2205472598 90 | -0.1952481432 91 | -0.1728511044 92 | -0.1530232441 93 | -0.1354698504 94 | -0.1199300176 95 | -0.1061727689 96 | -0.09399362296 97 | -0.08321155462 98 | -0.07366630421 99 | -0.06521599555 100 | -0.05773502717 101 | -------------------------------------------------------------------------------- /Examples/Hydrogen/inputs/p-p.sq.PairAction: -------------------------------------------------------------------------------- 1 | Section (Fits) 2 | { 3 | string Type="DavidFit"; 4 | int NumOffDiagonalTerms = 3; 5 | Section (Particle1) 6 | { 7 | string Name = "p"; 8 | double lambda =0.5; 9 | int Ndim = 3; 10 | } 11 | Section (Particle2) 12 | { 13 | string Name = "p"; 14 | double lambda =0.5; 15 | int Ndim = 3; 16 | } 17 | string Daviddmfile = "inputs/p-p.sq.h5"; 18 | } 19 | -------------------------------------------------------------------------------- /Examples/Hydrogen/inputs/p-p.sq.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkclark/pimcpp/83a6fd7f81cf80f192bd5d0eae3dff0259b02291/Examples/Hydrogen/inputs/p-p.sq.h5 -------------------------------------------------------------------------------- /Examples/Hydrogen/inputs/p-p.sq.in: -------------------------------------------------------------------------------- 1 | UNITS H A 2 | TYPE p 0.000272 3 | TYPE p 0.000272 4 | GRID 100 LOG 0.000100 17.320508 5 | SQUARER 8.000000 1 3 3 30 14 6 | POT COUL 17.320508 1.000000 0.D0 7 | -------------------------------------------------------------------------------- /Examples/Hydrogen/inputs/p-p.sq.potential.dat: -------------------------------------------------------------------------------- 1 | 10000.0 2 | 8852.893633 3 | 7837.372567 4 | 6938.342569 5 | 6142.440875 6 | 5437.837571 7 | 4814.059761 8 | 4261.835901 9 | 3772.957991 10 | 3340.159577 11 | 2957.007745 12 | 2617.807504 13 | 2317.517138 14 | 2051.673272 15 | 1816.324524 16 | 1607.972782 17 | 1423.5212 18 | 1260.228177 19 | 1115.6666 20 | 987.687774 21 | 874.3894806 22 | 774.0877065 23 | 685.2916128 24 | 606.6813755 25 | 537.0885686 26 | 475.4787969 27 | 420.9363214 28 | 372.6504479 29 | 329.9034778 30 | 292.0600398 31 | 258.5576466 32 | 228.8983344 33 | 202.6412607 34 | 179.3961526 35 | 158.8175057 36 | 140.5994485 37 | 124.4711963 38 | 110.1930261 39 | 97.5527139 40 | 86.36237997 41 | 76.45569637 42 | 67.68541476 43 | 59.92117773 44 | 53.04758128 45 | 46.96245946 46 | 41.57536583 47 | 36.80622914 48 | 32.58416316 49 | 28.84641306 50 | 25.53742265 51 | 22.60800863 52 | 20.01462957 53 | 17.71873867 54 | 15.68621087 55 | 13.88683563 56 | 12.29386788 57 | 10.88363046 58 | 9.635162284 59 | 8.529906683 60 | 7.551435656 61 | 6.685205664 62 | 5.918341465 63 | 5.239444747 64 | 4.638424704 65 | 4.106348053 66 | 3.635306253 67 | 3.218297958 68 | 2.84912495 69 | 2.522300013 70 | 2.232965372 71 | 1.976820493 72 | 1.750058155 73 | 1.54930787 74 | 1.371585778 75 | 1.2142503 76 | 1.074962875 77 | 0.9516531989 78 | 0.8424884545 79 | 0.7458460674 80 | 0.6602895901 81 | 0.5845473508 82 | 0.517493552 83 | 0.4581315371 84 | 0.4055789768 85 | 0.3590547541 86 | 0.3178673546 87 | 0.281404588 88 | 0.2491244885 89 | 0.2205472598 90 | 0.1952481432 91 | 0.1728511044 92 | 0.1530232441 93 | 0.1354698504 94 | 0.1199300176 95 | 0.1061727689 96 | 0.09399362296 97 | 0.08321155462 98 | 0.07366630421 99 | 0.06521599555 100 | 0.05773502717 101 | -------------------------------------------------------------------------------- /Examples/Hydrogen/jobs/job.sub: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #PSUB -o outputs/job.out 3 | #PSUB -ro 4 | #PSUB -re 5 | #PSUB -ln 2 6 | #PSUB -gres ignore 7 | #PSUB -tM 01:00 8 | #PSUB -b fraqsa 9 | source ${HOME}/modules.sh 10 | OMP_NUM_THREADS=1 11 | export OMP_NUM_THREADS 12 | WORK_HOME=/p/lscratchb/brown281/Hatom 13 | cd $WORK_HOME 14 | mpirun -np 32 pimc++ inputs/H.in &> outputs/H.out 15 | -------------------------------------------------------------------------------- /Examples/ParticleInABox/ParticleInABox.in: -------------------------------------------------------------------------------- 1 | // This is an input for an electron in a 3D box with L=10A at T=1K. 2 | 3 | Section (Output) 4 | { 5 | string OutFileBase = "ParticleInABox"; 6 | } 7 | 8 | Section (Parallel) 9 | { 10 | int ProcsPerClone = 1; 11 | } 12 | 13 | Section (System) 14 | { 15 | double tau = 0.05; 16 | int NumTimeSlices = 20; 17 | Array Box(3) = [10.0,10.0,10.0]; 18 | Array IsPeriodic(3) = [true,true,true]; 19 | Section (Particles) 20 | { 21 | Section (Species) 22 | { 23 | string Name = "free"; 24 | string Type = "free"; 25 | double lambda = 1.0; 26 | string Statistics = "BOLTZMANNON"; 27 | int NumParticles = 1; 28 | int NumDim = 3; 29 | string InitPaths = "BCC"; 30 | } 31 | } 32 | } 33 | 34 | Section (Actions) 35 | { 36 | int NumImages = 1; 37 | int MaxLevels = 3; 38 | Array PairActionFiles(1) = ["zero.PairAction"]; 39 | } 40 | 41 | Section (Observables) 42 | { 43 | Section (Observable) 44 | { 45 | string Type = "Energy"; 46 | string Name = "Energy"; 47 | string Description = "Total Energy"; 48 | int Frequency = 1; 49 | } 50 | 51 | Section (Observable) 52 | { 53 | string Type = "TimeAnalysis"; 54 | string Name = "TimeAnalysis"; 55 | int Frequency = 1; 56 | } 57 | 58 | } 59 | 60 | Section (Moves) 61 | { 62 | 63 | Section (Move) 64 | { 65 | string Type = "BisectionBlock"; 66 | string Name = "BisectionBlock"; 67 | string PermuteType = "NONE"; 68 | string Species = "free"; 69 | int NumLevels = 3; 70 | int StepsPerBlock = 1; 71 | } 72 | 73 | Section (Move) 74 | { 75 | string Type = "ShiftMove"; 76 | string Name = "Shift"; 77 | } 78 | 79 | } 80 | 81 | Section (Algorithm) 82 | { 83 | 84 | Section (Loop){ 85 | int Steps = 100; 86 | 87 | Section (Loop){ 88 | int Steps = 100000; 89 | 90 | Section (Move) {string Name = "BisectionBlock";} 91 | Section (Observe) {string Name = "Energy";} 92 | Section (Observe) {string Name = "TimeAnalysis";} 93 | Section (Move) {string Name = "Shift";} 94 | } 95 | Section (WriteData){} 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /Examples/ParticleInABox/zero.PairAction: -------------------------------------------------------------------------------- 1 | Section (Fits) 2 | { 3 | string Type = "zerofit"; 4 | 5 | Section (Particle1) 6 | { 7 | string Name = "e"; 8 | double lambda = 1.0; 9 | int Ndim = 3; 10 | } 11 | 12 | Section (Particle2) 13 | { 14 | string Name = "e"; 15 | double lambda = 1.0; 16 | int Ndim = 3; 17 | } 18 | 19 | Section (Potential) 20 | { 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Examples/SimpleHarmonicOscillator/zero.PairAction: -------------------------------------------------------------------------------- 1 | Section (Fits) 2 | { 3 | string Type = "zerofit"; 4 | 5 | Section (Particle1) 6 | { 7 | string Name = "e"; 8 | double lambda = 1.0; 9 | int Ndim = 3; 10 | } 11 | 12 | Section (Particle2) 13 | { 14 | string Name = "e"; 15 | double lambda = 1.0; 16 | int Ndim = 3; 17 | } 18 | 19 | Section (Potential) 20 | { 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PIMC++ 2 | 3 | PIMC++ is a code designed to perform fully-correlated simulations of quantum systems in continuous space at finite temperature using Path Integral Monte Carlo. 4 | Written in object-oriented C++, it is designed in a modular way to facilitate easy addition of new methods, observables, moves and techniques. 5 | 6 | Computational quantum mechanics involves the use of complicated algorithms and sophisticated codes to calculate properties of quantum systems. In many situations, 7 | people end up reinventing the wheel by reimplementing algorithms or techniques that already are in existing codes. 8 | PIMC++ is designed to alleviate this problem. It is designed to be sufficiently general to be of use for a wide variety 9 | of Path Integral calculations, optimized for high performance calculations (both in terms of speed and parallelization) 10 | to allow for quick results, and written in an object oriented way to facillitate fast prototyping and addition of 11 | new algorithms and techniques. The goal is for this to become a community-wide code that speeds up the rate of research 12 | and that PIMC++ will grow from through the contributions of the community. 13 | 14 | ## Requirements 15 | 16 | * [FFTW3](https://github.com/FFTW/fftw3) 17 | * [HDF5](http://www.hdfgroup.org/HDF5/) 18 | * [GSL](http://www.gnu.org/software/gsl/) 19 | * [SPRNG](http://www.sprng.org/) 20 | * [Blitz++](http://sourceforge.net/projects/blitz/) 21 | * [CMake](http://www.cmake.org/) 22 | 23 | ## Installation 24 | 25 | * Set the environmental variables to point to the respective installation directories: 26 | `FFTW_HOME`,`HDF5_HOME`, `GSL_HOME`, `SPRNG_HOME`, `BLITZ_HOME` 27 | * Adjust the CMakeLists.txt file to fit the machine and compilers you are using. 28 | * Run `mkdir build && cd build && cmake ..`. 29 | * Run `make` (use `-j` for distributed compiling if possible). Built libraries are put in `$PROJECTDIR/bin/`. 30 | 31 | ## Running 32 | 33 | Basic execution is done very simply by `pimc++ InputFile.in`. 34 | 35 | ## Further information 36 | 37 | For help on any subject (including creating input files), please see the [documentation](http://etano.github.io/pimcpp). 38 | 39 | 40 | -------------------------------------------------------------------------------- /Scripts/C-input.py: -------------------------------------------------------------------------------- 1 | import genDM 2 | 3 | ###### Inputs ###### 4 | 5 | ## Hydrogen Atom 6 | unit1 = 'H' # energy unit 7 | unit2 = 'a0' # length unit 8 | tau = 0.125 # time step 9 | pairs = [['e','e',0.5,0.5,1.0],['e','c',0.5,0.00002285749742,-6.0],['c','c',0.0002723089072243553,0.00002285749742,36.0]] 10 | suffix = '' # suffix to input files 11 | 12 | ## Potgen 13 | OurEwald = False # use our Ken's ewald (True) or David's (False) 14 | nGrid = 100 # number of grid points 15 | rMin = 0.0004 # first grid point 16 | L = 100.0 # length of box 17 | breakup = 2 # 2 - Short-ranged only, 1 - Optimized breakup, 0 - Classical Ewald breakup 18 | rCut = 10. # r cutoff for ewald 19 | nCut = 4 # n cutoff for ewald (kCut = nCut*2.0*math.pi/L) 20 | gridType = "LOG" # LOG/LINEAR 21 | 22 | ## Squarer 23 | nTemp = 1 # number of temperatures at which to compute the density matrix (must be <= 8) 24 | D = 3 # dimension 25 | 26 | ## Run through pairs 27 | for [type1,type2,lam1,lam2,Z1Z2] in pairs: 28 | genDM.GenDM(suffix,unit1,unit2,type1,type2,lam1,lam2,Z1Z2,L,D,tau,gridType,nGrid,rMin,rCut,nCut,nTemp,breakup,OurEwald) 29 | -------------------------------------------------------------------------------- /Scripts/Cusp.py: -------------------------------------------------------------------------------- 1 | 2 | tau = 0.125 3 | lam = 1.0 4 | Z1Z2 = 1.0 5 | gam = tau*(Z1Z2*Z1Z2)/lam 6 | 7 | P = [1.772453851,-0.074137740,0.005834805,-0.000382686,0.000008738,0.000002138,-0.000000356,0.000000021] 8 | 9 | u00 = 0. 10 | for j in range(1,len(P)+1): 11 | u00 += ((1)**j) * P[j-1] * (gam**(j/2.)) 12 | print u00 13 | #print u00/tau 14 | 15 | #du00 = -Z1Z2/lam 16 | #print du00 17 | # 18 | #from scipy.misc import factorial, comb 19 | #from scipy.special import zeta 20 | # 21 | #def kappa(n): 22 | # tot = mu(n) 23 | # for m in range(1,n): 24 | # tot -= comb(n-1,m-1)*kappa(m)*mu(n-m) 25 | # return tot 26 | # 27 | #def mu(n): 28 | # if(n % 2 == 0): 29 | # return (((-1)**n)/factorial(n,exact=1)) * factorial(n/2.,exact=1) * zeta(n+2,1) 30 | # else: 31 | # 32 | # return (((-1)**n)/factorial(n,exact=1)) * factorial(n/2.,exact=1) * zeta(n+2,1) 33 | # 34 | #print kappa(1) 35 | -------------------------------------------------------------------------------- /Scripts/Energy.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import numpy as np 3 | import h5py as h5 4 | import Stats 5 | 6 | StartCut = int(sys.argv[1]) 7 | suffix = sys.argv[2] 8 | 9 | ENames = ['Kinetic','Node','dUExt','dULong','dUShort','ShortRange','VShort','DavidLongRange','VLong','Total'] 10 | EStats = {} 11 | for fname in sys.argv[3:]: 12 | f = h5.File(fname,'r') 13 | 14 | for EName in ENames: 15 | try: 16 | Es = np.array(f['Observables/Energy/'+EName][StartCut:]) 17 | try: 18 | EStats[EName].append(Stats.stats(Es)) 19 | except: 20 | EStats[EName] = [Stats.stats(Es)] 21 | except: 22 | pass 23 | 24 | f = open('Energy-'+suffix+'.dat','w') 25 | for EName in ENames: 26 | try: 27 | TotStats = Stats.UnweightedAvg(EStats[EName]) 28 | print EName, TotStats 29 | f.write('%s %f %f %f %f\n'%(EName, TotStats[0], TotStats[1], TotStats[2], TotStats[3])) 30 | except: 31 | pass 32 | f.close() 33 | 34 | -------------------------------------------------------------------------------- /Scripts/H-box-input.py: -------------------------------------------------------------------------------- 1 | import genDM 2 | 3 | ###### Inputs ###### 4 | 5 | ## Hydrogen Atom 6 | unit1 = 'H' # energy unit 7 | unit2 = 'a0' # length unit 8 | tau = 0.125 # time step 9 | pairs = [['e','e',0.5,0.5,1.0],['e','p',0.5,0.0002723089072243553,-1.0],['p','p',0.0002723089072243553,0.0002723089072243553,1.0]] 10 | suffix = '' # suffix to input files 11 | 12 | ## Potgen 13 | OurEwald = False # use our Ken's ewald (True) or David's (False) 14 | nGrid = 100 # number of grid points 15 | rMin = 0.0004 # first grid point 16 | L = 10.0 # length of box 17 | breakup = 1 # 2 - Short-ranged only, 1 - Optimized breakup, 0 - Classical Ewald breakup 18 | rCut = 5. # r cutoff for ewald 19 | nCut = 4 # n cutoff for ewald (kCut = nCut*2.0*math.pi/L) 20 | gridType = "LINEAR" # LOG/LINEAR 21 | 22 | ## Squarer 23 | nTemp = 1 # number of temperatures at which to compute the density matrix (must be <= 8) 24 | D = 3 # dimension 25 | 26 | ## Run through pairs 27 | for [type1,type2,lam1,lam2,Z1Z2] in pairs: 28 | genDM.GenDM(suffix,unit1,unit2,type1,type2,lam1,lam2,Z1Z2,L,D,tau,gridType,nGrid,rMin,rCut,nCut,nTemp,breakup,OurEwald) 29 | -------------------------------------------------------------------------------- /Scripts/H-input.py: -------------------------------------------------------------------------------- 1 | import genDM 2 | 3 | ###### Inputs ###### 4 | 5 | ## Hydrogen Atom 6 | unit1 = 'H' # energy unit 7 | unit2 = 'a0' # length unit 8 | tau = 0.125 # time step 9 | pairs = [['e','e',0.5,0.5,1.0],['e','p',0.5,0.0002723089072243553,-1.0],['p','p',0.0002723089072243553,0.0002723089072243553,1.0]] 10 | suffix = '' # suffix to input files 11 | 12 | ## Potgen 13 | OurEwald = False # use our Ken's ewald (True) or David's (False) 14 | nGrid = 100 # number of grid points 15 | rMin = 0.0001 # first grid point 16 | L = 100.0 # length of box 17 | breakup = 2 # 2 - Short-ranged only, 1 - Optimized breakup, 0 - Classical Ewald breakup 18 | rCut = 17.32 # r cutoff for ewald 19 | nCut = 4 # n cutoff for ewald (kCut = nCut*2.0*math.pi/L) 20 | gridType = "LOG" # LOG/LINEAR 21 | 22 | ## Squarer 23 | nTemp = 1 # number of temperatures at which to compute the density matrix (must be <= 8) 24 | D = 3 # dimension 25 | 26 | ## Run through pairs 27 | for [type1,type2,lam1,lam2,Z1Z2] in pairs: 28 | genDM.GenDM(suffix,unit1,unit2,type1,type2,lam1,lam2,Z1Z2,L,D,tau,gridType,nGrid,rMin,rCut,nCut,nTemp,breakup,OurEwald) 29 | -------------------------------------------------------------------------------- /Scripts/Li-input.py: -------------------------------------------------------------------------------- 1 | import genDM 2 | 3 | ###### Inputs ###### 4 | 5 | ## Hydrogen Atom 6 | unit1 = 'H' # energy unit 7 | unit2 = 'a0' # length unit 8 | tau = 0.125 # time step 9 | pairs = [['e','e',0.5,0.5,1.0],['e','li',0.5,0.00003951745348,-3.0],['li','li',0.00003951745348,0.00003951745348,9.0]] 10 | suffix = '' # suffix to input files 11 | 12 | ## Potgen 13 | OurEwald = False # use our Ken's ewald (True) or David's (False) 14 | nGrid = 100 # number of grid points 15 | rMin = 0.0004 # first grid point 16 | L = 100.0 # length of box 17 | breakup = 2 # 2 - Short-ranged only, 1 - Optimized breakup, 0 - Classical Ewald breakup 18 | rCut = 10. # r cutoff for ewald 19 | nCut = 4 # n cutoff for ewald (kCut = nCut*2.0*math.pi/L) 20 | gridType = "LOG" # LOG/LINEAR 21 | 22 | ## Squarer 23 | nTemp = 1 # number of temperatures at which to compute the density matrix (must be <= 8) 24 | D = 3 # dimension 25 | 26 | ## Run through pairs 27 | for [type1,type2,lam1,lam2,Z1Z2] in pairs: 28 | genDM.GenDM(suffix,unit1,unit2,type1,type2,lam1,lam2,Z1Z2,L,D,tau,gridType,nGrid,rMin,rCut,nCut,nTemp,breakup,OurEwald) 29 | -------------------------------------------------------------------------------- /Scripts/MPIClass.py: -------------------------------------------------------------------------------- 1 | class MPI: 2 | def __init__(self, UseMPI): 3 | self.UseMPI = UseMPI 4 | if UseMPI: 5 | import mpi 6 | self.mpiLib = mpi 7 | self.rank = mpi.rank 8 | self.size = mpi.size 9 | else: 10 | self.mpiLib = None 11 | self.rank = 0 12 | self.size = 1 13 | 14 | def barrier(self): 15 | if self.UseMPI: 16 | self.mpiLib.barrier() 17 | 18 | def allgather(self, a): 19 | if self.UseMPI: 20 | return self.mpiLib.allgather(a) 21 | else: 22 | return a 23 | -------------------------------------------------------------------------------- /Scripts/SHO.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | from math import asinh,sinh,tanh 4 | 5 | def wt(t,w): 6 | return (2./t)*asinh(w*t/2.) 7 | 8 | def z0(B,t,w,d): 9 | return (1./(2.*sinh(B*wt(t,w)/2.)))**(d) 10 | 11 | def dz0(B,t,w,d): 12 | return -(wt(t,w)*d/2.)*(1./tanh(B*wt(t,w)/2.))*z0(B,t,w,d) 13 | 14 | def z(N,B,t,w,d,Fermi=0): 15 | if N == 0: 16 | return 1. 17 | else: 18 | tot = 0. 19 | for n in range(1,N+1): 20 | tot += ((-1)**((n-1)*Fermi)) * z0(n*B,t,w,d) * z(N-n,B,t,w,d,Fermi) 21 | return tot/N 22 | 23 | def dz(N,B,t,w,d,Fermi=0): 24 | if N == 0: 25 | return 0 26 | else: 27 | tot = 0. 28 | for n in range(1,N+1): 29 | tot += ((-1)**((n-1)*Fermi)) * (n*dz0(n*B,t,w,d)*z(N-n,B,t,w,d,Fermi) + z0(n*B,t,w,d)*dz(N-n,B,t,w,d,Fermi)) 30 | return tot/N 31 | 32 | def e(N,B,t,w,d,Fermi=0): 33 | return -(1./z(N,B,t,w,d,Fermi))*dz(N,B,t,w,d,Fermi) 34 | 35 | def usage(): 36 | print "Usage: %s N B t w d (Fermi)" % os.path.basename(sys.argv[0]) 37 | sys.exit(2) 38 | 39 | def main(argv=None): 40 | if argv is None: 41 | argv = sys.argv 42 | if "-h" in argv or "--help" in argv: 43 | usage() 44 | 45 | try: 46 | N = int(sys.argv[1]) 47 | B = float(sys.argv[2]) 48 | t = float(sys.argv[3]) 49 | w = float(sys.argv[4]) 50 | d = int(sys.argv[5]) 51 | except: 52 | usage() 53 | 54 | try: 55 | Fermi = int(sys.argv[6]) 56 | except: 57 | Fermi = 0 58 | 59 | print 'E:', e(N,B,t,w,d,Fermi) 60 | 61 | if __name__ == "__main__": 62 | sys.exit(main()) 63 | 64 | -------------------------------------------------------------------------------- /Scripts/printdm.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | from numpy import * 4 | import h5py as h5 5 | from scipy import interpolate 6 | 7 | f = h5.File(sys.argv[1]) 8 | 9 | def printitout(name): 10 | print name 11 | data = f[name+'/Data'] 12 | data = data[:].flatten() 13 | print len(data) 14 | 15 | start = f[name+'/Grid/Start'][0] 16 | end = f[name+'/Grid/End'][0] 17 | N = f[name+'/Grid/NumGridPoints'][0] 18 | rs = linspace(start,end,num=N,endpoint=True) 19 | 20 | spline = interpolate.splrep(rs,data,s=0) 21 | rsnew = arange(0.1,3.01,0.1) 22 | datanew = interpolate.splev(rsnew,spline,der=0) 23 | 24 | for i in range(0,len(rsnew)): 25 | print rsnew[i], datanew[i] 26 | 27 | printitout('Ukj0') 28 | #printitout('Ukj1') 29 | #printitout('Ukj2') 30 | #printitout('Ukj3') 31 | printitout('dUkjdBeta0') 32 | #printitout('dUkjdBeta1') 33 | #printitout('dUkjdBeta2') 34 | #printitout('dUkjdBeta3') 35 | f.close() 36 | -------------------------------------------------------------------------------- /Scripts/units.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | import math 4 | 5 | def GetUnits(rs,ToTF,pol,N,M): 6 | # INPUTS 7 | print 'N:', N 8 | print 'rs:', rs 9 | print 'ToTF:', ToTF 10 | print 'M:', M 11 | print 'polarized:', pol 12 | 13 | # CONSTANTS IN UNITS (a,Ry) 14 | lam = 1./(rs**2) 15 | eps = 2./rs 16 | # Fermi Temp (see Martin pg 103 (only he uses atomic units)) 17 | if pol: 18 | TF = (9. * math.pi / 2.)**(2./3.) / (rs**2) 19 | else: 20 | TF = (9. * math.pi / 4.)**(2./3.) / (rs**2) 21 | print 'lam:', lam, 'eps:', eps, 'TF:', TF 22 | 23 | # Length Scale Conversions 24 | La = (4. * math.pi * N / 3.)**(1./3.) # Wigner-Seitz radii 25 | a0 = 0.529 # Angstroms 26 | a0cm = 5.29*(10**-9) 27 | LAng = La*rs*a0 28 | Lcm = La*rs*a0cm 29 | print 'L:', La, 'a, ', LAng, 'Ang, ', Lcm, 'cm' 30 | 31 | # Density Conversions 32 | NoV = (3.*math.pi/4.)*((rs*a0cm)**(-3)) 33 | mekg = 9.10938188*(10**-31) 34 | meg = mekg * 1000 35 | print 'N/V:', NoV, 'cm^-3' 36 | print 'm/V:', meg*NoV, 'g/cm^-3' 37 | 38 | # Energy Scale Conversions 39 | TRy = ToTF * TF # Rydberg 40 | beta = 1/TRy 41 | tau = beta/M 42 | print 'beta:', beta, 'Ry^-1, tau:', tau 43 | TH = TRy * 2. #Hartree 44 | RyeV = 13.6056925330 45 | TeV = TRy * RyeV # electron volts 46 | eVK = 11604.45 47 | TK = TeV * eVK # Kelvin 48 | print 'T:', TRy, 'Ry, ', TH, 'H, ', TeV, 'eV, ', TK, 'K' 49 | 50 | return La,TRy,tau,lam,eps 51 | 52 | def usage(): 53 | print "Usage: %s rs ToTF pol N M" % os.path.basename(sys.argv[0]) 54 | sys.exit(2) 55 | 56 | def main(argv=None): 57 | if argv is None: 58 | argv = sys.argv 59 | if "-h" in argv or "--help" in argv: 60 | usage() 61 | 62 | # INPUTS 63 | try: 64 | rs = float(sys.argv[1]) 65 | ToTF = float(sys.argv[2]) 66 | pol = int(sys.argv[3]) 67 | N = int(sys.argv[4]) 68 | M = int(sys.argv[5]) 69 | except: 70 | usage() 71 | 72 | GetUnits(rs,ToTF,pol,N,M) 73 | 74 | if __name__ == "__main__": 75 | sys.exit(main()) 76 | -------------------------------------------------------------------------------- /src/Actions/BlendActions.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef BLEND_ACTIONS_H 18 | #define BLEND_ACTIONS_H 19 | 20 | #include "ActionBase.h" 21 | 22 | class BlendActionsClass : public ActionBaseClass 23 | { 24 | // store two actions to blend in the form: 25 | // S = (1-lambda_blend) * S0 + lambda_blend * S1 26 | Array S0; 27 | Array S1; 28 | // blending parameter (must be betwen 0 and 1) 29 | double lambda_blend; 30 | 31 | public: 32 | double SingleAction(int slice1, int slice2, 33 | const Array &activeParticles, 34 | int level); 35 | 36 | double d_dBeta (int slice1, int slice2, 37 | int level); 38 | 39 | void Read (IOSectionClass &in); 40 | string GetName(); 41 | BlendActionsClass(PathDataClass &pathData); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Actions/DiagonalActionClass.h: -------------------------------------------------------------------------------- 1 | #ifndef DIAGONAL_ACTION_CLASS 2 | #define DIAGONAL_ACTION_CLASS 3 | #include "ActionBase.h" 4 | #include "../PairAction/PAFit.h" 5 | 6 | 7 | 8 | /// The ShortRangeClass is an action class which stores the part of 9 | /// the potential pair action that is summed in real space. If the 10 | /// potential is short range, it contains the whole potential action. 11 | /// This action, in general, contains off diagaonal contributions. 12 | class DiagonalActionClass : public ActionBaseClass 13 | { 14 | protected: 15 | Array &PairMatrix; 16 | 17 | int TotalTime; 18 | /// These are the coefficients used for the low-variance estimator 19 | /// for the gradient 20 | Array ck; 21 | int NumBasisFuncs, m; 22 | double Router; 23 | bool UseLowVariance; 24 | void Setup_ck(); 25 | inline double g(double r); 26 | public: 27 | 28 | 29 | bool HaveSamplingTable; 30 | void Read (IOSectionClass &in); 31 | /* double dUdR(int slice,int ptcl1, int ptcl2, int level); */ 32 | /* double dUdR_movers(int slice,int ptcl1, int ptcl2, int level); */ 33 | /* double d2UdR2(int slice,int ptcl1, int ptcl2, int level); */ 34 | /* double d2UdR2_movers(int slice,int ptcl1, int ptcl2, int level); */ 35 | 36 | 37 | 38 | double SingleAction (int slice1, int slice2, 39 | const Array &activeParticles, int level); 40 | /* double SingleActionForcedPairAction (int slice1, int slice2, */ 41 | /* PairActionFitClass &PA); */ 42 | /* double d_dBetaForcedPairAction (int slice1, int slice2, */ 43 | // PairActionFitClass &pA); 44 | 45 | double d_dBeta (int slice1, int slice2, int level); 46 | /* void GradAction (int slice1, int slice2, const Array &ptcls, */ 47 | /* int level, Array &gradVec); */ 48 | string GetName(); 49 | DiagonalActionClass (PathDataClass &pathData, 50 | Array &pairMatrix); 51 | }; 52 | 53 | 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/Actions/HarmonicPotential.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef HARMONIC_POTENTIAL_CLASS_H 18 | #define HARMONIC_POTENTIAL_CLASS_H 19 | 20 | #include "ActionBase.h" 21 | 22 | /// The HarmonicPotentialClass is an action class which stores the part of 23 | /// the potential pair action that is summed in real space. If the 24 | /// potential is short range, it contains the whole potential action. 25 | /// This action, in general, contains off diagaonal contributions. 26 | class HarmonicPotentialClass : public ActionBaseClass 27 | { 28 | protected: 29 | int TotalTime; 30 | double omega; 31 | public: 32 | void Read (IOSectionClass &in); 33 | double dUdR(int slice, int ptcl1, int level); 34 | double d2UdR2(int slice, int ptcl1, int ptcl2, int level); 35 | double SingleAction (int slice1, int slice2, const Array &activeParticles, int level); 36 | double d_dBeta (int slice1, int slice2, int level); 37 | string GetName(); 38 | HarmonicPotentialClass (PathDataClass &pathData); 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/Actions/KineticClass.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef KINETIC_CLASS_H 18 | #define KINETIC_CLASS_H 19 | 20 | #include "ActionBase.h" 21 | 22 | /// The KineticClass calculates the kinetic part of the action. This 23 | /// is the "spring term", of the form 24 | /// \f$ K \equiv \left(4\pi\lambda\tau\right)^{-\frac{ND}{2}} 25 | /// \exp\left[-\frac{(R-R')^2}{4\lambda\tau}\right] \f$ 26 | class KineticClass : public ActionBaseClass 27 | { 28 | public: 29 | int NumImages; 30 | 31 | void Read (IOSectionClass &in); 32 | double SingleAction (int slice1, int slice2, 33 | const Array &activeParticles, int level); 34 | double SingleActionForcedTau (int slice1, int slice2, 35 | const Array &changedParticles, 36 | int level, 37 | double forcedTau); 38 | double d_dBeta (int slice1, int slice2, int level); 39 | double d_dBetaForcedTau (int slice1, int slice2, 40 | int level, 41 | double forcedTau); 42 | 43 | 44 | string GetName(); 45 | inline void SetNumImages (int num) { NumImages = num; } 46 | KineticClass (PathDataClass &pathData); 47 | }; 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/Actions/LongRangePotClass.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef LONG_RANGE_POT_CLASS 18 | #define LONG_RANGE_POT_CLASS 19 | 20 | #include "ActionBase.h" 21 | #include "../PairAction/PAFit.h" 22 | 23 | class LongRangePotClass : public PotentialBaseClass 24 | { 25 | private: 26 | Array &PairMatrix; 27 | public: 28 | bool UseBackground; 29 | double V (int slice); 30 | 31 | LongRangePotClass (PathDataClass &pathData, 32 | Array &pairMatrix); 33 | }; 34 | 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/Actions/Mu.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef MU_CLASS_H 18 | #define MU_CLASS_H 19 | 20 | #include "ActionBase.h" 21 | 22 | 23 | 24 | 25 | /// The ShortRangeClass is an action class which stores the part of 26 | /// the potential pair action that is summed in real space. If the 27 | /// potential is short range, it contains the whole potential action. 28 | /// This action, in general, contains off diagaonal contributions. 29 | class MuClass : public ActionBaseClass 30 | { 31 | protected: 32 | public: 33 | void Read (IOSectionClass &in); 34 | bool PadWorm(); 35 | double SingleAction (int slice1, int slice2, 36 | const Array &activeParticles, int level); 37 | double d_dBeta(int x, int y, int z) 38 | { 39 | return 0.0; 40 | } 41 | string GetName(); 42 | double Mu; 43 | MuClass (PathDataClass &pathData); 44 | 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/Actions/OpenLoopImportance.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef OPENLOOP_IMPORTANCE_H 18 | #define OPENLOOP_IMPORTANCE_H 19 | 20 | #include "ActionBase.h" 21 | 22 | typedef enum {NOIMP,DISTIMP,DISPXIMP,CONSTSHIFT,TUNEDFUNCTION,RETUNEDFUNCTION, POLYNOMIAL,EXPONENTIAL} SampleChoice; 23 | 24 | typedef enum {MIN_IMAGE_DISP,MIN_IMAGE_DIST,DISP,DIST} Xvalue; 25 | 26 | class OpenLoopImportanceClass : public ActionBaseClass 27 | { 28 | public: 29 | Array Polynom; 30 | double a; 31 | double alpha; 32 | double s; 33 | void Read (IOSectionClass &in); 34 | double SingleAction (int slice1, int slice2, 35 | const Array &activeParticles, int level); 36 | double d_dBeta (int slice1, int slice2, int level); 37 | string GetName(); 38 | OpenLoopImportanceClass (PathDataClass &pathData); 39 | SampleChoice ImpChoice; 40 | Xvalue Xis; 41 | double Shift; 42 | }; 43 | 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/Actions/QMCSamplingClass.h: -------------------------------------------------------------------------------- 1 | #ifndef QMC_SAMPLING_CLASS_H 2 | #define QMC_SAMPLING_CLASS_H 3 | 4 | //#include 5 | #include "ActionBase.h" 6 | #include 7 | #include 8 | 9 | #ifdef USE_QMC 10 | class CEIMCActionClass: public ActionBaseClass 11 | { 12 | ofstream out; 13 | std::vector* qmcData; 14 | int EnergyIndex0, EnergyIndex1, EnergyDiffIndex; 15 | Array ptclSet0, ptclSet1; 16 | 17 | public: 18 | double dt; 19 | int walkers, chains, steps, blocks; 20 | bool correlated; 21 | string QMCMethod; 22 | double SingleAction(int slice1,int slice2, 23 | const Array &activeParticles,int level); 24 | double d_dBeta (int slice1, int slice2, int level); 25 | std::string GetName(); 26 | void Read (IOSectionClass &in); 27 | 28 | CEIMCActionClass(PathDataClass &pathData); 29 | }; 30 | #endif 31 | 32 | class IonIonActionClass: public ActionBaseClass 33 | { 34 | double prefactor; 35 | double cutoff; 36 | public: 37 | double SingleAction(int slice1,int slice2, 38 | const Array &activeParticles,int level); 39 | double d_dBeta (int slice1, int slice2, int level); 40 | std::string GetName(); 41 | void Read (IOSectionClass &in); 42 | 43 | IonIonActionClass(PathDataClass &pathData); 44 | }; 45 | 46 | class QMCSamplingClass: public ActionBaseClass 47 | { 48 | public: 49 | int manager; 50 | int myProc; 51 | int workerSize; 52 | int workerList[]; 53 | double SingleAction(int slice1,int slice2,const 54 | Array &activeParticles,int level); 55 | double d_dBeta (int slice1, int slice2, int level); 56 | std::string GetName(); 57 | void Read (IOSectionClass &in); 58 | 59 | QMCSamplingClass(PathDataClass &pathData); 60 | }; 61 | 62 | //double QuickAvg(std::vector* values); 63 | void QuickAvg(std::vector* values, double& avg, double& var); 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/Actions/ReadAction.cc: -------------------------------------------------------------------------------- 1 | #include "../PathDataClass.h" 2 | #include "ReadAction.h" 3 | 4 | std::string 5 | ReadFromFileActionClass::GetName() 6 | { 7 | return "ReadFromFileAction"; 8 | } 9 | 10 | ReadFromFileActionClass::ReadFromFileActionClass(PathDataClass &pathData) : ActionBaseClass (pathData){ 11 | qCount = 0; 12 | } 13 | 14 | double ReadFromFileActionClass::SingleAction(int slice1,int slice2,const Array &activeParticles,int level){ 15 | if(safe_mode) { 16 | assert(slice1==slice2); 17 | assert(slice1==0); 18 | } 19 | qCount++; 20 | double Utotal = 0.0; 21 | Utotal = ComputeEnergy(slice1, slice2, activeParticles, level); 22 | return Utotal*PathData.Path.tau; 23 | } 24 | 25 | double ReadFromFileActionClass::ComputeEnergy(int slice1,int slice2,const Array &activeParticles,int level){ 26 | double Utotal = 0.0; 27 | //cerr << "pwscf Compute Energy " << slice1 << " " << slice2 << endl; 28 | infile >> Utotal; 29 | return (conversion * Utotal); 30 | } 31 | 32 | double ReadFromFileActionClass::d_dBeta (int slice1, int slice2, int level){ 33 | //int slice = 0; 34 | cerr << "ReadFromFileAction dBeta returning null" << endl; 35 | double Utotal = -999; 36 | return Utotal; 37 | } 38 | 39 | void ReadFromFileActionClass::Read (IOSectionClass &in){ 40 | cerr << "ReadFromFileAction Read" << endl; 41 | string filename; 42 | assert(in.ReadVar("File",filename)); 43 | infile.open(filename.c_str()); 44 | cerr << "ReadFRomFileAction Read finished." << endl; 45 | safe_mode = true; 46 | in.ReadVar("Safe",safe_mode); 47 | conversion = 1.0; 48 | in.ReadVar("Conversion",conversion); 49 | } 50 | -------------------------------------------------------------------------------- /src/Actions/ReadAction.h: -------------------------------------------------------------------------------- 1 | #ifndef READ_FROM_FILE_ACTION_CLASS_H 2 | #define READ_FROM_FILE_ACTION_CLASS_H 3 | 4 | #include "ActionBase.h" 5 | 6 | class ReadFromFileActionClass: public ActionBaseClass 7 | { 8 | ifstream infile; 9 | int qCount; 10 | bool safe_mode; 11 | double conversion; 12 | public: 13 | 14 | double SingleAction(int slice1,int slice2, 15 | const Array &activeParticles,int level); 16 | double ComputeEnergy(int slice1,int slice2, 17 | const Array &activeParticles,int level); 18 | double d_dBeta (int slice1, int slice2, int level); 19 | std::string GetName(); 20 | void Read (IOSectionClass &in); 21 | 22 | ReadFromFileActionClass(PathDataClass &pathData); 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/Actions/Sal.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef SAL_CLASS_H 18 | #define SAL_CLASS_H 19 | 20 | #include "ActionBase.h" 21 | 22 | #include "../PairAction/PAFit.h" 23 | 24 | 25 | 26 | 27 | /// The LongRangeClass is an action class responsible for the long 28 | /// wavelength components of the action that are summed in k-space. 29 | /// This class reads in and uses an optimized breakup from a file that 30 | /// David supplies. 31 | 32 | class SalClass : public ActionBaseClass 33 | { 34 | protected: 35 | public: 36 | void Read (IOSectionClass &in); 37 | double V(int slice1,int slice2,int level); 38 | double SingleAction (int slice1, int slice2, 39 | const Array &activeParticles, int level); 40 | double d_dBeta (int slice1, int slice2, int level); 41 | string GetName(); 42 | SalClass(PathDataClass &pathData); 43 | 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Actions/ShortRangeApproximateClass.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef SHORT_RANGE_APPROXIMATE_CLASS_H 18 | #define SHORT_RANGE_APPROXIMATE_CLASS_H 19 | 20 | #include "ActionBase.h" 21 | #include "../PairAction/PAFit.h" 22 | 23 | /// The ShortRangeApproximateClass is an action class which stores the part of 24 | /// the potential pair action that is summed in real space. If the 25 | /// potential is short range, it contains the whole potential action. 26 | /// This action, in general, contains off diagaonal contributions. 27 | class ShortRangeApproximateClass : public ActionBaseClass 28 | { 29 | protected: 30 | Array &PairMatrix; 31 | Array DoPtcl; 32 | public: 33 | void Read (IOSectionClass &in); 34 | double SingleAction (int slice1, int slice2, 35 | const Array &activeParticles, int level); 36 | double d_dBeta (int slice1, int slice2, int level); 37 | string GetName(); 38 | ShortRangeApproximateClass (PathDataClass &pathData, 39 | Array &pairMatrix); 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Actions/ShortRangeOnClass.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef SHORT_RANGE_ON_CLASS_H 18 | #define SHORT_RANGE_ON_CLASS_H 19 | 20 | #include "ActionBase.h" 21 | #include "../PairAction/PAFit.h" 22 | 23 | /// The ShortRangeClass is an action class which stores the part of 24 | /// the potential pair action that is summed in real space. If the 25 | /// potential is short range, it contains the whole potential action. 26 | /// This action, in general, contains off diagaonal contributions. 27 | class ShortRangeOnClass : public ActionBaseClass 28 | { 29 | protected: 30 | Array &PairMatrix; 31 | Array DoPtcl; 32 | public: 33 | void Read (IOSectionClass &in); 34 | double SingleAction (int slice1, int slice2, 35 | const Array &activeParticles, int level); 36 | double d_dBeta (int slice1, int slice2, int level); 37 | string GetName(); 38 | ShortRangeOnClass (PathDataClass &pathData, 39 | Array &pairMatrix); 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Actions/ShortRangePotClass.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #include "../PathDataClass.h" 18 | #include "ShortRangePotClass.h" 19 | 20 | ShortRangePotClass::ShortRangePotClass 21 | (PathDataClass &pathData, Array &pairMatrix) : 22 | PotentialBaseClass (pathData), PairMatrix(pairMatrix) 23 | { 24 | // Do nothing 25 | } 26 | 27 | double 28 | ShortRangePotClass::V(int slice) 29 | { 30 | double val = 0.0; 31 | for (int ptcl1=0; ptcl1 &PairMatrix; 27 | public: 28 | double V (int slice); 29 | 30 | ShortRangePotClass (PathDataClass &pathData, 31 | Array &pairMatrix); 32 | }; 33 | 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/Actions/ShortRangePrimitive.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef SHORT_RANGE_PRIMITIVE_CLASS_H 18 | #define SHORT_RANGE_PRIMITIVE_CLASS_H 19 | 20 | #include "ActionBase.h" 21 | #include "../PairAction/PAFit.h" 22 | 23 | /// The ShortRangePrimitiveClass is an action class which stores the part of 24 | /// the potential pair action that is summed in real space. If the 25 | /// potential is short range, it contains the whole potential action. 26 | /// This action, in general, contains off diagaonal contributions. 27 | class ShortRangePrimitiveClass : public ActionBaseClass 28 | { 29 | protected: 30 | Array &PairMatrix; 31 | Array DoPtcl; 32 | public: 33 | void Read (IOSectionClass &in); 34 | double SingleAction (int slice1, int slice2, 35 | const Array &activeParticles, int level); 36 | double d_dBeta (int slice1, int slice2, int level); 37 | string GetName(); 38 | ShortRangePrimitiveClass (PathDataClass &pathData, 39 | Array &pairMatrix); 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Actions/StructureReject.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef STRUCTURE_REJECT_H 18 | #define STRUCTURE_REJECT_H 19 | 20 | #include "ActionBase.h" 21 | 22 | class StructureRejectClass : public ActionBaseClass 23 | { 24 | Array Sk; 25 | int Species1; 26 | int Species2; 27 | int TotalCounts; 28 | public: 29 | void Read (IOSectionClass &in); 30 | double SingleAction (int slice1, int slice2, 31 | const Array &activeParticles, int level); 32 | double d_dBeta (int slice1, int slice2, int level); 33 | string GetName(); 34 | StructureRejectClass (PathDataClass &pathData); 35 | }; 36 | 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/Actions/Tether.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef TETHER_H 18 | #define TETHER_H 19 | 20 | #include "ActionBase.h" 21 | 22 | class TetherClass : public ActionBaseClass 23 | { 24 | public: 25 | void Read (IOSectionClass &in); 26 | double SingleAction (int slice1, int slice2, 27 | const Array &activeParticles, int level); 28 | double d_dBeta (int slice1, int slice2, int level); 29 | std::string GetName(); 30 | TetherClass (PathDataClass &pathData); 31 | Array TetheredSites; 32 | double TetherCutoff; 33 | int SpeciesNum; 34 | }; 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/Actions/Timer.h: -------------------------------------------------------------------------------- 1 | #ifndef TIMER_H 2 | #define TIMER_H 3 | 4 | #include 5 | class TimerClass 6 | { 7 | public: 8 | struct timeval start, end; 9 | struct timezone tz; 10 | double TimeSpent; 11 | string Name; 12 | 13 | TimerClass(string tempName) : Name(tempName) 14 | { 15 | TimeSpent=0.; 16 | 17 | } 18 | 19 | 20 | void Start() 21 | { 22 | gettimeofday(&start, &tz); 23 | } 24 | 25 | void Stop() 26 | { 27 | gettimeofday(&end, &tz); 28 | TimeSpent += (double)(end.tv_sec-start.tv_sec) + 29 | 1.0e-6*(double)(end.tv_usec-start.tv_usec); 30 | } 31 | 32 | void Clear() 33 | { 34 | TimeSpent=0.0; 35 | } 36 | 37 | double Time() 38 | { 39 | return TimeSpent; 40 | 41 | } 42 | 43 | }; 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Actions/WaterClass.cc: -------------------------------------------------------------------------------- 1 | #include "WaterFast.h" 2 | #include "../PathDataClass.h" 3 | 4 | double WaterClass::SingleAction (int slice1, int slice2, 5 | const Array &activeParticles, int level) 6 | { 7 | t.Start(); 8 | // cerr<<"Calling for "< &myVec) 4 | { 5 | for (int i=0;i &myVec) 15 | { 16 | for (int i=0;i > &myVec) 25 | { 26 | for (int i=0;i &myVec) 34 | { 35 | cerr< 5 | #include "../Blitz.h" 6 | using namespace std; 7 | 8 | class dVecp 9 | { 10 | public: 11 | int size() 12 | { 13 | return vec.size(); 14 | } 15 | 16 | vector vec; 17 | dVecp() 18 | { 19 | vec.resize(NDIM); 20 | for (int i=0;i &myVec); 56 | 57 | 58 | void ZeroVec(vector &myVec); 59 | 60 | 61 | 62 | void ZeroVec(vector > &myVec); 63 | 64 | 65 | void PrintVec(vector &myVec); 66 | 67 | double dot(dVecp &a, dVecp &b); 68 | 69 | 70 | #endif 71 | 72 | -------------------------------------------------------------------------------- /src/Actions/det_calc_uekt.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | #ifdef ORDER_N_FERMIONS 17 | 18 | 19 | #ifndef _DET_CALC_UEKT_H_ 20 | #define _DET_CALC_UEKT_H_ 21 | 22 | struct drc_uekt_vanilla_parms{ 23 | double tolerance; 24 | int max_its; 25 | int its_used; 26 | }; 27 | 28 | 29 | int testme(); 30 | // int drc_uekt_identity_preconditioner(double* x, double*y); 31 | 32 | // int det_ratio_calculator_uekt_symmetric_vanilla(int (*func)(double*,double*,int,void*), 33 | // void * data, int N, double * u, int col_id, 34 | // double die_roll, double* det_ratio, void *params); 35 | 36 | 37 | void det_ratio_calculator_uekt_symmetric_vanilla_value(int (*func)(double*,double*,int,void*), 38 | void * data, int N, double * u, int col_id, 39 | double die_roll, double* det_ratio, void *params); 40 | 41 | // int drc_uekt_templates_style_fcall(double *alpha, double* x, double *beta, double*y); 42 | 43 | 44 | // int det_ratio_calculator_uekt_nonsymmetric_col_vanilla(int (*func)(double*,double*,int,void*), 45 | // void * data, int N, double * u, int col_id, 46 | // double die_roll, double* det_ratio, void *params); 47 | 48 | 49 | 50 | #endif 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /src/Actions/exec_pwscf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from pwscf import * 4 | import sys 5 | 6 | infile_pre = 'pwscf.0.in' 7 | infile_post = 'pwscf.1.in' 8 | 9 | if(len(sys.argv) != 3): 10 | print "Usage: >./exec_pwscf.py " 11 | sys.exit() 12 | infile_coords = sys.argv[1] 13 | energy_out = sys.argv[2] 14 | execute(infile_pre, infile_post, infile_coords, energy_out) 15 | -------------------------------------------------------------------------------- /src/Actions/pwscf.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | import commands 4 | 5 | def create(infile_pre, infile_post, coordfile): 6 | filename = 'pwscf_pimcpp.in' 7 | runfile = open(filename,'w') 8 | i = open(infile_pre,'r') 9 | line = i.readline() 10 | while(line != ''): 11 | runfile.write(line) 12 | line = i.readline() 13 | i.close() 14 | X = open(coordfile,'r') 15 | line = X.readline() 16 | while(line != ''): 17 | runfile.write(line) 18 | line = X.readline() 19 | X.close() 20 | #for x in range(0,len(coords)): 21 | # runfile.write(coords[x]) 22 | # #runfile.write(coords[x] +'\n') 23 | i = open(infile_post,'r') 24 | line = i.readline() 25 | while(line != ''): 26 | runfile.write(line) 27 | line = i.readline() 28 | i.close() 29 | print "Created pwscf input",filename 30 | return filename 31 | 32 | def run(filename): 33 | print "Running pwscf..." 34 | os.system('mpirun -np 4 pw.x < ' + filename + ' > pw.out') 35 | x = commands.getoutput('grep energy pw.out') 36 | print "pwscf finished." 37 | return x 38 | 39 | def processString(line): 40 | entry = [] 41 | string = '' 42 | i = 0 43 | while i < len(line): 44 | if (line[i] == ' ' or line[i] == ',' or line[i] == '\t' or line[i] == '\n'): #Edit for the delimiters you want to recognize 45 | if (line[i-1] != ' ' and i>0): 46 | entry.append(string) 47 | string = '' 48 | else: 49 | string += line[i] 50 | i += 1 51 | return entry 52 | 53 | def parse(output): 54 | p = processString(output) 55 | e = [] 56 | index = 0 57 | while(index 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "../Blitz.h" 8 | #include 9 | #include "../MatrixOps/MatrixOps.h" 10 | 11 | using namespace blitz; 12 | 13 | void FitEllipse(Array &A) 14 | { 15 | const int M = A.rows(); 16 | const int D = A.cols(); 17 | 18 | Array avg(D); 19 | avg = 0; 20 | for (int k = 0; k < M; k++) 21 | for (int d = 0; d < D; d++) 22 | avg(d) += A(k,d); 23 | avg = avg/M; 24 | 25 | Array C(D,D); // Will be the covariance matrix. 26 | C = 0; // Eigenvectors will be major & minor axes. Eigenvalues will be lengths of axes, squared. 27 | for (int k = 0; k < M; k++) 28 | for (int d1 = 0; d1 < D; d1++) 29 | for (int d2 = 0; d2 < D; d2++) 30 | C(d1,d2) += (A(k,d1) - avg(d1)) * (A(k,d2) - avg(d2)); 31 | C = C/(M-1); 32 | 33 | Array Vals(D); 34 | Array Vectors(D,D); 35 | SymmEigenPairs(C,D,Vals,Vectors); 36 | 37 | cout << avg << C << Vals << Vectors << endl; 38 | } 39 | 40 | int main(int argc, char* argv[]) 41 | { 42 | string CoordFile = argv[1]; 43 | std::ifstream ifs(CoordFile.c_str()); 44 | 45 | const int M = 512; 46 | const int D = 3; 47 | 48 | Array,1> A(M); 49 | std::string line; 50 | int i = 0; 51 | while(std::getline(ifs,line)) { 52 | istringstream iss(line); 53 | TinyVector a; 54 | int j = 0; 55 | do { 56 | string sub; 57 | iss >> sub; 58 | double x = atof(sub.c_str()); 59 | if (x!=0) 60 | a(j) = x; 61 | j++; 62 | } while (iss); 63 | A(i) = a; 64 | i++; 65 | } 66 | 67 | 68 | //for (int k = 0; k < M; k++) 69 | // cout << k << " " << A(k) << endl; 70 | 71 | Array B(M,D); 72 | for (int k = 0; k < M; k++) 73 | for (int d = 0; d < D; d++) 74 | B(k,d) = A(k)(d); 75 | FitEllipse(B); 76 | 77 | return 0; 78 | } 79 | -------------------------------------------------------------------------------- /src/IO/FileExpand.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef FILE_EXPAND_H 18 | #define FILE_EXPAND_H 19 | 20 | #ifndef MAC 21 | #include 22 | #endif 23 | #include 24 | 25 | inline string ExpandFileName(string fname) 26 | { 27 | string outName; 28 | #ifdef MAC 29 | if (fname[0] == '~') { 30 | outName = getenv ("HOME"); 31 | fname = fname.erase(0,1); 32 | } 33 | outName.append(fname); 34 | #else 35 | wordexp_t words; 36 | wordexp (fname.c_str(), &words, 0); 37 | outName = words.we_wordv[0]; 38 | wordfree(&words); 39 | #endif 40 | return outName; 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/IO/InputOutput.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #include "InputOutput.h" 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Integration/Integrate.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef INTEGRATE_H 18 | #define INTEGRATE_H 19 | 20 | #include "../Blitz.h" 21 | #include "../Splines/Grid.h" 22 | 23 | void RungeKutta4 (const Grid &grid, 24 | int StartPoint, int EndPoint, 25 | Array &Result, 26 | Array (*DerivFunc)(pscalar x, Array y, void *Params), 27 | void *Params); 28 | void IntegrateFirstOrder (const Grid &grid, 29 | int StartPoint, int EndPoint, 30 | Array &Result, 31 | pscalar (*DerivFunc)(pscalar x, pscalar y, void *Params), 32 | void *Params); 33 | void IntegrateFirstOrderNS (const Grid &grid, 34 | int StartPoint, int EndPoint, 35 | Array &Result, 36 | pscalar (*DerivFunc)(pscalar x, pscalar y, void *Params), 37 | void *Params); 38 | void IntegrateSecondOrder (const Grid &grid, 39 | int StartPoint, int EndPoint, 40 | Array &Result, 41 | Vec2 (*DerivFunc)(pscalar x, Vec2 y, void *Params), 42 | void *Params); 43 | 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/LoopClass.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef LOOP_CLASS_H 18 | #define LOOP_CLASS_H 19 | 20 | #include "EventClass.h" 21 | 22 | class ObservableClass; 23 | class MoveClass; 24 | 25 | /// Note: LoopClass is not allowed to write any output to its out IOsection. 26 | class LoopClass : public EventClass 27 | { 28 | protected: 29 | int NumSteps; 30 | bool Equilibrate; 31 | std::list &Moves; 32 | std::list &Observables; 33 | std::list Events; 34 | MoveClass *FindMove(string name); 35 | ObservableClass *FindObservable(string name); 36 | public: 37 | void DoEvent(); 38 | void Read(IOSectionClass &IO); 39 | void Read(IOSectionClass &IO, int steps); 40 | void SetOutfile (IOSectionClass &out) 41 | { IOSection = out; } 42 | LoopClass(PathDataClass &pathData, IOSectionClass &out, list &moves, list &observables) : 43 | EventClass(pathData, out), NumSteps(1), Moves(moves), Observables(observables) 44 | { 45 | // do nothing 46 | } 47 | }; 48 | 49 | 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/MatrixOps/GJ.m: -------------------------------------------------------------------------------- 1 | N = 41; 2 | 3 | A = rand(N,N); 4 | Acopy = A; 5 | Ainv = A^(-1); 6 | 7 | mydet = 1.0; 8 | 9 | ipiv = [1:N]; 10 | for k = [1:N] 11 | [abspivot,kb] = max([zeros(k-1,1);abs(A(k:N,k))]); 12 | pivot = A(kb,k); 13 | [A(k,:),A(kb,:)] = swap(A(k,:),A(kb,:)); 14 | [ipiv(k),ipiv(kb)] = swap(ipiv(k),ipiv(kb)); 15 | A(:,k) = -[A(1:k-1,k);0;A(k+1:N,k)]/pivot; 16 | A = A + A(:,k)*A(k,:); 17 | A(k,:) = [A(k,1:k-1),1,A(k,k+1:N)]/pivot; 18 | mydet = mydet * pivot; 19 | if (kb != k) 20 | mydet = -mydet; 21 | end 22 | end 23 | 24 | A(:,ipiv) = A; 25 | (A*Acopy); 26 | mydet 27 | det(Acopy) 28 | 29 | -------------------------------------------------------------------------------- /src/MirroredClass.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #include "MirroredClass.h" 18 | 19 | ModeType ActiveCopy=OLDMODE; 20 | 21 | void MirroredClassTest() 22 | { 23 | MirroredClass a; 24 | double b; 25 | 26 | b = 1.0; 27 | a = b; 28 | cerr << "a = " << a << endl;; 29 | 30 | Mirrored1DClass c; 31 | Array d; 32 | c.resize(3); 33 | d.resize(3); 34 | c(0) = 1.0; 35 | c(1) = 2.0; c(2) = 3.0; 36 | d = c; 37 | cerr << "c = " << c.data() << endl; 38 | 39 | 40 | Mirrored2DClass e; 41 | Array f; 42 | 43 | e.resize(2,3); 44 | e.data() = 1.0, 2.0, 3.0, 4.0, 5.0, 6.0; 45 | 46 | f = e; 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/MoleculeHelper.h: -------------------------------------------------------------------------------- 1 | #ifndef MOLECULE_HELPER_H 2 | #define MOLECULE_HELPER_H 3 | 4 | #include "Common.h" 5 | #include "IO/IO.h" 6 | 7 | 8 | using namespace IO; 9 | 10 | class MoleculeManagerClass 11 | { 12 | int numMolTypes; 13 | int totalNumMol; 14 | Array names; 15 | Array num; 16 | Array, 1> Members; 17 | Array, 1> ListByType; 18 | Array MolRef; 19 | Array MolLabel; 20 | 21 | public: 22 | 23 | int checkNumParticles; 24 | void Read(IOSectionClass& in); 25 | void Init(); 26 | Array& MembersOf(int mol); 27 | void MembersOf(Array& members, int mol); 28 | int SizeOf(int mol); 29 | int NumMol(int type); 30 | int NumMol(string typeLabel); 31 | int NumMol(); 32 | string NameOf(int mol); 33 | Array MolOfType(int type); 34 | Array MolOfType(string typeLabel); 35 | void MolOfType(Array& list, string typeLabel); 36 | void MolOfType(Array& list, int type); 37 | int Index(string label); 38 | inline int operator() (int ptcl); 39 | 40 | MoleculeManagerClass(); 41 | }; 42 | 43 | inline int MoleculeManagerClass::operator()(int ptcl) 44 | { 45 | return MolRef(ptcl); 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/Moves/AVBMove.h: -------------------------------------------------------------------------------- 1 | #ifndef AGG_VOLUME_BIAS_MOVE_H 2 | #define AGG_VOLUME_BIAS_MOVE_H 3 | 4 | #include "MoleculeMoveBase.h" 5 | 6 | class AVBMove: public MolMoveClass{ 7 | double vol, Vin, Vout; 8 | double Rin, Rout, RCubeDiff; 9 | double Pbias; 10 | int numAccepted,numMoves; 11 | public: 12 | AVBMove(PathDataClass &myPathData,IOSectionClass outSection); 13 | AVBMove(PathDataClass &myPathData,IOSectionClass outSection, int numToRead, int start) : 14 | MolMoveClass (myPathData,outSection) 15 | { 16 | } 17 | void Read(IOSectionClass &moveInput); 18 | bool AreBound(int slice, int mol1, int mol2); 19 | bool AreBound(int slice, int mol1, dVec coord); 20 | dVec GenerateBound(int slice, int ToMol, int FromMol); 21 | dVec GenerateUnBound(int slice, int ToMol, int FromMol); 22 | double Sample(int& slice1, int& slice2, Array& activeParticles); 23 | /* void WriteRatio() 24 | { 25 | };*/ 26 | 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/Moves/BisectionJosephsonStage.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef BISECTION_JOSEPHSON_STAGE_CLASS_H 18 | #define BISECTION_JOSEPHSON_STAGE_CLASS_H 19 | 20 | #include "MultiStage.h" 21 | #include "../Observables/ObservableVar.h" 22 | 23 | class BisectionJosephsonStageClass : public LocalStageClass 24 | 25 | { 26 | public: 27 | void WriteRatio(); 28 | double Sample(int &slice1,int &slice2, 29 | Array &activeParticles); 30 | void Accept(); 31 | void Reject(); 32 | int TotalLevels; 33 | BisectionJosephsonStageClass(PathDataClass &pathData, int level, 34 | IOSectionClass outSection) : 35 | LocalStageClass(pathData,outSection) 36 | { 37 | //do nothing for now 38 | BisectionLevel = level; 39 | 40 | } 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/Moves/BisectionStage.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef BISECTION_STAGE_CLASS_H 18 | #define BISECTION_STAGE_CLASS_H 19 | 20 | #include "MultiStage.h" 21 | #include "../Observables/ObservableVar.h" 22 | #include 23 | 24 | class BisectionStageClass : public LocalStageClass 25 | { 26 | public: 27 | 28 | // void Read(IOSectionClass& IO); 29 | void CalcShift(Array &activeParticles, int slice, double sigma, double &det); 30 | double Sample(int &slice1,int &slice2, Array &activeParticles); 31 | double SampleFree(int &slice1,int &slice2, Array &activeParticles); 32 | double Sample_old(int &slice1,int &slice2, Array &activeParticles); 33 | 34 | Array dispShift; 35 | Array Correlated; 36 | Array S; 37 | bool UseCorrelatedSampling; 38 | int TotalLevels; 39 | 40 | BisectionStageClass(PathDataClass &pathData, int level, IOSectionClass outSection) : 41 | LocalStageClass(pathData,outSection) 42 | { 43 | BisectionLevel = level; 44 | TimeSpent = 0.0; 45 | } 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/Moves/CenterofMassMove.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef CENTER_OF_MASS_MOVE_H 18 | #define CENTER_OF_MASS_MOVE_H 19 | 20 | #include "MoveBase.h" 21 | 22 | class CenterOfMassMoveClass : public ParticleMoveClass 23 | { 24 | public: 25 | void MakeMove(); 26 | void Read(IOSectionClass &moveInput); 27 | CenterOfMassMoveClass(PathDataClass &myPathData,IOSectionClass outSection) : 28 | ParticleMoveClass (myPathData,outSection) 29 | { 30 | 31 | } 32 | dVec original_center_of_mass; 33 | bool firstTime; 34 | // double AcceptanceRatio(int numAccepted,int numMoves); 35 | void WriteRatio() 36 | { 37 | //do nothing for now 38 | }; 39 | 40 | 41 | 42 | }; 43 | 44 | 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/Moves/CouplingMove.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #include "CouplingMove.h" 18 | #include "BisectionStage.h" 19 | #include "CouplingStage.h" 20 | 21 | void CouplingMoveClass::WriteRatio() 22 | { 23 | MultiStageClass::WriteRatio(); 24 | //Do nothing for now 25 | } 26 | 27 | void CouplingMoveClass::MakeMove() 28 | { 29 | 30 | bool toAccept=true; 31 | list::iterator stageIter=Stages.begin(); 32 | double prevActionChange=0.0; 33 | int stageCount=0; 34 | while (stageIter!=Stages.end() && toAccept){ 35 | // cerr<<"This is stage "<Attempt(Slice1,Slice2, 37 | ActiveParticles,prevActionChange); 38 | stageIter++; 39 | // cerr<Read(in); 52 | coupleStage->Actions.push_back(&PathData.Actions.Kinetic); 53 | coupleStage->Actions.push_back(&PathData.Actions.ShortRange); 54 | Stages.push_back (coupleStage); 55 | } 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /src/Moves/CouplingMove.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef COUPLINGMOVE_CLASS_H 18 | #define COUPLINGMOVE_CLASS_H 19 | 20 | 21 | #include "../PathDataClass.h" 22 | #include "MoveBase.h" 23 | #include "MultiStage.h" 24 | 25 | 26 | 27 | 28 | /// This is the bisection move class inherited from ParticleMoveClass 29 | /// Explanation of how bisection moves work is in 30 | /// Path Integrals in the theory of condensed helium 31 | /// by D.M. Ceperley (Review of Modern Physics 1995) section V.H 32 | class CouplingMoveClass : public MultiStageClass 33 | { 34 | private: 35 | // EndType Open; 36 | int SpeciesNum; 37 | public: 38 | ///Number of levels the bisection move works on 39 | int NumLevels; 40 | void Read(IOSectionClass &moveInput); 41 | void WriteRatio(); 42 | void MakeMove(); 43 | CouplingMoveClass(PathDataClass &myPathData, IOSectionClass iosection) : 44 | MultiStageClass(myPathData,iosection) 45 | { 46 | /* Do nothing for now. */ 47 | } 48 | }; 49 | 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/Moves/CouplingStage.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef COUPLING_STAGE_CLASS_H 18 | #define COUPLING_STAGE_CLASS_H 19 | 20 | #include "MultiStage.h" 21 | #include "../Observables/ObservableVar.h" 22 | 23 | 24 | class CouplingStageClass : public LocalStageClass 25 | { 26 | private: 27 | void ChooseTimeSlices(int &slice1,int &slice2); 28 | IOSectionClass OutSection; 29 | Array AcceptRatio; 30 | ObservableVecDouble1 AcceptRatioVar; 31 | public: 32 | void WriteRatio(); 33 | void Accept(); 34 | void Reject(); 35 | void Read(IOSectionClass &in); 36 | double Sample(int &slice1,int &slice2, 37 | Array &activeParticles); 38 | CouplingStageClass(PathDataClass &pathData, int numLevels, 39 | IOSectionClass &outSection) : 40 | LocalStageClass(pathData,outSection), 41 | OutSection(outSection), 42 | AcceptRatioVar("Acceptance Ratio",OutSection,PathData.Path.Communicator) 43 | 44 | { 45 | AcceptRatio.resize(2); 46 | AcceptRatio=0; 47 | 48 | //do nothing for now 49 | 50 | } 51 | }; 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /src/Moves/EmptyStage.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | 18 | #include "EmptyStage.h" 19 | void EmptyStageClass::Read(IOSectionClass &in) 20 | { 21 | LocalStageClass::Read(in); 22 | } 23 | 24 | void EmptyStageClass::WriteRatio() 25 | { 26 | // cerr<<"About to write my ratio"< acceptRatio(2); 28 | acceptRatio(0)=(double)AcceptRatio(0)/EndAttempts; 29 | acceptRatio(1)=(double)AcceptRatio(1)/EndAttempts; 30 | AcceptRatioVar.Write(acceptRatio); 31 | AcceptRatioVar.Flush(); 32 | // cerr<<"done writing my ratio"< &activeParticles) 50 | { 51 | return 1.0; 52 | } 53 | -------------------------------------------------------------------------------- /src/Moves/EmptyStage.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef EMPTY_STAGE_CLASS_H 18 | #define EMPTY_STAGE_CLASS_H 19 | 20 | #include "MultiStage.h" 21 | #include "../Observables/ObservableVar.h" 22 | 23 | 24 | class EmptyStageClass : public LocalStageClass 25 | { 26 | private: 27 | IOSectionClass OutSection; 28 | Array AcceptRatio; 29 | ObservableVecDouble1 AcceptRatioVar; 30 | int EndAttempts; 31 | public: 32 | void WriteRatio(); 33 | void Accept(); 34 | void Reject(); 35 | void Read(IOSectionClass &in); 36 | double Sample(int &slice1,int &slice2, 37 | Array &activeParticles); 38 | EmptyStageClass(PathDataClass &pathData, int level, 39 | IOSectionClass &outSection) : 40 | LocalStageClass(pathData,outSection), 41 | OutSection(outSection), 42 | AcceptRatioVar("Acceptance Ratio",OutSection,PathData.Path.Communicator) 43 | { 44 | EndAttempts=0; 45 | AcceptRatio.resize(2); 46 | AcceptRatio=0; 47 | BisectionLevel=level; 48 | //do nothing for now 49 | 50 | } 51 | }; 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /src/Moves/EndStage.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef END_STAGE_CLASS_H 18 | #define END_STAGE_CLASS_H 19 | 20 | #include "MultiStage.h" 21 | #include "../Observables/ObservableVar.h" 22 | 23 | typedef enum {HEAD,TAIL} EndType; 24 | 25 | class EndStageClass : public LocalStageClass 26 | { 27 | private: 28 | EndType Open; 29 | int NumLevels; 30 | void ChooseTimeSlices(int &slice1,int &slice2); 31 | IOSectionClass OutSection; 32 | Array AcceptRatio; 33 | int EndAttempts; 34 | ObservableVecDouble1 AcceptRatioVar; 35 | public: 36 | bool OnlyX; 37 | void WriteRatio(); 38 | void Accept(); 39 | void Reject(); 40 | void Read(IOSectionClass &in); 41 | double Sample(int &slice1,int &slice2, 42 | Array &activeParticles); 43 | EndStageClass(PathDataClass &pathData, int numLevels, 44 | IOSectionClass &outSection) : 45 | LocalStageClass(pathData,outSection), 46 | OutSection(outSection), 47 | AcceptRatioVar("Acceptance Ratio",OutSection,PathData.Path.Communicator), 48 | NumLevels(numLevels) 49 | { 50 | AcceptRatio.resize(2); 51 | AcceptRatio=0; 52 | EndAttempts=0; 53 | //do nothing for now 54 | 55 | } 56 | }; 57 | 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /src/Moves/IonMoveManager.cc: -------------------------------------------------------------------------------- 1 | #include "IonMoveManager.h" 2 | 3 | void IonMoveClass::Read(IOSectionClass &in) 4 | { 5 | string speciesName; 6 | assert (in.ReadVar ("Species", speciesName)); 7 | MoveStage = new IonStageClass(PathData, NumLevels, IOSection, speciesName); 8 | MoveStage->Read (in); 9 | Stages.push_back (MoveStage); 10 | } 11 | -------------------------------------------------------------------------------- /src/Moves/IonMoveManager.h: -------------------------------------------------------------------------------- 1 | #ifndef ION_MOVE_MANAGER_CLASS_H 2 | #define ION_MOVE_MANAGER_CLASS_H 3 | 4 | 5 | #include "../PathDataClass.h" 6 | #include "MoveBase.h" 7 | #include "../Observables/ObservableVar.h" 8 | #include "IonMoveStage.h" 9 | 10 | class IonMoveClass : public MultiStageClass 11 | { 12 | private: 13 | int StepNum; 14 | int NumLevels, LowestLevel; 15 | int StepsPerBlock; 16 | bool HaveRefslice; 17 | int SpeciesNum; 18 | void ChooseTimeSlices(); 19 | StageClass* MoveStage; 20 | // ObservableDouble AcceptanceRatioVar; 21 | public: 22 | /// Number of levels the bisection move works on 23 | void Read(IOSectionClass &in); 24 | 25 | /// Override base class MakeMove to do a block of moves 26 | //void MakeMove(); 27 | 28 | IonMoveClass(PathDataClass &pathData, IOSectionClass &out) : 29 | MultiStageClass(pathData, out),StepNum(0) 30 | 31 | { 32 | // do nothing for now 33 | } 34 | }; 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/Moves/IonMoveStage.h: -------------------------------------------------------------------------------- 1 | #ifndef ION_MOVE_STAGE_CLASS_H 2 | #define ION_MOVE_STAGE_CLASS_H 3 | 4 | #include "MultiStage.h" 5 | #include "../Observables/ObservableVar.h" 6 | 7 | class IonStageClass : public LocalStageClass 8 | { 9 | Array PtclRoster; 10 | public: 11 | IonStageClass(PathDataClass &pathData, int level, IOSectionClass outSection, string SpeciesName); 12 | int specID; 13 | double dRMag; 14 | void Set(double setdRMag); 15 | void WriteRatio(); 16 | void Read(IOSectionClass& in); 17 | bool Attempt(int &slice1, int &slice2, Array &activeParticles, double &prevActionChange); 18 | double Sample(int &slice1,int &slice2, Array &activeParticles); 19 | // void Accept(); 20 | // void Reject(); 21 | //int TotalLevels; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/Moves/MoleculeMove.input: -------------------------------------------------------------------------------- 1 | // example for new MoleculeMove input format 2 | 3 | // conventional MoleculeMove 4 | Section (Move) 5 | { 6 | string Type="MoleculeMove"; 7 | string Name="WaterRotate"; 8 | Section(Stage) { 9 | string MoveMethod = "Rotate"; 10 | double SetAngle = 0.3; 11 | string Mode = "SEQUENTIAL"; 12 | Array Actions(2) = ["FM_MoleculeInteractions","LongRange"]; 13 | } 14 | } 15 | 16 | // Presampling block 17 | Section(Move) 18 | { 19 | string Type="PreSampleMoleculeMove"; 20 | string Name="PreSample"; 21 | int NumPreSteps = 32; 22 | int NumPreStages = 2; 23 | Section(PreStage) 24 | { 25 | string MoveMethod = "Translate"; 26 | Array Actions(2) = ["FM_MoleculeInteractions", "LongRange"]; 27 | // Translate 28 | double SetStep = 0.04; 29 | string Mode = "SEQUENTIAL"; 30 | } 31 | Section(PreStage) 32 | { 33 | string MoveMethod = "Rotate"; 34 | Array Actions(2) = ["FM_MoleculeInteractions", "LongRange"]; 35 | // Rotate 36 | double SetAngle = 0.04; 37 | string Mode = "SEQUENTIAL"; 38 | } 39 | 40 | Array PreActions(2) = ["FM_MoleculeInteractions", "LongRange"]; 41 | Array FinalActions(1) = ["QBoxAction"]; 42 | } 43 | 44 | // Stochastic Potential Switching Block 45 | Section(Move) 46 | { 47 | string Type="SPSMoleculeMove"; 48 | string Name="SPS"; 49 | double LogTransProb = 6015;//1.0;//0.001; 50 | double LogReverseTransProb = 0; 51 | Section(Stage) 52 | { 53 | string MoveMethod = "Translate"; 54 | double SetStep = 0.15; 55 | string Mode = "SEQUENTIAL"; 56 | Array Actions(1) = [""]; 57 | } 58 | 59 | Array FullActions(1) = ["MoleculeInteractions"]; 60 | Array SwitchActions(1) = ["EAM"]; 61 | } 62 | 63 | -------------------------------------------------------------------------------- /src/Moves/MoleculeMoveBase.h: -------------------------------------------------------------------------------- 1 | #ifndef MOLECULE_MOVE_BASE_H 2 | #define MOLECULE_MOVE_BASE_H 3 | 4 | //#include "MoveBase.h" 5 | #include "StageClass.h" 6 | 7 | // Identifies whether moves should be attempted globally 8 | // or one particle at a time (SINGLE) 9 | enum MoveMode{GLOBAL, SINGLE, SEQUENTIAL, MULTIPLE}; 10 | 11 | //class MolMoveClass: public ParticleMoveClass{ 12 | class MolMoveClass: public LocalStageClass{ 13 | int numMol, molIndex; 14 | int numActionsToRead, startIndex; 15 | public: 16 | MoveMode mode; 17 | int numAccepted, numMoves; 18 | double rc; 19 | // located in PathClass now 20 | // This will store an array of active particles for each molecule in the sim; 21 | // should eliminate the need to repeatedly asemble these arrays at each move 22 | //Array,1> MolMembers; 23 | Array MoveList; 24 | MolMoveClass(PathDataClass&, IO::IOSectionClass); 25 | //MolMoveClass(PathDataClass&, IO::IOSectionClass, int numToRead, int start); 26 | dVec GetCOM(int slice, int mol); 27 | dVec TranslateMol(int slice, Array& activePtcls, double epsilon); 28 | dVec TranslateMol(int slice, Array& activePtcls, dVec translate); 29 | dVec TranslateMolAll(Array& activePtcls, double epsilon); 30 | void TranslatePtcl(int slice, int ptcl, double Sigma); 31 | void MoveDimerSeparation(int slice, Array mol1, Array mol2, double Sigma); 32 | void RotateMol(int slice, Array& activePtcls, dVec& axis, double theta); 33 | void RotateMol(int slice, Array& activePtcls, double theta); 34 | void RotateMolXYZ(int slice, Array& activePtcls, double theta); 35 | void RotateMolXYZ(Array& Slices, Array& activePtcls, double theta); 36 | void RotateMolXYZAll(Array& activePtcls, double theta); 37 | void StressAngle(int slice, int ptcl, dVec axis, double theta); 38 | void StressBond(int slice, int ptcl, int mol, double s); 39 | void Read (IOSectionClass &in); 40 | void Accept(); 41 | void Advance(); 42 | void LoadActions(list actions); 43 | }; 44 | 45 | dVec ArbitraryRotate(dVec axis,dVec coord, double phi); 46 | dVec RotateXYZ(dVec coord,int u1,int u2,int u3,double theta); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/Moves/MoleculeMoveManager.h: -------------------------------------------------------------------------------- 1 | #ifndef MOLECULE_MOVE_MANAGER_CLASS_H 2 | #define MOLECULE_MOVE_MANAGER_CLASS_H 3 | 4 | 5 | #include "../PathDataClass.h" 6 | #include "MoveBase.h" 7 | #include "../Observables/ObservableVar.h" 8 | #include "MoleculeMove.h" 9 | #include "AVBMove.h" 10 | #include "MultiStage.h" 11 | #include "MoleculeBias.h" 12 | 13 | class MoleculeMoveStageManagerClass : public MultiStageClass 14 | { 15 | private: 16 | int SpeciesNum; 17 | // void ChooseTimeSlices(); 18 | //StageClass* MoveStage; 19 | StageClass* MoveStage; 20 | // ObservableDouble AcceptanceRatioVar; 21 | public: 22 | /// Number of levels the bisection move works on 23 | void Read(IOSectionClass &in); 24 | 25 | /// Override base class MakeMove to do a block of moves 26 | //void MakeMove(); 27 | 28 | MoleculeMoveStageManagerClass(PathDataClass &pathData, IOSectionClass &out) : 29 | MultiStageClass(pathData, out) 30 | 31 | { 32 | // do nothing for now 33 | } 34 | }; 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/Moves/MoveClass.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef MOVE_CLASS_H 18 | #define MOVE_CLASS_H 19 | 20 | 21 | #include "BisectionBlock.h" 22 | #include "BisectionSphereBlock.h" 23 | #include "CentroidMove.h" 24 | #include "CenterDropletMove.h" 25 | #include "MetaMoves.h" 26 | #include "PermuteTableClass.h" 27 | #include "RandomPermMove.h" 28 | #include "MultiStage.h" 29 | #include "PreSampling.h" 30 | #include "SPS.h" 31 | #include "IonMoveManager.h" 32 | #include "MoleculeMoveManager.h" 33 | 34 | #include "CorrelatedBisectionBlock.h" 35 | #include "CenterofMassMove.h" 36 | #include "RefSliceMove.h" 37 | #include "RefSliceShift.h" 38 | #include "DisplaceMove.h" 39 | #include "NodalModelMove.h" 40 | #include "DisplaceMoveFast.h" 41 | #include "OpenEndMove.h" 42 | #include "MoleculeMove.h" 43 | #include "SwapMove.h" 44 | #include "ClusterMove.h" 45 | #include "StructureRejectStage.h" 46 | #include "CouplingMove.h" 47 | 48 | 49 | 50 | #include "WormGrow.h" 51 | #include "ReadPath.h" 52 | #endif 53 | -------------------------------------------------------------------------------- /src/Moves/MoveUtils.h: -------------------------------------------------------------------------------- 1 | #ifndef MOVE_UTILITIES_H 2 | #define MOVE_UTILITIES_H 3 | 4 | 5 | #include "../Blitz.h" 6 | // typedef TinyVector dVec; 7 | 8 | // A number of functions used by several 9 | // Move and Action classes 10 | // -jg 11 | 12 | dVec crossprod(dVec v1, dVec v2); 13 | dVec cross(dVec v1, dVec v2); 14 | 15 | // return the dot product of two vectors 16 | double dotprod(dVec vec1, dVec vec2); 17 | 18 | // return the dot product of two vectors, 19 | // normalizing by a given value 20 | // i.e. gives the dot product of two unit vectors 21 | double dotprod(dVec vec1, dVec vec2, double mag); 22 | 23 | // returns the magnitude of a vector 24 | double Mag(dVec v); 25 | 26 | // normalizes a vector 27 | // i.e. generates a unit vector 28 | dVec Normalize(dVec v); 29 | 30 | // Scales a vector by a given scalar 31 | // now deprecated 32 | dVec Scale(dVec v, double scale); 33 | 34 | // **Re-Scales** a vector by a given scalar 35 | // used to be called Scale() 36 | dVec Renormalize(dVec v, double scale); 37 | 38 | // Takes a vector u and a unit vector R 39 | // and returns the vector aligned that is 40 | // the component of u parallel to R, and 41 | // perp, the component of u perpendicular to R 42 | void Strip(dVec R, dVec u,dVec &aligned, dVec &perp); 43 | 44 | // not really supported; just a quick hack 45 | double GetAngle(dVec v1, dVec v2); 46 | dVec GetBisector(dVec v1, dVec v2); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/Moves/NoPermuteStage.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef NO_PERMUTE_STAGE_CLASS_H 18 | #define NO_PERMUTE_STAGE_CLASS_H 19 | 20 | #include "PermuteStage.h" 21 | #include "MultiStage.h" 22 | #include "PermuteTableClass.h" 23 | #include "../Observables/ObservableVar.h" 24 | 25 | class NoPermuteStageClass : public PermuteStageClass 26 | { 27 | private: 28 | int ChooseParticle(); 29 | int NumLevels; 30 | int NumMoves; 31 | public: 32 | double Sample (int &slice1, int &slice2, Array &activeParticles); 33 | bool Attempt (int &slice1, int &slice2, Array &activeParticles, double &prevActionChange); 34 | 35 | void InitBlock(int &slice1,int &slice2); 36 | NoPermuteStageClass (PathDataClass &pathData, int speciesNum, int numLevels, IOSectionClass &outSection) 37 | : PermuteStageClass(pathData, speciesNum, numLevels,outSection) 38 | { 39 | // do nothing for now 40 | } 41 | }; 42 | 43 | 44 | 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Moves/OpenEndMove.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef OPENENDMOVE_CLASS_H 18 | #define OPENENDMOVE_CLASS_H 19 | 20 | 21 | #include "../PathDataClass.h" 22 | #include "MoveBase.h" 23 | #include "MultiStage.h" 24 | 25 | 26 | 27 | 28 | /// This is the bisection move class inherited from ParticleMoveClass 29 | /// Explanation of how bisection moves work is in 30 | /// Path Integrals in the theory of condensed helium 31 | /// by D.M. Ceperley (Review of Modern Physics 1995) section V.H 32 | class OpenEndMoveClass : public MultiStageClass 33 | { 34 | private: 35 | // EndType Open; 36 | int SpeciesNum; 37 | public: 38 | ///Number of levels the bisection move works on 39 | int NumLevels; 40 | void Read(IOSectionClass &moveInput); 41 | void WriteRatio(); 42 | void MakeMove(); 43 | OpenEndMoveClass(PathDataClass &myPathData, IOSectionClass iosection) : 44 | MultiStageClass(myPathData,iosection) 45 | { 46 | /* Do nothing for now. */ 47 | } 48 | }; 49 | 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/Moves/PermuteStage.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | 18 | #include "PermuteStage.h" 19 | 20 | 21 | void PermuteStageClass::InitBlock(int &slice1, int &slice2) 22 | { 23 | //do nothing for now 24 | } 25 | void PermuteStageClass::Read (IOSectionClass &in) 26 | { 27 | //do nothing for now 28 | } 29 | void PermuteStageClass::Accept() 30 | { 31 | // 32 | } 33 | 34 | void PermuteStageClass::Reject() 35 | { 36 | //do nothing for now 37 | } 38 | 39 | 40 | 41 | // double TablePermuteStageClass::Sample (int &slice1, int &slice2, 42 | // Array &activeParticles) 43 | // { 44 | 45 | 46 | // } 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/Moves/RandomPermClass.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | //#include "Common/Blitz.h" 18 | #include "../PathDataClass.h" 19 | #ifndef RANDOM_PERM_CLASS_H 20 | #define RANDOM_PERM_CLASS_H 21 | 22 | 23 | class RandomPermClass 24 | { 25 | private: 26 | /* double GetActionEstimate(int i, int j, double fourLambdaBetaInv, */ 27 | /* Array speciesData); */ 28 | Array ActionPairs; 29 | 30 | 31 | 32 | 33 | public: 34 | void GetActionPairs(); 35 | void Apply(); 36 | void Read(IOSectionClass &inSection); 37 | PathDataClass &PathData; 38 | RandomPermClass(PathDataClass &myPathData); 39 | int Slice1,Slice2; 40 | int SpeciesNum; 41 | Array PermArray; //Must resize perm array 42 | void GeneratePerm(); 43 | Array CurrentParticles; 44 | }; 45 | 46 | 47 | 48 | 49 | /* inline double RandomPermClass::GetActionEstimate(int i,int j, */ 50 | /* double fourLambdaBetaInv, */ 51 | /* Array speciesData) */ 52 | /* { */ 53 | /* dVec disp_ij=speciesData(Slice2,j)-speciesData(Slice1,i); */ 54 | /* PathData.Path.PutInBox(disp_ij); */ 55 | /* double dist_ij=dot(disp_ij,disp_ij); */ 56 | /* return exp(-dist_ij*fourLambdaBetaInv); */ 57 | /* } */ 58 | 59 | 60 | 61 | 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/Moves/ReadPath.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef READ_PATH_H 18 | #define READ_PATH_H 19 | 20 | #include "../PathDataClass.h" 21 | #include "MoveBase.h" 22 | 23 | class ReadPathClass : public MoveClass 24 | { 25 | public: 26 | int NumConfigs; 27 | int currConfig; 28 | void MakeMove(); 29 | void Read(IOSectionClass &input); 30 | IOVarBase *IOVar; 31 | Array ActiveParticles; 32 | ReadPathClass(PathDataClass &myPathData, IOSectionClass &io) : 33 | MoveClass(myPathData,io) 34 | { 35 | //do nothing for now 36 | } 37 | }; 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/Moves/RefSliceShift.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef REF_SLICE_SHIFT_H 18 | #define REF_SLICE_SHIFT_H 19 | 20 | #include "../PathDataClass.h" 21 | #include "MultiStage.h" 22 | 23 | class RefSliceShiftStageClass : public CommonStageClass 24 | { 25 | private: 26 | int oldRefSlice; 27 | 28 | public: 29 | int maxShift; 30 | void Accept(); 31 | void Reject(); 32 | 33 | double Sample (int &slice1, int &slice2, Array &activeParticles); 34 | RefSliceShiftStageClass (PathDataClass &pathData,IOSectionClass &outSection) : 35 | CommonStageClass (pathData,outSection) 36 | {} 37 | }; 38 | 39 | 40 | class RefSliceShiftClass : public MultiStageClass 41 | { 42 | private: 43 | int maxShift; 44 | RefSliceShiftStageClass RefSliceShiftStage; 45 | Array activeSpecies; 46 | public: 47 | // Read the parameters from the input file 48 | void Read (IOSectionClass &in); 49 | // Actually attempts the move and accepts or rejects 50 | void MakeMove(); 51 | RefSliceShiftClass (PathDataClass &pathData, IOSectionClass &outSection) : 52 | MultiStageClass(pathData, outSection), RefSliceShiftStage(pathData, outSection) 53 | {} 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/Moves/SpaceWarp.h: -------------------------------------------------------------------------------- 1 | #ifndef SPACE_WARP_H 2 | #define SPACE_WARP_H 3 | 4 | #include "../Blitz.h" 5 | 6 | class SpaceWarpClass 7 | { 8 | protected: 9 | int N; 10 | /// The current ion positions 11 | Array Rions; 12 | /// The proposed change in ion positions 13 | Array DeltaRions; 14 | Array rhat, Wgr; 15 | Array Weights, g; 16 | Vec3 Box, BoxInv; 17 | bool DoForward; 18 | void PutInBox(Vec3 &r); 19 | /// The unnormalized weight function 20 | inline double phi(double rinv) { return rinv*rinv*rinv*rinv;} 21 | /// Its logarithmic derivative 22 | inline double d_ln_phi(double rinv) { return -4.0*rinv; }; 23 | public: 24 | /// Set the ions and their change 25 | void Set (const Array &rions, const Array &delta, Vec3 box, 26 | bool doForward=true); 27 | Vec3 ForwardWarp(Vec3 r, Mat3 &jmat); 28 | Vec3 ForwardWarp(Vec3 r); 29 | /// For a given ending position, this function returns where I must 30 | /// have warped from. Solves iteratively. 31 | Vec3 ReverseWarp(Vec3 rp, Mat3 &jmat); 32 | Vec3 ReverseWarp(Vec3 rp); 33 | /// Warp based in the current set direction. 34 | inline Vec3 Warp (Vec3 r, Mat3 &jmat); 35 | /// This function sets r1p to make {r0,r1,r2} and {r0p,r1p,r2p} 36 | /// similar triangles. It returns the length ratio |r2p-r0p|/|r2-r0|. 37 | void SimilarTriangles (const Vec3 &r0, const Vec3 &r1, const Vec3 &r2, 38 | const Vec3 &r0p, Vec3 &r1p, const Vec3 &r2p, 39 | double &alpha, double &beta, double &h, 40 | double &ratio); 41 | /// Adjusts r1 to scale the height by factor s. Returns the scaled height. 42 | double ScaleTriangleHeight (const Vec3 &r0, Vec3 &r1, const Vec3 &r2, 43 | double s); 44 | // Solves the equation As^2 + B ln(s) + C = 0; returns s. 45 | double SolveScaleEquation (double A, double B, double C); 46 | }; 47 | 48 | inline Vec3 49 | SpaceWarpClass::Warp (Vec3 r, Mat3 &jmat) 50 | { 51 | if (DoForward) 52 | return ForwardWarp (r, jmat); 53 | else 54 | return ReverseWarp (r, jmat); 55 | } 56 | 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/Moves/StructureRejectStage.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | 18 | #include "StructureRejectStage.h" 19 | 20 | 21 | double StructureRejectStageClass::Sample(int &slice1,int &slice2, 22 | Array &changedParticles) 23 | { 24 | //do nothing for now 25 | } 26 | 27 | 28 | 29 | 30 | void StructureRejectStageClass::Read (IOSectionClass &in) 31 | { 32 | assert(in.ReadVar("MaxValue",MaxValue)); 33 | StructureFactor.Read(in); 34 | } 35 | 36 | bool StructureRejectStageClass::Attempt (int &slice1, int &slice2, 37 | Array &activeParticles, 38 | double &prevActionChange) 39 | { 40 | bool toReturn=false; 41 | // double tcounts=(double)StructureFactor.TotalCounts; 42 | // double nslices=(double)PathData.Path.NumTimeSlices(); 43 | double norm=PathData.Path.NumParticles(); 44 | StructureFactor.Calculate(); 45 | for (int counter=0;counter4){ 48 | toReturn=true; 49 | } 50 | } 51 | StructureFactor.Clear(); 52 | return toReturn; 53 | } 54 | -------------------------------------------------------------------------------- /src/Moves/StructureRejectStage.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef STRUCTURE_REJECT_STAGE_CLASS_H 18 | #define STRUCTURE_REJECT_STAGE_CLASS_H 19 | 20 | #include "MultiStage.h" 21 | #include "../Observables/StructureFactor.h" 22 | 23 | class StructureRejectStageClass : public LocalStageClass 24 | { 25 | private: 26 | int Species1; 27 | int Species2; 28 | double MaxValue; 29 | StructureFactorClass StructureFactor; 30 | public: 31 | void Read(IOSectionClass &in); 32 | double Sample (int &slice1,int &slice2, 33 | Array &changedParticles); 34 | bool Attempt(int &slice1, int &slice2, 35 | Array &activeParticles, 36 | double &prevActionChange); 37 | 38 | StructureRejectStageClass (PathDataClass &pathData, IOSectionClass &in, 39 | IOSectionClass &out) 40 | : LocalStageClass(pathData,out), 41 | StructureFactor(pathData,in) 42 | { 43 | // do nothing for now 44 | } 45 | 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/Moves/WormClose.h: -------------------------------------------------------------------------------- 1 | #ifndef WORM_CLOSE_MOVE_H 2 | #define WORM_CLOSE_MOVE_H 3 | 4 | 5 | #include "../PathDataClass.h" 6 | #include "EmptyStage.h" 7 | #include "LeviFlightStage.h" 8 | #include "MultiStage.h" 9 | 10 | 11 | 12 | /// This is the displace move, which attempts to pick up a whole 13 | /// single-particle path and displace it by a random amount. 14 | class WormCloseMoveClass : public MultiStageClass 15 | { 16 | private: 17 | /// This is the standard distribution of the displacement gaussian 18 | double Sigma; 19 | LeviFlightStageClass LeviFlightStage; 20 | EmptyStageClass EmptyStage; 21 | ///We distinguish between the ActiveParticles which are the one's 22 | /// the stage actually works on and whose action may change and the 23 | /// SavedParticles which are the particles that need to be saved. 24 | Array SavedParticles; 25 | int SavedSlice1; 26 | int SavedSlice2; 27 | public: 28 | // Read the parameters from the input file 29 | void Read (IOSectionClass &in); 30 | void MakeMove(); 31 | void ChooseTimeSlices(); 32 | void SwapPermutations(int newHead,int oldHead); 33 | void Accept(); 34 | void Reject(); 35 | // Actually attempts the move and accepts or rejects 36 | // void MakeMove(); 37 | WormCloseMoveClass (PathDataClass &pathData, IOSectionClass &outSection) : 38 | MultiStageClass(pathData, outSection), 39 | LeviFlightStage(pathData, outSection), 40 | EmptyStage(pathData,0,outSection) 41 | 42 | { 43 | DumpFreq = 20; 44 | } 45 | }; 46 | 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/Moves/WormRemove.h: -------------------------------------------------------------------------------- 1 | #ifndef WORM_REMOVE_MOVE_H 2 | #define WORM_REMOVE_MOVE_H 3 | 4 | 5 | #include "../PathDataClass.h" 6 | #include "EmptyStage.h" 7 | #include "MultiStage.h" 8 | 9 | 10 | 11 | /// This is the displace move, which attempts to pick up a whole 12 | /// single-particle path and displace it by a random amount. 13 | class WormRemoveMoveClass : public MultiStageClass 14 | { 15 | private: 16 | /// This is the standard distribution of the displacement gaussian 17 | double Sigma; 18 | EmptyStageClass EmptyStage; 19 | public: 20 | // Read the parameters from the input file 21 | void Read (IOSectionClass &in); 22 | void MakeMove(); 23 | dVec RandomBoxLocation(); 24 | int CountWormSize(); 25 | // Actually attempts the move and accepts or rejects 26 | // void MakeMove(); 27 | WormRemoveMoveClass (PathDataClass &pathData, IOSectionClass &outSection) : 28 | MultiStageClass(pathData, outSection), 29 | EmptyStage(pathData,0,outSection) 30 | 31 | { 32 | DumpFreq = 20; 33 | } 34 | }; 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/Moves/WormStage.h: -------------------------------------------------------------------------------- 1 | #ifndef WORM_STAGE_CLASS_H 2 | #define WORM_STAGE_CLASS_H 3 | 4 | #include "MultiStage.h" 5 | #include "../Observables/ObservableVar.h" 6 | 7 | class WormStageClass : public LocalStageClass 8 | { 9 | public: 10 | void WriteRatio(); 11 | ObservableDouble AcceptRatioVar; 12 | double Sample(int &slice1,int &slice2, 13 | Array &activeParticles); 14 | void Read(IOSectionClass &io); 15 | 16 | void Accept(); 17 | void Reject(); 18 | bool PadWorm(); 19 | void MakeRoomForGrowingTail(int changeAmount,int &tailSlice); 20 | void MakeRoomForShrinkingTail(int changeAmount,int &tailSlice); 21 | void MakeRoomForGrowingHead(int slicesToGrow,int &headSlice); 22 | void MakeRoomForShrinkingHead(int slicesToShrink,int &headSlice); 23 | bool MoveHead; 24 | bool Grow; 25 | int ChangeAmount; 26 | 27 | WormStageClass(PathDataClass &pathData, 28 | IOSectionClass outSection) : 29 | LocalStageClass(pathData,outSection), 30 | AcceptRatioVar("AcceptRatio",OutSection,pathData.Path.Communicator) 31 | { 32 | //do nothing for now 33 | BisectionLevel = 0; 34 | } 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/Moves/deprecated/BisectionMoveClass.h: -------------------------------------------------------------------------------- 1 | /// \cond deprecated 2 | #ifndef BISECTIONMOVE_CLASS2_H 3 | #define BISECTIONMOVE_CLASS2_H 4 | 5 | //#include "../Common.h" 6 | #include "MoveBase.h" 7 | #include "../PathDataClass.h" 8 | // #include "../ActionClass.h" 9 | #include "BisectionClass.h" 10 | 11 | /// This is the bisection move class inherited from ParticleMoveClass 12 | /// Explanation of how bisection moves work is in 13 | /// Path Integrals in the theory of condensed helium 14 | /// by D.M. Ceperley (Review of Modern Physics 1995) section V.H 15 | class BisectionMoveClass : public ParticleMoveClass 16 | { 17 | private: 18 | BisectionClass Bisection; 19 | public: 20 | ///This is the slice in which the bisection move starts. It ends up 21 | ///going to StartTimeSlice+2^NumLevels 22 | int StartTimeSlice; 23 | ///Number of levels the bisection move works on 24 | int NumLevels; 25 | void Read(IOSectionClass &moveInput); 26 | /// Function to actually make a bisection move. 27 | void MakeMove(); 28 | void WriteRatio(); 29 | 30 | BisectionMoveClass(PathDataClass &myPathData, IOSectionClass outSection) : 31 | ParticleMoveClass(myPathData, outSection), 32 | Bisection(myPathData) 33 | { 34 | ///Defaults to the 0'th time slice but shouldn't matter because it 35 | ///chooses a different time slice each time. 36 | StartTimeSlice=0; 37 | } 38 | }; 39 | 40 | 41 | #endif 42 | /// \endcond 43 | -------------------------------------------------------------------------------- /src/Moves/deprecated/OpenBisectionMoveClass.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENBISECTIONMOVE_CLASS2_H 2 | #define OPENBISECTIONMOVE_CLASS2_H 3 | 4 | //#include "../Common.h" 5 | #include "MoveBase.h" 6 | #include "../PathDataClass.h" 7 | //#include "../ActionClass.h" 8 | #include "BisectionClass.h" 9 | 10 | /// This is the bisection move class inherited from ParticleMoveClass 11 | /// Explanation of how bisection moves work is in 12 | /// Path Integrals in the theory of condensed helium 13 | /// by D.M. Ceperley (Review of Modern Physics 1995) section V.H 14 | class OpenBisectionMoveClass : public ParticleMoveClass 15 | { 16 | private: 17 | BisectionClass Bisection; 18 | string Open; 19 | public: 20 | ///Number of levels the bisection move works on 21 | int NumLevels; 22 | void Read(IOSectionClass &moveInput); 23 | /// Function to actually make a bisection move. 24 | void MakeMove(); 25 | 26 | OpenBisectionMoveClass(PathDataClass &myPathData, IOSectionClass iosection) : 27 | ParticleMoveClass(myPathData, iosection), 28 | Bisection(myPathData) 29 | { 30 | /* Do nothing for now. */ 31 | } 32 | }; 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Observables/Angular.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef ANGULAR_H 18 | #define ANGULAR_H 19 | 20 | #include "ObservableBase.h" 21 | 22 | class AngularClass : public ObservableClass 23 | { 24 | private: 25 | int Freq,DumpFreq; 26 | int TotalCounts; 27 | int TimesCalled; 28 | ObservableVecDouble2 CorVar; 29 | 30 | public: 31 | ///l x t 32 | Array Correlation; 33 | int Species; 34 | void Accumulate(); 35 | void Read(IOSectionClass& in); 36 | void WriteBlock(); 37 | AngularClass(PathDataClass &myPathData, IOSectionClass &ioSection) : 38 | ObservableClass(myPathData,ioSection), 39 | CorVar("y", IOSection, myPathData.Path.Communicator) 40 | { 41 | TimesCalled=0; 42 | } 43 | 44 | }; 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/Observables/Coupling.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef COUPLING_H 18 | #define COUPLING_H 19 | 20 | #include "ObservableBase.h" 21 | 22 | /// A pair correlation function observable. 23 | class CouplingClass : public ObservableClass 24 | { 25 | private: 26 | ObservableVecDouble1 couplingVar; 27 | /// Stores number of counts in each bin 28 | Array Coupling; 29 | /// Stores the total number of counts 30 | int TotalCounts; 31 | int TimesCalled; 32 | int Freq; 33 | int DumpFreq; 34 | public: 35 | /// My specialization of the virtual function. 36 | void Accumulate(); 37 | /// My specialization of the virtual function. 38 | void Initialize(); 39 | /// My specialization of the virtual function. 40 | void WriteBlock(); 41 | void WriteInfo(); 42 | void Read(IOSectionClass& IO); 43 | CouplingClass(PathDataClass &myPathData, IOSectionClass &ioSection) : 44 | ObservableClass(myPathData,ioSection), 45 | couplingVar("y", IOSection, myPathData.Path.Communicator) 46 | { 47 | Initialize(); 48 | } 49 | 50 | 51 | }; 52 | 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/Observables/DistanceToHead.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef DISTANCE_TO_HEAD_H 18 | #define DISTANCE_TO_HEAD_H 19 | 20 | #include "ObservableBase.h" 21 | 22 | class HeadLocClass : public ObservableClass 23 | { 24 | 25 | private: 26 | //Must be initialized 27 | Array HeadLoc; 28 | Array TailLoc; 29 | ///This is the set of locations you should compare against to decide 30 | ///the location of the head and the tail 31 | Array FixedLoc; 32 | ObservableVecDouble1 HeadLocVar,TailLocVar; 33 | 34 | int NumSamples; 35 | int TimesCalled; 36 | int Freq; 37 | int DumpFreq; 38 | public: 39 | void WriteInfo(); 40 | void Accumulate(); 41 | void WriteBlock(); 42 | void Read(IOSectionClass& in); 43 | HeadLocClass(PathDataClass &myPathData, IOSectionClass &ioSection) 44 | : ObservableClass(myPathData, ioSection) , 45 | HeadLocVar("HeadLocation",IOSection,myPathData.Path.Communicator), 46 | TailLocVar("TailLocation",IOSection,myPathData.Path.Communicator) 47 | { 48 | NumSamples = 0; 49 | TimesCalled=0; 50 | } 51 | }; 52 | 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/Observables/HistogramClass.h: -------------------------------------------------------------------------------- 1 | #include "../Blitz.h" 2 | #include 3 | #include 4 | 5 | class HistogramClass 6 | { 7 | public: 8 | vector histogram; 9 | int NumPoints; 10 | double totalPoints; 11 | double delta; 12 | double startVal; 13 | double endVal; 14 | void Init(int t_NumPoints, double t_startVal, double t_endVal) 15 | { 16 | NumPoints=t_NumPoints; 17 | startVal=t_startVal; 18 | endVal=t_endVal; 19 | delta=(endVal-startVal)/NumPoints; 20 | histogram.resize(NumPoints); 21 | totalPoints=0.0; 22 | for (int i=0;i=0 && n_loc Phase; 27 | ObservableVecDouble1 PhaseVar; 28 | 29 | int NumSamples; 30 | int TimesCalled; 31 | public: 32 | void Accumulate(); 33 | void WriteBlock(); 34 | void Read(IOSectionClass& in); 35 | JosephsonPathDumpClass(PathDataClass &myPathData, IOSectionClass &ioSection) 36 | : ObservableClass(myPathData, ioSection) , 37 | PhaseVar("Phase",IOSection,myPathData.Path.Communicator) 38 | 39 | { 40 | Phase.resize(PathData.Path.NumTimeSlices()); 41 | TimesCalled=0; 42 | 43 | } 44 | }; 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/Observables/NodalModelTime.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef NODALMODELTIME_H 18 | #define NODALMODELTIME_H 19 | 20 | #include "ObservableBase.h" 21 | #include "../MatrixOps/MatrixOps.h" 22 | 23 | class NodalModelTimeClass : public ObservableClass 24 | { 25 | private: 26 | ObservableVecDouble1 NodalModelTimeVar; 27 | Array counts; 28 | int NumSamples; 29 | string Species; 30 | public: 31 | /// This grid defines the bins. Bin 0 is bounded by 0 on the 32 | /// bottom and grid(0) on the top. 33 | void Accumulate(); 34 | void Read(IOSectionClass& in); 35 | void WriteBlock(); 36 | void WriteInfo(); 37 | NodalModelTimeClass(PathDataClass &myPathData, IOSectionClass &ioSection) : 38 | ObservableClass(myPathData,ioSection), 39 | NodalModelTimeVar("Time", IOSection, myPathData.Path.Communicator) 40 | { 41 | NumSamples = 0; 42 | } 43 | 44 | }; 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/Observables/ObservableVar.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | 18 | 19 | #include "../Communication/Communication.h" 20 | #include "ObservableVar.h" 21 | 22 | 23 | void ObservableVar:: 24 | Flush() 25 | { 26 | if (Comm.MyProc()==0) 27 | Out.FlushFile(); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /src/Observables/OpenOrientation.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef OPEN_ORIENTATION_H 18 | #define OPEN_ORIENTATION_H 19 | 20 | #include "ObservableBase.h" 21 | 22 | class OpenOrientationClass : public ObservableClass 23 | { 24 | 25 | private: 26 | //Must be initialized 27 | double R2; 28 | double Z2; 29 | double R2OverZ2; 30 | 31 | ObservableDouble R2Var; 32 | ObservableDouble Z2Var; 33 | ObservableDouble R2OverZ2Var; 34 | 35 | int NumSamples; 36 | int TimesCalled; 37 | int Freq; 38 | int DumpFreq; 39 | public: 40 | void WriteInfo(); 41 | void Accumulate(); 42 | void WriteBlock(); 43 | void Read(IOSectionClass& in); 44 | OpenOrientationClass(PathDataClass &myPathData, IOSectionClass &ioSection) 45 | : ObservableClass(myPathData, ioSection) , 46 | R2Var("R2",IOSection,myPathData.Path.Communicator), 47 | Z2Var("Z2",IOSection,myPathData.Path.Communicator), 48 | R2OverZ2Var("R2OverZ2",IOSection,myPathData.Path.Communicator) 49 | { 50 | NumSamples = 0; 51 | TimesCalled=0; 52 | } 53 | }; 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/Observables/ParticleAverageLoc.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef PARTICLE_AVERAGE_LOC_H 18 | #define PARTICLE_AVERAGE_LOC_H 19 | 20 | #include "ObservableBase.h" 21 | #include 22 | #include 23 | 24 | class ParticleAverageLocClass : public ObservableClass 25 | { 26 | 27 | private: 28 | int Species; 29 | Array ParticleCenterOfMass; 30 | ObservableVecDouble2 ParticleAverageLocVar; 31 | int NumSamples; 32 | int TimesCalled; 33 | int Freq; 34 | int DumpFreq; 35 | public: 36 | void WriteInfo(); 37 | void Accumulate(); 38 | void WriteBlock(); 39 | void Read(IOSectionClass& in); 40 | ParticleAverageLocClass(PathDataClass &myPathData, IOSectionClass &ioSection) 41 | : ObservableClass(myPathData, ioSection) , 42 | ParticleAverageLocVar("y",IOSection,myPathData.Path.Communicator) 43 | { 44 | NumSamples = 0; 45 | TimesCalled=0; 46 | } 47 | }; 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/Observables/PermutationCount.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef PERMUTATIONCOUNT_H 18 | #define PERMUTATIONCOUNT_H 19 | 20 | #include "ObservableBase.h" 21 | 22 | class PermutationCountClass : public ObservableClass 23 | { 24 | private: 25 | ObservableVecDouble1 SectorCountVar; 26 | ObservableVecDouble1 CycleCountVar; 27 | ObservableVecInt2 PossPermsVar; 28 | vector SectorCount; 29 | Array CycleCount; 30 | int NumSamples; 31 | int Species; 32 | public: 33 | void Accumulate(); 34 | void Read(IOSectionClass& in); 35 | void WriteBlock(); 36 | PermutationCountClass(PathDataClass &myPathData, IOSectionClass &ioSection) : 37 | ObservableClass(myPathData,ioSection), 38 | PossPermsVar("PossPerms", IOSection, myPathData.Path.Communicator), 39 | CycleCountVar("y", IOSection, myPathData.Path.Communicator), 40 | SectorCountVar("SectorCount",IOSection,myPathData.Path.Communicator) 41 | { 42 | NumSamples = 0; 43 | //SectorCount = 0.0; 44 | CycleCount = 0.0; 45 | } 46 | 47 | }; 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/Observables/Phik.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #include "Phik.h" 18 | 19 | 20 | 21 | void PhiKClass::Accumulate() 22 | { 23 | //Move the join to the end so we don't have to worry about permutations 24 | PathData.MoveJoin(PathData.NumTimeSlices()-1); 25 | 26 | NumSamples++; 27 | 28 | int slice1 = 0; 29 | int slice2 = PathData.Path.NumTimeSlices()-1; 30 | int numTimeSlices=PathData.Path.NumTimeSlices(); 31 | PathClass &Path= PathData.Path; 32 | for (int tau=0;tau PhiK; 27 | ObservableVecDouble1 PhiKVar; 28 | 29 | 30 | 31 | int NumSamples; 32 | int TimesCalled; 33 | public: 34 | void Accumulate(); 35 | void WriteBlock(); 36 | void Read(IOSectionClass& in); 37 | PhiKClass(PathDataClass &myPathData, IOSectionClass &ioSection) 38 | : ObservableClass(myPathData, ioSection) , 39 | PhiKVar("PhiK",IOSection,myPathData.Path.Communicator) 40 | 41 | { 42 | PhiK.resize(PathData.Path.NumTimeSlices()); 43 | PhiK=0; 44 | TimesCalled=0; 45 | 46 | } 47 | }; 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/Observables/PlaneDensity.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef PLANE_DENSITY_H 18 | #define PLANE_DENSITY_H 19 | 20 | #include "ObservableBase.h" 21 | #include 22 | #include 23 | 24 | class PlaneDensityClass : public ObservableClass 25 | { 26 | 27 | private: 28 | Array Grid; 29 | ObservableVecDouble2 GridVar; 30 | int IntoGrid(double num,int dim); 31 | int NumSamples; 32 | int TimesCalled; 33 | int Freq; 34 | int DumpFreq; 35 | public: 36 | void WriteInfo(); 37 | void Accumulate(); 38 | void WriteBlock(); 39 | void Read(IOSectionClass& in); 40 | PlaneDensityClass(PathDataClass &myPathData, IOSectionClass &ioSection) 41 | : ObservableClass(myPathData, ioSection) , 42 | GridVar("y",IOSection,myPathData.Path.Communicator) 43 | { 44 | NumSamples = 0; 45 | TimesCalled=0; 46 | int numPoints=1000; 47 | Grid.resize(numPoints,numPoints); 48 | Grid=0.0; 49 | } 50 | }; 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/Observables/Sign.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | #include "../Communication/Communication.h" 17 | #include "Sign.h" 18 | 19 | 20 | // Fix to include final link between link M and 0 21 | void SignClass::Accumulate() 22 | { 23 | 24 | NumSamples++; 25 | double FullSign = 0.0; 26 | double currSign=PathData.Path.SignWeight; 27 | PathData.Path.Communicator.GatherProd(currSign,FullSign,0); 28 | Sign=Sign+FullSign; 29 | 30 | } 31 | 32 | void SignClass::ShiftData (int NumTimeSlices) 33 | { 34 | // Do nothing 35 | } 36 | 37 | void SignClass::WriteBlock() 38 | { 39 | Sign=Sign/(double)NumSamples; 40 | Tot.Write(Sign); 41 | if (PathData.Path.Communicator.MyProc()==0) 42 | IOSection.FlushFile(); 43 | Sign = 0.0; 44 | NumSamples = 0; 45 | } 46 | 47 | void SignClass::Read(IOSectionClass &in) 48 | { 49 | ObservableClass::Read(in); 50 | if (PathData.Path.Communicator.MyProc()==0){ 51 | WriteInfo(); 52 | IOSection.WriteVar("Type","Scalar"); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Observables/Sign.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef SIGN_H 18 | #define SIGN_H 19 | 20 | 21 | 22 | #include "ObservableBase.h" 23 | 24 | 25 | 26 | 27 | class SignClass : public ObservableClass 28 | { 29 | 30 | private: 31 | double Sign; 32 | 33 | int NumSamples; 34 | int TimesCalled; 35 | int Freq; 36 | int DumpFreq; 37 | ObservableDouble Tot; 38 | public: 39 | void Accumulate(); 40 | void WriteBlock(); 41 | void ShiftData(int numTimeSlices); 42 | void Read(IOSectionClass& in); 43 | SignClass(PathDataClass &myPathData, IOSectionClass &ioSection) 44 | : ObservableClass(myPathData, ioSection), 45 | Tot("Total",IOSection,PathData.Path.Communicator) 46 | { 47 | 48 | Sign = 0.0; 49 | NumSamples = 0; 50 | TimesCalled=0; 51 | } 52 | }; 53 | 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/Observables/SuperfluiDrop.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef SUPERFLUIDROP_H 18 | #define SUPERFLUIDROP_H 19 | 20 | #include "ObservableBase.h" // what are we inheriting? 21 | 22 | class SuperfluiDrop : public ObservableClass 23 | { 24 | private: 25 | int Freq,DumpFreq; 26 | int TotalCounts; 27 | int TimesCalled; 28 | //double superfluidity; 29 | ObservableDouble areaSquared,momInertia; 30 | public: 31 | double area,anorm; 32 | double momi,mominorm; 33 | int Species; 34 | void Accumulate(); 35 | void Read(IOSectionClass& in); 36 | void WriteBlock(); 37 | SuperfluiDrop(PathDataClass &myPathData, IOSectionClass &ioSection) : 38 | ObservableClass(myPathData,ioSection), 39 | areaSquared("area", IOSection, myPathData.Path.Communicator), 40 | momInertia("mominertia", IOSection, myPathData.Path.Communicator) 41 | { 42 | TimesCalled=0; 43 | } 44 | }; 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/Observables/SuperfluidFraction.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #include "SuperfluidFraction.h" 18 | 19 | 20 | void 21 | SuperfluidFractionClass::Read(IOSectionClass& IO) 22 | { 23 | WindingNumberClass::Read(IO); 24 | assert(SpeciesList.size() == 1); 25 | } 26 | 27 | void 28 | SuperfluidFractionClass::WriteBlock() 29 | { 30 | int species = SpeciesList(0); 31 | double beta = PathData.Path.tau * PathData.Path.TotalNumSlices; 32 | int numParticles = PathData.Path.Species(species).LastPtcl - PathData.Path.Species(species).FirstPtcl + 1; 33 | double factor = 1.0/(2.0 * PathData.Path.Species(species).lambda * beta * numParticles); 34 | 35 | CalcWN2(); 36 | // Only processor 0 writes. 37 | if (PathData.Path.Communicator.MyProc() == 0) { 38 | if (FirstTime) { 39 | FirstTime = false; 40 | WriteInfo(); 41 | IOSection.WriteVar("Type",string("Vector")); 42 | } 43 | for (int dim = 0; dim < NDIM; dim++) 44 | WN2Array(dim) = WN2Array(dim) * factor * PathData.Path.GetBox()[dim] * PathData.Path.GetBox()[dim]; 45 | SFVar.Write(WN2Array); 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /src/Observables/SuperfluidFraction.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef SUPERFLUID_FRACTION__H 18 | #define SUPERFLUID_FRACTION__H 19 | 20 | #include "ObservableBase.h" 21 | #include "WindingNumber.h" 22 | 23 | 24 | 25 | class SuperfluidFractionClass : public WindingNumberClass 26 | { 27 | protected: 28 | ObservableVecDouble1 SFVar; 29 | public: 30 | void Read(IOSectionClass& IO); 31 | void WriteBlock(); 32 | SuperfluidFractionClass(PathDataClass &myPathData,IOSectionClass &ioSection) : 33 | WindingNumberClass(myPathData,ioSection), 34 | SFVar("SuperfluidFraction", IOSection, myPathData.Path.Communicator) 35 | { 36 | W2Sum = 0.0; 37 | SamplesInBlock = 0; 38 | } 39 | 40 | }; 41 | 42 | 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Observables/SuperfluidFractionPerLayer.h: -------------------------------------------------------------------------------- 1 | #ifndef SUPERFLUID_FRACTION_PER_LAYER_H 2 | #define SUPERFLUID_FRACTION_PER_LAYER_H 3 | 4 | #include "ObservableBase.h" 5 | #include "WindingNumber.h" 6 | 7 | 8 | 9 | class SuperfluidFractionPerLayerClass : public WindingNumberClass 10 | { 11 | protected: 12 | ObservableVecDouble1 HistogramVar; 13 | Array ParticleAlreadyCounted; 14 | void BinZWindingNumber(double ptclWinding,int ptcl, 15 | int dim,int cycleLength); 16 | double GetWindingNumber(int ptcl,int dim,int &cycleLength); 17 | 18 | void Accumulate(); 19 | Array Histogram; 20 | public: 21 | LinearGrid grid; 22 | void Read(IOSectionClass& IO); 23 | void WriteBlock(); 24 | SuperfluidFractionPerLayerClass(PathDataClass &myPathData,IOSectionClass &ioSection) : 25 | WindingNumberClass(myPathData,ioSection), 26 | HistogramVar("SuperfluidFractionPerLayer", IOSection, myPathData.Path.Communicator) 27 | { 28 | W2Sum = 0.0; 29 | SamplesInBlock = 0; 30 | } 31 | 32 | }; 33 | 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/Observables/Weight.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef WEIGHT_H 18 | #define WEIGHT_H 19 | 20 | 21 | 22 | #include "ObservableBase.h" 23 | 24 | 25 | 26 | 27 | class WeightClass : public ObservableClass 28 | { 29 | 30 | private: 31 | Array Weight; 32 | 33 | int NumSamples; 34 | int TimesCalled; 35 | int Freq; 36 | int DumpFreq; 37 | ObservableVecDouble1 Tot; 38 | public: 39 | void Accumulate(); 40 | void WriteBlock(); 41 | void ShiftData(int numTimeSlices); 42 | void Read(IOSectionClass& in); 43 | WeightClass(PathDataClass &myPathData, IOSectionClass &ioSection) 44 | : ObservableClass(myPathData, ioSection), 45 | Tot("Total",IOSection,PathData.Path.Communicator) 46 | { 47 | Weight.resize(4); 48 | Weight = 0.0; 49 | NumSamples = 0; 50 | TimesCalled=0; 51 | } 52 | }; 53 | 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/PIMCClass.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef PIMC_CLASS_H 18 | #define PIMC_CLASS_H 19 | 20 | 21 | #include "PathDataClass.h" 22 | #include "Moves/MoveClass.h" 23 | #include "Observables/ObservableClass.h" 24 | #include "LoopClass.h" 25 | #include "RunInfoClass.h" 26 | #include "QMCWrapper.h" 27 | 28 | class PIMCClass 29 | { 30 | 31 | public: 32 | std::list Moves; 33 | std::list Observables; 34 | void ReadMoves(IOSectionClass &in); 35 | void ReadObservables(IOSectionClass &in); 36 | void ReadAlgorithm(IOSectionClass &in); 37 | void WriteSystemInfo(); 38 | void CreateOutFile(IOSectionClass &in); 39 | string OutFileName; 40 | IOSectionClass OutFile; 41 | LoopClass Algorithm; 42 | RunInfoClass RunInfo; 43 | // QMC Wrapper 44 | QMCWrapperClass* QMCWrapper; 45 | public: 46 | PathDataClass PathData; 47 | bool Read(IOSectionClass &in); 48 | void Run(); 49 | void Dummy(); 50 | PIMCClass() : Algorithm(PathData, OutFile, Moves, Observables) 51 | { 52 | RunInfo.ProgramName="pimc++"; 53 | } 54 | }; 55 | 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/PairAction/GeneralPot.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef GENERAL_POT_H 18 | #define GENERAL_POT_H 19 | 20 | #include "PotentialBase.h" 21 | #include "../Splines/CubicSpline.h" 22 | 23 | class GeneralPot : public Potential 24 | { 25 | protected: 26 | Grid *PotGrid; 27 | CubicSpline PotSpline; 28 | double Z; 29 | public: 30 | double V (double r); 31 | double dVdr (double r); 32 | double d2Vdr2 (double r); 33 | 34 | void Write (IOSectionClass &out); 35 | void Read (IOSectionClass &in); 36 | GeneralPot(); 37 | ~GeneralPot(); 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/PairAction/PAzeroFit.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef PA_ZERO_FIT_H 18 | #define PA_ZERO_FIT_H 19 | #include "PAFitBase.h" 20 | 21 | 22 | class PAzeroFitClass : public PairActionFitClass 23 | { 24 | public: 25 | 26 | void ReadParams (IOSectionClass &inSection) {}; 27 | void WriteBetaIndependentInfo (IOSectionClass &outSection) {}; 28 | /// Returns weighter RMS error 29 | // void Error (Rho &rho, double &Uerror, double &dUerror) {}; 30 | // void DoFit (Rho &rho) {}; 31 | void WriteFit(IOSectionClass &outSection) {}; 32 | void ReadInput (IOSectionClass &inSection) {}; 33 | 34 | bool Read (IOSectionClass &inSection, double lowestBeta, 35 | int NumBetas); 36 | double U(double q, double z, double s2, int level); 37 | double dU(double q, double z, double s2, int level); 38 | void Derivs (double q, double z, double s2, int level, 39 | double &d_dq, double &d_dz, double &d_ds); 40 | double V(double r); 41 | bool IsLongRange(); 42 | PAzeroFitClass() 43 | { 44 | 45 | } 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/PairAction/Particle.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef PARTICLE_H 18 | #define PARTICLE_H 19 | 20 | #include "../IO/IO.h" 21 | 22 | using namespace IO; 23 | 24 | class ParticleClass 25 | { 26 | public: 27 | string Name; 28 | double lambda; 29 | double Charge; 30 | int Ndim; 31 | inline void Write (IOSectionClass &outSection) 32 | { 33 | outSection.WriteVar ("Name", Name); 34 | outSection.WriteVar ("lambda", lambda); 35 | outSection.WriteVar ("Charge", Charge); 36 | outSection.WriteVar ("Ndim", Ndim); 37 | } 38 | inline bool Read (IOSectionClass &inSection) 39 | { 40 | bool success; 41 | success = inSection.ReadVar ("Name", Name); 42 | success &= inSection.ReadVar ("lambda", lambda); 43 | success &= inSection.ReadVar ("Charge", Charge); 44 | success &= inSection.ReadVar ("Ndim", Ndim); 45 | return (success); 46 | } 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/PairAction/Potential.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #include "Potential.h" 18 | 19 | Potential* ReadPotential (IOSectionClass &in) 20 | { 21 | assert(1==2); 22 | string type; 23 | Potential *pot; 24 | assert (in.ReadVar ("Type", type)); 25 | // if (type == "Coulomb") 26 | // pot = new CoulombPot; 27 | // else if (type == "General") 28 | // pot = new GeneralPot; 29 | // else if (type == "ToppHopfield") 30 | // pot = new ToppHopfieldPot; 31 | // else if (type == "QuinticPH") 32 | // pot = new QuinticPH; 33 | // else if (type == "Screened") 34 | // pot = new ScreenedPot; 35 | // else if (type == "Spline") 36 | // pot = new SplinePot; 37 | // else if (type == "HeAziz") 38 | // pot = new HeAzizPot; 39 | // else if (type == "NLPP") 40 | // pot = new NLPPClass; 41 | // else { 42 | // cerr << "Unrecognize potential type \"" << type << "\". Exitting.\n"; 43 | // exit(1); 44 | // } 45 | // pot->Read(in); 46 | return pot; 47 | } 48 | -------------------------------------------------------------------------------- /src/PairAction/Potential.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef POTENTIAL_H 18 | #define POTENTIAL_H 19 | 20 | /* #include "CoulombPot.h" */ 21 | /* #include "ToppHopfield.h" */ 22 | /* #include "ScreenedPot.h" */ 23 | /* #include "QuinticPH.h" */ 24 | /* #include "SplinePot.h" */ 25 | /* #include "HeAzizPot.h" */ 26 | #include "GeneralPot.h" 27 | /* #include "NLPP.h" */ 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/PairAction/old/PAcoulombFit.h: -------------------------------------------------------------------------------- 1 | #ifndef PA_COULOMB_FIT_H 2 | #define PA_COULOMB_FIT_H 3 | 4 | #include "PAFitBase.h" 5 | 6 | class PAcoulombFitClass : public PairActionFitClass 7 | { 8 | private: 9 | bool GridIsMine; 10 | Array Ucoefs; 11 | public: 12 | int Order; 13 | Grid *qgrid; 14 | Array Ujshort, Ujlong; 15 | Array dUjshort, dUjlong; 16 | #ifdef MAKE_FIT 17 | void ReadParams (IOSectionClass &inSection); 18 | void WriteBetaIndependentInfo (IOSectionClass &outSection); 19 | /// Returns weighter RMS error 20 | void Error (Rho &rho, double &Uerror, double &dUerror); 21 | void AddFit (Rho &rho); 22 | void WriteFits(IOSectionClass &outSection); 23 | #endif 24 | void Write (IOSectionClass &outSection); 25 | bool Read (IOSectionClass &inSection, double lowestBeta, 26 | int NumBetas); 27 | double U(double q, double z, double s2, int level); 28 | double dU(double q, double z, double s2, int level); 29 | PAcoulombFitClass() 30 | { 31 | GridIsMine = false; 32 | NumBetas=0; 33 | } 34 | ~PAcoulombFitClass() 35 | { if (GridIsMine) delete qgrid; } 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/PairAction/old/PAsFit.h: -------------------------------------------------------------------------------- 1 | #ifndef PA_S_FIT_H 2 | #define PA_S_FIT_H 3 | #include "PAFitBase.h" 4 | #include "../Splines/BicubicSpline.h" 5 | #ifdef MAKE_FIT 6 | #include "../MPI/Communication.h" 7 | #endif 8 | 9 | class PAsFitClass : public PairActionFitClass 10 | { 11 | private: 12 | bool GridsAreMine; 13 | Array Coefs; 14 | Array Pn; 15 | Array sMax; 16 | // Array UsMax; 17 | // Array dUsMax; 18 | #ifdef MAKE_FIT 19 | CommunicatorClass Comm; 20 | #endif 21 | public: 22 | Grid *qgrid, *ygrid; 23 | Array Usplines, dUsplines; 24 | int Order; 25 | #ifdef MAKE_FIT 26 | void ReadParams (IOSectionClass &inSection); 27 | void WriteBetaIndependentInfo (IOSectionClass &outSection); 28 | /// Returns weighter RMS error 29 | void Error (Rho &rho, double &Uerror, double &dUerror); 30 | void AddFit (Rho &rho); 31 | void WriteFits(IOSectionClass &outSection); 32 | #endif 33 | void Write (IOSectionClass &outSection); 34 | bool Read (IOSectionClass &inSection, double lowestBeta, 35 | int NumBetas); 36 | double U(double q, double z, double s2, int level); 37 | double dU(double q, double z, double s2, int level); 38 | PAsFitClass() 39 | { 40 | #ifdef MAKE_FIT 41 | Comm.SetWorld(); 42 | #endif 43 | GridsAreMine = false; 44 | NumBetas=0; 45 | } 46 | ~PAsFitClass() 47 | { if (GridsAreMine){ delete qgrid; delete ygrid; } } 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/PairAction/old/PAszFit.h: -------------------------------------------------------------------------------- 1 | #ifndef PA_SZ_FIT_H 2 | #define PA_SZ_FIT_H 3 | 4 | #include "PAFitBase.h" 5 | 6 | class PAszFitClass : public PairActionFitClass 7 | { 8 | private: 9 | bool GridIsMine; 10 | Array Coefs; 11 | Array sMax; // Array index is level 12 | public: 13 | int Order; 14 | Grid *qgrid; 15 | Array Ukj; 16 | Array dUkj; 17 | #ifdef MAKE_FIT 18 | void ReadParams (IOSectionClass &inSection); 19 | void WriteBetaIndependentInfo (IOSectionClass &outSection); 20 | void DoFit (Rho &rho); 21 | void WriteFit(IOSectionClass &outSection); 22 | void Error(Rho &rho, double &Uerror, double &dUerror); 23 | #endif 24 | void Write (IOSectionClass &outSection); 25 | bool Read (IOSectionClass &inSection, double lowestBeta, 26 | int NumBetas); 27 | double U (double q, double z, double s2, int level); 28 | double dU(double q, double z, double s2, int level); 29 | PAszFitClass() 30 | { 31 | GridIsMine = false; 32 | NumBetas=0; 33 | } 34 | ~PAszFitClass() 35 | { if (GridIsMine) delete qgrid; } 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/ParseCommand.cc: -------------------------------------------------------------------------------- 1 | #include "ParseCommand.h" 2 | 3 | CommandLineParserClass::CommandLineParserClass(list &argList) 4 | { 5 | list::iterator iter; 6 | for (iter=argList.begin(); iter!=argList.end(); iter++) 7 | ArgMap[iter->GetName()] = (*iter); 8 | for (iter=argList.begin(); iter!=argList.end(); iter++) 9 | if (iter->GetShortName() != "") 10 | ShortMap[iter->GetShortName()] = (*iter); 11 | } 12 | 13 | bool 14 | CommandLineParserClass::Parse(int argc, char **argv) 15 | { 16 | for (int i=1; i::iterator iter; 20 | iter = ArgMap.find(name); 21 | if (iter != ArgMap.end()) { 22 | ArgMap[name].Found = true; 23 | if (ArgMap[name].NeedsArg) { 24 | if ((i+1) < argc) 25 | ArgMap[name].SetArg(argv[++i]); 26 | else 27 | return false; 28 | } 29 | } 30 | else { 31 | cerr << "Unrecognized argument """ << name << """" << endl; 32 | return false; 33 | } 34 | } 35 | else if (argv[i][0] == '-') { 36 | string name = &(argv[i][1]); 37 | map::iterator iter; 38 | iter = ShortMap.find(name); 39 | if (iter != ArgMap.end()) { 40 | ShortMap[name].Found = true; 41 | if (ShortMap[name].NeedsArg) { 42 | if ((i+1) < argc) 43 | ShortMap[name].SetArg(argv[++i]); 44 | else 45 | return false; 46 | } 47 | } 48 | else { 49 | cerr << "Unrecognized short argument """ << name << """" << endl; 50 | return false; 51 | } 52 | } 53 | else 54 | Files.push_back (argv[i]); 55 | } 56 | return true; 57 | } 58 | -------------------------------------------------------------------------------- /src/ParseCommand.h: -------------------------------------------------------------------------------- 1 | #ifndef PARSE_COMMAND_H 2 | #define PARSE_COMMAND_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | using namespace std; 12 | 13 | class ParamClass 14 | { 15 | private: 16 | string Arg, Name, ShortName; 17 | public: 18 | bool NeedsArg, Found; 19 | string GetName () { return Name; } 20 | string GetShortName() { return ShortName; } 21 | 22 | string GetArg () 23 | { 24 | assert (NeedsArg); 25 | return Arg; 26 | } 27 | void SetArg (string arg) { 28 | assert (NeedsArg); 29 | Arg = arg; 30 | } 31 | 32 | ParamClass (string name, string shortName, bool needsArg) { 33 | Name = name; 34 | ShortName = shortName; 35 | NeedsArg = needsArg; 36 | Found = false; 37 | } 38 | 39 | ParamClass (string name, bool needsArg) { 40 | Name = name; 41 | NeedsArg = needsArg; 42 | Found = false; 43 | } 44 | ParamClass() { 45 | NeedsArg = false; 46 | Found = false; 47 | } 48 | }; 49 | 50 | class 51 | CommandLineParserClass 52 | { 53 | private: 54 | map ArgMap; 55 | map ShortMap; 56 | vector Files; 57 | public: 58 | bool Parse (int argc, char **argv); 59 | inline bool Found (string name) { 60 | return ArgMap[name].Found; 61 | } 62 | inline string GetArg (string name) { 63 | return ArgMap[name].GetArg(); 64 | } 65 | inline int NumFiles() { return Files.size(); } 66 | string GetFile(int i) { return Files[i]; } 67 | 68 | CommandLineParserClass (list &argList); 69 | }; 70 | 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /src/QMCWrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef QMC_WRAPPER_H 2 | #define QMC_WRAPPER_H 3 | 4 | #include "PathDataClass.h" 5 | 6 | #ifdef USE_QMC 7 | #include 8 | #include 9 | #include "Message/Communicate.h" 10 | #include "Utilities/OhmmsInfo.h" 11 | #include 12 | #include 13 | #endif 14 | 15 | class QMCWrapperClass 16 | { 17 | bool initialized; 18 | ofstream out; 19 | public: 20 | #ifdef USE_QMC 21 | double dt; 22 | int walkers; 23 | int steps; 24 | int blocks; 25 | int chains; 26 | bool correlated; 27 | string QMCMethod; 28 | int EnergyDiffIndex, EnergyIndex0, EnergyIndex1; 29 | void DummyInit(PathDataClass& PathData); 30 | void QMCDummy(PathDataClass& PathData); 31 | QMCWrapperClass(PathDataClass& pathData){ 32 | initialized = false; 33 | dt = pathData.dt; 34 | walkers = pathData.walkers; 35 | steps = pathData.steps; 36 | blocks = pathData.blocks; 37 | correlated = pathData.correlated; 38 | chains = pathData.chains; 39 | QMCMethod = pathData.QMCMethod; 40 | } 41 | #else 42 | QMCWrapperClass(PathDataClass& pathData){}; 43 | void QMCDummy(PathDataClass& PathData); 44 | void DummyInit(PathDataClass& PathData); 45 | #endif 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/Splines/Grid.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #include "Grid.h" 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Splines/LinearSpline.h: -------------------------------------------------------------------------------- 1 | #ifndef LINEAR_SPLINE_H 2 | #define LINEAR_SPLINE_H 3 | #include 4 | 5 | class LinearSpline 6 | { 7 | private: 8 | double GridStart, GridEnd; 9 | blitz::Array Data; 10 | double dx, dxInv; 11 | public: 12 | inline double Start() { return GridStart; } 13 | inline double End() { return GridEnd; } 14 | inline void Init (double start, double end, Array &data); 15 | inline double operator()(double x); 16 | }; 17 | 18 | 19 | inline double 20 | LinearSpline::operator()(double x) 21 | { 22 | double id = dxInv*(x-GridStart); 23 | double ipart; 24 | double frac = modf (id, &ipart); 25 | int i = (int) ipart; 26 | return ((1.0-frac)*Data(i) + frac*Data(i+1)); 27 | } 28 | 29 | inline void 30 | LinearSpline::Init (double start, double end, Array &data) 31 | { 32 | Data.resize(data.size()); 33 | Data = data; 34 | GridStart = start; 35 | GridEnd = end; 36 | dx = (GridEnd-GridStart)/(double)(data.size()-1); 37 | dxInv = 1.0/dx; 38 | } 39 | 40 | 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/SwitchClass.cc: -------------------------------------------------------------------------------- 1 | #include "PathDataClass.h" 2 | #include "SwitchClass.h" 3 | #include "time.h" 4 | 5 | void SwitchClass::DoEvent() 6 | { 7 | TimesCalled++; 8 | if (PathData.Path.Equilibrate) 9 | PathData.Path.Equilibrate = 0; 10 | else 11 | PathData.Path.Equilibrate = 1; 12 | } 13 | 14 | void SwitchClass::Read(IOSectionClass &in) 15 | { 16 | //do nothing for now 17 | } 18 | -------------------------------------------------------------------------------- /src/SwitchClass.h: -------------------------------------------------------------------------------- 1 | #ifndef SWITCH_CLASS_H 2 | #define SWITCH_CLASS_H 3 | 4 | #include "EventClass.h" 5 | 6 | /// This is the generic parent class for all switches, including "real switches" 7 | /// which actually move particles and "pseudo switches", which just shift around 8 | /// data, but don't move anything physical. 9 | class SwitchClass : public EventClass 10 | { 11 | protected: 12 | 13 | public: 14 | //virtual void Read(IOSectionClass &input)=0; 15 | void DoEvent(); 16 | void Read(IOSectionClass &input); 17 | 18 | /// SwitchClass constructor. Sets reference to the PathData object 19 | SwitchClass(PathDataClass &pathData, IOSectionClass &out) : 20 | EventClass(pathData, out) 21 | { 22 | // do nothing 23 | } 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/WriteData.cc: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #include "PathDataClass.h" 18 | #include "WriteData.h" 19 | #include "Moves/MoveBase.h" 20 | #include "Observables/ObservableBase.h" 21 | 22 | void 23 | WriteDataClass::DoEvent() 24 | { 25 | list::iterator moveIter; 26 | for (moveIter = Moves.begin(); moveIter != Moves.end(); moveIter++) 27 | (*moveIter) -> WriteRatio(); 28 | 29 | list::iterator observeIter; 30 | for (observeIter = Observables.begin(); observeIter != Observables.end(); observeIter++) 31 | (*observeIter) -> WriteBlock(); 32 | if (PathData.Path.Communicator.MyProc() == 0) 33 | IOSection.FlushFile(); 34 | } 35 | 36 | 37 | void 38 | WriteDataClass::Read(IOSectionClass &in) 39 | { 40 | //do nothing for now 41 | } 42 | -------------------------------------------------------------------------------- /src/WriteData.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | 17 | #ifndef WRITE_DATA_CLASS_H 18 | #define WRITE_DATA_CLASS_H 19 | 20 | #include "EventClass.h" 21 | class ObservableClass; 22 | class MoveClass; 23 | 24 | 25 | /// Note: LoopClass is not allow to write any output to its out 26 | /// IOsection. 27 | class WriteDataClass : public EventClass 28 | { 29 | protected: 30 | list &Moves; 31 | list &Observables; 32 | public: 33 | void DoEvent(); 34 | void Read(IOSectionClass &IO); 35 | WriteDataClass(PathDataClass &pathData, IOSectionClass &out, 36 | list &moves, 37 | list &observables) : 38 | EventClass(pathData, out), 39 | Moves(moves), Observables(observables) 40 | { 41 | Name = "WriteData"; 42 | } 43 | }; 44 | 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/config.h: -------------------------------------------------------------------------------- 1 | // #define F77_FUNC(name,NAME) NAME 2 | #define F77_FUNC(name1,name2) name1 ## _ 3 | -------------------------------------------------------------------------------- /src/det_calc_uekt.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////// 2 | // Copyright (C) 2003-2013 B. Clark, K. Esler, E. Brown // 3 | // // 4 | // This program is free software; you can redistribute it // 5 | // and/or modify it under the terms of the GNU General // 6 | // Public License as published by the Free Software // 7 | // Foundation; either version 2 of the License, or // 8 | // (at your option) any later version. This program is // 9 | // distributed in the hope that it will be useful, but // 10 | // WITHOUT ANY WARRANTY; without even the implied warranty // 11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // 12 | // See the GNU General Public License for more details. // 13 | // For more information, please see the PIMC++ Home Page: // 14 | // http://code.google.com/p/pimcplusplus/ // 15 | ///////////////////////////////////////////////////////////// 16 | #ifdef ORDER_N_FERMIONS 17 | 18 | 19 | #ifndef _DET_CALC_UEKT_H_ 20 | #define _DET_CALC_UEKT_H_ 21 | 22 | struct drc_uekt_vanilla_parms{ 23 | double tolerance; 24 | int max_its; 25 | int its_used; 26 | }; 27 | 28 | 29 | int testme(); 30 | // int drc_uekt_identity_preconditioner(double* x, double*y); 31 | 32 | // int det_ratio_calculator_uekt_symmetric_vanilla(int (*func)(double*,double*,int,void*), 33 | // void * data, int N, double * u, int col_id, 34 | // double die_roll, double* det_ratio, void *params); 35 | 36 | 37 | void det_ratio_calculator_uekt_symmetric_vanilla_value(int (*func)(double*,double*,int,void*), 38 | void * data, int N, double * u, int col_id, 39 | double die_roll, double* det_ratio, void *params); 40 | 41 | // int drc_uekt_templates_style_fcall(double *alpha, double* x, double *beta, double*y); 42 | 43 | 44 | // int det_ratio_calculator_uekt_nonsymmetric_col_vanilla(int (*func)(double*,double*,int,void*), 45 | // void * data, int N, double * u, int col_id, 46 | // double die_roll, double* det_ratio, void *params); 47 | 48 | 49 | 50 | #endif 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /src/nan.h: -------------------------------------------------------------------------------- 1 | #ifndef NAN_H 2 | #define NAN_H 3 | 4 | inline 5 | bool myIsNAN (double x) 6 | { 7 | union 8 | { 9 | double d; 10 | unsigned long long int l; 11 | } val; 12 | val.d = x; 13 | return ((val.l == (unsigned long long int)0xfff8000000000000ULL) || 14 | (val.l == (unsigned long long int)0x7ff8000000000000ULL)); 15 | } 16 | 17 | #endif 18 | --------------------------------------------------------------------------------