Re: [AMBER] TI simulation instability with truncated octahedron box

From: Timothy Giese via AMBER <amber.ambermd.org>
Date: Mon, 6 Apr 2026 18:59:16 +0000

Truncated octahedron boxes are supported and routinely used in alchemical free energy simulations. From your description, my first guess is to check if the IFBOX pointer in the parm7 file is set to 2 (2 means truncate octahedron). If you rebuilt the parm7/rst7 files from tleap for each stage of your multi-stage setup from a previously equilibrated system (such that you used the "setbox" command rather than "solvateOct"), then you'll need to manually change the IFBOX pointer in the parm7 file (from 1 to 2) and adjust the lattice vector lengths and angles on the last line of the rst7 file (setbox makes an orthorhombic units cell). In many cases, you can use these two bash functions to modify the parm7 and rst7 outputs from tleap.

function resetunitcell
{
   # Modify the lattice vector lengths and angles to match a reference restart file
   # Arg 1: The name of a reference (formatted) restart file
   # Arg 2: The name of a (formatted) restart file to modify
    local refrst="$1"
    local modrst="$2"

    local c=($(tail -n 1 ${refrst}))
    ChBox -X ${c[0]} -Y ${c[1]} -Z ${c[2]} -al ${c[3]} -bt ${c[4]} -gm ${c[5]} -c ${modrst} -o ${modrst}.tmp
    mv ${modrst}.tmp ${modrst}
}

function resetifbox
{
    # Reset a parm7 file's IFBOX flag from 1 to 2. Kind of a dangerous implementation, NGL
    # Arg 1: The name of a parm7 file.
    local parm="$1"
    sed -i 's|0 0 1|0 0 2|' ${parm}
}

________________________________
From: Kalandadze, Nino via AMBER <amber.ambermd.org>
Sent: Monday, April 6, 2026 2:29 PM
To: amber.ambermd.org <amber.ambermd.org>
Subject: [AMBER] TI simulation instability with truncated octahedron box

I would like to report a reproducible issue encountered while running thermodynamic integration (TI) simulations in AMBER using a truncated octahedron box. It appears that the truncated octahedral box might not be supported, as it appears the box shape changes to a right rectangular prism.
I was performing TI calculations on a riboswitch-ligand system using a standard three step protocol (decharge, van der Waals/bonded, and recharge). The systems consisted of both the complex (riboswitch and ligand) and ligand-only simulations, solvated in OPC water with a 10 Å buffer. The RNA was parameterized with the RNA.OL3 force field and the ligand with GAFF. My simulation protocol consisted of heating from 0 to 300 K over 20 ps, followed by 100 ps equilibration and 5000 ps production per window.
During early production on GPU, simulations repeatedly terminated with a density-related error stating that the system density had likely changed significantly and that the GPU code could not reorganize grid cells automatically. As suggested in the error message, I attempted to continue using the CPU code instead. This allowed the simulation to continue, but visual inspection of the resulting trajectories revealed that the truncated octahedron solvent box gradually deformed during equilibration and appeared to transform toward a cubic shape. This change is shown below. The first image shows the end of heating (a), the second shows the end of equilibration (b), and the third shows end of production (c).
a[A group of red and white objects AI-generated content may be incorrect.]b[A pile of red and white speckled objects AI-generated content may be incorrect.]c [A large group of red and white objects AI-generated content may be incorrect.]

These simulations were run using the following input files:
heating
 &cntrl
   imin = 0, nstlim = 10000, irest = 0, ntx = 1, dt = 0.002,
   ntt = 3, temp0 = 300.0, tempi = 50.0, tautp = 1.0,
   ntc = 2, ntf = 1,
   ntb = 1,
   ioutfm = 1, iwrap = 1,
   ntwe = 1000, ntwx = 1000, ntpr = 1000, ntwr = 5000,

   nmropt = 1,
   ntr = 1, restraint_wt = 5.00,
   restraintmask='!:WAT & !.H=',

   icfe = 1, clambda = 0.00240639, scalpha = 0.5, scbeta = 12.0,
   logdvdl = 0,
   timask1 = ':1', timask2 = ':2',
   ifsc = 0, crgmask = ':2.H041',
 /

 &ewald
 /

 &wt
   type='TEMP0',
   istep1 = 0, istep2 = 8000,
   value1 = 50.0, value2 = 300.0
 /

 &wt type = 'END'
 /

Equilibration simulation
 &cntrl
   imin = 0, nstlim = 50000, irest = 1, ntx = 5, dt = 0.002,
   ntt = 3, temp0 = 300.0, gamma_ln = 2.0, ig = -1,
   ntc = 2, ntf = 1,
   ntb = 2,
   ntp = 1, pres0 = 1.0, taup = 5.0,
   ioutfm = 1, iwrap = 1,
   ntwe = 2000, ntwx = 2000, ntpr = 2000, ntwr = 2000,

   icfe = 1, clambda = 0.00240639, scalpha = 0.5, scbeta = 12.0,
   logdvdl = 1,
   ifmbar = 1,
   timask1 = ':1', timask2 = ':2',
   ifsc = 0, crgmask = ':2.H041',
 /

 &ewald
 /

TI simulation
 &cntrl
   imin = 0, nstlim = 2500000, irest = 1, ntx = 5, dt = 0.002,
   ntt = 3, temp0 = 300.0, gamma_ln = 2.0, ig = -1,
   ntc = 2, ntf = 1,
   ntb = 2,
   ntp = 1, pres0 = 1.0, taup = 5.0,
   ioutfm = 1, iwrap = 1,
   ntwe = 50000, ntwx = 50000, ntpr = 50000, ntwr = 50000,

   icfe = 1, clambda = 0.00240639, scalpha = 0.5, scbeta = 12.0,
   logdvdl = 1,
   ifmbar = 1,
   timask1 = ':1', timask2 = ':2',
   ifsc = 0, crgmask = ':2.H041',
 /

 &ewald
 /

To test whether the issue was related to box geometry, I rebuilt the systems using a cubic solvent box instead of a truncated octahedron while keeping all other parameters identical. With the cubic box, the simulations ran normally. No GPU density errors occurred, equilibration proceeded smoothly, and no box deformation was observed. This behavior was consistent across multiple TI windows and replicates, suggesting that the issue is reproducible and specifically associated with truncated octahedron boxes in this context. Based on these observations, I think there may be an issue affecting TI simulations when using truncated octahedron periodic boxes.
I could not find any documentation of this and I would appreciate your feedback.
Thank you for your help!
Best,
Nino Kalandadze

_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Mon Apr 06 2026 - 12:30:09 PDT
Custom Search