Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
documentation:language_reference:functions:createclusterhamiltonian [2024/09/16 11:26] Sina Shokridocumentation:language_reference:functions:createclusterhamiltonian [2024/09/18 14:23] (current) – old revision restored (2024/09/16 12:17) Sina Shokri
Line 3: Line 3:
 ### ###
 The function //CreateClusterHamiltonian(TB, cluster, ...)// generates a Hamiltonian operator using the input tight-binding Object (//TB//) and the information regarding the cluster (//cluster//). The cluster can be an open cluster or a periodic one.  The function //CreateClusterHamiltonian(TB, cluster, ...)// generates a Hamiltonian operator using the input tight-binding Object (//TB//) and the information regarding the cluster (//cluster//). The cluster can be an open cluster or a periodic one. 
 +See also //[[documentation:language_reference:objects:tightbinding:start|Tight Binding]]// object.
 ### ###
  
Line 282: Line 283:
 [     0] -1.00000000E-01 [     0] -1.00000000E-01
 </file> </file>
 +
 +===== Periodic Cluster =====
 +
 +//HCl = CreateClusterHamiltonian(TB, {"periodic", SuperCell}, U, ...)//
 +
 +===== Inputs =====
 +
 +  * TB: tight-binding object
 +  * SuperCell: an array of dimension 3x3 in the format {a,b,c} with the rows being the vectors of the super-cell. The super-cell is defined in the units of the unit cell defined in TB.Cell.
 +  * U: Aditional Operator to add (optional). The operator must be defined within the unit cell defined in TB.Cell and will be copied to all unit cells within the super-cell and added to the output cluster Hamiltonian operator.
 +
 +===== Example =====
 +
 +###
 +A small example:
 +###
 +
 +==== Input ====
 +<code Quanty Example.Quanty>
 +-- set parameters
 +dAB = 0.2
 +tnn = 1.1
 +-- create the tight binding Hamiltonian
 +HTB = NewTightBinding()
 +HTB.Name = "dichalcogenide tight binding"
 +HTB.Cell = {{sqrt(3),0,0},
 +            {sqrt(3/4),3/2,0},
 +            {0,0,1}}
 +HTB.Atoms = { {"A", {0,0,0},       {{"p", {"0"}}}},
 +              {"B", {sqrt(3),1,0}, {{"p", {"0"}}}}}
 +HTB.Hopping = {{"A.p","A.p",        0,   0,0},{{-dAB/2}}},
 +               {"B.p","B.p",        0,   0,0},{{ dAB/2}}},
 +               {"A.p","B.p",        0,   1,0},{{ tnn  }}},
 +               {"B.p","A.p",        0,  -1,0},{{ tnn  }}},
 +               {"A.p","B.p",{ sqrt(3/4),-1/2,0},{{ tnn  }}},
 +               {"B.p","A.p",{-sqrt(3/4), 1/2,0},{{ tnn  }}},
 +               {"A.p","B.p",{-sqrt(3/4),-1/2,0},{{ tnn  }}},
 +               {"B.p","A.p",{ sqrt(3/4), 1/2,0},{{ tnn  }}}
 +              }
 +print("create a cluster Hamiltonian")
 +HCl = CreateClusterHamiltonian(HTB, {"periodic", {{3,0,0},{0,1,0},{0,0,1}}})
 +
 +print("Output operator:")
 +print(HCl)
 +</code>
 +
 +==== Result ====
 +<file Quanty_Output>
 +create a cluster Hamiltonian
 +Output operator:
 +
 +Operator: Operator
 +QComplex                  0 (Real==0 or Complex==1 or Mixed==2)
 +MaxLength        =          2 (largest number of product of lader operators)
 +NFermionic modes =          6 (Number of fermionic modes (site, spin, orbital, ...) in the one particle basis)
 +NBosonic modes            0 (Number of bosonic modes (phonon modes, ...) in the one particle basis)
 +
 +Operator of Length   2
 +QComplex      =          0 (Real==0 or Complex==1)
 +N                     18 (number of operators of length   2)
 +C  0 A  0 | -1.00000000000000E-01
 +C  1 A  1 |  1.00000000000000E-01
 +C  0 A  5 |  2.20000000000000E+00
 +C  1 A  2 |  2.20000000000000E+00
 +C  0 A  1 |  1.10000000000000E+00
 +C  1 A  0 |  1.10000000000000E+00
 +C  2 A  2 | -1.00000000000000E-01
 +C  3 A  3 |  1.00000000000000E-01
 +C  2 A  1 |  2.20000000000000E+00
 +C  3 A  4 |  2.20000000000000E+00
 +C  2 A  3 |  1.10000000000000E+00
 +C  3 A  2 |  1.10000000000000E+00
 +C  4 A  4 | -1.00000000000000E-01
 +C  5 A  5 |  1.00000000000000E-01
 +C  4 A  3 |  2.20000000000000E+00
 +C  5 A  0 |  2.20000000000000E+00
 +C  4 A  5 |  1.10000000000000E+00
 +C  5 A  4 |  1.10000000000000E+00
 +</file>
 +
 +====== Options ======
 +
 +The last element of CreateClusterHamiltonian can be a table of options. Possible options are:
 +  * "AddSpin": Boolean for including spin in the output Hamiltonian operator. (standard value false)
 +  * "ReturnTBSuperCell": Boolean for returning the output tight-binding object. (standard value false) 
 +  * "ReturnTBCellPositions": Boolean for returning the lattice vectors of the output periodic cluster. (standard value false)
 +  * "ReturnTBKVectors": Boolean for returning the reciprocal lattice vectors of the output periodic cluster. (standard value false)
 +  * "ReturnTBIndicesDict": Boolean for returning the dict for the indices defined for the output Hamiltonian operator (see //[[documentation:language_reference:functions:CreateAtomicIndicesDict|CreateAtomicIndicesDict()]]//). 
 +  * "k": possible phase-shift in the hopping matrix elements of the output Hamiltonian operator. (standard value {0,0,0})
  
 ===== Table of contents ===== ===== Table of contents =====
 {{indexmenu>.#1}} {{indexmenu>.#1}}
  
Print/export