Harmonic Oscillator

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

ho (harmonic oscillator) module

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

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

Methods

add(shift, fcmatrix) Adds the matrix of FC factors to the storage
copy() Returns a shallow copy of the self
deepcopy() Returns a deep copy of the self
get(ii) Returns a stored FC matrix
index(shift) Returns an index of the FC factors with a given shift
load(filename[, test]) Loads an object from a file and returns it
loaddir(dirname) Returns a directory of objects saved into a directory
lookup(shift) Returns true if the FC factors for a given shift are available
save(filename[, comment, test]) Saves the object with all its content into a file
savedir(dirname[, tag, comment, test]) Saves an object into directory containing a file with unique name
scopy() Creates a copy of the object by saving and loading it
add(shift, fcmatrix)[source]

Adds the matrix of FC factors to the storage

get(ii)[source]

Returns a stored FC matrix

index(shift)[source]

Returns an index of the FC factors with a given shift

lookup(shift)[source]

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

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

Class providing useful operators

Creation and anihilation operators

Methods

copy() Returns a shallow copy of the self
deepcopy() Returns a deep copy of the self
load(filename[, test]) Loads an object from a file and returns it
loaddir(dirname) Returns a directory of objects saved into a directory
save(filename[, comment, test]) Saves the object with all its content into a file
savedir(dirname[, tag, comment, test]) Saves an object into directory containing a file with unique name
scopy() Creates a copy of the object by saving and loading it
shift_operator(dd_) Calculates the Shift Operator based on the size N_ of the basis of states and the shift dd_.
anihilation_operator  
creation_operator  
unity_operator  
shift_operator(dd_)[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.

class quantarhei.qm.oscillators.ho.qrepresentation(qaxis)[source]

Coordinate representation of the HO wavefunctions

Methods

generate_ho_eigenfunctions() Generated q-representation of HO eigenfunctions
get_coherent_state(alpha) Returns q-representation of a coherent state with a given alpha
get_ho_eigenfunction(N) Returns q-representation of HO eigenfunction
get_ho_ground_state() Returns the ground state wavefunction of the Harmonic oscillator
get_probability_distribution(wfce) Returns probability distribution for a given wavefunction
generate_ho_eigenfunctions()[source]

Generated q-representation of HO eigenfunctions

get_coherent_state(alpha)[source]

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

get_ho_eigenfunction(N)[source]

Returns q-representation of HO eigenfunction

get_ho_ground_state()[source]

Returns the ground state wavefunction of the Harmonic oscillator

get_probability_distribution(wfce)[source]

Returns probability distribution for a given wavefunction