Differences
This shows you the differences between two versions of the page.
documentation:tutorials:introduction_to_quanty:operators_2 [2016/10/07 20:21] – created Maurits W. Haverkort | documentation:tutorials:introduction_to_quanty:operators_2 [2016/10/10 09:41] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{indexmenu_n> | ||
+ | ====== Operators continued ====== | ||
+ | ### | ||
+ | The third examples shows several standard operators acting on a $p$-shell. | ||
+ | ### | ||
+ | |||
+ | ### | ||
+ | <code Quanty Operators_continued.Quanty> | ||
+ | -- A basis consists of: | ||
+ | -- a number of Fermionic modes or spin-orbitals | ||
+ | NF=6; | ||
+ | -- a number of Bosonic modes (phonon modes, ...) | ||
+ | NB=0; | ||
+ | -- an index relating the spinorbitals to quantum | ||
+ | -- numbers we assign to them. For a p-shell we would | ||
+ | -- like the have 6 spinorbitals with the quantum | ||
+ | -- numbers spin up ml=-1, | ||
+ | -- with ml=-1, ml=0, ml=1 | ||
+ | IndexDn={0, | ||
+ | IndexUp={1, | ||
+ | -- the code knows that a 3 fold degenerate shell | ||
+ | -- has l=1 and ml=-1, 0 and 1 are assigned to | ||
+ | -- them automatically | ||
+ | |||
+ | -- we can now create the spin operators on this basis | ||
+ | OppSx=NewOperator(" | ||
+ | OppSy=NewOperator(" | ||
+ | OppSz=NewOperator(" | ||
+ | |||
+ | -- and print them | ||
+ | print(OppSx) | ||
+ | print(OppSy) | ||
+ | print(OppSz) | ||
+ | |||
+ | print(" | ||
+ | -- the spin operators commute such that | ||
+ | -- Sx * Sy - Sy * Sx = I Sz. This can easily be | ||
+ | -- checked by multiplying operators | ||
+ | OppNill = OppSx * OppSy - OppSy * OppSx - I * OppSz; | ||
+ | |||
+ | -- OppNill should be a zero operator | ||
+ | print(OppNill) | ||
+ | |||
+ | -- Printing indeed showed only zero' | ||
+ | -- still stored. The above equation should return | ||
+ | -- an operator of lenght zero. in order to remove | ||
+ | -- small values from the operator one can chop these | ||
+ | OppNill=Chop(OppNill); | ||
+ | |||
+ | -- secondly the name of the operator is a generic | ||
+ | -- " | ||
+ | OppNill.Name = "Sx * Sy - Sy * Sx - I Sz"; | ||
+ | |||
+ | -- now we can print again. | ||
+ | print(OppNill) | ||
+ | </ | ||
+ | ### | ||
+ | |||
+ | ### | ||
+ | The output is: | ||
+ | <file Quanty_Output Operators_continued.out> | ||
+ | Operator: Sx | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 6 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 1 | 5.000000000000000E-01 | ||
+ | C 1 A 0 | 5.000000000000000E-01 | ||
+ | C 2 A 3 | 5.000000000000000E-01 | ||
+ | C 3 A 2 | 5.000000000000000E-01 | ||
+ | C 4 A 5 | 5.000000000000000E-01 | ||
+ | C 5 A 4 | 5.000000000000000E-01 | ||
+ | |||
+ | |||
+ | |||
+ | Operator: Sy | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 6 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 1 | 0.000000000000000E+00 | ||
+ | C 1 A 0 | 0.000000000000000E+00 -5.000000000000000E-01 | ||
+ | C 2 A 3 | 0.000000000000000E+00 | ||
+ | C 3 A 2 | 0.000000000000000E+00 -5.000000000000000E-01 | ||
+ | C 4 A 5 | 0.000000000000000E+00 | ||
+ | C 5 A 4 | 0.000000000000000E+00 -5.000000000000000E-01 | ||
+ | |||
+ | |||
+ | |||
+ | Operator: Sz | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 6 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 A 1 | 5.000000000000000E-01 | ||
+ | C 0 A 0 | -5.000000000000000E-01 | ||
+ | C 3 A 3 | 5.000000000000000E-01 | ||
+ | C 2 A 2 | -5.000000000000000E-01 | ||
+ | C 5 A 5 | 5.000000000000000E-01 | ||
+ | C 4 A 4 | -5.000000000000000E-01 | ||
+ | |||
+ | |||
+ | ================================= | ||
+ | |||
+ | Operator: Operator | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 6 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 A 1 | 0.000000000000000E+00 | ||
+ | C 0 A 0 | 0.000000000000000E+00 | ||
+ | C 3 A 3 | 0.000000000000000E+00 | ||
+ | C 2 A 2 | 0.000000000000000E+00 | ||
+ | C 5 A 5 | 0.000000000000000E+00 | ||
+ | C 4 A 4 | 0.000000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 C 0 A 1 A 0 | 0.000000000000000E+00 | ||
+ | C 2 C 0 A 3 A 1 | 0.000000000000000E+00 | ||
+ | C 3 C 0 A 2 A 1 | 0.000000000000000E+00 | ||
+ | C 4 C 0 A 5 A 1 | 0.000000000000000E+00 | ||
+ | C 5 C 0 A 4 A 1 | 0.000000000000000E+00 | ||
+ | C 2 C 1 A 3 A 0 | 0.000000000000000E+00 | ||
+ | C 3 C 1 A 2 A 0 | 0.000000000000000E+00 | ||
+ | C 4 C 1 A 5 A 0 | 0.000000000000000E+00 | ||
+ | C 5 C 1 A 4 A 0 | 0.000000000000000E+00 | ||
+ | C 3 C 2 A 3 A 2 | 0.000000000000000E+00 | ||
+ | C 4 C 2 A 5 A 3 | 0.000000000000000E+00 | ||
+ | C 5 C 2 A 4 A 3 | 0.000000000000000E+00 | ||
+ | C 4 C 3 A 5 A 2 | 0.000000000000000E+00 | ||
+ | C 5 C 3 A 4 A 2 | 0.000000000000000E+00 | ||
+ | C 5 C 4 A 5 A 4 | 0.000000000000000E+00 | ||
+ | |||
+ | |||
+ | |||
+ | Operator: Sx * Sy - Sy * Sx - I Sz | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 6 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | </ | ||
+ | ### | ||
+ | |||
+ | |||
+ | ===== Table of contents ===== | ||
+ | {{indexmenu> |