SSAGESproject / SSAGES

Software Suite for Advanced General Ensemble Simulations
GNU General Public License v3.0
81 stars 28 forks source link

How the ANN method add the bias force? #34

Open wxsongsh opened 3 years ago

wxsongsh commented 3 years ago

Dear SSAGES developers,

I want to calculate the free energy using the ANN method.

The following is the content of a JSON file used in ANN:

{
    "walkers" : 1,
    "input" : "in.metal",
    "CVs": [
        {
            "qatom": false,
            "qvmean": true,
            "short_cutoff": 2.6,
            "long_cutoff": 3.8,
            "q_dimension": 6,
            "type": "Q_Steinhardt"
        },
        {
            "short_cutoff": 2.6,
            "long_cutoff": 3.8,
            "type": "Rpp"
        }
     ],
    "methods" : [
            {
                    "type" : "ANN",
                    "topology" : [30, 20],
                    "nsweep" : 10000,
                    "overwrite_output" : false,
                    "temperature" : 1300,
                    "grid" : {
                            "lower" : [0, -1.0],
                            "upper" : [1.1, 1.1],
                            "number_points" : [50, 50],
                            "periodic" : [false, false]
                    },
                    "lower_bounds" : [-0.1, -1.1],
                    "upper_bounds" : [1.2, 1.2],
                    "lower_bound_restraints" : [0, 0],
                    "upper_bound_restraints" : [0, 0],
                    "max_iters" : 10,
                    "weight" : 15.0 // Is the unit like the lammps one, eV herein? I also use the default value and it does not work.
            }
    ]
}

Using two newly designed CVs, the metadynamics simulations are fine, where the system can traverse the distinguished states I concerned. However, the system only locate at the initial state as I use the ANN method. It means that the bias force is not added to the atoms. As I know, ANN also need add the bias force to the atoms like metadynamics. What is the wrong I meet?

The two CVs should consider the whole atoms as well as its neighbor atoms. In the corresponding XXCV.cpp, I have given the val value and its devirative on x (or y, z), grad[].

The following is a JSON file used in the metadynamics simulations (It works fine):

{
    "walkers" : 1,
    "input" : "in.metal",
    "CVs": [
        {
            "qatom": false,
            "qvmean": true,
            "short_cutoff": 2.6,
            "long_cutoff": 3.8,
            "q_dimension": 6,
            "type": "Q_Steinhardt"
        },
        {
            "short_cutoff": 2.6,
            "long_cutoff": 3.8,
            "type": "Rpp"
        }
     ],
    "methods" : [
        {
            "type" : "Metadynamics",
            "widths" : [
                0.02, 0.04
            ],
            "height" : 0.103408,
            "lower_bounds" : [0, -1.0],
            "upper_bounds" : [1.1, 1.1],
            "lower_bound_restraints" : [0, 0],
            "upper_bound_restraints" : [0, 0],
            "hill_frequency" : 500
        }
    ]
}

Thanks! Looking forward to your reply.

pabloferz commented 2 years ago

Hi @wxsongsh. Sorry for the delayed reply here. One thing to consider here is the roughness of the free energy as function of your CV.

Maybe the grid size is too low to effectively learn it? Can you share more details on your use case? (here or on a private channel depending on the nature of your work)

wxsongsh commented 2 years ago

Dear Pabloferz, I study the nucleation from liquid using the Q (Steinhardt) order parameter. Q can distinguish the two liquid and crystalline phases, but it is hard to distinguish the different liquid sates. Now, the ANN method always locates at the liquid state, which seems not adding bias force on the atom to escape the liquid minimum. Using Metadynamics, the Q parameter works fine. I do not know what's wrong in the ANN.