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:densitymatrix [2016/10/09 22:05] – created Maurits W. Haverkortdocumentation:language_reference:functions:densitymatrix [2024/02/14 12:55] (current) Sina Shokri
Line 1: Line 1:
 +====== DensityMatrix ======
  
 +###
 +//DensityMatrix(psi, OrbitalTable, options)// 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 or a list of wavefunctions
 +  * OrbitalTable : Vector (table) of unsigned integers. Orbitals start at 0. If the table is not given, all orbitals will be included.
 +  * options: a list of options. Currently, only one option can be given: { {"Tensor", bool} }, where bool can be true or false. This option can be used when a list of wavefunctions are given. If the option is set to true, the density matrix is taken with respect to all wavefunctions $\langle \psi_{n} | a^{\dagger}_{\tau}a^{\phantom{\dagger}}_{\tau'} | \psi_{n'} \rangle $. The default value is false, where those density matrices with $n = n'$ will be calculated. The output will be a matrix of density matrices.
 +
 +===== 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
 +     9.486832980505E-01       100010
 +     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