Matrix form for creation and annihilation operator with spins.

10 views (last 30 days)
This might be little geared towards physics but if anyone can help, it would so much helpful for me. So basically I want the matrix form of the following Hamiltonian ., where creates an electron at site i with spin σ which can be up () or down (). For this I need the matrix form of the operators involved. For people who have been working with this type of Hamiltonian are aware that it follows aniti-commutation relations
What I can do now is that I can write the operators without the spin as below but i need help with the above when spin is also involved.
N = 4;
%n = 1:N;
a = diag(sqrt(1:N),1)% Creates matrix with elements of the vector on first super diagonal(i.e 1)
ad = a' %adagger
Is there anyway to do that. How should I go on to create the Hamiltonian for that. Are there any helpful packages to do that. Any help would be appreciated.
Thank you.

Answers (1)

Matt J
Matt J on 17 Sep 2021
Edited: Matt J on 17 Sep 2021
Not sure this will help, but if you can write a function that implements the operator, then his File Exchange offering,
will convert it to matrix form. For example,
fn=@(x) 7*x(1:3)-3*x(4:6); %A function, doesn't have to be anonymous
A=func2mat(fn, ones(6,1));
full(A)
ans = 3×6
7 0 0 -3 0 0 0 7 0 0 -3 0 0 0 7 0 0 -3

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!