Differences

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

Link to this comparison view

documentation:language_reference:functions:partialmeanfieldoperator [2018/08/03 15:07]
Simon Heinze created
documentation:language_reference:functions:partialmeanfieldoperator [2018/08/03 15:47] (current)
Simon Heinze Added Code Example
Line 25: Line 25:
 ==== Input ==== ==== Input ====
 <code Quanty Example.Quanty>​ <code Quanty Example.Quanty>​
--- some example code+NF = 4 
 + 
 +rho = {{0.8,​0.3,​0,​0},​{0.3,​0.7,​0,​0},​{0,​0,​0.4,​0.5*I},​{0,​0,​-0.5*I,​0.2}} 
 + 
 +print("​Rho:"​) 
 +print(rho) 
 + 
 +op1 = NewOperator("​Number",​NF,​{1},​{1},​{0.1+I}) + NewOperator("​U",​NF,​{0},​{1},​{5}) + 3 
 +op2 = NewOperator("​Number",​NF,​{1},​{1},​{0.00001 + I}) + NewOperator("​Number",​NF,​{2},​{2},​{1}) + NewOperator("​U",​NF,​{0},​{1},​{0},​{1},​{2},​{3},​{2},​{3},​{3}) + NewOperator("​U",​NF,​{0},​{1},​{5}) 
 + 
 +print("​\n\n\n"​) 
 +print("​op1:"​) 
 +print(op1) 
 +print("​PartialMeanFieldOperator(op1,​ rho, {0,​1})"​) 
 +print(PartialMeanFieldOperator(op1,​ rho, {0,1})) 
 +print("​\n\n\n"​) 
 +print("​op2:"​) 
 +print(op2) 
 +print("​PartialMeanFieldOperator(op2,​ rho, {0,​1})"​) 
 +print(PartialMeanFieldOperator(op2,​ rho, {0,1})) 
 +print("​PartialMeanFieldOperator(op2,​ rho, {0,1}, {{\"​AddDFTSelfInteraction\",​true}})"​) 
 +print(PartialMeanFieldOperator(op2,​ rho, {0,1}, {{"​AddDFTSelfInteraction",​true}})) 
 +print("​PartialMeanFieldOperator(op2,​ rho, {2})"​) 
 +print(PartialMeanFieldOperator(op2,​ rho, {2}))
 </​code>​ </​code>​
  
 ==== Result ==== ==== Result ====
 <file Quanty_Output>​ <file Quanty_Output>​
-text produced as output+Rho: 
 +{ { 0.8 , 0.3 , 0 , 0 } ,  
 +  { 0.3 , 0.7 , 0 , 0 } ,  
 +  { 0 , 0 , 0.4 , (0 + 0.5 I) } ,  
 +  { 0 , 0 , (-0 - 0.5 I) , 0.2 } } 
 + 
 + 
 + 
 + 
 +op1: 
 + 
 +Operator: CrAn 
 +QComplex ​        ​= ​         2 (Real==0 or Complex==1 or Mixed==2) 
 +MaxLength ​       =          4 (largest number of product of lader operators) 
 +NFermionic modes =          4 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) 
 +NBosonic modes   ​= ​         0 (Number of bosonic modes (phonon modes, ...) in the one particle basis) 
 + 
 +Operator of Length ​  0 
 +QComplex ​     =          0 (Real==0 or Complex==1) 
 +N             ​= ​         1 (number of operators of length ​  0) 
 +|  3.000000000000000E+00 
 + 
 +Operator of Length ​  2 
 +QComplex ​     =          1 (Real==0 or Complex==1) 
 +N             ​= ​         1 (number of operators of length ​  2) 
 +C  1 A  1 |  1.000000000000000E-01 ​ 1.000000000000000E+00 
 + 
 +Operator of Length ​  4 
 +QComplex ​     =          0 (Real==0 or Complex==1) 
 +N             ​= ​         1 (number of operators of length ​  4) 
 +C  1 C  0 A  1 A  0 | -5.000000000000000E+00 
 + 
 + 
 +PartialMeanFieldOperator(op1,​ rho, {0,1}) 
 + 
 +Operator:  
 +QComplex ​        ​= ​         2 (Real==0 or Complex==1 or Mixed==2) 
 +MaxLength ​       =          4 (largest number of product of lader operators) 
 +NFermionic modes =          4 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) 
 +NBosonic modes   ​= ​         0 (Number of bosonic modes (phonon modes, ...) in the one particle basis) 
 + 
 +Operator of Length ​  0 
 +QComplex ​     =          0 (Real==0 or Complex==1) 
 +N             ​= ​         1 (number of operators of length ​  0) 
 +|  8.150000000000000E+00 
 + 
 +Operator of Length ​  2 
 +QComplex ​     =          1 (Real==0 or Complex==1) 
 +N             ​= ​         4 (number of operators of length ​  2) 
 +C  1 A  1 | -3.900000000000000E+00 ​ 1.000000000000000E+00 
 +C  1 A  0 |  1.500000000000000E+00 ​ 0.000000000000000E+00 
 +C  0 A  1 |  1.500000000000000E+00 ​ 0.000000000000000E+00 
 +C  0 A  0 | -3.500000000000000E+00 -0.000000000000000E+00 
 + 
 + 
 + 
 + 
 + 
 + 
 +op2: 
 + 
 +Operator: CrAn 
 +QComplex ​        ​= ​         2 (Real==0 or Complex==1 or Mixed==2) 
 +MaxLength ​       =          4 (largest number of product of lader operators) 
 +NFermionic modes =          4 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) 
 +NBosonic modes   ​= ​         0 (Number of bosonic modes (phonon modes, ...) in the one particle basis) 
 + 
 +Operator of Length ​  2 
 +QComplex ​     =          1 (Real==0 or Complex==1) 
 +N             ​= ​         2 (number of operators of length ​  2) 
 +C  1 A  1 |  1.000000000000000E-05 ​ 1.000000000000000E+00 
 +C  2 A  2 |  1.000000000000000E+00 ​ 0.000000000000000E+00 
 + 
 +Operator of Length ​  4 
 +QComplex ​     =          0 (Real==0 or Complex==1) 
 +N             ​= ​         2 (number of operators of length ​  4) 
 +C  1 C  0 A  3 A  2 | -3.000000000000000E+00 
 +C  1 C  0 A  1 A  0 | -5.000000000000000E+00 
 + 
 + 
 +PartialMeanFieldOperator(op2,​ rho, {0,1}) 
 + 
 +Operator:  
 +QComplex ​        ​= ​         2 (Real==0 or Complex==1 or Mixed==2) 
 +MaxLength ​       =          4 (largest number of product of lader operators) 
 +NFermionic modes =          4 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) 
 +NBosonic modes   ​= ​         0 (Number of bosonic modes (phonon modes, ...) in the one particle basis) 
 + 
 +Operator of Length ​  0 
 +QComplex ​     =          0 (Real==0 or Complex==1) 
 +N             ​= ​         1 (number of operators of length ​  0) 
 +|  5.150000000000000E+00 
 + 
 +Operator of Length ​  2 
 +QComplex ​     =          1 (Real==0 or Complex==1) 
 +N             ​= ​         5 (number of operators of length ​  2) 
 +C  1 A  1 | -3.999990000000000E+00 ​ 1.000000000000000E+00 
 +C  2 A  2 |  1.000000000000000E+00 ​ 0.000000000000000E+00 
 +C  1 A  0 |  1.500000000000000E+00 ​ 0.000000000000000E+00 
 +C  0 A  1 |  1.500000000000000E+00 ​ 0.000000000000000E+00 
 +C  0 A  0 | -3.500000000000000E+00 -0.000000000000000E+00 
 + 
 + 
 +PartialMeanFieldOperator(op2,​ rho, {0,1}, {{"​AddDFTSelfInteraction",​true}}) 
 + 
 +Operator:  
 +QComplex ​        ​= ​         2 (Real==0 or Complex==1 or Mixed==2) 
 +MaxLength ​       =          4 (largest number of product of lader operators) 
 +NFermionic modes =          4 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) 
 +NBosonic modes   ​= ​         0 (Number of bosonic modes (phonon modes, ...) in the one particle basis) 
 + 
 +Operator of Length ​  0 
 +QComplex ​     =          0 (Real==0 or Complex==1) 
 +N             ​= ​         1 (number of operators of length ​  0) 
 +|  5.150000000000000E+00 
 + 
 +Operator of Length ​  2 
 +QComplex ​     =          1 (Real==0 or Complex==1) 
 +N             ​= ​         6 (number of operators of length ​  2) 
 +C  1 A  1 | -3.416656666666666E+00 ​ 1.000000000000000E+00 
 +C  2 A  2 |  1.333333333333333E+00 ​ 0.000000000000000E+00 
 +C  1 A  0 |  1.500000000000000E+00 ​ 0.000000000000000E+00 
 +C  0 A  1 |  1.500000000000000E+00 ​ 0.000000000000000E+00 
 +C  0 A  0 | -2.833333333333333E+00 -0.000000000000000E+00 
 +C  3 A  3 |  1.666666666666667E-01 ​ 0.000000000000000E+00 
 + 
 + 
 +PartialMeanFieldOperator(op2,​ rho, {2}) 
 + 
 +Operator:  
 +QComplex ​        ​= ​         2 (Real==0 or Complex==1 or Mixed==2) 
 +MaxLength ​       =          4 (largest number of product of lader operators) 
 +NFermionic modes =          4 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) 
 +NBosonic modes   ​= ​         0 (Number of bosonic modes (phonon modes, ...) in the one particle basis) 
 + 
 +Operator of Length ​  0 
 +QComplex ​     =          0 (Real==0 or Complex==1) 
 +N             ​= ​         1 (number of operators of length ​  0) 
 +| -0.000000000000000E+00 
 + 
 +Operator of Length ​  2 
 +QComplex ​     =          1 (Real==0 or Complex==1) 
 +N             ​= ​         2 (number of operators of length ​  2) 
 +C  1 A  1 |  1.000000000000000E-05 ​ 1.000000000000000E+00 
 +C  2 A  2 |  1.000000000000000E+00 ​ 0.000000000000000E+00 
 + 
 +Operator of Length ​  4 
 +QComplex ​     =          0 (Real==0 or Complex==1) 
 +N             ​= ​         1 (number of operators of length ​  4) 
 +C  1 C  0 A  1 A  0 | -5.000000000000000E+00 
 + 
 + 
 </​file>​ </​file>​
  
Print/export