Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| documentation:language_reference:functions:createspectra [2016/10/09 22:04] – created Maurits W. Haverkort | documentation:language_reference:functions:createspectra [2025/11/20 03:29] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== CreateSpectra ====== | ||
| + | ### | ||
| + | CreateSpectra($O_1$, | ||
| + | \begin{equation} | ||
| + | \langle \psi | O_2^{\dagger} \frac{1}{(\omega + \mathrm{i} \Gamma/2 + E_0 - O_1)} O_2 | \psi \rangle, | ||
| + | \end{equation} | ||
| + | with $E_0 = \langle \psi | O_1 | \psi \rangle$ and returns the result as a spectrum object and as a tri-diagonal matrix. $O_1$ and $O_2$ are allowed to be tables of operators or tables of wavefunctions. CreateSpectra can take a fourth element specifying options. | ||
| + | ### | ||
| + | |||
| + | ===== Input ===== | ||
| + | |||
| + | * $O_1$ : Operator | ||
| + | * $O_2$ : Operator or a list of operators | ||
| + | * $\psi$ : Wavefunction or a list of Wavefunctions | ||
| + | * Possible options are: | ||
| + | * " | ||
| + | * " | ||
| + | * " | ||
| + | * " | ||
| + | * " | ||
| + | * " | ||
| + | * " | ||
| + | * " | ||
| + | * " | ||
| + | |||
| + | ===== Output ===== | ||
| + | |||
| + | * //G// : Spectrum object. In the case that both a list of operators $\{O_2^a, | ||
| + | * //T// : List representing a tri-diagonal matrix, whose resolvent is the spectral function | ||
| + | |||
| + | ===== Example ===== | ||
| + | |||
| + | ### | ||
| + | description text | ||
| + | ### | ||
| + | |||
| + | ==== Input ==== | ||
| + | <code Quanty CreateSpectra.Quanty> | ||
| + | dofile(" | ||
| + | -- define an Hamiltonian (in this case a magnetic field of 6 tesla in the z direction) | ||
| + | H = 6 * EnergyUnits.Tesla.value * (2*OppSz + OppLz) | ||
| + | -- define a transition operator (in this case a pulsed magnetic field of 20 tesla in the x direction) | ||
| + | T = 20 * EnergyUnits.Tesla.value * (2*OppSx + OppLx) | ||
| + | -- define a ground-state (in this case a p electron with spin and angular momentum down) | ||
| + | psigrd = psim1dn | ||
| + | |||
| + | -- calculate < psigrd | T^dag 1/ | ||
| + | -- with E0 = <psigrd | H | psigrd > | ||
| + | -- spectri is optional | ||
| + | spec, spectri = CreateSpectra(H, | ||
| + | |||
| + | -- the real and imaginary part on a fixed energy grid | ||
| + | print(spec) | ||
| + | |||
| + | -- the spectrum represented as a continued fraction | ||
| + | -- spectri contains {a,b,E0} | ||
| + | -- and the spectrum is a[1] + b[1]^2 / (w + E0 + i G/2 - a[2] - b[2]^2 / (w + E0 + i G/2 - a[3] - b[3]^2 / ... )) | ||
| + | print(spectri) | ||
| + | </ | ||
| + | |||
| + | ==== Result ==== | ||
| + | <file Quanty_Output CreateSpectra.out> | ||
| + | #Spectra: 1 | ||
| + | Emin______Emax | ||
| + | EminPole__EmaxPole | ||
| + | dE________Gamma | ||
| + | Energy | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | { { { 0 , -0.00081037345215517 , -0.00092614108817734 } , | ||
| + | { 0.0014178581849128 , 0.00016372016094642 } , | ||
| + | mu = 0 , | ||
| + | name = Matrix , | ||
| + | type = Tri } } | ||
| + | </ | ||
| + | |||
| + | ===== Table of contents ===== | ||
| + | {{indexmenu> | ||