Skip to content

Commit 3132ce7

Browse files
committed
modify the name
1 parent e89192d commit 3132ce7

File tree

8 files changed

+140
-304
lines changed

8 files changed

+140
-304
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
.. _kw_ensemble_qtb:
2+
.. index::
3+
single: nvt_qtb (keyword in run.in)
4+
single: npt_qtb (keyword in run.in)
5+
single: Quantum Thermal Bath
6+
7+
:attr:`ensemble` (QTB)
8+
======================
9+
10+
The variants of the :attr:`ensemble` keyword described on this page implement the Quantum Thermal Bath (QTB) method [Dammak2009]_.
11+
The QTB thermostat is a Langevin-type thermostat that uses colored noise with a quantum Bose-Einstein energy spectrum instead of classical white noise.
12+
This allows approximate inclusion of nuclear quantum effects (zero-point energy and quantum heat capacity) in otherwise classical MD simulations.
13+
14+
The :attr:`npt_qtb` variant combines the QTB thermostat with the Parrinello-Rahman (MTTK) barostat [Martyna1994]_, equivalent to LAMMPS ``fix nph`` + ``fix qtb``.
15+
16+
17+
Syntax
18+
------
19+
20+
:attr:`nvt_qtb`
21+
^^^^^^^^^^^^^^^
22+
23+
Run an NVT simulation with the QTB thermostat::
24+
25+
ensemble nvt_qtb <T_1> <T_2> <T_coup> [f_max <value>] [N_f <value>] [seed <value>]
26+
27+
* :attr:`<T_1>` and :attr:`<T_2>`: Initial and final target temperature (K). The target temperature varies linearly during the run.
28+
* :attr:`<T_coup>`: Thermostat coupling parameter (in units of timestep). Controls the friction coefficient: :math:`\gamma = 1 / (\text{T\_coup} \times dt)`.
29+
* :attr:`f_max`: (Optional, default 200) Maximum frequency of the QTB filter in ps\ :sup:`-1`. Should be larger than the highest phonon frequency in the system.
30+
* :attr:`N_f`: (Optional, default 100) Number of frequency points in the filter. The filter uses :math:`2 N_f` points total.
31+
* :attr:`seed`: (Optional, default 880302) Random number seed for the colored noise generator.
32+
33+
:attr:`npt_qtb`
34+
^^^^^^^^^^^^^^^
35+
36+
Run an NPT simulation with the QTB thermostat and Parrinello-Rahman (MTTK) barostat::
37+
38+
ensemble npt_qtb <direction> <p_1> <p_2> temp <T_1> <T_2> tperiod <tau_T> pperiod <tau_p> [f_max <value>] [N_f <value>] [seed <value>]
39+
40+
Pressure control parameters:
41+
42+
* :attr:`<direction>`: One or more of ``iso``, ``aniso``, ``tri``, ``x``, ``y``, ``z``. Same syntax as :ref:`npt_mttk <mttk>`.
43+
* :attr:`<p_1>` and :attr:`<p_2>`: Initial and final target pressure (GPa).
44+
45+
Temperature and coupling parameters:
46+
47+
* :attr:`temp <T_1> <T_2>`: Initial and final target temperature (K).
48+
* :attr:`tperiod <tau_T>`: QTB thermostat coupling period (in units of timestep). Controls friction: :math:`\gamma = 1 / (\text{tperiod} \times dt)`.
49+
* :attr:`pperiod <tau_p>`: Barostat coupling period (in units of timestep, must be :math:`\geq 200`).
50+
51+
QTB-specific optional parameters (same as :attr:`nvt_qtb`):
52+
53+
* :attr:`f_max`: Maximum frequency (ps\ :sup:`-1`, default 200).
54+
* :attr:`N_f`: Number of frequency points (default 100).
55+
* :attr:`seed`: Random seed (default 880302).
56+
57+
58+
Examples
59+
--------
60+
61+
NVT-QTB
62+
^^^^^^^^
63+
64+
.. code-block:: rst
65+
66+
ensemble nvt_qtb 300 300 100
67+
68+
Run at 300 K with QTB thermostat. The coupling parameter is 100 timesteps.
69+
70+
.. code-block:: rst
71+
72+
ensemble nvt_qtb 300 300 100 f_max 150 N_f 200
73+
74+
Same as above but with custom filter parameters.
75+
76+
NPT-QTB
77+
^^^^^^^^
78+
79+
.. code-block:: rst
80+
81+
ensemble npt_qtb iso 0 0 temp 300 300 tperiod 100 pperiod 1000
82+
83+
Run at 300 K and 0 GPa with isotropic pressure control.
84+
85+
.. code-block:: rst
86+
87+
ensemble npt_qtb aniso 0 0 temp 300 300 tperiod 100 pperiod 1000 f_max 200 N_f 100 seed 12345
88+
89+
Anisotropic pressure control with explicit QTB parameters.
90+
91+
.. code-block:: rst
92+
93+
ensemble npt_qtb x 5 5 y 0 0 z 0 0 temp 300 300 tperiod 100 pperiod 1000
94+
95+
Apply 5 GPa along x and 0 GPa along y and z.
96+
97+
98+
Notes
99+
-----
100+
101+
* The QTB method generates colored noise whose power spectrum matches the quantum energy distribution :math:`E(\omega) = \hbar\omega[\frac{1}{2} + n_{BE}(\omega, T)]`, where :math:`n_{BE}` is the Bose-Einstein distribution.
102+
* The kinetic temperature reported in ``thermo.out`` will be higher than the target temperature due to zero-point energy contributions. This is expected behavior.
103+
* For liquid water at 300 K, the kinetic temperature is typically around 1000-1100 K.
104+
* The :attr:`npt_qtb` ensemble uses the MTTK (Martyna-Tuckerman-Tobias-Klein) integrator for pressure control, which is the same as :ref:`npt_mttk <mttk>` but with the Nosé-Hoover chain thermostat replaced by the QTB thermostat.
105+
* The :attr:`f_max` parameter should be set larger than the highest phonon frequency in the system. For water, 200 ps\ :sup:`-1` is sufficient.
106+
107+
108+
References
109+
----------
110+
111+
.. [Dammak2009] H. Dammak, Y. Chalopin, M. Laroche, M. Hayoun, and J.-J. Greffet, *Quantum Thermal Bath for Molecular Dynamics Simulation*, Phys. Rev. Lett. **103**, 190601 (2009).

doc/gpumd/input_parameters/ensemble_standard.rst

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,6 @@ If the first parameter is :attr:`nvt_lan`, it is similar to the case of :attr:`n
4444
^^^^^^^^^^^^^^^
4545
If the first parameter is :attr:`nvt_bao`, it is similar to the case of :attr:`nvt_ber`, but using the Langevin method with BAOAB splitting [Leimkuhler2013]_.
4646

47-
:attr:`nvt_qtb`
48-
^^^^^^^^^^^^^^^
49-
If the first parameter is :attr:`nvt_qtb`, it is similar to the case of :attr:`nvt_lan`, but using a :term:`QTB` (quantum thermal bath) thermostat with colored noise as proposed by Dammak et al. (Phys. Rev. Lett. 103, 190601, 2009).
50-
The required parameters are identical to those of :attr:`nvt_lan`::
51-
52-
ensemble nvt_qtb <T_1> <T_2> <T_coup>
53-
54-
Optional key-value parameters can be appended in any order::
55-
56-
f_max <f_max> N_f <N_f> seed <seed>
57-
58-
- :attr:`f_max`: frequency cutoff for the colored noise spectrum, in :math:`\mathrm{ps}^{-1}` (default: ``200``)
59-
- :attr:`N_f`: number of frequency grid points used in the filter construction (default: ``100``)
60-
- :attr:`seed`: random seed (default: ``880302``)
61-
62-
:attr:`npt_qtb`
63-
^^^^^^^^^^^^^^^
64-
If the first parameter is :attr:`npt_qtb`, it combines the :term:`QTB` thermostat with a Berendsen barostat for NPT simulations with nuclear quantum effects.
65-
This is equivalent to using ``fix nph`` + ``fix qtb`` in LAMMPS.
66-
The format is::
67-
68-
ensemble npt_qtb <T_1> <T_2> <T_coup> {<pressure_control_parameters>} [f_max <f_max>] [N_f <N_f>] [seed <seed>]
69-
70-
The pressure control parameters are identical to those of :attr:`npt_ber` (isotropic, orthogonal, or triclinic).
71-
The optional QTB key-value parameters (:attr:`f_max`, :attr:`N_f`, :attr:`seed`) can be appended after the pressure coupling constant.
72-
7347
:attr:`npt_ber`
7448
^^^^^^^^^^^^^^^
7549
If the first parameter is :attr:`npt_ber`, it means that the ensemble for the current run is NPT (isothermal–isobaric) generated by using the :ref:`Berendsen barostat <berendsen_barostat>`.

doc/gpumd/input_parameters/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Below you can find a listing of keywords for the ``run.in`` input file.
2323
ensemble
2424
ensemble_standard
2525
ensemble_mttk
26+
ensemble_qtb
2627
ensemble_heat
2728
ensemble_pimd
2829
ensemble_ti_liquid
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
*/
1515

1616
/*----------------------------------------------------------------------------80
17-
NPH + QTB: Parrinello-Rahman barostat (MTTK) with QTB colored noise thermostat.
17+
NPT-QTB: Parrinello-Rahman barostat (MTTK) with QTB colored noise thermostat.
1818
Equivalent to LAMMPS fix nph + fix qtb.
1919
[1] Dammak, T., et al. Phys. Rev. Lett. 103, 190601 (2009).
2020
[2] Martyna, G. J., et al. J. Chem. Phys. 101, 4177 (1994).
2121
------------------------------------------------------------------------------*/
2222

23-
#include "ensemble_nph_qtb.cuh"
23+
#include "ensemble_npt_qtb.cuh"
2424
#include "langevin_utilities.cuh"
2525
#include "utilities/common.cuh"
2626
#include "utilities/gpu_macro.cuh"
@@ -96,7 +96,7 @@ static __global__ void gpu_apply_qtb_half_step(
9696

9797
/* PLACEHOLDER_CONSTRUCTOR */
9898

99-
Ensemble_NPH_QTB::Ensemble_NPH_QTB(const char** params, int num_params)
99+
Ensemble_NPT_QTB::Ensemble_NPT_QTB(const char** params, int num_params)
100100
{
101101
// Initialize MTTK matrices to zero (same as parent constructor)
102102
for (int i = 0; i < 3; i++) {
@@ -110,7 +110,7 @@ Ensemble_NPH_QTB::Ensemble_NPH_QTB(const char** params, int num_params)
110110
}
111111
}
112112

113-
// NPH + QTB: barostat on, NHC thermostat off (QTB replaces it)
113+
// NPT-QTB: barostat on, NHC thermostat off (QTB replaces it)
114114
ensemble_type = NPH;
115115
use_barostat = true;
116116
use_thermostat = false;
@@ -120,8 +120,8 @@ Ensemble_NPH_QTB::Ensemble_NPH_QTB(const char** params, int num_params)
120120
int qtb_n_f_input = 100;
121121
qtb_seed = 880302;
122122

123-
// Parse parameters: nph_qtb <pressure_args> temp <T1> <T2> tperiod <tp> [f_max ...] [N_f ...] [seed ...]
124-
int i = 2; // skip "ensemble" and "nph_qtb"
123+
// Parse parameters: npt_qtb <pressure_args> temp <T1> <T2> tperiod <tp> [f_max ...] [N_f ...] [seed ...]
124+
int i = 2; // skip "ensemble" and "npt_qtb"
125125
while (i < num_params) {
126126
if (strcmp(params[i], "iso") == 0 || strcmp(params[i], "aniso") == 0 ||
127127
strcmp(params[i], "tri") == 0) {
@@ -179,19 +179,19 @@ Ensemble_NPH_QTB::Ensemble_NPH_QTB(const char** params, int num_params)
179179
if (!is_valid_int(params[i + 1], &qtb_seed)) PRINT_INPUT_ERROR("seed should be an integer.");
180180
i += 2;
181181
} else {
182-
PRINT_INPUT_ERROR("Unknown nph_qtb keyword.");
182+
PRINT_INPUT_ERROR("Unknown npt_qtb keyword.");
183183
}
184184
}
185185

186186
if (t_start <= 0 || t_stop <= 0)
187-
PRINT_INPUT_ERROR("nph_qtb requires temp <T_start> <T_stop>.");
187+
PRINT_INPUT_ERROR("npt_qtb requires temp <T_start> <T_stop>.");
188188
if (!use_barostat)
189-
PRINT_INPUT_ERROR("nph_qtb requires pressure specification (iso/aniso/tri/x/y/z).");
189+
PRINT_INPUT_ERROR("npt_qtb requires pressure specification (iso/aniso/tri/x/y/z).");
190190

191191
qtb_N_f = qtb_n_f_input;
192192

193193
// Print summary
194-
printf("Use NPH + QTB ensemble for this run.\n");
194+
printf("Use NPT-QTB ensemble for this run.\n");
195195
printf(" Parrinello-Rahman barostat + quantum thermal bath thermostat.\n");
196196
printf(" QTB temperature: t_start=%g K, t_stop=%g K\n", t_start, t_stop);
197197
printf(" QTB tperiod=%g timesteps\n", t_period);
@@ -204,19 +204,19 @@ Ensemble_NPH_QTB::Ensemble_NPH_QTB(const char** params, int num_params)
204204
printf(" %s: p_start=%g, p_stop=%g, pperiod=%g\n", sc[a][b], p_start[a][b], p_stop[a][b], p_period[a][b]);
205205
}
206206

207-
Ensemble_NPH_QTB::~Ensemble_NPH_QTB(void) {}
207+
Ensemble_NPT_QTB::~Ensemble_NPT_QTB(void) {}
208208

209209
/* PLACEHOLDER_INIT */
210210

211-
void Ensemble_NPH_QTB::init_mttk()
211+
void Ensemble_NPT_QTB::init_mttk()
212212
{
213213
// Call parent init for barostat setup
214214
Ensemble_MTTK::init_mttk();
215215
// Then initialize QTB
216216
init_qtb();
217217
}
218218

219-
void Ensemble_NPH_QTB::init_qtb()
219+
void Ensemble_NPT_QTB::init_qtb()
220220
{
221221
qtb_number_of_atoms = atom->number_of_atoms;
222222
qtb_dt = time_step;
@@ -251,12 +251,12 @@ void Ensemble_NPH_QTB::init_qtb()
251251
GPU_CHECK_KERNEL
252252
}
253253

254-
void Ensemble_NPH_QTB::get_target_temp()
254+
void Ensemble_NPT_QTB::get_target_temp()
255255
{
256256
t_target = t_start + (t_stop - t_start) * get_delta();
257257
}
258258

259-
void Ensemble_NPH_QTB::qtb_update_time_filter(const double target_temperature)
259+
void Ensemble_NPT_QTB::qtb_update_time_filter(const double target_temperature)
260260
{
261261
if (fabs(target_temperature - qtb_last_filter_temperature) < 1.0e-12)
262262
return;
@@ -289,7 +289,7 @@ void Ensemble_NPH_QTB::qtb_update_time_filter(const double target_temperature)
289289
qtb_last_filter_temperature = target_temperature;
290290
}
291291

292-
void Ensemble_NPH_QTB::qtb_refresh_colored_random_force()
292+
void Ensemble_NPT_QTB::qtb_refresh_colored_random_force()
293293
{
294294
const double g3p = sqrt(2.0 * qtb_fric_coef * 12.0 / qtb_h_timestep);
295295
gpu_refresh_qtb_random_force<<<(qtb_number_of_atoms - 1) / 128 + 1, 128>>>(
@@ -301,7 +301,7 @@ void Ensemble_NPH_QTB::qtb_refresh_colored_random_force()
301301
GPU_CHECK_KERNEL
302302
}
303303

304-
void Ensemble_NPH_QTB::qtb_apply_half_step()
304+
void Ensemble_NPT_QTB::qtb_apply_half_step()
305305
{
306306
const int N = qtb_number_of_atoms;
307307
const double dt_half = 0.5 * qtb_dt;
@@ -334,7 +334,7 @@ void Ensemble_NPH_QTB::qtb_apply_half_step()
334334
// compute1: press_chain -> QTB_half_kick -> barostat_v -> verlet_v -> box -> verlet_x -> box
335335
// compute2: verlet_v -> barostat_v -> omega_dot -> QTB_half_kick -> press_chain -> thermo
336336

337-
void Ensemble_NPH_QTB::compute1(
337+
void Ensemble_NPT_QTB::compute1(
338338
const double time_step,
339339
const std::vector<Group>& group,
340340
Box& box,
@@ -375,7 +375,7 @@ void Ensemble_NPH_QTB::compute1(
375375
propagate_box();
376376
}
377377

378-
void Ensemble_NPH_QTB::compute2(
378+
void Ensemble_NPT_QTB::compute2(
379379
const double time_step,
380380
const std::vector<Group>& group,
381381
Box& box,
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
#include <curand_kernel.h>
2525
#endif
2626

27-
class Ensemble_NPH_QTB : public Ensemble_MTTK
27+
class Ensemble_NPT_QTB : public Ensemble_MTTK
2828
{
2929
public:
30-
Ensemble_NPH_QTB(const char** params, int num_params);
31-
virtual ~Ensemble_NPH_QTB(void);
30+
Ensemble_NPT_QTB(const char** params, int num_params);
31+
virtual ~Ensemble_NPT_QTB(void);
3232

3333
virtual void compute1(
3434
const double time_step,

0 commit comments

Comments
 (0)