Page 1 of 1
Extending spinach to other physical implementation
Posted: Wed Aug 11, 2021 5:45 am
by yunwei
I am thinking if Spinach can be used to construct any kind of Hamiltonian.
For example, H=w_c*a_dag*a+w_q*sigmaz+g(a+a_dag)*(sigmax), which is cavity coupling to a 2-level system.
And H=wc*b_dag*b+a*(b_dag*b-1)*b_dag*b, which is anharmonic oscillator.
I want to apply the optimal model to the system H shown above, but I am not sure if I can do some tricks and construct such H in Spinach.
Re: Extending spinach to other physical implementation
Posted: Wed Aug 11, 2021 11:42 am
by kuprov
Hmmm, an interesting idea. So long as the excitation ladder is truncated at some point, a harmonic oscillator would be isomorphic mathematically to a spin...
I would suggest using pauli.m function to get creation and annihilation operators, and then trying to build the rest of the mathematics out of those. Much of Spinach functionality relies on the spin_system object existing, but in principle we could try adding a possibility of some of the particles inthe spin system being harmonic oscillators instead.
Do you have a simple five-line example of your harmonic oscillator calculation? I can take a look and see if we can extend the kernel to handle that.
Re: Extending spinach to other physical implementation
Posted: Mon Aug 16, 2021 9:39 pm
by yunwei
It would be fine, I just see the instruction to define the spin system.
I have another question, can I define interaction like S_z1+S_z2+S_x1*S_x2?
Re: Extending spinach to other physical implementation
Posted: Tue Aug 17, 2021 7:21 am
by kuprov
Well, that's a pretty standard Hamiltonian - of course you can. Either specify an interaction matrix with zeros in the right places, or build your own operator.
Re: Extending spinach to other physical implementation
Posted: Tue Aug 17, 2021 9:28 pm
by yunwei
function program()
function [b_dag,b]=cavity(h_dim)
b_dag=[1:h_dim-1];
b_dag=sqrt(diag(b_dag,-1));
b=[1:h_dim-1];
b=sqrt(b);
b=diag(b,1);
end
[b_dag,b]=cavity(10);
w_c=3.9*2*pi;%frequency of cavity
H0=w_c*b_dag*b;
end
These are lines to get the matrix of harmonic oscillator, which is also called cavity in quantum optics.
Could you please give me an example to construct such a Hamiltonian? Thanks!
Re: Extending spinach to other physical implementation
Posted: Fri Aug 20, 2021 8:00 am
by kuprov
Would this function suffice?
https://spindynamics.org/wiki/index.php ... cillator.m
If not, then call this:
https://spindynamics.org/wiki/index.php?title=Pauli.m
and use the raising and lowering operators that it returns as creation and annihilation operators of a truncated Harmonic oscillator.