Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
documentation:language_reference:objects:responsefunction:operations:len [2024/12/22 14:05] Maurits W. Haverkortdocumentation:language_reference:objects:responsefunction:operations:len [2024/12/22 15:56] (current) Maurits W. Haverkort
Line 3: Line 3:
  
 ### ###
-The length operator "#"+The length operator "#" returns the length of the table if the response function would have been transformed to a table. Note that the length for response functions in Tri-diagonal, Anderson, or ListOfPoles format is 2, for Natural impurity format the length is 1.
 ### ###
  
 ===== Example ===== ===== Example =====
  
-### +The script 
-description text +
-### +
 ==== Input ==== ==== Input ====
 <code Quanty Example.Quanty> <code Quanty Example.Quanty>
--- some example code+acon = {0,         1,   1,   1,   1,   1,  1} 
 +bcon = {   sqrt(1/2), 0.5, 0.5, 0.5, 0.5, 0.5} 
 +Gcon = ResponseFunction.New( {acon,bcon,mu=0,type="Tri"} ) 
 +aval = {0,        -1,  -1,  -1,  -1,  -1, -1} 
 +bval = {   sqrt(1/2), 0.5, 0.5, 0.5, 0.5, 0.5} 
 +Gval = ResponseFunction.New( {aval,bval,mu=0,type="Tri"} ) 
 +a0=0 
 +b0=1 
 +G = ResponseFunction.New( {{a0,b0},val=Gval,con=Gcon,mu=0,type="Nat", name="D"} ) 
 + 
 +print("The lenght of Gval is ",#Gval,"while it contains the elements acon and bcon"
 +print("The length of G is ",#G,"while it only contains the element {a0,b0}"
 +print("The other elements are not indexed by a consequitive number and thus not included in the counting")
 </code> </code>
 +Returns
 ==== Result ==== ==== Result ====
 <file Quanty_Output> <file Quanty_Output>
-text produced as output+The lenght of Gval is 2 while it contains the elements acon and bcon 
 +The length of G is 1 while it only contains the element {a0,b0} 
 +The other elements are not indexed by a consequitive number and thus not included in the counting
 </file> </file>
  
Print/export