two thermal regions for water chain and PIMD simulation.

6 views
Skip to first unread message

Somayeh Ahmadkhani

unread,
Jan 16, 2026, 8:35:51 AMJan 16
to ipi-users

Dear i-PI team and users,

I have just started using i-PI and am learning my way around the software.

I am attempting to simulate Path Integral Molecular Dynamics (PIMD) for a chain of water molecules that interacts with different thermal reservoirs (two distinct thermal regions with chain length or atoms). I am currently connecting i-PI to CP2K to utilize the q-TIP4P/F force field.

I have been struggling with defining the input correctly to specify these two thermal regions. I am unsure how to properly define the different atom groups within the i-PI input file.

Could you please assist me in correcting my input file to achieve this configuration? I am also curious if it is possible to perform this type of simulation purely within i-PI, without using an external driver like CP2K.

Thank you very much for your time and help.

Best regards,

Somaye

   My input is as follows,

<simulation>
  <output prefix='simulation'>
    <!-- Ensure correct list syntax with brackets if needed, the current form is generally fine -->
    <properties stride='20' filename='out'> [ step, time{picosecond}, conserved, temperature{kelvin}, kinetic_md{electronvolt}, kinetic_cv{electronvolt}, potential{electronvolt} ] </properties>
    <trajectory filename='vel' stride='20' bead='1' flush='200'> velocities </trajectory>
    <trajectory filename='xc' stride='20' flush='200'> x_centroid{angstrom} </trajectory>
    <trajectory filename='vc' stride='20' flush='200' > v_centroid </trajectory>
  </output>
  <total_steps>1000</total_steps>
  <prng>
    <seed>3337</seed>
  </prng>
  <!-- FIX 1: Port must be a number, not the string 'port'. This caused the initial error. -->
  <ffsocket mode='unix' name='driver'>
    <address>genoa1002</address>
    <port>31415</port> <!-- Use a number, and use this same number in your CP2K input -->
    <latency>0.01</latency>
    <timeout>5000</timeout>
  </ffsocket>
  <system>
  <normal_modes>
     <!-- FIX 2: Ensure correct list syntax for frequencies if using PA-CMD style -->
     <frequencies style='pa-cmd' units="inversecm"> [ ] </frequencies>
  </normal_modes>

  <initialize nbeads="32">
    <file mode="xyz">water.xyz</file>
    <velocities mode="thermal" units="kelvin">300</velocities>
  </initialize>

  <!-- FIX 3: Define atom groups using the 'atoms' attribute directly within the 'force' tag -->
  <forces>
      <!-- Force Group 1 for atoms 1-10 (named "region1") -->
      <force name="region1" atoms="1..10">
          <forcefield>driver</forcefield>
      </force>
      <!-- Force Group 2 for atoms 69-75 (named "region2") -->
      <force name="region2" atoms="69..75">
           <forcefield>driver</forcefield>
      </force>
      <!-- Force Group 3 for all other atoms not explicitly defined above -->
      <force name="region3" atoms="11..68, 76..96">
          <forcefield>driver</forcefield>
      </force>
    </forces>

    <motion mode="dynamics">
      <dynamics>
        <timestep units="fs">0.25</timestep>
        <!-- FIX 4: Apply thermostats using the 'select_thermo' attribute to link them to the names defined above -->

        <thermostat mode="pile_l" select_thermo="region1">
          <tau>100</tau>
          <temperature units="kelvin"> 290 </temperature>
        </thermostat>

        <thermostat mode="pile_l" select_thermo="region2">
          <tau>100</tau>
          <temperature units="kelvin"> 320 </temperature>
        </thermostat>
       
        <!-- Add a thermostat for the rest of the atoms, otherwise they are untempered -->
        <thermostat mode="pile_l" select_thermo="region3">
          <tau>100</tau>
          <temperature units="kelvin"> 300 </temperature>
        </thermostat>

      </dynamics>
    </motion>

  </system>
</simulation>

Mariana Rossi

unread,
Jan 16, 2026, 9:23:42 AMJan 16
to ipi-users
Dear  Somayeh,

There is no pre-implemented feature in i-PI to define such regions, attaching different thermostats. That would require some coding by yourself, as it is a very unusual setup!

All the best,
Mariana
Reply all
Reply to author
Forward
0 new messages