Table of Contents

Eq

You can compare two response functions. Two response functions $G1(\omega,\Gamma)$ and $G2(\omega,\Gamma)$ are considered to be equal when $|G1(\omega,\Gamma) - G2(\omega,\Gamma)| < \epsilon$ for $\epsilon=10^{-11}$ at all values of $\omega$ and $\Gamma = \omega/10$.

For example

Input

Example.Quanty
a1 = {0, -1,-0.5, 0,   0.5,   1, 1.5}
b1 = {  0.2, 0.4, 0.2, 0.4, 0.6, 0.2}
G1 = ResponseFunction.New( {a1,b1,mu=0,type="ListOfPoles", name="G1"} )
 
a2 = {0, -1,-0.5, 0,   0.5,   1, 1.5}
b2 = {  0.2, 0.4, 0.2, 0.4, 0.6, 0.2+1E-12}
G2 = ResponseFunction.New( {a2,b2,mu=0,type="ListOfPoles", name="G2"} )
 
a3 = {0, -1,-0.5, 0,   0.5,   1, 1.5}
b3 = {  0.2, 0.4, 0.2, 0.4, 0.6, 0.2+1E-10}
G3 = ResponseFunction.New( {a3,b3,mu=0,type="ListOfPoles", name="G3"} )
 
 
print("G1 is equal to G2",G1==G2)
print("G1 is equal to G3",G1==G3)

Result

G1 is equal to G2	true
G1 is equal to G3	false

Table of contents