Differences
This shows you the differences between two versions of the page.
| documentation:tutorials:introduction_to_quanty:wavefunctions [2016/10/07 20:23] – created Maurits W. Haverkort | documentation:tutorials:introduction_to_quanty:wavefunctions [2025/11/20 03:29] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | {{indexmenu_n> | ||
| + | ====== Wavefunctions ====== | ||
| + | ### | ||
| + | The fourth example creates wave-functions. | ||
| + | ### | ||
| + | |||
| + | ### | ||
| + | <code Quanty Wavefunctions.Quanty> | ||
| + | -- We start with the same basis as before | ||
| + | NF=6 | ||
| + | NB=0 | ||
| + | IndexDn={0, | ||
| + | IndexUp={1, | ||
| + | |||
| + | -- We now can create wave functions. For this we | ||
| + | -- need three inputs: | ||
| + | -- (1) The number of Fermions and Bosons | ||
| + | -- (2) A list defining the wavefunctions. The lists | ||
| + | -- consists of a string defining a determinant by | ||
| + | -- its occupation: (1 occupied, 0 empty). One bit | ||
| + | -- for each fermion, 8 bit for a boson (i.e. a | ||
| + | -- boson can have an occupation between 0 and 255). | ||
| + | -- (3) A number giving the pre-factor of the | ||
| + | -- determinant. | ||
| + | psi0=NewWavefunction(NF, | ||
| + | |||
| + | -- We can print the function | ||
| + | print(psi0) | ||
| + | |||
| + | -- The name of the wave function is generic, we can | ||
| + | -- set it | ||
| + | psi0.Name = "psi 0" | ||
| + | print(psi0) | ||
| + | |||
| + | -- We now could create all one electron functions | ||
| + | -- in the basis of the p-shell. | ||
| + | psi0=NewWavefunction(NF, | ||
| + | psi0.Name = "psi(1 -1 1/2 -1/2)" | ||
| + | psi1=NewWavefunction(NF, | ||
| + | psi1.Name = " | ||
| + | psi2=NewWavefunction(NF, | ||
| + | psi2.Name = " | ||
| + | psi3=NewWavefunction(NF, | ||
| + | psi3.Name = "psi(1 -1 1/2 1/2)" | ||
| + | psi4=NewWavefunction(NF, | ||
| + | psi4.Name = " | ||
| + | psi5=NewWavefunction(NF, | ||
| + | psi5.Name = " | ||
| + | |||
| + | -- And print them | ||
| + | print(" | ||
| + | print(psi0) | ||
| + | print(psi1) | ||
| + | print(psi2) | ||
| + | print(psi3) | ||
| + | print(psi4) | ||
| + | print(psi5) | ||
| + | print(" | ||
| + | |||
| + | -- The wavefunctions should be orthonormal, | ||
| + | -- easily test this | ||
| + | psiList={psi0, | ||
| + | for i = 1, 6 do | ||
| + | for j = 1, 6 do | ||
| + | print("<", | ||
| + | end | ||
| + | end | ||
| + | print(" | ||
| + | -- in table or matrix form: | ||
| + | psiList={psi0, | ||
| + | for i = 1, 6 do | ||
| + | for j = 1, 6 do | ||
| + | io.write(string.format(" | ||
| + | end | ||
| + | io.write(" | ||
| + | end | ||
| + | </ | ||
| + | ### | ||
| + | |||
| + | ### | ||
| + | The output is: | ||
| + | <file Quanty_Output Wavefunctions.out> | ||
| + | WaveFunction: | ||
| + | QComplex | ||
| + | N = 2 (Number of basis functions used to discribe psi) | ||
| + | NFermionic modes = 6 (Number of fermions in the one particle basis) | ||
| + | NBosonic modes | ||
| + | |||
| + | # pre-factor | ||
| + | | ||
| + | | ||
| + | |||
| + | |||
| + | |||
| + | WaveFunction: | ||
| + | QComplex | ||
| + | N = 2 (Number of basis functions used to discribe psi) | ||
| + | NFermionic modes = 6 (Number of fermions in the one particle basis) | ||
| + | NBosonic modes | ||
| + | |||
| + | # pre-factor | ||
| + | | ||
| + | | ||
| + | |||
| + | |||
| + | ============================ | ||
| + | |||
| + | WaveFunction: | ||
| + | QComplex | ||
| + | N = 1 (Number of basis functions used to discribe psi) | ||
| + | NFermionic modes = 6 (Number of fermions in the one particle basis) | ||
| + | NBosonic modes | ||
| + | |||
| + | # pre-factor | ||
| + | | ||
| + | |||
| + | |||
| + | |||
| + | WaveFunction: | ||
| + | QComplex | ||
| + | N = 1 (Number of basis functions used to discribe psi) | ||
| + | NFermionic modes = 6 (Number of fermions in the one particle basis) | ||
| + | NBosonic modes | ||
| + | |||
| + | # pre-factor | ||
| + | | ||
| + | |||
| + | |||
| + | |||
| + | WaveFunction: | ||
| + | QComplex | ||
| + | N = 1 (Number of basis functions used to discribe psi) | ||
| + | NFermionic modes = 6 (Number of fermions in the one particle basis) | ||
| + | NBosonic modes | ||
| + | |||
| + | # pre-factor | ||
| + | | ||
| + | |||
| + | |||
| + | |||
| + | WaveFunction: | ||
| + | QComplex | ||
| + | N = 1 (Number of basis functions used to discribe psi) | ||
| + | NFermionic modes = 6 (Number of fermions in the one particle basis) | ||
| + | NBosonic modes | ||
| + | |||
| + | # pre-factor | ||
| + | | ||
| + | |||
| + | |||
| + | |||
| + | WaveFunction: | ||
| + | QComplex | ||
| + | N = 1 (Number of basis functions used to discribe psi) | ||
| + | NFermionic modes = 6 (Number of fermions in the one particle basis) | ||
| + | NBosonic modes | ||
| + | |||
| + | # pre-factor | ||
| + | | ||
| + | |||
| + | |||
| + | |||
| + | WaveFunction: | ||
| + | QComplex | ||
| + | N = 1 (Number of basis functions used to discribe psi) | ||
| + | NFermionic modes = 6 (Number of fermions in the one particle basis) | ||
| + | NBosonic modes | ||
| + | |||
| + | # pre-factor | ||
| + | | ||
| + | |||
| + | |||
| + | ============================ | ||
| + | < psi(1 -1 1/2 -1/2) | psi(1 -1 1/2 -1/2) > = 1 | ||
| + | < psi(1 -1 1/2 -1/2) | psi(1 | ||
| + | < psi(1 -1 1/2 -1/2) | psi(1 | ||
| + | < psi(1 -1 1/2 -1/2) | psi(1 -1 1/2 1/2) > = 0 | ||
| + | < psi(1 -1 1/2 -1/2) | psi(1 | ||
| + | < psi(1 -1 1/2 -1/2) | psi(1 | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < psi(1 -1 1/2 1/2) | psi(1 -1 1/2 -1/2) > = 0 | ||
| + | < psi(1 -1 1/2 1/2) | psi(1 | ||
| + | < psi(1 -1 1/2 1/2) | psi(1 | ||
| + | < psi(1 -1 1/2 1/2) | psi(1 -1 1/2 1/2) > = 1 | ||
| + | < psi(1 -1 1/2 1/2) | psi(1 | ||
| + | < psi(1 -1 1/2 1/2) | psi(1 | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | ============================ | ||
| + | 1 | ||
| + | 0 | ||
| + | 0 | ||
| + | 0 | ||
| + | 0 | ||
| + | 0 | ||
| + | </ | ||
| + | ### | ||
| + | |||
| + | ===== Table of contents ===== | ||
| + | {{indexmenu> | ||