Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
documentation:language_reference:objects:responsefunction:start [2024/09/16 11:44] – created Maurits W. Haverkortdocumentation:language_reference:objects:responsefunction:start [2024/12/20 17:07] (current) Maurits W. Haverkort
Line 3: Line 3:
  
 ### ###
-Operators define quantum mechanical operators implemented in second quantizationThe most general operator one can implement is: + 
-$$ \begin{align} +The ResponseFunction object in Quanty defines (linear) response functionsFor Hamiltonian $H$, ground-state $| \psi_0 \rangle$ and list of transition operators $T_i$ with $i \in [1,n]$ we define the response function $G(\omega,\Gamma)$ as giving an $n$ by $n$ matrix for each value of $\omega$ and $\Gamma$. The elements of this matrix are given as 
-O&=\alpha^{(0,0)} \\ +$$ 
- &+\sum_{\tau} \alpha^{(0,1)}_{\tau} a^{\phantom{\dagger}}_{\tau} + \alpha^{(1,0)}_{\tau} a^{\dagger}_{\tau} \\ +G_{i,j}(\omega,\Gamma) = \left\langle \psi_0 \middle| T^{\dagger}_i \frac{1}{\omega - H + \mathrm{i} \Gamma/E_0T^{\phantom{\dagger}}_j \middle| \psi_0 \right\rangle
- &+\sum_{\tau_1,\tau_2} \alpha^{(0,2)}_{\tau_1,\tau_2} a^{\phantom{\dagger}}_{\tau_1}a^{\phantom{\dagger}}_{\tau_2} + \alpha^{(1,1)}_{\tau_1,\tau_2} a^{\dagger}_{\tau_1}a^{\phantom{\dagger}}_{\tau_2} + \alpha^{(2,0)}_{\tau_1,\tau_2} a^{\dagger}_{\tau_1}a^{\dagger}_{\tau_2} \\ +$$ 
-& + \sum_{\tau_1,\tau_2,\tau_3\alpha^{(0,3)}_{\tau_1,\tau_2,\tau_3} a^{\phantom{\dagger}}_{\tau_1}a^{\phantom{\dagger}}_{\tau_2}a^{\phantom{\dagger}}_{\tau_3} + \alpha^{(1,2)}_{\tau_1,\tau_2,\tau_3} a^{\dagger}_{\tau_1}a^{\phantom{\dagger}}_{\tau_2}a^{\phantom{\dagger}}_{\tau_3}  \alpha^{(2,1)}_{\tau_1,\tau_2,\tau_3} a^{\dagger}_{\tau_1}a^{\dagger}_{\tau_2}a^{\phantom{\dagger}}_{\tau_3} \alpha^{(3,0)}_{\tau_1,\tau_2,\tau_3} a^{\dagger}_{\tau_1}a^{\dagger}_{\tau_2}a^{\dagger}_{\tau_3} \\ +with $E_0 = \left\langle \psi_0 \middle| H \middle| \psi_0 \right\rangle$. One can calculate response functions using the Quanty function [[documentation:language_reference:functions:createspectra|CreateSpectra]]. This function returns two objects. At the first position spectra object that contains the intensity for given values of $\omega$ and one specific value of $\Gamma$ on gridAt the second position [[documentation:language_reference:functions:createspectra|CreateSpectra]] returns a ResponseFunction object. 
-&+ \dots +
-\end{align} $$ +
-Note that as $a^{\dagger}_{\tau_1}a^{\phantom{\dagger}}_{\tau_2} = \delta_{\tau_1,\tau_2}-a^{\phantom{\dagger}}_{\tau_2}a^{\dagger}_{\tau_1}for Fermions and $a^{\dagger}_{\tau_1}a^{\phantom{\dagger}}_{\tau_2} = a^{\phantom{\dagger}}_{\tau_2}a^{\dagger}_{\tau_1}-\delta_{\tau_1,\tau_2}$ for Bosons the equation above allows for any operator to be definedOperator defines an object that can store the most general operator. Several methods that act on this object are implemented. Furthermore one can access several properties of Operators+
 ### ###
  
-### +
-Operators can act on Fermions and Bosons. An operator //O// has //O.NF// Fermions and //O.NB// Bosons. The Fermions are indexed from //0// to //O.NF-1//, the Bosons are indexed from //O.NF// to //O.NF+O.NB-1//.+
 ### ###
  
 +ResponseFunctions are objects that can be evaluated at any frequency or imaginary offset. For example:
 +<code Quanty Example.Quanty>
 +H   = Matrix.ToOperator( Matrix.Diagonal({1,2,3,4,5}) )
 +psi = NewWavefunction(5,0,{{"00000",1}})
 +T = {}
 +for i=0,4 do
 +  T[i+1] = NewOperator(5,0,{{i,1}})
 +end
 +S, G = CreateSpectra(H,T,psi)
 +omega = 1.1
 +gamma = 0.01
 +print(G[1](omega,gamma))
 +</code>
 +returns
 +<file Quanty_Output>
 +(9.9750623441396 - 0.49875311720698 I)
 +</file>
 +i.e. the value of the response function for the first transition operator defined at $\omega=1.1$ and $\Gamma=0.01$. 
  
-===== Table of contents ===== +###
-{{indexmenu>.#2}}+
  
-==== Result ====+### 
 + 
 +Besides single complex valued functions we can generate a response function that returns a matrix for each value of $\omega$. For example 
 +<code Quanty Example.Quanty> 
 +H   Matrix.ToOperator( Matrix.Diagonal({1,2,3,4,5}) ) 
 +psi NewWavefunction(5,0,{{"00000",1}}) 
 +{} 
 +for i=0,4 do 
 +  T[i+1] NewOperator(5,0,{{i,1}}) 
 +end 
 +S, G CreateSpectra(H,T,psi,{{"Tensor",true}}) 
 +omega 1.1 
 +gamma 0.01 
 +print(G(omega,gamma)) 
 +</code> 
 +returns
 <file Quanty_Output> <file Quanty_Output>
-text produced as output+{ { (9.9750623441396 - 0.49875311720698 I) , 0 , 0 , 0 , 0 } ,  
 +  { 0 , (-1.1110768186167 - 0.0061726489923151 I) , 0 , 0 , 0 } ,  
 +  { 0 , 0 , (-0.52631214465274 - 0.0013850319596125 I) , 0 , 0 } ,  
 +  { 0 , 0 , 0 , (-0.34482656115767 - 0.00059452855372011 I) , 0 } ,  
 +  { 0 , 0 , 0 , 0 , (-0.25640983496082 - 0.00032873055764208 I) } }
 </file> </file>
 +i.e. a 5 by 5 matrix with matrix elements $G_{i,j}(\omega,\gamma)$. (In this case the response function is diagonal as the Hamiltonian is diagonal. In general all elements can be non-zero.)
 +
 +###
 +
 +###
 +
 +Response functions can be added, subtracted, scaled and many other functions are available to modify them. Response functions can be used to calculate self energies of systems and used for diagrammatic expansions of problems otherwise to involved to solve.
 +
 +###
 +
 +###
 +
 +Internally response functions can be stored in different formats. We need several formats as (1) transformations between the different formats take time (2) transformations between different formats can involve a loss of numerical accuracy and (3) different algorithms require the response function in different formats. The formats used in Quanty to store response functions are
 +  - List of poles $$ G(\omega,\Gamma) = A_0 + \sum_{i=1}^{n} B_{i-1} \frac{1}{\omega + \mathrm{i}\Gamma/2 - a_i} $$
 +  - Tri-diagonal $$ G(\omega,\Gamma) = A_0 + B_0^* \frac{1}{\omega + \mathrm{i}\Gamma/2 - A_1 - B_{1}^{\phantom{\dagger}} \frac{1}{\omega + \mathrm{i}\Gamma/2 - A_2 - B_{2}^{\phantom{\dagger}} \frac{1}{\omega + \mathrm{i}\Gamma/2 - A_2 - B_{3}^{\phantom{\dagger}} \frac{...}{\omega + \mathrm{i}\Gamma/2 - A_{n-1} - B_{n-1}^{\phantom{\dagger}} \frac{1}{\omega + \mathrm{i}\Gamma/2 - A_n } B_{n-1}^{\dagger}} B_{3}^{\dagger} } B_{2}^{\dagger} } B_{1}^{\dagger} } B_0^T $$
 +  - Anderson $$ G(\omega,\Gamma) = A_0 + B_0^* \frac{1}{\omega + \mathrm{i}\Gamma/2 - A_1 - \sum_{i=2}^{n} B_{i-1}^{\phantom{\dagger}} \frac{1}{\omega + \mathrm{i}\Gamma/2 - A_{i} } B_{i-1}^{\dagger} } B_0^T $$
 +  - Natural Impurity. We define $G_{val}(\omega,\Gamma)$ and $G_{con}(\omega,\Gamma)$ as response functions with poles either at positive energy ($G_{con}(\omega,\Gamma)$) or poles at negative energy ($G_{val}(\omega,\Gamma)$). The full response function is defined as $$ G(\omega,\Gamma) = A_0 + B_0^* \left( G_{val}(\omega,\Gamma) + G_{con}(\omega,\Gamma) \right) B_0^T$$ 
 +
 +###
 +
 +###
 +
 +
 +Whereby capital letters $A_i$ and $B_i$ refer to matrices equal to the dimension of $G(\omega,\Gamma)$ and small letters $a_i$ refer to numbers.
 +
 +###
 +
 +###
 +
 +
 +Below you find several functions, methods, properties and operations related to response functions.
 +
 +Response functions can be stored internally as Lua tables with a metatable set to ResponseFunctionMeta, or as a user data. Both objects behave similarly. One should be careful as a comparison between a response function stored as a table to a response function stored as a user data is always falls. That said, comparing functions of doubles will always be problematic due to numerical inaccuracies.
 +
 +###
  
 ===== Table of contents ===== ===== Table of contents =====
-{{indexmenu>.#1|msort}}+{{indexmenu>.#2|tsort}}
  
Print/export