From 0eef8cc48f3e66baf910357a3ce0753091c0fbfd Mon Sep 17 00:00:00 2001 From: JerryChen97 Date: Wed, 8 Jan 2025 14:58:05 -0500 Subject: [PATCH] format dipole --- pennylane/qchem/vibrational/taylor_ham.py | 30 +++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/pennylane/qchem/vibrational/taylor_ham.py b/pennylane/qchem/vibrational/taylor_ham.py index 1602adf37ea..cc6925b4d0e 100644 --- a/pennylane/qchem/vibrational/taylor_ham.py +++ b/pennylane/qchem/vibrational/taylor_ham.py @@ -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]])]