Giter VIP home page Giter VIP logo

Comments (5)

ChristophHotter avatar ChristophHotter commented on August 26, 2024

Hi @eric940109

Yes QuantumCumulants is usually well suited for this problem (depending on the parameter regime).
I think in your case the mistake is that the Hamiltonian is not hermitian (which is unphysical).
For a real eta (eta = 1) the drive term needs to be eta (a' + a) or i eta (a' - a).

from quantumcumulants.jl.

eric940109 avatar eric940109 commented on August 26, 2024

Hi @ChristophHotter

Thanks a lot for your comment! After correcting the drive term, the negative photon numbers seem to still remain. Does this mean my setting of parameters are out of the reasonable parameter regime?

The code and typical results are attached.

issues_220619


M = 2 #order
@cnumbers N Δc Δs g κ γ12 η γ22
hf = FockSpace(:cavity)
ha1 = NLevelSpace(:atom, 2)
ha = ClusterSpace(ha1, N, M)
h = tensor(hf, ha);

@qnumbers a::Destroy(h)
σ(i, j, k) = Transition(h, :σ, i, j)[k]

#Hamiltonian
H = Δc*a'*a + Δs*sum(σ(2,1,i)*σ(1,2,i) for i = 1:M) + g*sum(a'*σ(1,2,i) + a*σ(2,1,i) for i=1:M) + η*(a'+a)

#Collapse operators
J = [a;[σ(1,2,i) for i = 1:M];[σ(2,2,i) for i = 1:M]]
rates = [κ;[γ12 for i = 1:M];[γ22 for i = 1:M]]

#Derive equation
eqs = meanfield([σ(2,2,1)],H,J;rates = rates, order = 2)
eqs_c = complete(eqs, order = 2)

using OrdinaryDiffEq, ModelingToolkit
@named sys = ODESystem(eqs_c)
u0 = zeros(ComplexF64, length(eqs_c))
u0[1] = 1.0
ps = [N, Δc, Δs, g, κ, γ12, η, γ22] #N Δc Δs g κ γ12 η γ22
p0 = [1e14, 0.0, 0.0, 2*π*0.022, 2*π*0.18e6, 1e4, 1e5, 2*π*0.42e6]
prob0 = ODEProblem(sys, u0, (0.0, 8e-5), ps.=>p0)
alg = RK4()
sol0 = solve(prob0, alg)
t0 = sol0.t
q = real.(sol0[a'*a])
using Plots
plot(t0,q)```

Best wishes,
Eric

from quantumcumulants.jl.

ChristophHotter avatar ChristophHotter commented on August 26, 2024

The program itself seems fine.
I think the problem is your parameter set, you have very small and very large numbers at the same time, which is usually hard to solve numerically.

from quantumcumulants.jl.

ChristophHotter avatar ChristophHotter commented on August 26, 2024

I just saw this again. You could also try to reduce the tolerance of the numerics with e.g. sol0 = solve(prob0, Tsit5(); abstol=1e-10, reltol=1e-10.

from quantumcumulants.jl.

eric940109 avatar eric940109 commented on August 26, 2024

@ChristophHotter Thanks a lot for your reply! I will have it a go!

from quantumcumulants.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.