Differences

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

Link to this comparison view

Next revision
Previous revision
documentation:language_reference:functions:orthonormalize [2018/06/21 15:22] – created Simon Heinzedocumentation:language_reference:functions:orthonormalize [2026/11/12 17:59] (current) – Maurits W. Haverkort
Line 2: Line 2:
  
 ### ###
-alligned paragraph text+Orthonormalizes vecors and wave-functions
 ### ###
  
 ===== Input ===== ===== Input =====
  
-  * bla : Integer +  * First argument should be a table of complex vectors or wave-functions 
-  * bla2 : Real+  * second optional argument can be a lsit of options. 
 +  * possible options are: (first option is standard) 
 +    * - "Method":         string value: "Lowdin", "GramSchmidt" 
 +    * - "Order":          string value: "Row", "Column" 
 +    * - "SingularValue":  double: values equal or smaller than SingularValue are removed from basis (standard value $10^{-12}$) 
 +    * - "ReduceDimension": boolean (remove singular vectors or add a zero vector to the basis) (standard value true)
  
-===== Output ===== +### 
- +The two methods do not return the same basis. "Lowdin" returns the symmetric orthonormal form, $A (A^{\dagger} A)^{-1/2}$, which is the orthonormal basis closest to the input, treats all vectors on the same footing and does not depend on the order in which they are given. "GramSchmidt" works through the list in order, so the first vector is left alone up to its norm and each following one is made orthogonal to those before it; the result depends on the order of the list. 
-  * bla : real +###
- +
-===== Example =====+
  
 ### ###
-description text+For a table of vectors the singular values are obtained from the vectors themselves and can be resolved down to $\epsilon_{\mathrm{machine}} \, s_{\mathrm{max}} \approx 2 \cdot 10^{-16} s_{\mathrm{max}}$. For a table of wave-functions with "Method" set to "Lowdin" this is not possible: the vectors are too long to hand to LAPACK, so the symmetric form is built from the overlap matrix $S_{ij} = \langle \psi_i | \psi_j \rangle$, in which a singular value $s$ enters as $s^2$. A singular value below $3 \sqrt{\epsilon_{\mathrm{machine}}} \, s_{\mathrm{max}} \approx 4.5 \cdot 10^{-8} s_{\mathrm{max}}$ can then not be distinguished from the rounding error of $S$ and is removed whatever //SingularValue// is set to, so setting //SingularValue// below that limit does not buy accuracy. "GramSchmidt" on wave-functions does not form $S$ and has no such limit, but it gives an order dependent basis rather than the symmetric one.
 ### ###
  
-==== Input ==== +===== Output ===== 
-<code Quanty Example.Quanty> + 
--- some example code +  * orthonormalized vectors or wave-functions
-</code>+
  
-==== Result ==== 
-<file Quanty_Output> 
-text produced as output 
-</file> 
  
 ===== Table of contents ===== ===== Table of contents =====
 {{indexmenu>.#1}} {{indexmenu>.#1}}
 +
  
Print/export