qml.qchem.taylor_hamiltonian¶
- taylor_hamiltonian(pes, max_deg=4, min_deg=3, mapping='binary', n_states=2, wire_map=None, tol=1e-12)[source]¶
Return Taylor vibrational Hamiltonian.
The construction of the Hamiltonian is based on Eqs. 4-7 of arXiv:1703.09313. The Hamiltonian is then converted to a qubit operator with a selected
mapping
method.- 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
mapping (str) – Method used to map to qubit basis. Input values can be
"binary"
or"unary"
. Default is"binary"
.n_states (int) – maximum number of allowed bosonic states
wire_map (dict) – A dictionary defining how to map the states of the Bose operator to qubit wires. If
None
, integers used to label the bosonic states will be used as wire labels. Defaults toNone
.tol (float) – tolerance for discarding the imaginary part of the coefficients
- Returns
the Taylor Hamiltonian
- Return type
Example
>>> pes_onemode = np.array([[0.309, 0.115, 0.038, 0.008, 0.000, 0.006, 0.020, 0.041, 0.070]]) >>> pes_twomode = np.zeros((1, 1, 9, 9)) >>> dipole_onemode = np.zeros((1, 9, 3)) >>> gauss_weights = np.array([3.96e-05, 4.94e-03, 8.85e-02, ... 4.33e-01, 7.20e-01, 4.33e-01, ... 8.85e-02, 4.94e-03, 3.96e-05]) >>> grid = np.array([-3.19, -2.27, -1.47, -0.72, 0.0, 0.72, 1.47, 2.27, 3.19]) >>> pes_object = qml.qchem.VibrationalPES( ... freqs=np.array([0.025]), ... grid=grid, ... uloc=np.array([[1.0]]), ... gauss_weights=gauss_weights, ... pes_data=[pes_onemode, pes_twomode], ... dipole_data=[dipole_onemode], ... localized=True, ... dipole_level=1, ... ) >>> qml.qchem.taylor_hamiltonian(pes_object, 4, 2) ( -0.003833496032473659 * X(0) + (0.0256479442871582+0j) * I(0) + (-0.013079509779221888+0j) * Z(0) )