Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| documentation:tutorials:introduction_to_quanty:eigenstates [2016/10/07 20:26] – created Maurits W. Haverkort | documentation:tutorials:introduction_to_quanty:eigenstates [2025/11/20 03:29] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | {{indexmenu_n> | ||
| + | ====== Eigenstates ====== | ||
| + | ### | ||
| + | The sixth example discusses eigenstates. | ||
| + | ### | ||
| + | |||
| + | ### | ||
| + | <code Quanty Eigenstates.Quanty> | ||
| + | -- Using operators and wavefunctions as explained in | ||
| + | -- the Operators and Wavefunctions example | ||
| + | -- and being able to multiply them to get | ||
| + | -- expectation values we can continue and look | ||
| + | -- at eigenstates of operators | ||
| + | |||
| + | -- define the basis | ||
| + | -- For a p-shell we would like the have 6 | ||
| + | -- spinorbitals, | ||
| + | -- spin up ml=-1, | ||
| + | -- spin down with ,ml=-1, ml=0, ml=1 | ||
| + | NF=6 | ||
| + | NB=0 | ||
| + | IndexDn={0, | ||
| + | IndexUp={1, | ||
| + | |||
| + | -- Define spin and angular momentum operators. | ||
| + | OppSx | ||
| + | OppSy | ||
| + | OppSz | ||
| + | OppSsqr =NewOperator(" | ||
| + | OppSplus=NewOperator(" | ||
| + | OppSmin =NewOperator(" | ||
| + | |||
| + | OppLx | ||
| + | OppLy | ||
| + | OppLz | ||
| + | OppLsqr =NewOperator(" | ||
| + | OppLplus=NewOperator(" | ||
| + | OppLmin =NewOperator(" | ||
| + | |||
| + | OppJx | ||
| + | OppJy | ||
| + | OppJz | ||
| + | OppJsqr =NewOperator(" | ||
| + | OppJplus=NewOperator(" | ||
| + | OppJmin =NewOperator(" | ||
| + | |||
| + | Oppldots=NewOperator(" | ||
| + | |||
| + | -- Define the coulomb operator | ||
| + | -- We here define the part depending on F0 | ||
| + | -- separately from the part depending on F2. | ||
| + | -- When summing we can put in the numerical values | ||
| + | -- of the slater integrals. | ||
| + | OppF0 = NewOperator(" | ||
| + | OppF2 = NewOperator(" | ||
| + | OppU = 5.0 * OppF0 + 4.0 * OppF2 | ||
| + | |||
| + | -- Note that the previous definition is the same as | ||
| + | -- OppU = NewOperator(" | ||
| + | -- | ||
| + | |||
| + | -- Define the Hamiltonian as a numerical sum of the | ||
| + | -- previous defined operators. | ||
| + | Hamiltonian = 5.0 * OppF0 + 4.0 * OppF2 + 0.000001 * (2*OppSz + OppLz) | ||
| + | Hamiltonian2 = 6.0 * OppF0 + 4.0 * OppF2 + 0.000001 * (2*OppSz + OppLz) | ||
| + | |||
| + | -- For large systems we do not need to know all | ||
| + | -- eigenstates, | ||
| + | -- Npsi lowest states: | ||
| + | Npsi=15 | ||
| + | |||
| + | -- In order to make sure we have a filling of 2 | ||
| + | -- electrons we need to define some restrictions | ||
| + | StartRestrictions = {NF, NB, {" | ||
| + | |||
| + | -- We now can create the lowest Npsi eigenstates: | ||
| + | psiList = Eigensystem(Hamiltonian, | ||
| + | |||
| + | oppList={Hamiltonian, | ||
| + | |||
| + | -- after we've created the eigen states we can look | ||
| + | -- at a list of their expectation values | ||
| + | print(" | ||
| + | for key,value in pairs(psiList) do | ||
| + | expvalue = value * oppList * value | ||
| + | for k,v in pairs(expvalue) do | ||
| + | io.write(string.format(" | ||
| + | end; | ||
| + | io.write(" | ||
| + | end | ||
| + | </ | ||
| + | ### | ||
| + | |||
| + | ### | ||
| + | The output is: | ||
| + | <file Quanty_Output Eigenstates.out> | ||
| + | Start of BlockGroundState. Converge 15 states to an energy with relative variance smaller than 1.490116119384766E-06 | ||
| + | |||
| + | Start of BlockOperatorPsiSerialRestricted | ||
| + | Outer loop 1, Number of Determinants: | ||
| + | Start of BlockOperatorPsiSerialRestricted | ||
| + | Start of BlockGroundState. Converge 15 states to an energy with relative variance smaller than 1.490116119384766E-06 | ||
| + | |||
| + | Start of BlockOperatorPsiSerial | ||
| + | < | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | ### | ||
| + | |||
| + | ===== Table of contents ===== | ||
| + | {{indexmenu> | ||