Dice Fortran Backend Documentation
|
This is the homepage for the Developer Documentation of the Fortran backend of Dice. On this site, you will find definitions for all of the functions and subroutines that we use to run VQMC simulations on our three currently implemented problems (QHO, H2plus and H2), as well as instructions for integrating support for a new problem into the code (see below).
Link | Destination |
---|---|
GitHub | Here |
Dev Documentation Main | Here |
Fortran Dev Documentation | You are here |
Python Dev Documentation | Here |
This section presents what the user would need to modify in the Fortran files (.f90) to add a new problem to Dice QMC.
The first step is to add the derived type of the new problem to shared_data.f90
, under the section "Derived Types". Below is a sample format of how the derived type should look like.
If the user wants to add any other numerical constants then they can be added to the constants
module in shared_data.f90
.
The next step is to modify quantum_solvers.f90
. Regardless of the new problem the user will need to implement a function that calculates the transition probability of the current step and the proposed step. Below is a sample format of how the transition probability function should look like.
The other function that is also necessary to be implemented regardless of the problem is one that calculates the local energy of the problem at a given position. Below is a sample format of how the local energy function should look like.
Most problems will require the user to implement a wave function corresponding to the problem, in order to calculate the transitional probabilities and local energies. The user is free to implement this however they want, as long as the local energy and transitional probability functions have the formats presented above. Another remark for the user is that when calculating the energy, unless the derivatives can be found analytically the user will need to use some numerical method to obtain the derivatives, which they will have to implement themselves. All of the modifications to quantum_solvers.f90
should be done after the section H_2 Solvers
.
The next step is to modify the vqmc.f90
module. The user will need to implement a new VQMC solver for the new problem in this module. The user should use one of the "VQMC_QHO", "VQMC_H_2_plus" or "VQMC_H_2" sub-routines as a template for their VQMC solver. This is because they would only need to modify the transitional probability and local energy functions in the Metropolis algorithm. Below is a sample template of how the Metropolis algorithm should look like.
If the user uses one of the "VQMC_QHO", "VQMC_H_2_plus" or "VQMC_H_2" sub-routines as a template then the burning and thinning features can be reused for the new problem. It is important to stick to one of the VQMC sub-routines so that the outputs are the same.
The next step is to add the automatic gradient descent-based search (GDBS) to vqmc.f90
. The user should use "Auto_H_2", "Auto_H_2_plus" sub-routines as a template and should only modify the VQMC solver being called (see below). This modification should be place after the new VQMC solver.
If the user does not want to do a GDBS then they can ignore the previous step. Instead they can add a grid search to vqmc.f90
. The user should use "Grid_H_2", "Grid_H_2_plus" sub-routines as a template and should only modify the VQMC solver being called (see below). This sub-routine should be placed after the new VQMC solver.
The user can of course add both of the search methods mentioned above, but it is important that they at least add one. The final item the user has to add to vqmc.f90
is the equilibration run subroutine. This can be based off "Equil_QHO" or "Equil_H_2" and the user should only modify the VQMC solver being used like in the previous step.
The final step is to modify driver.f90
. The user should add a new case with the corresponding problem to the "VQMC Loops" section. The user should use the following "Quantum Harmonic Oscillator" subsection, as a template to write their code. The code should only be modified so that the GDBS or grid search, and equilibration subroutines for the new problem are called (see below).
After all the modifications the user should be able to run the code the same way as it is explained in the user manual.
This documentation was generated from commit ece8004