Skip to content

Commit baa5863

Browse files
soranjhDSGuala
andauthored
Upgrade vibrional hamiltonian docs (#6918)
### Before submitting Please complete the following checklist when submitting a PR: - [ ] All new features must include a unit test. If you've fixed a bug or added code that should be tested, add a test to the test directory! - [ ] All new functions and code must be clearly commented and documented. If you do make documentation changes, make sure that the docs build and render correctly by running `make docs`. - [ ] Ensure that the test suite passes, by running `make test`. - [ ] Add a new entry to the `doc/releases/changelog-dev.md` file, summarizing the change, and including a link back to the PR. - [ ] The PennyLane source code conforms to [PEP8 standards](https://www.python.org/dev/peps/pep-0008/). We check all of our code against [Pylint](https://www.pylint.org/). To lint modified files, simply `pip install pylint`, and then run `pylint pennylane/path/to/file.py`. When all the above are checked, delete everything above the dashed line and fill in the pull request template. ------------------------------------------------------------------------------------------------------------ **Context:** **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** --------- Co-authored-by: Diego <[email protected]>
1 parent 3d80d52 commit baa5863

File tree

6 files changed

+372
-167
lines changed

6 files changed

+372
-167
lines changed

doc/releases/changelog-dev.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,10 @@ Here's a list of deprecations made this release. For a more detailed breakdown o
789789

790790
<h3>Documentation 📝</h3>
791791

792+
* The functions in `qml.qchem.vibrational` are updated to include additional information about the
793+
theory and input arguments.
794+
[(#6918)](https://github.com/PennyLaneAI/pennylane/pull/6918)
795+
792796
* The usage examples for `qml.decomposition.DecompositionGraph` have been updated.
793797
[(#7692)](https://github.com/PennyLaneAI/pennylane/pull/7692)
794798

pennylane/labs/tests/vibrational/test_pes_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
h5py = pytest.importorskip("h5py")
2929

30-
# pylint: disable=too-many-arguments, protected-access, too-many-positional-arguments
30+
# pylint: disable=too-many-arguments, protected-access, too-many-positional-arguments, unsubscriptable-object
3131

3232
ref_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "test_ref_files")
3333

pennylane/qchem/vibrational/localize_modes.py

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -174,26 +174,38 @@ def _localize_modes(freqs, vecs):
174174

175175

176176
def localize_normal_modes(freqs, vecs, bins=[2600]):
177-
"""
178-
Localizes vibrational normal modes.
177+
r"""Computes spatially localized vibrational normal modes.
179178
180-
The normal modes are localized by separating frequencies into specified ranges following the
181-
procedure described in `J. Chem. Phys. 141, 104105 (2014)
179+
The vibrational normal modes are localized using a localizing unitary following the procedure
180+
described in `J. Chem. Phys. 141, 104105 (2014)
182181
<https://pubs.aip.org/aip/jcp/article-abstract/141/10/104105/74317/
183-
Efficient-anharmonic-vibrational-spectroscopy-for?redirectedFrom=fulltext>`_.
182+
Efficient-anharmonic-vibrational-spectroscopy-for?redirectedFrom=fulltext>`_. The localizing
183+
unitary :math:`U` is defined in terms of the normal and local coordinates, :math:`q` and
184+
:math:`\tilde{q}`, respectively as:
185+
186+
.. math::
187+
188+
\tilde{q} = \sum_{j=1}^M U_{ij} q_j,
189+
190+
where :math:`M` is the number of modes. The normal modes
191+
can be separately localized, to prevent mixing between specific groups of normal modes, by
192+
defining frequency ranges in ``bins``. For instance, ``bins = [2600]`` allows to separately
193+
localize modes that have frequencies above and below :math:`2600` reciprocal centimetre (:math:`\text{cm}^{-1}`).
194+
Similarly, ``bins = [1300, 2600]`` allows to separately localize modes in three groups that have
195+
frequencies below :math:`1300`, between :math:`1300-2600` and above :math:`2600`.
184196
185197
Args:
186-
freqs (list[float]): normal mode frequencies in ``cm^-1``
187-
vecs (TensorLike[float]): displacement vectors for normal modes
188-
bins (list[float]): List of upper bound frequencies in ``cm^-1`` for creating separation bins .
189-
Default is ``[2600]`` which means having one bin for all frequencies between ``0`` and ``2600 cm^-1``.
198+
freqs (TensorLike[float]): normal mode frequencies in reciprocal centimetre (:math:`\text{cm}^{-1}`).
199+
vecs (TensorLike[float]): displacement vectors of the normal modes
200+
bins (List[float]): grid of frequencies for grouping normal modes.
201+
Default is ``[2600]``.
190202
191203
Returns:
192204
tuple: A tuple containing the following:
193-
- list[float] : localized frequencies
194-
- TensorLike[float] : localized displacement vectors
195-
- TensorLike[float] : localization matrix describing the relationship between
196-
original and localized modes.
205+
- TensorLike[float] : localized frequencies in reciprocal centimetre (:math:`\text{cm}^{-1}`).
206+
- List[TensorLike[float]] : localized displacement vectors
207+
- TensorLike[float] : localization matrix describing the relationship between the
208+
original and the localized modes
197209
198210
**Example**
199211
@@ -209,7 +221,7 @@ def localize_normal_modes(freqs, vecs, bins=[2600]):
209221
... [-5.49709883e-17, 7.49851221e-08, -2.77912798e-02]]])
210222
>>> freqs_loc, vecs_loc, uloc = qml.qchem.localize_normal_modes(freqs, vectors)
211223
>>> freqs_loc
212-
array([1332.62008773, 2296.73455892, 2296.7346082 ])
224+
array([1332.62013257, 2296.73453455, 2296.73460655])
213225
214226
"""
215227
if not bins:

0 commit comments

Comments
 (0)