Differences

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

Link to this comparison view

Next revision
Previous revision
documentation:language_reference:objects:matrix:functions:sqrt [2018/09/25 13:12] – created Simon Heinzedocumentation:language_reference:objects:matrix:functions:sqrt [2024/12/12 18:03] (current) Maurits W. Haverkort
Line 5: Line 5:
 Matrix.Sqrt($M$) takes a quadratic matrix $M$ and returns $\sqrt{M}$, which is defined by the property $\sqrt{M}\sqrt{M} = M$. Matrix.Sqrt($M$) takes a quadratic matrix $M$ and returns $\sqrt{M}$, which is defined by the property $\sqrt{M}\sqrt{M} = M$.
  
-At the moment this only works for Hermitian matrices.+M must be Hermitian and positive definite.
 ### ###
  
 ===== Example ===== ===== Example =====
- 
-### 
-Soon. 
-### 
  
 ==== Input ==== ==== Input ====
 <code Quanty Example.Quanty> <code Quanty Example.Quanty>
--- some example code+M = {{1,2*I}, 
 +    {-2*I,4}} 
 +      
 +print("M:"
 +print(M) 
 +sqrtM = Matrix.Sqrt(M) 
 +print("sqrt(M):"
 +print(sqrtM) 
 +print("sqrt(M)*sqrt(M)"
 +print(sqrtM*sqrtM)
 </code> </code>
  
 ==== Result ==== ==== Result ====
 <file Quanty_Output> <file Quanty_Output>
-text produced as output+M: 
 +{ { 1 , (0 + 2 I) } ,  
 +  { (-0 - 2 I) , 4 } } 
 +sqrt(M): 
 +{ { 0.44721359549996 , (0 + 0.89442719099992 I) } ,  
 +  { (0 - 0.89442719099992 I) , 1.7888543819998 } } 
 +sqrt(M)*sqrt(M) 
 +{ { 1 , (0 + 2 I) } ,  
 +  { (0 - 2 I) , 4 } }
 </file> </file>
  
 ===== Table of contents ===== ===== Table of contents =====
-{{indexmenu>.#1|msort}}+{{indexmenu>..:#2|tsort}}
  
Print/export