Differences
This shows you the differences between two versions of the page.
documentation:language_reference:functions:ytokmatrix [2018/09/25 13:42] – created Simon Heinze | documentation:language_reference:functions:ytokmatrix [2018/09/25 16:28] (current) – Filled with content Simon Heinze | ||
---|---|---|---|
Line 2: | Line 2: | ||
### | ### | ||
- | alligned paragraph text | + | YtoKMatrix($orb$) takes the angular momentum $l$ or the name of a non-relativistic atomic orbital and returns the corresponding matrix to rotate from a basis of spherical harmonics to cubic harmonics. It is also possible to give a list of $l$ numbers or orbital names, in which case the output is a block diagonal matrix with the rotation matrices as entries. |
### | ### | ||
===== Input ===== | ===== Input ===== | ||
- | * bla : Integer | + | * $orb$ : An integer number, or a list of integer numbers, or a string that can be interpreted as a non-relativistic atomic orbital, or a list or strings. |
- | * bla2 : Real | + | * Options: |
+ | * " | ||
===== Output ===== | ===== Output ===== | ||
- | * bla : real | + | * $R$ : Rotation Matrix from a basis of spherical to cubic harmonics. |
===== Example ===== | ===== Example ===== | ||
- | ### | ||
- | description text | ||
- | ### | ||
==== Input ==== | ==== Input ==== | ||
<code Quanty Example.Quanty> | <code Quanty Example.Quanty> | ||
- | -- some example code | + | print("" |
+ | print(" | ||
+ | print(YtoKMatrix(0)) | ||
+ | |||
+ | print("" | ||
+ | print(" | ||
+ | print(YtoKMatrix(" | ||
+ | |||
+ | print("" | ||
+ | print(" | ||
+ | print(YtoKMatrix(1)) | ||
+ | |||
+ | print("" | ||
+ | print(" | ||
+ | print(YtoKMatrix(" | ||
+ | |||
+ | print("" | ||
+ | print(" | ||
+ | print(YtoKMatrix(2)) | ||
+ | |||
+ | print("" | ||
+ | print(" | ||
+ | print(YtoKMatrix(" | ||
+ | |||
+ | print("" | ||
+ | print(" | ||
+ | print(YtoKMatrix({0, | ||
+ | |||
+ | print("" | ||
+ | print(" | ||
+ | print(YtoKMatrix({" | ||
+ | |||
+ | print(" | ||
+ | print(" | ||
+ | Orbitals = {" | ||
+ | Indices, NF = CreateAtomicIndicesDict(Orbitals) | ||
+ | |||
+ | --Some Operator definition on spherical harmonics | ||
+ | op = NewOperator(" | ||
+ | print(" | ||
+ | print(op) | ||
+ | |||
+ | opK = Rotate(op, YtoKMatrix(Orbitals)) | ||
+ | print(" | ||
+ | print(opK) | ||
</ | </ | ||
==== Result ==== | ==== Result ==== | ||
<file Quanty_Output> | <file Quanty_Output> | ||
- | text produced as output | + | YtoKMatrix(0) |
+ | { { 1 , 0 } , | ||
+ | { 0 , 1 } } | ||
+ | |||
+ | YtoKMatrix(" | ||
+ | { { 1 } } | ||
+ | |||
+ | YtoKMatrix(1) | ||
+ | { { 0.70710678118655 , 0 , 0 , 0 , -0.70710678118655 , 0 } , | ||
+ | { 0 , 0.70710678118655 , 0 , 0 , 0 , -0.70710678118655 } , | ||
+ | { (0 + 0.70710678118655 I) , 0 , 0 , 0 , (0 + 0.70710678118655 I) , 0 } , | ||
+ | { 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 , (0 + 0.70710678118655 I) } , | ||
+ | { 0 , 0 , 1 , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 , 1 , 0 , 0 } } | ||
+ | |||
+ | YtoKMatrix(" | ||
+ | { { 0.70710678118655 , 0 , 0 , 0 , -0.70710678118655 , 0 } , | ||
+ | { 0 , 0.70710678118655 , 0 , 0 , 0 , -0.70710678118655 } , | ||
+ | { (0 + 0.70710678118655 I) , 0 , 0 , 0 , (0 + 0.70710678118655 I) , 0 } , | ||
+ | { 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 , (0 + 0.70710678118655 I) } , | ||
+ | { 0 , 0 , 1 , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 , 1 , 0 , 0 } } | ||
+ | |||
+ | YtoKMatrix(2) | ||
+ | { { 0.70710678118655 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.70710678118655 , 0 } , | ||
+ | { 0 , 0.70710678118655 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.70710678118655 } , | ||
+ | { 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 , (0 + 0.70710678118655 I) , 0 , 0 } , | ||
+ | { 0 , 0 , 0.70710678118655 , 0 , 0 , 0 , -0.70710678118655 , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 , 0.70710678118655 , 0 , 0 , 0 , -0.70710678118655 , 0 , 0 } , | ||
+ | { (0 + 0.70710678118655 I) , 0 , 0 , 0 , 0 , 0 , 0 , 0 , (0 - 0.70710678118655 I) , 0 } , | ||
+ | { 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 , 0 , 0 , 0 , 0 , (0 - 0.70710678118655 I) } } | ||
+ | |||
+ | YtoKMatrix(" | ||
+ | { { 0.70710678118655 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.70710678118655 , 0 } , | ||
+ | { 0 , 0.70710678118655 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.70710678118655 } , | ||
+ | { 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 , (0 + 0.70710678118655 I) , 0 , 0 } , | ||
+ | { 0 , 0 , 0.70710678118655 , 0 , 0 , 0 , -0.70710678118655 , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 , 0.70710678118655 , 0 , 0 , 0 , -0.70710678118655 , 0 , 0 } , | ||
+ | { (0 + 0.70710678118655 I) , 0 , 0 , 0 , 0 , 0 , 0 , 0 , (0 - 0.70710678118655 I) , 0 } , | ||
+ | { 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 , 0 , 0 , 0 , 0 , (0 - 0.70710678118655 I) } } | ||
+ | |||
+ | YtoKMatrix({0, | ||
+ | { { 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } , | ||
+ | { 0 , 0.70710678118655 , 0 , -0.70710678118655 , 0 , 0 , 0 , 0 , 0 } , | ||
+ | { 0 , (0 + 0.70710678118655 I) , 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 , 0 , 0.70710678118655 , 0 , 0 , 0 , 0.70710678118655 } , | ||
+ | { 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 , 0 , 0 , (0 + 0.70710678118655 I) , 0 , (0 + 0.70710678118655 I) , 0 } , | ||
+ | { 0 , 0 , 0 , 0 , 0 , 0.70710678118655 , 0 , -0.70710678118655 , 0 } , | ||
+ | { 0 , 0 , 0 , 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 , (0 - 0.70710678118655 I) } } | ||
+ | |||
+ | YtoKMatrix({" | ||
+ | { { 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } , | ||
+ | { 0 , 0.70710678118655 , 0 , -0.70710678118655 , 0 , 0 , 0 , 0 , 0 } , | ||
+ | { 0 , (0 + 0.70710678118655 I) , 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 , 0 , 0.70710678118655 , 0 , 0 , 0 , 0.70710678118655 } , | ||
+ | { 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 } , | ||
+ | { 0 , 0 , 0 , 0 , 0 , (0 + 0.70710678118655 I) , 0 , (0 + 0.70710678118655 I) , 0 } , | ||
+ | { 0 , 0 , 0 , 0 , 0 , 0.70710678118655 , 0 , -0.70710678118655 , 0 } , | ||
+ | { 0 , 0 , 0 , 0 , (0 + 0.70710678118655 I) , 0 , 0 , 0 , (0 - 0.70710678118655 I) } } | ||
+ | |||
+ | |||
+ | |||
+ | A more realistic example | ||
+ | Operator on a basis of spherical harmonics | ||
+ | |||
+ | Operator: Coulomb Operator | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 10 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 5 C 4 A 5 A 4 | -3.999999999999999E-02 | ||
+ | C 7 C 5 A 7 A 5 | 2.000000000000000E-01 | ||
+ | C 6 C 5 A 6 A 5 | 7.999999999999999E-02 | ||
+ | C 7 C 4 A 7 A 4 | 7.999999999999999E-02 | ||
+ | C 6 C 4 A 6 A 4 | 2.000000000000000E-01 | ||
+ | C 9 C 5 A 9 A 5 | 2.000000000000000E-01 | ||
+ | C 8 C 5 A 8 A 5 | -3.999999999999999E-02 | ||
+ | C 9 C 4 A 9 A 4 | -3.999999999999999E-02 | ||
+ | C 8 C 4 A 8 A 4 | 2.000000000000000E-01 | ||
+ | C 7 C 6 A 7 A 6 | -1.600000000000000E-01 | ||
+ | C 9 C 7 A 9 A 7 | 2.000000000000000E-01 | ||
+ | C 8 C 7 A 8 A 7 | 7.999999999999999E-02 | ||
+ | C 9 C 6 A 9 A 6 | 7.999999999999999E-02 | ||
+ | C 8 C 6 A 8 A 6 | 2.000000000000000E-01 | ||
+ | C 9 C 8 A 9 A 8 | -3.999999999999999E-02 | ||
+ | C 6 C 5 A 7 A 4 | 1.200000000000000E-01 | ||
+ | C 7 C 4 A 6 A 5 | 1.200000000000000E-01 | ||
+ | C 8 C 5 A 7 A 6 | -1.200000000000000E-01 | ||
+ | C 9 C 4 A 7 A 6 | 1.200000000000000E-01 | ||
+ | C 8 C 5 A 9 A 4 | 2.400000000000000E-01 | ||
+ | C 9 C 4 A 8 A 5 | 2.400000000000000E-01 | ||
+ | C 7 C 6 A 8 A 5 | -1.200000000000000E-01 | ||
+ | C 7 C 6 A 9 A 4 | 1.200000000000000E-01 | ||
+ | C 8 C 7 A 9 A 6 | 1.200000000000000E-01 | ||
+ | C 9 C 6 A 8 A 7 | 1.200000000000000E-01 | ||
+ | |||
+ | |||
+ | Operator on a basis of cubic harmonics | ||
+ | |||
+ | Operator: Coulomb Operator | ||
+ | QComplex | ||
+ | MaxLength | ||
+ | NFermionic modes = 10 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis) | ||
+ | NBosonic modes | ||
+ | |||
+ | Operator of Length | ||
+ | QComplex | ||
+ | N | ||
+ | C 5 C 4 A 5 A 4 | -1.599999999999999E-01 | ||
+ | C 7 C 6 A 5 A 4 | -1.200000000000000E-01 | ||
+ | C 7 C 4 A 7 A 4 | 7.999999999999997E-02 | ||
+ | C 6 C 5 A 7 A 4 | 1.200000000000000E-01 | ||
+ | C 7 C 4 A 6 A 5 | 1.200000000000000E-01 | ||
+ | C 6 C 5 A 6 A 5 | 7.999999999999997E-02 | ||
+ | C 5 C 4 A 7 A 6 | -1.200000000000000E-01 | ||
+ | C 7 C 6 A 7 A 6 | -1.599999999999999E-01 | ||
+ | C 9 C 5 A 9 A 5 | 1.999999999999999E-01 | ||
+ | C 9 C 7 A 9 A 7 | 1.999999999999999E-01 | ||
+ | C 8 C 5 A 8 A 5 | 7.999999999999997E-02 | ||
+ | C 8 C 7 A 8 A 7 | 7.999999999999997E-02 | ||
+ | C 9 C 4 A 9 A 4 | 7.999999999999997E-02 | ||
+ | C 9 C 6 A 9 A 6 | 7.999999999999997E-02 | ||
+ | C 8 C 4 A 8 A 4 | 1.999999999999999E-01 | ||
+ | C 8 C 6 A 8 A 6 | 1.999999999999999E-01 | ||
+ | C 7 C 5 A 7 A 5 | 1.999999999999999E-01 | ||
+ | C 6 C 4 A 6 A 4 | 1.999999999999999E-01 | ||
+ | C 9 C 8 A 9 A 8 | -1.600000000000000E-01 | ||
+ | C 8 C 5 A 9 A 4 | 1.200000000000000E-01 | ||
+ | C 8 C 7 A 9 A 6 | 1.200000000000000E-01 | ||
+ | C 9 C 4 A 8 A 5 | 1.200000000000000E-01 | ||
+ | C 9 C 6 A 8 A 7 | 1.200000000000000E-01 | ||
+ | C 5 C 4 A 9 A 8 | -1.200000000000000E-01 | ||
+ | C 7 C 6 A 9 A 8 | -1.200000000000000E-01 | ||
+ | C 9 C 8 A 5 A 4 | -1.200000000000000E-01 | ||
+ | C 9 C 8 A 7 A 6 | -1.200000000000000E-01 | ||
</ | </ | ||