qml.qchem.taylor_dipole_coeffs¶
- taylor_dipole_coeffs(pes, max_deg=4, min_deg=1)[source]¶
Compute fitted coefficients for the Taylor dipole operator.
- Parameters
pes (VibrationalPES) – object containing the vibrational potential energy surface data
max_deg (int) – maximum degree of Taylor form polynomial
min_deg (int) – minimum degree of Taylor form polynomial
- Returns
- a tuple containing:
list(array(floats)): coefficients for x-displacements
list(array(floats)): coefficients for y-displacements
list(array(floats)): coefficients for z-displacements
- Return type
tuple
Example
>>> freqs = np.array([0.01885397]) >>> grid, weights = np.polynomial.hermite.hermgauss(9) >>> pes_onebody = np.array([[0.05235573, 0.03093067, 0.01501878, 0.00420778, 0.0, ... 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 ... ) >>> x, y, z = qml.qchem.taylor_dipole_coeffs(vib_obj, 4, 2) >>> print(z) [array([[ 1.64124324e-03, 5.39120159e-03, -4.80053702e-05]])]
code/api/pennylane.qchem.taylor_dipole_coeffs
Download Python script
Download Notebook
View on GitHub