# Issue with GBS for Molecular Vibronic Spectra: Formic Acid

**URL:** <https://discuss.pennylane.ai/t/issue-with-gbs-for-molecular-vibronic-spectra-formic-acid/1308>\
**Category:** Strawberry Fields\
**Created:** [August 22, 2021, 8:50pm UTC](https://discuss.pennylane.ai/t/issue-with-gbs-for-molecular-vibronic-spectra-formic-acid/1308 "2021-08-22T20:50:17Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![sjahangiri](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/sjahangiri/32/1443_2.png) [@sjahangiri](https://discuss.pennylane.ai/u/sjahangiri)\
**Post date:** [April 13, 2022, 8:23pm UTC](https://discuss.pennylane.ai/t/issue-with-gbs-for-molecular-vibronic-spectra-formic-acid/1308/21 "2022-04-13T20:23:07Z")

</div>

Hi @GSQ. Could you please upload your full code and the GAMESS input and output files to a publicly-accessible github page? I will run the code and will debug it.

---

<div class="post-metadata">

**Author:** ![GSQ](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@GSQ](https://discuss.pennylane.ai/u/GSQ)\
**Post date:** [April 14, 2022, 6:11am UTC](https://discuss.pennylane.ai/t/issue-with-gbs-for-molecular-vibronic-spectra-formic-acid/1308/22 "2022-04-14T06:11:30Z")

</div>

> **[GitHub - GongSiqiu/ORCA-vibronic-debug](https://github.com/GongSiqiu/ORCA-vibronic-debug)**
>
> Contribute to GongSiqiu/ORCA-vibronic-debug development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![sjahangiri](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/sjahangiri/32/1443_2.png) [@sjahangiri](https://discuss.pennylane.ai/u/sjahangiri)\
**Post date:** [April 14, 2022, 10:02pm UTC](https://discuss.pennylane.ai/t/issue-with-gbs-for-molecular-vibronic-spectra-formic-acid/1308/23 "2022-04-14T22:02:08Z")

</div>

Thanks @GSQ. The problem is very likely due to a mismatch between the way that GAMESS and ORCA report the final results. I am working on your code and will let you know as soon as I find the problem with ORCA.

---

<div class="post-metadata">

**Author:** ![sjahangiri](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/sjahangiri/32/1443_2.png) [@sjahangiri](https://discuss.pennylane.ai/u/sjahangiri)\
**Post date:** [April 19, 2022, 10:55pm UTC](https://discuss.pennylane.ai/t/issue-with-gbs-for-molecular-vibronic-spectra-formic-acid/1308/24 "2022-04-19T22:55:33Z")

</div>

Hi @GSQ.

I looked at the data extracted from GAMESS and ORCA and it seems that your code uses the normal modes of ORCA without mass weighting. You should double check the ORCA manual to see if the normal modes are already mass-weighted or not. You must also check the consistency of the units in which the normal mode displacements are printed.

Also, it seems that GAMESS and ORCA give somehow different vibrational frequencies and normal modes. You can visualize the vibrational normal modes and see if they are significantly different or not. In principle, with the same electronic structure method in your calculations, you must get almost identical vibrational frequencies and normal modes.

You can also compare the outputs of GAMESS and ORCA for a smaller molecule such as hydrogen and see if you get identical results. It might help to resolve the inconsistency in the vibrational frequencies and normal modes.

---

<div class="post-metadata">

**Author:** ![GSQ](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@GSQ](https://discuss.pennylane.ai/u/GSQ)\
**Post date:** [May 18, 2022, 4:17pm UTC](https://discuss.pennylane.ai/t/issue-with-gbs-for-molecular-vibronic-spectra-formic-acid/1308/25 "2022-05-18T16:17:23Z")

</div>

I finally solved this problem. Noticed that

> [@GSQ](#):
>
> NORMAL MODES  
> These modes are the Cartesian displacements weighted by the diagonal matrix M(i,i)=1/sqrt(m[i]) where m[i] is the mass of the displaced atom. Thus, these vectors are normalized but _not_ orthogonal

when use the normal modes from ORCA, I need to mass-weight it to make it orthogonal and then normalize it. Finally it give me the correct result. Thank you very much!

---

<div class="post-metadata">

**Author:** ![GSQ](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@GSQ](https://discuss.pennylane.ai/u/GSQ)\
**Post date:** [May 20, 2022, 6:43am UTC](https://discuss.pennylane.ai/t/issue-with-gbs-for-molecular-vibronic-spectra-formic-acid/1308/26 "2022-05-20T06:43:05Z")

</div>

Hello Alain,  
you said

> [@Alain\_Delgado\_Gran](#):
>
> However, due to the symmetry of the molecule, the Duschinsky matrix for this vibronic transition is block diagonal with two blocks, one of dimension 7x7 (totally symmetric block) and the other with dimension 2x2 (non-totally symmetric block).

However, the Duschinsky matrix I got is not block diagonal. ![%E5%9B%BE%E7%89%87](https://canada1.discourse-cdn.com/flex012/uploads/pennylane/original/2X/d/d6b8e1c75f8a60fee06f4a00aaf034a1bdfb7526.png)  
Do I need to do some transformations on it?

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [May 20, 2022, 9:53pm UTC](https://discuss.pennylane.ai/t/issue-with-gbs-for-molecular-vibronic-spectra-formic-acid/1308/27 "2022-05-20T21:53:53Z")

</div>

Hi @GSQ, thank you for your question. We will be taking a look at it and coming back with an answer hopefully on Tuesday. Have a good weekend!

---

<div class="post-metadata">

**Author:** ![sjahangiri](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/sjahangiri/32/1443_2.png) [@sjahangiri](https://discuss.pennylane.ai/u/sjahangiri)\
**Post date:** [May 24, 2022, 10:17pm UTC](https://discuss.pennylane.ai/t/issue-with-gbs-for-molecular-vibronic-spectra-formic-acid/1308/28 "2022-05-24T22:17:51Z")

</div>

Hi @GSQ. This could be because of the electronic structure method you are using to compute the vibrational normal modes for formic acid, which very likely does not provide two sets of fully decoupled modes. If the shape of the spectrum matches the reference ones given in this [demo](https://strawberryfields.ai/photonics/apps/run_tutorial_vibronic.html), no need to perform any transformations.

---

<div class="post-metadata">

**Author:** ![GSQ](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@GSQ](https://discuss.pennylane.ai/u/GSQ)\
**Post date:** [May 25, 2022, 1:31pm UTC](https://discuss.pennylane.ai/t/issue-with-gbs-for-molecular-vibronic-spectra-formic-acid/1308/29 "2022-05-25T13:31:03Z")

</div>

Thanks for your reply. I wonder how to get two sets of fully decoupled modes. Because it can reduce the time of calculation and the hardware demand efficiently.

---

<div class="post-metadata">

**Author:** ![sjahangiri](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/sjahangiri/32/1443_2.png) [@sjahangiri](https://discuss.pennylane.ai/u/sjahangiri)\
**Post date:** [May 25, 2022, 9:31pm UTC](https://discuss.pennylane.ai/t/issue-with-gbs-for-molecular-vibronic-spectra-formic-acid/1308/30 "2022-05-25T21:31:54Z")

</div>

Hi @GSQ, the discussion on the Duschinsky matrix being block diagonal, was based on data taken from this [paper](https://arxiv.org/pdf/1412.8427.pdf). You might follow the procedure in the paper for performing the electronic structure calculations to obtain the vibrational frequencies and normal modes. It might require going beyond DFT though.

[Previous page](https://discuss.pennylane.ai/t/issue-with-gbs-for-molecular-vibronic-spectra-formic-acid/1308.md?page=1)
