no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | documentation:language_reference:functions:partialoperator [2022/10/04 22:08] (current) – Maurits W. Haverkort | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== PartialOperator ====== | ||
+ | |||
+ | ### | ||
+ | PartialOperator(// | ||
+ | ### | ||
+ | |||
+ | ### | ||
+ | Mode //" | ||
+ | ### | ||
+ | |||
+ | ### | ||
+ | Mode //" | ||
+ | ### | ||
+ | |||
+ | ### | ||
+ | Mode //" | ||
+ | ### | ||
+ | |||
+ | ===== Input ===== | ||
+ | |||
+ | * //op// : An Operator. | ||
+ | * //indices// : A list of indices. | ||
+ | * //mode// : either " | ||
+ | |||
+ | ===== Output ===== | ||
+ | |||
+ | * // | ||
+ | |||
+ | ===== Example ===== | ||
+ | |||
+ | ==== Input ==== | ||
+ | <code Quanty Example.Quanty> | ||
+ | NF = 3 | ||
+ | NB = 0 | ||
+ | |||
+ | opp1cr = NewOperator(NF, | ||
+ | opp1an = NewOperator(NF, | ||
+ | opp2 = opp1cr * opp1an | ||
+ | opp3 = opp1an * opp2 | ||
+ | opp4 = opp1cr * opp3 | ||
+ | |||
+ | opp = 1 + opp1cr + opp1an + opp2 + opp3 + opp4 | ||
+ | |||
+ | -- The operatore contains strings of creation and annihilation operators of length 0 to 4 | ||
+ | -- l=0 1 term | ||
+ | -- l=1 6 terms (3 creation, 3 annihilation) | ||
+ | -- l=2 9 terms (3 creation * 3 annihilation) | ||
+ | -- l=3 9 terms (cr an an) note that an0 an1 = - an1 an0 | ||
+ | -- l=4 9 terms | ||
+ | -- the full operator is | ||
+ | print(" | ||
+ | print(opp) | ||
+ | |||
+ | -- We only keep terms that at least act once on orbital 1 | ||
+ | print(" | ||
+ | print(PartialOperator(opp, | ||
+ | |||
+ | -- We only keep terms that at least act once on orbital 0 or at orbital 1 | ||
+ | print(" | ||
+ | print(PartialOperator(opp, | ||
+ | |||
+ | -- We remove all terms that act on orbital 1 | ||
+ | print(" | ||
+ | print(PartialOperator(opp, | ||
+ | |||
+ | -- We exclude all terms that act on orbital 0 and we exclude all terms that act on orbital 2 | ||
+ | print(" | ||
+ | print(PartialOperator(opp, | ||
+ | |||
+ | -- We only keep the terms that keep the occupation of orbital 1 conserved | ||
+ | print(" | ||
+ | print(PartialOperator(opp, | ||
+ | |||
+ | -- We only keep the terms that keep the occupation of orbital 0 conserved and that keep | ||
+ | -- the occupation of orbital 2 conserved | ||
+ | print(" | ||
+ | print(PartialOperator(opp, | ||
+ | |||
+ | -- We only keep those terms that keep the sum of the occupation of orbital 0 and 2 conserved | ||
+ | print(" | ||
+ | print(PartialOperator(opp, | ||
+ | </ | ||
+ | |||
+ | ==== Result ==== | ||
+ | <file Quanty_Output> | ||
+ | ================ opp ============= | ||
+ | |||
+ | Operator: Operator | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 3 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | | 1.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 | 1.00000000000000E+00 | ||
+ | C 1 | 1.00000000000000E+00 | ||
+ | C 2 | 1.00000000000000E+00 | ||
+ | A 0 | 4.00000000000000E+00 | ||
+ | A 1 | 4.00000000000000E+00 | ||
+ | A 2 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 0 | 4.00000000000000E+00 | ||
+ | C 1 A 0 | 4.00000000000000E+00 | ||
+ | C 2 A 0 | 4.00000000000000E+00 | ||
+ | C 0 A 1 | 4.00000000000000E+00 | ||
+ | C 1 A 1 | 4.00000000000000E+00 | ||
+ | C 2 A 1 | 4.00000000000000E+00 | ||
+ | C 0 A 2 | 4.00000000000000E+00 | ||
+ | C 1 A 2 | 4.00000000000000E+00 | ||
+ | C 2 A 2 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 0 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 1 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 1 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 2 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 0 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 1 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 2 A 2 A 1 | 0.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 1 C 0 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 0 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 1 C 0 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 2 C 0 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 2 A 1 | 0.00000000000000E+00 | ||
+ | |||
+ | |||
+ | ================ PartialOperator | ||
+ | |||
+ | Operator: | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 3 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 | 1.00000000000000E+00 | ||
+ | A 1 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 A 0 | 4.00000000000000E+00 | ||
+ | C 0 A 1 | 4.00000000000000E+00 | ||
+ | C 1 A 1 | 4.00000000000000E+00 | ||
+ | C 2 A 1 | 4.00000000000000E+00 | ||
+ | C 1 A 2 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 1 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 1 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 2 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 0 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 1 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 2 A 2 A 1 | 0.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 1 C 0 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 1 C 0 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 2 C 0 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 2 A 1 | 0.00000000000000E+00 | ||
+ | |||
+ | |||
+ | ================ PartialOperator | ||
+ | |||
+ | Operator: | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 3 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 | 1.00000000000000E+00 | ||
+ | C 2 | 1.00000000000000E+00 | ||
+ | A 0 | 4.00000000000000E+00 | ||
+ | A 2 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 0 | 4.00000000000000E+00 | ||
+ | C 1 A 0 | 4.00000000000000E+00 | ||
+ | C 2 A 0 | 4.00000000000000E+00 | ||
+ | C 0 A 1 | 4.00000000000000E+00 | ||
+ | C 2 A 1 | 4.00000000000000E+00 | ||
+ | C 0 A 2 | 4.00000000000000E+00 | ||
+ | C 1 A 2 | 4.00000000000000E+00 | ||
+ | C 2 A 2 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 0 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 1 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 1 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 2 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 0 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 1 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 2 A 2 A 1 | 0.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 1 C 0 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 0 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 1 C 0 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 2 C 0 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 2 A 1 | 0.00000000000000E+00 | ||
+ | |||
+ | |||
+ | ================ PartialOperator | ||
+ | |||
+ | Operator: | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 3 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | | 1.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 | 1.00000000000000E+00 | ||
+ | C 2 | 1.00000000000000E+00 | ||
+ | A 0 | 4.00000000000000E+00 | ||
+ | A 2 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 0 | 4.00000000000000E+00 | ||
+ | C 2 A 0 | 4.00000000000000E+00 | ||
+ | C 0 A 2 | 4.00000000000000E+00 | ||
+ | C 2 A 2 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 2 A 2 A 0 | 0.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 2 C 0 A 2 A 0 | 0.00000000000000E+00 | ||
+ | |||
+ | |||
+ | ================ PartialOperator | ||
+ | |||
+ | Operator: | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 3 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | | 1.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 | 1.00000000000000E+00 | ||
+ | A 1 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 A 1 | 4.00000000000000E+00 | ||
+ | |||
+ | |||
+ | ================ PartialOperator | ||
+ | |||
+ | Operator: | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 3 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | | 1.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 | 1.00000000000000E+00 | ||
+ | C 2 | 1.00000000000000E+00 | ||
+ | A 0 | 4.00000000000000E+00 | ||
+ | A 2 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 0 | 4.00000000000000E+00 | ||
+ | C 2 A 0 | 4.00000000000000E+00 | ||
+ | C 1 A 1 | 4.00000000000000E+00 | ||
+ | C 0 A 2 | 4.00000000000000E+00 | ||
+ | C 2 A 2 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 1 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 1 A 2 A 1 | 0.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 0 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 1 C 0 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 2 A 1 | 0.00000000000000E+00 | ||
+ | |||
+ | |||
+ | ================ PartialOperator | ||
+ | |||
+ | Operator: | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 3 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | | 1.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 | 1.00000000000000E+00 | ||
+ | A 1 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 0 | 4.00000000000000E+00 | ||
+ | C 1 A 1 | 4.00000000000000E+00 | ||
+ | C 2 A 2 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 A 2 A 1 | 0.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 0 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 2 A 1 | 0.00000000000000E+00 | ||
+ | |||
+ | |||
+ | ================ PartialOperator | ||
+ | |||
+ | Operator: | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 3 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | | 1.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 | 1.00000000000000E+00 | ||
+ | A 1 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 0 | 4.00000000000000E+00 | ||
+ | C 2 A 0 | 4.00000000000000E+00 | ||
+ | C 1 A 1 | 4.00000000000000E+00 | ||
+ | C 0 A 2 | 4.00000000000000E+00 | ||
+ | C 2 A 2 | 4.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 0 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 2 A 2 A 1 | 0.00000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 C 0 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 0 A 2 A 0 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 1 A 0 | 0.00000000000000E+00 | ||
+ | C 1 C 0 A 2 A 1 | 0.00000000000000E+00 | ||
+ | C 2 C 1 A 2 A 1 | 0.00000000000000E+00 | ||
+ | </ | ||
+ | |||
+ | ===== Table of contents ===== | ||
+ | {{indexmenu> | ||