Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| documentation:language_reference:functions:partialoperator [2018/08/03 14:48] – created Simon Heinze | documentation:language_reference:functions:partialoperator [2025/11/20 03:29] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== PartialOperator ====== | ====== PartialOperator ====== | ||
| - | (will be published in fall 2018) | + | ### |
| + | PartialOperator(// | ||
| + | ### | ||
| + | |||
| + | ### | ||
| + | Mode //" | ||
| + | ### | ||
| + | |||
| + | ### | ||
| + | Mode //" | ||
| + | ### | ||
| ### | ### | ||
| - | PartialOperator(//op//,//indices//) takes an operator and a list of indices and returns any part of //op// that acts on the index-set | + | Mode //" |
| ### | ### | ||
| Line 11: | Line 21: | ||
| * //op// : An Operator. | * //op// : An Operator. | ||
| * //indices// : A list of indices. | * //indices// : A list of indices. | ||
| + | * //mode// : either " | ||
| ===== Output ===== | ===== Output ===== | ||
| - | * // | + | * // |
| ===== Example ===== | ===== Example ===== | ||
| Line 20: | Line 31: | ||
| ==== Input ==== | ==== Input ==== | ||
| <code Quanty Example.Quanty> | <code Quanty Example.Quanty> | ||
| - | NF = 4 | + | NF = 3 |
| + | NB = 0 | ||
| + | opp1cr = NewOperator(NF, | ||
| + | opp1an = NewOperator(NF, | ||
| + | opp2 = opp1cr * opp1an | ||
| + | opp3 = opp1an * opp2 | ||
| + | opp4 = opp1cr * opp3 | ||
| - | op1 = NewOperator(" | + | opp = 1 + opp1cr |
| - | op2 = NewOperator(" | + | |
| - | print(" | + | -- The operatore contains strings of creation and annihilation operators of length 0 to 4 |
| - | print(op1) | + | -- l=0 1 term |
| - | print(" | + | -- l=1 6 terms (3 creation, 3 annihilation) |
| - | print(PartialOperator(op1, {0,1})) | + | -- l=2 9 terms (3 creation * 3 annihilation) |
| - | print(" | + | -- l=3 9 terms (cr an an) note that an0 an1 = - an1 an0 |
| - | print(PartialOperator(op1, {2})) | + | -- l=4 9 terms |
| - | print(" | + | -- the full operator is |
| - | print(" | + | print(" |
| - | print(op2) | + | print(opp) |
| - | print("PartialOperator(op2, {0,1})") | + | |
| - | print(PartialOperator(op2, {0,1})) | + | -- We only keep terms that at least act once on orbital 1 |
| - | print(" | + | print(" |
| - | print(PartialOperator(op2, {2})) | + | print(PartialOperator(opp,{1}," |
| + | |||
| + | -- We only keep terms that at least act once on orbital 0 or at orbital 1 | ||
| + | print(" | ||
| + | print(PartialOperator(opp,{0,2}," | ||
| + | |||
| + | -- 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,{0,2}," | ||
| + | |||
| + | -- We only keep the terms that keep the occupation of orbital 1 conserved | ||
| + | print(" | ||
| + | print(PartialOperator(opp,{1}," | ||
| + | |||
| + | -- 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,{0,2}," | ||
| + | |||
| + | -- We only keep those terms that keep the sum of the occupation of orbital 0 and 2 conserved | ||
| + | print(" | ||
| + | print(PartialOperator(opp,{{0,2}}," | ||
| </ | </ | ||
| ==== Result ==== | ==== Result ==== | ||
| <file Quanty_Output> | <file Quanty_Output> | ||
| - | op1: | + | ================ opp ============= |
| - | Operator: | + | Operator: |
| - | QComplex | + | QComplex |
| MaxLength | MaxLength | ||
| - | NFermionic modes = | + | NFermionic modes = |
| NBosonic modes | NBosonic modes | ||
| Line 54: | Line 95: | ||
| QComplex | QComplex | ||
| N | N | ||
| - | | | + | | |
| + | |||
| + | 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 | Operator of Length | ||
| - | QComplex | + | QComplex |
| - | N | + | N |
| - | C 1 A 1 | 1.000000000000000E-01 | + | 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 | | ||
| + | C | ||
| + | C 2 A | ||
| + | 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 | Operator of Length | ||
| QComplex | QComplex | ||
| - | N | + | N |
| - | C 1 C 0 A 1 A 0 | -5.000000000000000E+00 | + | C 1 C 0 A 1 A 0 | |
| + | 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(op1, {0,1}) | + | ================ |
| Operator: | Operator: | ||
| - | QComplex | + | QComplex |
| MaxLength | MaxLength | ||
| - | NFermionic modes = | + | NFermionic modes = |
| NBosonic modes | NBosonic modes | ||
| + | |||
| + | Operator of Length | ||
| + | QComplex | ||
| + | N | ||
| + | C 1 | 1.00000000000000E+00 | ||
| + | A 1 | 4.00000000000000E+00 | ||
| Operator of Length | Operator of Length | ||
| - | QComplex | + | QComplex |
| - | N | + | N |
| - | C 1 A 1 | 1.000000000000000E-01 | + | C 1 A 0 | 4.00000000000000E+00 |
| + | C 0 A 1 | | ||
| + | C | ||
| + | C 2 A | ||
| + | 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 | Operator of Length | ||
| QComplex | QComplex | ||
| - | N | + | N |
| - | C 1 C 0 A 1 A 0 | -5.000000000000000E+00 | + | C 1 C 0 A 1 A 0 | |
| + | 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(op1, {2}) | + | ================ |
| Operator: | Operator: | ||
| QComplex | QComplex | ||
| MaxLength | MaxLength | ||
| - | NFermionic modes = | + | NFermionic modes = |
| NBosonic modes | 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 | ||
| - | op2: | + | ================ PartialOperator |
| - | Operator: | + | Operator: |
| - | QComplex | + | QComplex |
| MaxLength | MaxLength | ||
| - | NFermionic modes = | + | NFermionic modes = |
| NBosonic modes | 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 | Operator of Length | ||
| - | QComplex | + | QComplex |
| - | N | + | N |
| - | C | + | C |
| - | C 2 A 2 | 1.000000000000000E+00 0.000000000000000E+00 | + | C 2 A 0 | 4.00000000000000E+00 |
| + | C 0 A 2 | 4.00000000000000E+00 | ||
| + | C 2 A 2 | | ||
| + | |||
| + | 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 | Operator of Length | ||
| QComplex | QComplex | ||
| - | N | + | N |
| - | C | + | C |
| - | C 1 C | + | |
| - | PartialOperator(op2, {0,1}) | + | ================ |
| Operator: | Operator: | ||
| - | QComplex | + | QComplex |
| MaxLength | MaxLength | ||
| - | NFermionic modes = | + | NFermionic modes = |
| NBosonic modes | 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 | Operator of Length | ||
| - | QComplex | + | QComplex |
| N | N | ||
| - | C 1 A 1 | 1.000000000000000E-05 | + | C 1 A 1 | |
| + | |||
| + | |||
| + | ================ PartialOperator | ||
| + | |||
| + | Operator: | ||
| + | QComplex | ||
| + | MaxLength | ||
| + | NFermionic modes = 3 (Number of fermionic modes (site, spin, orbital, | ||
| + | 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 | Operator of Length | ||
| QComplex | QComplex | ||
| - | N | + | N |
| - | C 1 C 0 A | + | C 1 C 0 A |
| - | C 1 C 0 A | + | C |
| + | C 2 C 1 A 1 A 0 | 0.00000000000000E+00 | ||
| + | C 1 C 0 A | ||
| + | C 2 C 1 A 2 A 1 | 0.00000000000000E+00 | ||
| - | PartialOperator(op2, {2}) | + | ================ |
| Operator: | Operator: | ||
| - | QComplex | + | QComplex |
| MaxLength | MaxLength | ||
| - | NFermionic modes = | + | NFermionic modes = |
| NBosonic modes | 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 | Operator of Length | ||
| - | QComplex | + | QComplex |
| - | N | + | N |
| - | C 2 A 2 | 1.000000000000000E+00 0.000000000000000E+00 | + | C 0 A 0 | 4.00000000000000E+00 |
| + | C 1 A 1 | 4.00000000000000E+00 | ||
| + | C 2 A 2 | | ||
| + | |||
| + | 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 | Operator of Length | ||
| QComplex | QComplex | ||
| - | N | + | N |
| - | C 1 C 0 A | + | C 1 C 0 A |
| + | C | ||
| + | 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 | ||
| </ | </ | ||