Generating Adsorbate Density Profiles from GCMC Restart Files in RASPA

Started by had-sham, May 11, 2025, 12:48:17 PM

Previous topic - Next topic

had-sham

Hi all,

I understand that grids are used to speed up GCMC simulations and for visualization purposes. I have already run some GCMC simulations without energy grids, and I have the snapshots.
Is it possible to use the Restart file (final configuration) to perform a new GCMC run with grids enabled, in order to obtain adsorbate density plots?
Alternatively, is there a way to generate density plots from the final configuration of a GCMC run that was performed without grids?

Best regards,

EulaVikum

Interesting point about grids in GCMC! I've been exploring similar simulation techniques myself. Are you finding that using grids noticeably improves performance? Perhaps it's like solving Wordle Unlimited – you can brute force it, but a smart strategy (like grids) can dramatically speed things up. I'm curious how your snapshots compare with and without the grid implementation. Thanks for sharing!


dubbelda

These are two different "grids." Energy interpolation grids only speed up host–guest energy evaluation. Adsorbate density plots come from a separate histogram, ComputeDensityGrid, which is sampled over many production configurations. A restart file is one snapshot; it is a good starting point for a new production run, not a density profile by itself.

Yes — restart from the JSON restart and run production with density grids on. You do not need energy/interpolation grids for that.

A density cube is an ensemble average: every SampleDensityGridEvery production cycles, adsorbate positions are binned onto a 3D grid and written as Gaussian cube files under density_grids/. One final configuration (or one restart) only shows where the molecules happened to sit at that moment.

Energy interpolation grids (UseInterpolationGrids in force_field.json) are optional and unrelated. They precompute framework–adsorbate energies. Turning them on later does not create density plots, and you can compute density grids without them.

Do not use RestartFromBinaryFile. That restores the original run's full state and ignores new simulation.json settings, so you cannot switch on density grids that way.

Use the JSON restart instead:

Copy the restart out of output/ so the next run does not overwrite it:
cp output/restart_<T>_<P>.s0.json .
Point the system at it with "RestartFileName", set "CreateNumberOfMolecules": 0, and enable density grids.
Because the configuration is already equilibrated, you can use few (or zero) initialization cycles, then enough production cycles for a converged histogram.
{
  "SimulationType": "MonteCarlo",
  "NumberOfInitializationCycles": 0,
  "NumberOfProductionCycles": 100000,
  "PrintEvery": 5000,
  "Systems": [
    {
      "Type": "Framework",
      "Name": "YourFramework",
      "NumberOfUnitCells": [2, 2, 2],
      "ExternalTemperature": 298.0,
      "ExternalPressure": 1.0e5,
      "RestartFileName": "restart_298_0.s0",
      "ComputeDensityGrid": true,
      "SampleDensityGridEvery": 10,
      "WriteDensityGridEvery": 5000,
      "DensityGridSize": [128, 128, 128]
    }
  ],
  "Components": [
    {
      "Name": "CO2",
      "TranslationProbability": 0.5,
      "RotationProbability": 0.5,
      "ReinsertionProbability": 0.5,
      "SwapProbability": 1.0,
      "CreateNumberOfMolecules": 0
    }
  ]
}
Output goes to density_grids/ as .cube files (view in VMD, iRASPA, etc.). Optional extras: "DensityGridPseudoAtomsList" for site-resolved maps (e.g. C_co2 vs O_co2), and "DensityGridBinning": "Equitable" for smoother histograms.

No — not from the final configuration alone. RASPA3 has no "make a density cube from this restart/PDB" step. If you already wrote a PDB movie (OutputPDBMovie) with many frames, you can histogram that trajectory yourself (for example VMD volmap). That is a post-processing substitute, not a built-in RASPA3 feature, and a single last frame is still not enough.

Practical recommendation: copy the JSON restart, enable ComputeDensityGrid, and run a production-only continuation. Add interpolation grids only if you want that continuation to run faster.

SMF spam blocked by CleanTalk