Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
documentation:language_reference:functions:braketdiagonal [2022/10/05 16:26] Maurits W. Haverkortdocumentation:language_reference:functions:braketdiagonal [2024/12/31 14:13] (current) Maurits W. Haverkort
Line 2: Line 2:
  
 ### ###
-//BraketDiagonal(psi1List, O, psi2List)// calculates the expectation value or matrix element $\left\langle \psi_1[i] \mid O \mid \psi_2[i] \right\rangle$ for all $i$.  +//BraketDiagonal(psi1List, O, psi2List)// calculates the expectation value or matrix element $\left\langle \psi_1[i] \mid O \mid \psi_2[i] \right\rangle$ for all $i$. Whereby $I$ is the minimum of the length of the two tables. If //#psi1List// is not equal to //#psi2List// a warning is givenIf psi1List or psi2List is function instead of a list of functions the value returned is the same as one would get for //Braket//.
- +
-In Quanty //Braket(psi1, O, psi2)// is the same as // psi1 * O * psi2//. The difference is that the function //Braket// can be faster//Braket// can work on lists of functions and then returns a matrix or vector with all possible expectation values+
 ### ###
  
Line 15: Line 13:
 ===== Output ===== ===== Output =====
  
-  * real or complex number, or a list of these or a matrix of these+  * real or complex number, or a list of these
  
 ===== Example ===== ===== Example =====
  
 ### ###
-description text+see [[documentation:language_reference:functions:braket|Braket]] for more information
 ### ###
  
-==== Input ==== 
-<code Quanty Example.Quanty> 
--- some example code 
-</code> 
- 
-==== Result ==== 
-<file Quanty_Output> 
-text produced as output 
-</file> 
  
 ===== Table of contents ===== ===== Table of contents =====
 {{indexmenu>.#1}} {{indexmenu>.#1}}
  
Print/export