Skip to content

Commit

Permalink
format dipole
Browse files Browse the repository at this point in the history
  • Loading branch information
JerryChen97 committed Jan 8, 2025
1 parent ea0e422 commit 0eef8cc
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions pennylane/qchem/vibrational/taylor_ham.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,19 +362,23 @@ def taylor_dipole_coeffs(pes, max_deg=4, min_deg=1):
0.00584504, 0.02881817, 0.08483433, 0.22025702]])
>>> pes_twobody = None
>>> dipole_onebody = np.array([[[-1.92201700e-16, 1.45397041e-16, -1.40451549e-01],
[-1.51005108e-16, 9.53185441e-17, -1.03377032e-01],
[-1.22793018e-16, 7.22781963e-17, -6.92825934e-02],
[-1.96537436e-16, -5.86686504e-19, -3.52245369e-02],
[ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[ 5.24758835e-17, -1.40650833e-16, 3.69955543e-02],
[-4.52407941e-17, 1.38406311e-16, 7.60888733e-02],
[-4.63820104e-16, 5.42928787e-17, 1.17726042e-01],
[ 1.19224372e-16, 9.12491386e-17, 1.64013197e-01]]])
>>>
>>> vib_obj = qml.qchem.VibrationalPES(freqs=freqs, grid=grid, gauss_weights=weights,
uloc = None, pes_data=[pes_onebody, pes_twobody],
dipole_data=[dipole_onebody], localized=False)
>>>
... [-1.51005108e-16, 9.53185441e-17, -1.03377032e-01],
... [-1.22793018e-16, 7.22781963e-17, -6.92825934e-02],
... [-1.96537436e-16, -5.86686504e-19, -3.52245369e-02],
... [ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
... [ 5.24758835e-17, -1.40650833e-16, 3.69955543e-02],
... [-4.52407941e-17, 1.38406311e-16, 7.60888733e-02],
... [-4.63820104e-16, 5.42928787e-17, 1.17726042e-01],
... [ 1.19224372e-16, 9.12491386e-17, 1.64013197e-01]]])
>>> vib_obj = qml.qchem.VibrationalPES(
... freqs=freqs,
... grid=grid,
... gauss_weights=weights,
... uloc=None,
... pes_data=[pes_onebody, pes_twobody],
... dipole_data=[dipole_onebody],
... localized=False
... )
>>> x, y, z = qml.qchem.taylor_dipole_coeffs(vib_obj, 4, 2)
>>> print(z)
[array([[ 1.64124324e-03, 5.39120159e-03, -4.80053702e-05]])]
Expand Down

0 comments on commit 0eef8cc

Please sign in to comment.