Differences

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

Link to this comparison view

documentation:language_reference:functions:densitymatrix [2016/10/10 09:41] (current)
Line 1: Line 1:
 +====== DensityMatrix ======
  
 +###
 +//​DensityMatrix(psi,​ OrbitalTable)//​ creates the density matrix of psi $a^{\dagger}_{\tau}a^{\phantom{\dagger}}_{\tau'​}$ for the orbitals included in orbitaltable. It returns a table.
 +###
 +
 +===== Input =====
 +
 +  * psi : Wavefunction
 +  * OrbitalTable : Vector (table) of unsigned integers. Orbitals start at 0.
 +
 +===== Output =====
 +
 +  * rho : Matrix (Table of Tables) of reals of dimension #​OrbitalTable
 +
 +===== Example =====
 +
 +###
 +description text
 +###
 +
 +==== Input ====
 +<code Quanty DensityMatrix.Quanty>​
 +dofile("​../​definitions.Quanty"​)
 +
 +print("​For the wave-function"​)
 +print(psi1)
 +print("​the density matrix is")
 +rho = DensityMatrix(psi1)
 +print(rho)
 +print("​the density matrix of orbital 1 and 4 is (counting starts at 0)")
 +rho = DensityMatrix(psi1,​{1,​4})
 +print(rho)
 +</​code>​
 +
 +==== Result ====
 +<file Quanty_Output DensityMatrix.out>​
 +For the wave-function
 +
 +WaveFunction:​ Wave Function
 +QComplex ​        ​= ​         0 (Real==0 or Complex==1)
 +N                =          2 (Number of basis functions used to discribe psi)
 +NFermionic modes =          6 (Number of fermions in the one particle basis)
 +NBosonic modes   ​= ​         0 (Number of bosons in the one particle basis)
 +
 +#      pre-factor ​        ​Determinant
 +   ​1 ​  ​9.486832980505E-01 ​      ​100010
 +   ​2 ​  ​3.162277660168E-01 ​      ​110000
 +
 +
 +the density matrix is
 +{ { 1 , 0 , 0 , 0 , 0 , 0 } , 
 +  { 0 , 0.1 , 0 , 0 , 0.3 , 0 } , 
 +  { 0 , 0 , 0 , 0 , 0 , 0 } , 
 +  { 0 , 0 , 0 , 0 , 0 , 0 } , 
 +  { 0 , 0.3 , 0 , 0 , 0.9 , 0 } , 
 +  { 0 , 0 , 0 , 0 , 0 , 0 } }
 +the density matrix of orbital 1 and 4 is (counting starts at 0)
 +{ { 0.1 , 0.3 } , 
 +  { 0.3 , 0.9 } }
 +</​file>​
 +
 +===== Table of contents =====
 +{{indexmenu>​.#​1}}
Print/export