Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
documentation:language_reference:functions:operatorsettrace [2018/09/26 13:00] – disclaimer Simon Heinze | documentation:language_reference:functions:operatorsettrace [2018/09/26 14:40] – Added Code Example and corrected some statements Simon Heinze | ||
---|---|---|---|
Line 2: | Line 2: | ||
### | ### | ||
- | OperatorSetTrace($O$, | + | OperatorSetTrace($O$, |
After the operation the operator has the property | After the operation the operator has the property | ||
\begin{equation*} | \begin{equation*} | ||
\sum_{j=\{i_1, | \sum_{j=\{i_1, | ||
- | O_{jj} | + | \frac{O_{jj}}{n} |
= | = | ||
t | t | ||
Line 29: | Line 29: | ||
* $O$ : Operator | * $O$ : Operator | ||
- | * $t$ : New value of the trace (Default 0) | + | * $t$ : New value of the trace average |
* {$i_1, | * {$i_1, | ||
Line 38: | Line 38: | ||
===== Example ===== | ===== Example ===== | ||
- | ### | ||
- | Give me just a minute. | ||
- | ### | ||
==== Input ==== | ==== Input ==== | ||
<code Quanty Example.Quanty> | <code Quanty Example.Quanty> | ||
- | -- some example code | + | Orbitals = {" |
+ | Indices, NF = CreateAtomicIndicesDict(Orbitals) | ||
+ | e1s = 1 | ||
+ | e2s = 2 | ||
+ | F0ss = 0.5 | ||
+ | O = NewOperator(" | ||
+ | + NewOperator(" | ||
+ | + NewOperator(" | ||
+ | + NewOperator(" | ||
+ | O.Name = " | ||
+ | print(O) | ||
+ | |||
+ | print(" | ||
+ | OperatorSetTrace(O) | ||
+ | print(O) | ||
+ | |||
+ | print(" | ||
+ | OperatorSetTrace(O, | ||
+ | print(O) | ||
+ | |||
+ | print(" | ||
+ | OperatorSetTrace(O, | ||
+ | OperatorSetTrace(O, | ||
+ | print(O) | ||
</ | </ | ||
==== Result ==== | ==== Result ==== | ||
<file Quanty_Output> | <file Quanty_Output> | ||
- | text produced as output | + | Operator: Operator |
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 4 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 0 | 1.000000000000000E+00 | ||
+ | C 1 A 1 | 1.000000000000000E+00 | ||
+ | C 2 A 2 | 2.000000000000000E+00 | ||
+ | C 3 A 3 | 2.000000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 C 0 A 1 A 0 | -5.000000000000000E-01 | ||
+ | C 3 C 2 A 3 A 2 | -5.000000000000000E-01 | ||
+ | |||
+ | |||
+ | Set Operator trace average to 0 | ||
+ | |||
+ | Operator: Operator | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 4 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 0 | -5.000000000000000E-01 | ||
+ | C 1 A 1 | -5.000000000000000E-01 | ||
+ | C 2 A 2 | 5.000000000000000E-01 | ||
+ | C 3 A 3 | 5.000000000000000E-01 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 C 0 A 1 A 0 | -5.000000000000000E-01 | ||
+ | C 3 C 2 A 3 A 2 | -5.000000000000000E-01 | ||
+ | |||
+ | |||
+ | Set Operator trace average to 2 | ||
+ | |||
+ | Operator: Operator | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 4 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 0 | 1.500000000000000E+00 | ||
+ | C 1 A 1 | 1.500000000000000E+00 | ||
+ | C 2 A 2 | 2.500000000000000E+00 | ||
+ | C 3 A 3 | 2.500000000000000E+00 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 C 0 A 1 A 0 | -5.000000000000000E-01 | ||
+ | C 3 C 2 A 3 A 2 | -5.000000000000000E-01 | ||
+ | |||
+ | |||
+ | Set trace average of 1s orbitals to -1, and trace average of 2s orbitals to 15 | ||
+ | |||
+ | Operator: Operator | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 4 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 0 A 0 | -1.000000000000000E+00 | ||
+ | C 1 A 1 | -1.000000000000000E+00 | ||
+ | C 2 A 2 | 1.500000000000000E+01 | ||
+ | C 3 A 3 | 1.500000000000000E+01 | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 1 C 0 A 1 A 0 | -5.000000000000000E-01 | ||
+ | C 3 C 2 A 3 A 2 | -5.000000000000000E-01 | ||
</ | </ | ||