Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
documentation:language_reference:objects:responsefunction:start [2024/10/04 17:26] – Sina Shokri | documentation:language_reference:objects:responsefunction:start [2024/10/07 10:00] (current) – Sina Shokri | ||
---|---|---|---|
Line 3: | Line 3: | ||
One simple way to represent a spectrum, for example one that is calculated using the function // | One simple way to represent a spectrum, for example one that is calculated using the function // | ||
- | $$ I(\omega) = \sum_{k} \frac{R_k}{\omega - \omega_k + i \gamma/ | + | \begin{equation} |
- | A more compact way to store this spectrum is by just using two arrays for the values of $ \{R_k\} $ (residues) and $ \{\omega_k\} $ (poles). This is precicely the purpose of the object | + | |
+ | \end{equation} | ||
+ | A more compact way to store this spectrum, as a function of $\omega$ (and $\gamma$), | ||
- | ===== Table of contents | + | The response functions can also be defined by matrices such that the function is given by |
- | {{indexmenu> | + | $$ A_0 + B_0^* \frac{ 1 }{\omega - H + i \gamma / 2} \Bigg|_{[0, |
+ | where $A_0$, $B_0$ and $H$ are matrices. Any unitary transformation that leaves the [0,0] element of $H$ unchanged results in the same spectrum. Hence $H$ can have different forms, whereby only a few elements/ | ||
+ | * list of poles (// | ||
+ | * tri-diagonal (//Tri//) | ||
+ | * Anderson (//And//) | ||
+ | * natural impurity orbital (// | ||
+ | |||
+ | These types are related to each other by unitary transformations and the Quanty function // | ||
+ | |||
+ | In order to define a response function, one needs to set the meta table to " | ||
+ | |||
+ | ==== Definitions | ||
+ | <code Quanty Example.Quanty> | ||
+ | -- Defining single-valued response functions | ||
+ | |||
+ | a = {0, -1,-0.5, 0, | ||
+ | b = { 0.2, 0.1, 0.1, 0.1, 0.2, 0.3} | ||
+ | GA_L = {a, | ||
+ | setmetatable(GA_L, | ||
+ | |||
+ | a = {0, 1, | ||
+ | b = { 1, 0.5, 0.5, 0.5, 0.5, 0.5} | ||
+ | GB_T = {a, | ||
+ | setmetatable(GB_T, | ||
+ | |||
+ | a = {0, 1, 1.5, 2, 2.5, 3, 3.5} | ||
+ | b = { 1, 0.5, 0.5, 0.5, 0.5, 0.5} | ||
+ | GC_A = {a, | ||
+ | setmetatable(GC_A, | ||
+ | |||
+ | acon = {0, | ||
+ | bcon = { | ||
+ | Gcon = {acon, | ||
+ | setmetatable(Gcon, | ||
+ | aval = {0, -1, -1, -1, -1, -1, -1} | ||
+ | bval = { | ||
+ | Gval = {aval, | ||
+ | setmetatable(Gval, | ||
+ | a0=0 | ||
+ | b0=1 | ||
+ | GD_N = {{a0, | ||
+ | setmetatable(GD_N, | ||
+ | |||
+ | -- For a more efficient storage, one can convert from Table to Userdata | ||
+ | GA_l = ResponseFunction.ToUserdata(GA_L) | ||
+ | GB_t = ResponseFunction.ToUserdata(GB_T) | ||
+ | GC_a = ResponseFunction.ToUserdata(GC_A) | ||
+ | GD_n = ResponseFunction.ToUserdata(GD_N) | ||
+ | |||
+ | print(" | ||
+ | print(GA_L) | ||
+ | print(" | ||
+ | print(GA_l) | ||
+ | |||
+ | print(" | ||
+ | print(GB_T) | ||
+ | print(" | ||
+ | print(GB_t) | ||
+ | |||
+ | print(" | ||
+ | print(GC_A) | ||
+ | print(" | ||
+ | print(GC_a) | ||
+ | |||
+ | print(" | ||
+ | print(GD_N) | ||
+ | print(" | ||
+ | print(GD_n) | ||
+ | |||
+ | -- response functions in Quanty are functions that, given | ||
+ | -- a complex number as input w + I gamma/2 return a complex | ||
+ | -- number (single valued functions) or a matrix (matrix functions) | ||
+ | omega = 0.764 | ||
+ | gamma = 0.1 | ||
+ | print(" | ||
+ | print(" | ||
+ | |||
+ | print("" | ||
+ | print(" | ||
+ | print(" | ||
+ | |||
+ | print(" | ||
+ | print(" | ||
+ | |||
+ | print(" | ||
+ | print(" | ||
+ | |||
+ | print(" | ||
+ | print(" | ||
+ | |||
+ | |||
+ | -- Defining matrix response functions | ||
+ | |||
+ | A0 = {{0, | ||
+ | setmetatable(A0, | ||
+ | A1 = {{1, | ||
+ | setmetatable(A1, | ||
+ | A2 = {{2, | ||
+ | setmetatable(A2, | ||
+ | A3 = {{3, | ||
+ | setmetatable(A3, | ||
+ | a1 = -1 | ||
+ | a2 = 0 | ||
+ | a3 = 1 | ||
+ | av1 = -0.5 | ||
+ | av2 = -1.0 | ||
+ | av3 = -1.5 | ||
+ | ac1 = 0.5 | ||
+ | ac2 = 1.0 | ||
+ | ac3 = 1.5 | ||
+ | B0s = {{1, | ||
+ | setmetatable(B0s, | ||
+ | t=sqrt(0.5) | ||
+ | B0vs = {{t, | ||
+ | setmetatable(B0vs, | ||
+ | B0cs = {{t, | ||
+ | setmetatable(B0cs, | ||
+ | B0 = B0s * B0s | ||
+ | B0v = B0vs * B0vs | ||
+ | B0c = B0cs * B0cs | ||
+ | B1s = {{1, | ||
+ | setmetatable(B1s, | ||
+ | B1 = B1s * B1s | ||
+ | B2s = {{2,0,3},{0,5,6},{3,6,9}} | ||
+ | setmetatable(B2s, | ||
+ | B2 = B2s * B2s | ||
+ | B3s = {{3, | ||
+ | setmetatable(B3s, | ||
+ | B3 = B3s * B3s | ||
+ | |||
+ | MA_L = { {A0, | ||
+ | setmetatable(MA_L, | ||
+ | |||
+ | MB_T = { {A0, | ||
+ | setmetatable(MB_T, | ||
+ | |||
+ | MC_A = { {A0, | ||
+ | setmetatable(MC_A, | ||
+ | |||
+ | MD_Nv = { {A0, | ||
+ | setmetatable(MD_Nv, | ||
+ | |||
+ | MD_Nc = { {A0, | ||
+ | setmetatable(MD_Nc, | ||
+ | |||
+ | MD_N = {{A0, | ||
+ | setmetatable(MD_N, | ||
+ | |||
+ | -- For a more efficient storage, one can convert from Table to Userdata | ||
+ | MA_l = ResponseFunction.ToUserdata(MA_L) | ||
+ | MB_t = ResponseFunction.ToUserdata(MB_T) | ||
+ | MC_a = ResponseFunction.ToUserdata(MC_A) | ||
+ | MD_n = ResponseFunction.ToUserdata(MD_N) | ||
+ | |||
+ | |||
+ | print(" | ||
+ | print(MA_L) | ||
+ | print(" | ||
+ | print(MA_l) | ||
+ | |||
+ | print(" | ||
+ | print(MB_T) | ||
+ | print(" | ||
+ | print(MB_t) | ||
+ | |||
+ | print(" | ||
+ | print(MC_A) | ||
+ | print(" | ||
+ | print(MC_a) | ||
+ | |||
+ | print(" | ||
+ | print(MD_N) | ||
+ | print(" | ||
+ | print(MD_n) | ||
+ | |||
+ | |||
+ | -- response functions in Quanty are functions that, given | ||
+ | -- a complex number as input w + I gamma/2 return a complex | ||
+ | -- number (single valued functions) or a matrix (matrix functions) | ||
+ | omega = 0.764 | ||
+ | gamma = 0.1 | ||
+ | print(" | ||
+ | print(" | ||
+ | |||
+ | print("" | ||
+ | print(" | ||
+ | print(MA_L(omega, | ||
+ | print(" | ||
+ | print(MA_l(omega, | ||
+ | |||
+ | print("" | ||
+ | print(" | ||
+ | print(MB_T(omega, | ||
+ | print(" | ||
+ | print(MB_t(omega, | ||
+ | |||
+ | print("" | ||
+ | print(" | ||
+ | print(MC_A(omega, | ||
+ | print(" | ||
+ | print(MC_a(omega, | ||
+ | |||
+ | print("" | ||
+ | print(" | ||
+ | print(MD_N(omega, | ||
+ | print(" | ||
+ | print(MD_n(omega, | ||
+ | </ | ||
- | ==== Result ==== | ||
<file Quanty_Output> | <file Quanty_Output> | ||
- | text produced as output | + | GA_L: |
+ | { { 0 , -1 , -0.5 , 0 , 0.5 , 1 , 1.5 } , | ||
+ | { 0.2 , 0.1 , 0.1 , 0.1 , 0.2 , 0.3 } , | ||
+ | type = ListOfPoles , | ||
+ | mu = 0 , | ||
+ | name = A } | ||
+ | GA_l: | ||
+ | ResponseFunction in userdata format use ToTable() in order to get a table form | ||
+ | GB_T: | ||
+ | { { 0 , 1 , 1 , 1 , 1 , 1 , 1 } , | ||
+ | { 1 , 0.5 , 0.5 , 0.5 , 0.5 , 0.5 } , | ||
+ | type = Tri , | ||
+ | mu = 0 , | ||
+ | name = B } | ||
+ | GB_t: | ||
+ | ResponseFunction in userdata format use ToTable() in order to get a table form | ||
+ | GC_A: | ||
+ | { { 0 , 1 , 1.5 , 2 , 2.5 , 3 , 3.5 } , | ||
+ | { 1 , 0.5 , 0.5 , 0.5 , 0.5 , 0.5 } , | ||
+ | type = And , | ||
+ | mu = 0 , | ||
+ | name = C } | ||
+ | GC_a: | ||
+ | ResponseFunction in userdata format use ToTable() in order to get a table form | ||
+ | GD_N: | ||
+ | { { 0 , 1 } , | ||
+ | type = Nat , | ||
+ | val = { { 0 , -1 , -1 , -1 , -1 , -1 , -1 } , | ||
+ | { 0.70710678118655 , 0.5 , 0.5 , 0.5 , 0.5 , 0.5 } , | ||
+ | mu = 0 , | ||
+ | type = Tri } , | ||
+ | con = { { 0 , 1 , 1 , 1 , 1 , 1 , 1 } , | ||
+ | { 0.70710678118655 , 0.5 , 0.5 , 0.5 , 0.5 , 0.5 } , | ||
+ | mu = 0 , | ||
+ | type = Tri } , | ||
+ | name = D , | ||
+ | mu = 0 } | ||
+ | GD_n: | ||
+ | ResponseFunction in userdata format use ToTable() in order to get a table form | ||
+ | omega = 0.764 | ||
+ | gamma = 0.1 | ||
+ | |||
+ | GA_L(omega, gamma) = (-0.52850742098896 - 0.28351791776891 I) | ||
+ | GA_l(omega, gamma) = (-0.52850742098896 - 0.28351791776891 I) | ||
+ | GB_T(omega, gamma) = (-1.6762624946074 - 5.2043002596032 I) | ||
+ | GB_t(omega, gamma) = (-1.6762624946074 - 5.2043002596032 I) | ||
+ | GC_A(omega, gamma) = (1.5075603166492 - 0.20713674761056 I) | ||
+ | GC_a(omega, gamma) = (1.5075603166492 - 0.20713674761056 I) | ||
+ | GD_N(omega, gamma) = (-0.52770560643508 - 2.61282805234 I) | ||
+ | GD_n(omega, gamma) = (-0.52770560643508 - 2.61282805234 I) | ||
+ | MA_L: | ||
+ | { { { { 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 } } , -1 , 0 , 1 } , | ||
+ | { { { 11 , (18 + 6 I) , (30 + 6 I) } , | ||
+ | { (18 - 6 I) , 62 , (84 - 3 I) } , | ||
+ | { (30 - 6 I) , (84 + 3 I) , 126 } } , | ||
+ | { { 13 , 18 , 33 } , | ||
+ | { 18 , 61 , 84 } , | ||
+ | { 33 , 84 , 126 } } , | ||
+ | { { 18 , 18 , 36 } , | ||
+ | { 18 , 61 , 84 } , | ||
+ | { 36 , 84 , 126 } } } , | ||
+ | type = ListOfPoles , | ||
+ | mu = 0 , | ||
+ | name = A } | ||
+ | MA_l: | ||
+ | ResponseFunction in userdata format use ToTable() in order to get a table form | ||
+ | MB_T: | ||
+ | { { { { 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 } } , | ||
+ | { { 1 , 2 , 3 } , | ||
+ | { 2 , 5 , 6 } , | ||
+ | { 3 , 6 , 9 } } , | ||
+ | { { 2 , 2 , 3 } , | ||
+ | { 2 , 5 , 6 } , | ||
+ | { 3 , 6 , 9 } } , | ||
+ | { { 3 , 2 , 3 } , | ||
+ | { 2 , 5 , 6 } , | ||
+ | { 3 , 6 , 9 } } } , | ||
+ | { { { 1 , 0 , 0 } , | ||
+ | { 0 , 1 , 0 } , | ||
+ | { 0 , 0 , 1 } } , | ||
+ | { { 11 , (18 + 6 I) , (30 + 6 I) } , | ||
+ | { (18 - 6 I) , 62 , (84 - 3 I) } , | ||
+ | { (30 - 6 I) , (84 + 3 I) , 126 } } , | ||
+ | { { 13 , 18 , 33 } , | ||
+ | { 18 , 61 , 84 } , | ||
+ | { 33 , 84 , 126 } } } , | ||
+ | type = Tri , | ||
+ | mu = 0 , | ||
+ | name = B } | ||
+ | MB_t: | ||
+ | ResponseFunction in userdata format use ToTable() in order to get a table form | ||
+ | MC_A: | ||
+ | { { { { 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 } } , | ||
+ | { { 1 , 2 , 3 } , | ||
+ | { 2 , 5 , 6 } , | ||
+ | { 3 , 6 , 9 } } , | ||
+ | { { 2 , 2 , 3 } , | ||
+ | { 2 , 5 , 6 } , | ||
+ | { 3 , 6 , 9 } } , | ||
+ | { { 3 , 2 , 3 } , | ||
+ | { 2 , 5 , 6 } , | ||
+ | { 3 , 6 , 9 } } } , | ||
+ | { { { 1 , 0 , 0 } , | ||
+ | { 0 , 1 , 0 } , | ||
+ | { 0 , 0 , 1 } } , | ||
+ | { { 11 , (18 + 6 I) , (30 + 6 I) } , | ||
+ | { (18 - 6 I) , 62 , (84 - 3 I) } , | ||
+ | { (30 - 6 I) , (84 + 3 I) , 126 } } , | ||
+ | { { 13 , 18 , 33 } , | ||
+ | { 18 , 61 , 84 } , | ||
+ | { 33 , 84 , 126 } } } , | ||
+ | type = And , | ||
+ | mu = 0 , | ||
+ | name = C } | ||
+ | MC_a: | ||
+ | ResponseFunction in userdata format use ToTable() in order to get a table form | ||
+ | MD_N: | ||
+ | { { { { 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 } } , | ||
+ | { { 1 , 0 , 0 } , | ||
+ | { 0 , 1 , 0 } , | ||
+ | { 0 , 0 , 1 } } } , | ||
+ | type = Nat , | ||
+ | val = { { { { 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 } } , -0.5 , -1 , -1.5 } , | ||
+ | { { { 11 , (18 + 6 I) , (30 + 6 I) } , | ||
+ | { (18 - 6 I) , 62 , (84 - 3 I) } , | ||
+ | { (30 - 6 I) , (84 + 3 I) , 126 } } , | ||
+ | { { 13 , 18 , 33 } , | ||
+ | { 18 , 61 , 84 } , | ||
+ | { 33 , 84 , 126 } } , | ||
+ | { { 18 , 18 , 36 } , | ||
+ | { 18 , 61 , 84 } , | ||
+ | { 36 , 84 , 126 } } } , | ||
+ | type = ListOfPoles , | ||
+ | mu = 0 , | ||
+ | name = Dv } , | ||
+ | con = { { { { 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 } } , 0.5 , 1 , 1.5 } , | ||
+ | { { { 11 , (18 + 6 I) , (30 + 6 I) } , | ||
+ | { (18 - 6 I) , 62 , (84 - 3 I) } , | ||
+ | { (30 - 6 I) , (84 + 3 I) , 126 } } , | ||
+ | { { 13 , 18 , 33 } , | ||
+ | { 18 , 61 , 84 } , | ||
+ | { 33 , 84 , 126 } } , | ||
+ | { { 18 , 18 , 36 } , | ||
+ | { 18 , 61 , 84 } , | ||
+ | { 36 , 84 , 126 } } } , | ||
+ | type = ListOfPoles , | ||
+ | mu = 0 , | ||
+ | name = Dc } , | ||
+ | name = D , | ||
+ | mu = 0 } | ||
+ | MD_n: | ||
+ | ResponseFunction in userdata format use ToTable() in order to get a table form | ||
+ | omega = 0.764 | ||
+ | gamma = 0.1 | ||
+ | |||
+ | MA_L(omega, gamma) = | ||
+ | { { (-49.82074737235 - 16.750435144161 I) , (-39.242754250336 - 13.890672203015 I) , (-85.890426598686 - 30.827754261851 I) } , | ||
+ | { (-39.435420350993 - 20.687932234176 I) , (-132.74935751632 - 58.607579693628 I) , (-183.63057392827 - 82.382725361235 I) } , | ||
+ | { (-86.083092699343 - 37.625014293012 I) , (-183.53424087794 - 78.984095345655 I) , (-275.37361110465 - 121.02511553017 I) } } | ||
+ | MA_l(omega, gamma) = | ||
+ | { { (-49.82074737235 - 16.750435144161 I) , (-39.242754250336 - 13.890672203015 I) , (-85.890426598686 - 30.827754261851 I) } , | ||
+ | { (-39.435420350993 - 20.687932234176 I) , (-132.74935751632 - 58.607579693628 I) , (-183.63057392827 - 82.382725361235 I) } , | ||
+ | { (-86.083092699343 - 37.625014293012 I) , (-183.53424087794 - 78.984095345655 I) , (-275.37361110465 - 121.02511553017 I) } } | ||
+ | |||
+ | MB_T(omega, gamma) = | ||
+ | { { (0.99841211757801 - 0.4318886700871 I) , (-0.92217346376056 - 0.59364349550167 I) , (0.33618642304746 + 0.56252370645231 I) } , | ||
+ | { (-0.51999398150154 + 0.87279523667066 I) , (0.69431808205569 - 0.1748977600005 I) , (-0.34355189835894 - 0.03809026037919 I) } , | ||
+ | { (0.13982839704936 - 0.53101630282404 I) , (-0.25718128095213 + 0.17938506335344 I) , (0.080137084707226 - 0.049212538037938 I) } } | ||
+ | MB_t(omega, gamma) = | ||
+ | { { (0.99841211757801 - 0.4318886700871 I) , (-0.92217346376056 - 0.59364349550167 I) , (0.33618642304746 + 0.56252370645231 I) } , | ||
+ | { (-0.51999398150154 + 0.87279523667066 I) , (0.69431808205569 - 0.1748977600005 I) , (-0.34355189835894 - 0.03809026037919 I) } , | ||
+ | { (0.13982839704936 - 0.53101630282404 I) , (-0.25718128095213 + 0.17938506335344 I) , (0.080137084707226 - 0.049212538037938 I) } } | ||
+ | |||
+ | MC_A(omega, gamma) = | ||
+ | { { (0.0033404740201663 - 0.049014208032374 I) , (-0.0092579857609902 - 0.018133779674219 I) , (0.0041464743284782 + 0.021581712320061 I) } , | ||
+ | { (0.001131475130102 - 0.019625764066449 I) , (-0.006620607647268 - 0.0094591143626733 I) , (0.0044705980344151 + 0.010254424901895 I) } , | ||
+ | { (0.0018776712535675 + 0.024036826455971 I) , (0.0083397043445284 + 0.01003150710377 I) , (-0.0056913744700838 - 0.011590149052798 I) } } | ||
+ | MC_a(omega, gamma) = | ||
+ | { { (0.0033404740201663 - 0.049014208032374 I) , (-0.0092579857609902 - 0.018133779674219 I) , (0.0041464743284782 + 0.021581712320061 I) } , | ||
+ | { (0.001131475130102 - 0.019625764066449 I) , (-0.006620607647268 - 0.0094591143626733 I) , (0.0044705980344151 + 0.010254424901895 I) } , | ||
+ | { (0.0018776712535675 + 0.024036826455971 I) , (0.0083397043445284 + 0.01003150710377 I) , (-0.0056913744700838 - 0.011590149052798 I) } } | ||
+ | |||
+ | MD_N(omega, gamma) = | ||
+ | { { (-12.839446772164 - 21.169048830916 I) , (5.1855777994224 - 3.9320983625761 I) , (-10.184899840804 - 27.575394683943 I) } , | ||
+ | { (-3.5000860033155 - 57.291484603566 I) , (7.3025877301526 - 104.46376534286 I) , (1.7613982402315 - 156.19487348125 I) } , | ||
+ | { (-18.870563643542 - 80.934780924933 I) , (6.1042301416005 - 129.51518036075 I) , (5.8992212863723 - 214.2825403815 I) } } | ||
+ | MD_n(omega, gamma) = | ||
+ | { { (-12.839446772164 - 21.169048830916 I) , (5.1855777994224 - 3.9320983625761 I) , (-10.184899840804 - 27.575394683943 I) } , | ||
+ | { (-3.5000860033155 - 57.291484603566 I) , (7.3025877301526 - 104.46376534286 I) , (1.7613982402315 - 156.19487348125 I) } , | ||
+ | { (-18.870563643542 - 80.934780924933 I) , (6.1042301416005 - 129.51518036075 I) , (5.8992212863723 - 214.2825403815 I) } } | ||
</ | </ | ||
===== Table of contents ===== | ===== Table of contents ===== | ||
- | {{indexmenu> | + | {{indexmenu> |