# QuantumOptics.jl Time dependent Hamiltonian definition

**URL:** <https://discourse.julialang.org/t/quantumoptics-jl-time-dependent-hamiltonian-definition/119287>\
**Category:** General Usage\
**Tags:** package\
**Created:** [September 11, 2024, 4:30pm UTC](https://discourse.julialang.org/t/quantumoptics-jl-time-dependent-hamiltonian-definition/119287 "2024-09-11T16:30:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruno\_Piveta](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bruno_piveta/32/211906_2.png) [@Bruno\_Piveta](https://discourse.julialang.org/u/Bruno_Piveta)\
**Post date:** [September 11, 2024, 4:30pm UTC](https://discourse.julialang.org/t/quantumoptics-jl-time-dependent-hamiltonian-definition/119287/1 "2024-09-11T16:30:51Z")

</div>

I’m having some problems trying to implement the evolution of a time dependent Hamiltonian using the TimeDependentSum method, as recommended in the documentation. In the documentation the Hamiltonian

H = sin(t)\*sigmax

is implemented as

H = TimeDependentSum(sin=\>sx)

where sx was defined previously.  
What i want to implement is the Hamiltonian

H\_interest = [w1\*(1-t)+ w2\* t] \* [cos(t)\*sigmax + sin(t)\*sigmay]

I know that i can use tuples to define something like

H = TimeDependentSum((sin,cos),(sx,sz))

But I cant find a way to define my the Hamiltonian I need. Looks like a very basic question but its giving me a headache, thank you all in advance  
Here’s a screenshot of my code that works with what i want in the comments

 ![image](https://global.discourse-cdn.com/julialang/original/3X/8/d/8dee90a70e243104cd518e9815b866f8469eb727.png)
