# Lambda Systems

**URL:** <https://discourse.julialang.org/t/lambda-systems/113572>\
**Category:** Quantum\
**Created:** [April 27, 2024, 5:10pm UTC](https://discourse.julialang.org/t/lambda-systems/113572 "2024-04-27T17:10:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![avishipoddar](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@avishipoddar](https://discourse.julialang.org/u/avishipoddar)\
**Post date:** [April 27, 2024, 5:10pm UTC](https://discourse.julialang.org/t/lambda-systems/113572/1 "2024-04-27T17:10:03Z")

</div>

I am trying to simulate a 3-level lambda system. I have defined the operators such as sigma\_ee, sigma\_es, sigma\_eg, etc. as 3-level matrices.  
To build the Hamiltonian as an MPO, do I use spin-1?

---

<div class="post-metadata">

**Author:** ![avishipoddar](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@avishipoddar](https://discourse.julialang.org/u/avishipoddar)\
**Post date:** [April 27, 2024, 5:20pm UTC](https://discourse.julialang.org/t/lambda-systems/113572/2 "2024-04-27T17:20:17Z")

</div>

Moreover, in order to create a Hamiltonian that looks like

 ![Screenshot 2024-04-27 at 13.19.23](https://global.discourse-cdn.com/julialang/original/3X/5/2/52f4639cd8f344095ab9710054b6a6f3360decee.png)  
how do you define the MPO

---

<div class="post-metadata">

**Author:** ![avishipoddar](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@avishipoddar](https://discourse.julialang.org/u/avishipoddar)\
**Post date:** [April 27, 2024, 5:20pm UTC](https://discourse.julialang.org/t/lambda-systems/113572/3 "2024-04-27T17:20:55Z")

</div>

Here,

 ![Screenshot 2024-04-27 at 13.20.31](https://global.discourse-cdn.com/julialang/original/3X/e/1/e1f49bbfc2f863cb35e3108d5be83408f9357871.png)

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [April 27, 2024, 5:24pm UTC](https://discourse.julialang.org/t/lambda-systems/113572/4 "2024-04-27T17:24:36Z")

</div>

Hello and welcome to the community! 👋 You have posted in the category “General usage”, but your question assumes highly specific knowledge of a particular problem domain, something the general Julia user may not have. Please consider placing your post in a suitable topic, and provide more context to your question for those not intimately familiar with your problem domain.

---

<div class="post-metadata">

**Author:** ![Krastanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krastanov/32/6817_2.png) [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Post date:** [April 27, 2024, 6:58pm UTC](https://discourse.julialang.org/t/lambda-systems/113572/5 "2024-04-27T18:58:03Z")

</div>

Are you using any particular library (e.g. `QuantumOptics.jl`) or are you asking more generally how to set this up with the basic linear algebra capabilities that come with julia? Could you share what you have currently tried?

---

<div class="post-metadata">

**Author:** ![avishipoddar](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@avishipoddar](https://discourse.julialang.org/u/avishipoddar)\
**Post date:** [April 27, 2024, 7:07pm UTC](https://discourse.julialang.org/t/lambda-systems/113572/6 "2024-04-27T19:07:41Z")

</div>

No I am not using any library. I am just defining single-atom operators, for instance, ITensors.op(::OpName"See", ::SiteType"S=1") =  
[0 0 0  
0 1 0  
0 0 0] and then using that to construct the Hamiltonian. For example, for the first term, I write os1 = OpSum()  
for i=1:N  
os1 += -1im\*γ\_prime/2, “See”, i  
end

---

<div class="post-metadata">

**Author:** ![Krastanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krastanov/32/6817_2.png) [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Post date:** [April 27, 2024, 7:41pm UTC](https://discourse.julialang.org/t/lambda-systems/113572/7 "2024-04-27T19:41:02Z")

</div>

It seems you are using the `ITensor.jl` library. This is a pretty great library, but it is not something that is in base Julia, it is one of many packages implemented in Julia that one needs to install in additional the the language itself. I assume you have already taken care of the installation of the base language and of this library.

Please check out this post for some pointers on how to make it easier for others to answer your question: [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757)

One thing that would help is to format your code so that it is easy to read for others (using the backtick markdown notation as described in that post).

If I am getting your question correctly, you already can build various states and operators, but you are asking what are following best practices? Or are you stuck and do not really know yet how to start constructing these objects? Could post the complete code of what you have tried and explain why you are not satisfied with it or what is missing in it?
