Skip to content

Commit c735ce9

Browse files
njzjz-botJinzhe Zeng
authored andcommitted
docs: improve formula documentation based on review
- dipole_fitting: add 'an' before 'activation function' - polarizability_fitting: add R^i shape, clarify local-frame tensor, explain symmetry preservation in A^T S A form
1 parent d181a88 commit c735ce9

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

deepmd/dpmodel/fitting/dipole_fitting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DipoleFitting(GeneralFitting):
5050
\mathbf{M}^i = \mathcal{L}^{(n)} \circ \mathcal{L}^{(n-1)} \circ \cdots \circ \mathcal{L}^{(0)}(\mathcal{D}^i),
5151
5252
where :math:`\mathcal{D}^i` is the descriptor and each layer :math:`\mathcal{L}^{(k)}`
53-
is a fully connected layer with activation function.
53+
is a fully connected layer with an activation function.
5454
5555
Parameters
5656
----------

deepmd/dpmodel/fitting/polarizability_fitting.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,27 @@ class PolarFitting(GeneralFitting):
4545
r"""Fitting rotationally equivariant polarizability of the system.
4646
4747
The polarizability tensor :math:`\boldsymbol{\alpha} \in \mathbb{R}^{3 \times 3}` is
48-
computed from the fitting network output and the rotation matrix:
48+
computed from the fitting network output and the rotation matrix
49+
:math:`\mathbf{R}^i \in \mathbb{R}^{m_1 \times 3}` from the descriptor:
4950
5051
**Diagonal fitting** (when `fit_diag=True`):
5152
5253
.. math::
5354
\boldsymbol{\alpha}^i = \mathbf{R}^{i,T} \cdot \mathrm{diag}(\mathbf{p}^i) \cdot \mathbf{R}^i,
5455
55-
where :math:`\mathbf{p}^i \in \mathbb{R}^{m_1}` is the diagonal elements predicted by
56-
the fitting network.
56+
where :math:`\mathbf{p}^i \in \mathbb{R}^{m_1}` is the diagonal elements of the
57+
local-frame polarizability predicted by the fitting network.
5758
5859
**Full matrix fitting** (when `fit_diag=False`):
5960
6061
.. math::
6162
\boldsymbol{\alpha}^i = \mathbf{R}^{i,T} \cdot \mathbf{P}^i \cdot \mathbf{R}^i,
6263
63-
where :math:`\mathbf{P}^i = \frac{1}{2}(\hat{\mathbf{P}}^i + \hat{\mathbf{P}}^{i,T}) \in \mathbb{R}^{m_1 \times m_1}`
64-
is the symmetrized output of the fitting network (:math:`\hat{\mathbf{P}}^i` being the raw output),
65-
ensuring :math:`\boldsymbol{\alpha}^i` is a symmetric tensor.
64+
where :math:`\hat{\mathbf{P}}^i \in \mathbb{R}^{m_1 \times m_1}` is the raw output of
65+
the fitting network, and :math:`\mathbf{P}^i = \frac{1}{2}(\hat{\mathbf{P}}^i + \hat{\mathbf{P}}^{i,T})`
66+
is the symmetrized version. Since :math:`\mathbf{P}^i` is symmetric, the resulting
67+
:math:`\boldsymbol{\alpha}^i` is guaranteed to be a symmetric tensor (matrix products
68+
of the form :math:`A^T S A` preserve symmetry).
6669
6770
The fitting network is:
6871

0 commit comments

Comments
 (0)