-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Steady State solver #252
Comments
Thanks for pointing to that package, it looks really good. As the steady-state solvers in QO.jl either solve the ODE or diagonalize the Liouvillian there is definitely room for improvement. From our/my side this would certainly be a good addition to the |
Hi, I am the author of the above-mentioned It was first written in a generic way so as to be able to handle operators provided as any kind of matrix, in the perspective of taking advantage of the performance of running such iterative solvers in GPUs. Yet I have very recently refactored its code in such a way that its signatures are somehow consistent with those of the solvers within Such iterative methods usually converge within a few seconds for non-pathological systems of a few hundred states and prove especially more efficient than brute-force integration when a very low tolerance is required. As a benchmark of the method, I consider the case of the periodic driven-dissipative transverse-field Ising model with using QuantumOptics, SteadyState, IterativeSolvers
function transverse_ising(N)
γ = 1.0
V = 2γ
g = 1.3γ # ~ at the crossover
lbasis = SpinBasis(1//2)
gbasis = CompositeBasis([lbasis for i in 1:N])
sm = sigmam(lbasis)
sx = sigmax(lbasis)
sy = sigmay(lbasis)
sz = sigmaz(lbasis)
H = SparseOperator(gbasis)
for i in 1:N
H += embed(gbasis, [i, mod1(i+1,N)] ,[sz,sz])
H += embed(gbasis, i, g/2. * sx)
end
J = sqrt(γ) .* [embed(gbasis, i, sm) for i in 1:N]
return H, J
end
H, J = transverse_ising(10); # Hilbert space of dimension 1024
dH = DenseOperator(H);
dJ = DenseOperator.(J); From this one measures (on 6 CPU threads): julia> @time SteadyState.iterative(dH, dJ; tol=1e-3); # Here bicgstabl! is used by default
398.616856 seconds (3.90 k allocations: 7.127 GiB, 0.27% gc time)
julia> @time SteadyState.iterative(dH, dJ, idrs!; tol=1e-3);
411.671667 seconds (7.59 k allocations: 738.624 MiB, 0.12% gc time)
julia> @time SteadyState.iterative(dH, dJ, idrs!; tol=1e-6);
658.327444 seconds (11.72 k allocations: 740.137 MiB, 0.05% gc time) This works with julia> using CuArrays, BenchmarkTools
julia> H, J = transverse_ising(11); # Hilbert space of dimension 2048
julia> dH = DenseOperator(H);
julia> dJ = DenseOperator.(J);
julia> @btime SteadyState.iterative(cu(dH.data),map(x->cu(x.data),dJ); tol=1e-8) # defaults to idrs!
80.000 s (426821 allocations: 796.23 MiB) Achieving this precision by brute-force integration is rather hopeless, even for very small chains, due to the very slow relaxation of the system for these parameters. If you think this would be a useful addition to |
@david-pl As a side-note: this method, is crazy fast compared to Even for small systems, you get a considerable (>x10) speedup, and as a bonus you can scale scale up to a rather large number of sites. |
Hi @Z-Denis, Thanks for your comment. I have to admit I'm very impressed by the benchmarks. As @PhilipVinc says, even when I run your code for One thing we could discuss is switching from the So bottom line: If you're willing to contribute this, I would be happy to add it to |
After discussing with @PhilipVinc we have a few thoughts on this:
We believe that there are two possible ways to implement this in QuantumOptics.jl:
|
Regarding your suggestions on how to proceed: I would be fine either way, but I'm slightly more inclined to go for the first option. The other option depends a bit on what your plans are with SteadyState.jl. If you plan on making a lot of changes, it might not be the best idea to make QuantumOptics depend on SteadyState. But it's really your choice, so just let me know how you want to go about it. |
Hi,
I just wanted to bring you guys to the attention a small package authored by a colleague of mine to compute the steady state of an lindblad markovian system. It basically solves the system L\rho = 0 by also enforcing the trace normalization.
It's a very efficient method, allowing for finding the steady state of quite big systems.
In our group we've been using the method for quite some time and it works very well. Maybe you'd be interested in getting in touch to integrate that in QuantumOptics...
The text was updated successfully, but these errors were encountered: