Harmonic Oscillator#

Quantarhei package (http://www.github.com/quantarhei)

ho (harmonic oscillator) module

class quantarhei.qm.oscillators.ho.fcstorage[source]#

Bases: Saveable

FC factor look-up class

Once Frank-Condon factors for some value of the shift are calculated they can be stored here, and retrieved when needed again

__init__() None[source]#

Constructor

lookup(shift: float) bool[source]#

Returns true if the FC factors for a given shift are available

index(shift: float) int[source]#

Returns an index of the FC factors with a given shift

add(shift: float, fcmatrix: ndarray) None[source]#

Adds the matrix of FC factors to the storage

get(ii: int) ndarray[source]#

Returns a stored FC matrix

class quantarhei.qm.oscillators.ho.operator_factory(N: int = 100)[source]#

Bases: Saveable

Class providing useful operators

Creation and anihilation operators

anihilation_operator() ndarray[source]#
creation_operator() ndarray[source]#
shift_operator(dd_: Any) ndarray[source]#

Calculates the Shift Operator based on the size N_ of the basis of states and the shift dd_.

The shift operator is defined as

\[D_{\alpha} = e^{-\alpha \frac{\partial}{\partial Q}}\]

where \(Q\) is the dimensionless coordinate of the Harmonic oscillator with Hamiltonian

\[H = \frac{\hbar\omega}{2}\left(P^2 + Q^2\right).\]

In this definition, the shift operator acts on a statevector \(\psi(Q)\) in \(Q\)-representation is such a way that it shifts it by the value \(\alpha\) along the its coordinate \(Q\), i.e.

\[D_{\alpha}\psi(Q) = \psi(Q-\alpha).\]

This definition is consistent with the definition of a shift operator as defined in Wikipedia (look for shift operator). It shifts the function to the right along the coordite \(Q\) axis (unlike in the definition in Wikipedia - this seems to be more natural for physicists.)

The dimensionless coordite \(Q\) and dimensionless momentum \(P\) are related to creation and annihilation operators as

\[a = \frac{1}{\sqrt{2}}\left(Q+iP\right)\]
\[a^{\dagger} = \frac{1}{\sqrt{2}}\left(Q-iP\right)\]
\[Q = \frac{1}{\sqrt{2}}\left(a + a^{\dagger}\right)\]
\[P = \frac{1}{i\sqrt{2}}\left(a-a^{\dagger}\right).\]

With these definitions we have

\[H = \hbar\omega\left(a^{\dagger}a + \frac{1}{2}\right)\]

As we have \(P=-i\frac{\partial}{\partial Q}\), the shift operator reads as

\[D_{\alpha} = e^{-i\alpha P} = e^{-\frac{\alpha}{\sqrt{2}}\left(a-a^{\dagger}\right)}\]

The operator can be generalized for complex values of \(\alpha\) to read

\[D_{\alpha} = e^{\frac{1}{\sqrt{2}}\left(\alpha a^{\dagger}-\alpha^{*}a\right)},\]

where \(*\) represents complex conjugation. This is the definition implemented in Quantarhei.

The definition differs by the factor of \(\sqrt{2}\) from what is usually used in literature, but for applications in molecular physics, this definition seems to be more reasonable.

unity_operator() ndarray[source]#
class quantarhei.qm.oscillators.ho.qrepresentation(qaxis: Any)[source]#

Bases: object

Coordinate representation of the HO wavefunctions

generate_ho_eigenfunctions() None[source]#

Generated q-representation of HO eigenfunctions

get_ho_eigenfunction(N: int) None[source]#

Returns q-representation of HO eigenfunction

get_ho_ground_state() DFunction[source]#

Returns the ground state wavefunction of the Harmonic oscillator

get_coherent_state(alpha: Any) DFunction[source]#

Returns q-representation of a coherent state with a given alpha

get_probability_distribution(wfce: Any) DFunction[source]#

Returns probability distribution for a given wavefunction