Skip to content

To add example for time dependent coupling to a bath #17

@x94dai

Description

@x94dai

It seems one cannot construct an annealing object with time-dependent coupling to a bach in the same way as constant coupling. The following code block for example gives an error. It will be useful to have an example that desmonstrates using TimeDependentCoupling.

Δ = 0.1
H = DenseHamiltonian([(s)->2*s-1, (s)->1.0], [σz, Δ * σx], unit=:ħ)
η = 0.001
fc = 4 * 2 * π
T = 20
bath = Ohmic(η, fc, T)
coupling = TimeDependentCoupling([(s)->s], [σz], unit=:ħ)
u0 = PauliVec[3][1]
annealing = Annealing(H, u0, coupling=coupling, bath=bath)
MethodError: Cannot `convert` an object of type TimeDependentCoupling to an object of type OpenQuantumBase.AbstractCouplings
Closest candidates are:
  convert(::Type{T}, ::T) where T at essentials.jl:171

Stacktrace:
 [1] Interaction(::TimeDependentCoupling, ::OhmicBath) at C:\Users\x35dai\.julia\packages\OpenQuantumBase\Pk0vX\src\coupling\interaction.jl:16
 [2] Annealing(::DenseHamiltonian{Complex{Float64}}, ::Array{Complex{Float64},1}; coupling::TimeDependentCoupling, bath::OhmicBath, interactions::Nothing, annealing_parameter::Function) at C:\Users\x35dai\.julia\packages\OpenQuantumBase\Pk0vX\src\annealing\annealing_type.jl:33
 [3] top-level scope at In[11]:8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions