Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| documentation:language_reference:objects:responsefunction:operations:sub [2024/12/17 16:13] – created Maurits W. Haverkort | documentation:language_reference:objects:responsefunction:operations:sub [2025/11/20 04:20] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ### | ### | ||
| - | alligned paragraph text | + | We can subtract two response functions from each other. Note that the residue of a pole always needs to be positive. For $G = G_1 - G_2$ we start by setting $G=G_1$. For each pole in $G_2$ we look for the poles in $G_1$ at the same energy (a's). If this is present we subtract the residue of $G_2$ (b's) from $G$. If $G_2$ contains a pole at an energy that is not present in $G_1$ we subtract the residue from the pole with lower and higher energy such that the first moment locally is conserved. |
| ### | ### | ||
| Line 9: | Line 9: | ||
| ### | ### | ||
| - | description text | + | For the case where the poles in $G_2$ are also present in $G_1$ we find |
| ### | ### | ||
| ==== Input ==== | ==== Input ==== | ||
| <code Quanty Example.Quanty> | <code Quanty Example.Quanty> | ||
| - | -- some example code | + | a1 = {0, -1,-0.5, 0, |
| + | b1 = { 0.2, 0.4, 0.2, 0.4, 0.6, 0.2} | ||
| + | G1 = ResponseFunction.New( {a1, | ||
| + | |||
| + | |||
| + | a1 = {0, -1,-0.5, 0, | ||
| + | b1 = { 0.1, 0.4, 0.1, 0.4, 0.3, 0.2} | ||
| + | G2 = ResponseFunction.New( {a1, | ||
| + | |||
| + | G3 = G1-G2 | ||
| + | print(G3) | ||
| </ | </ | ||
| + | with the output | ||
| + | ==== Result ==== | ||
| + | <file Quanty_Output> | ||
| + | { { 0 , -1 , 0 , 1 } , | ||
| + | { 0.1 , 0.1 , 0.3 } , | ||
| + | name = G1 , | ||
| + | type = ListOfPoles , | ||
| + | mu = 0 } | ||
| + | </ | ||
| + | |||
| + | ===== Example ===== | ||
| + | |||
| + | ### | ||
| + | For the case where the poles in $G_2$ not present in $G_1$ we find | ||
| + | ### | ||
| + | |||
| + | ==== Input ==== | ||
| + | <code Quanty Example.Quanty> | ||
| + | a1 = {0, -1, | ||
| + | b1 = { 0.2, 0.2, 0.3, 0.3} | ||
| + | G1 = ResponseFunction.New( {a1, | ||
| + | |||
| + | |||
| + | a1 = {0, -0.5, 5.75} | ||
| + | b1 = { 0.2, 0.2} | ||
| + | G2 = ResponseFunction.New( {a1, | ||
| + | |||
| + | G3 = G1-G2 | ||
| + | print(G3) | ||
| + | </ | ||
| + | with the output | ||
| ==== Result ==== | ==== Result ==== | ||
| <file Quanty_Output> | <file Quanty_Output> | ||
| - | text produced as output | + | { { 0 , -1 , 0 , 5 , 6 } , |
| + | { 0.1 , 0.1 , 0.25 , 0.15 } , | ||
| + | name = G1 , | ||
| + | mu = 0 , | ||
| + | type = ListOfPoles } | ||
| </ | </ | ||
| + | |||
| + | The pole in $G_2$ at energy $-0.5$ is equally divided between the poles at $-1$ and $0$ in $G_1$, such that each of these residues is reduced by $0.2/ | ||
| ===== Table of contents ===== | ===== Table of contents ===== | ||
| {{indexmenu> | {{indexmenu> | ||