Skip to content

Commit 9172e82

Browse files
Implement Stochastic Schrodinger equation (#238)
* Implement Stochastic Schrodinger equation * Minor changes * Minor changes on the import * Fix wrong link * Fix instabilities * Avoid safety_copy
1 parent d47e9e9 commit 9172e82

File tree

7 files changed

+507
-5
lines changed

7 files changed

+507
-5
lines changed

Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ version = "0.14.1"
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
88
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
99
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
10+
DiffEqNoiseProcess = "77a26b50-5914-5dd7-bc55-306e6241c503"
1011
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
1112
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1213
IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895"
@@ -22,6 +23,7 @@ SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961"
2223
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2324
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
2425
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
26+
StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"
2527

2628
[weakdeps]
2729
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
@@ -34,6 +36,7 @@ ArrayInterface = "6, 7"
3436
CUDA = "5"
3537
DiffEqBase = "6"
3638
DiffEqCallbacks = "2 - 3.1, 3.8"
39+
DiffEqNoiseProcess = "5"
3740
FFTW = "1.5"
3841
Graphs = "1.7"
3942
IncompleteLU = "0.2"
@@ -49,6 +52,7 @@ SciMLOperators = "0.3"
4952
SparseArrays = "<0.0.1, 1"
5053
SpecialFunctions = "2"
5154
StaticArraysCore = "1"
55+
StochasticDiffEq = "6"
5256
Test = "<0.0.1, 1"
5357
julia = "1.10"
5458

docs/src/api.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,22 @@ qeye
175175
```@docs
176176
TimeEvolutionSol
177177
TimeEvolutionMCSol
178+
TimeEvolutionSSESol
178179
sesolveProblem
179180
mesolveProblem
180-
lr_mesolveProblem
181181
mcsolveProblem
182182
mcsolveEnsembleProblem
183+
ssesolveProblem
184+
ssesolveEnsembleProblem
185+
lr_mesolveProblem
183186
sesolve
184187
mesolve
185-
lr_mesolve
186188
mcsolve
189+
ssesolve
187190
dfd_mesolve
188191
dsf_mesolve
189192
dsf_mcsolve
193+
lr_mesolve
190194
liouvillian
191195
liouvillian_generalized
192196
steadystate

src/QuantumToolbox.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,21 @@ import SciMLBase:
2222
remake,
2323
u_modified!,
2424
ODEProblem,
25+
SDEProblem,
2526
EnsembleProblem,
2627
EnsembleThreads,
2728
FullSpecialize,
2829
CallbackSet,
2930
ContinuousCallback,
3031
DiscreteCallback
32+
import StochasticDiffEq: StochasticDiffEqAlgorithm, SRA1
3133
import SciMLOperators: MatrixOperator
3234
import LinearSolve: LinearProblem, SciMLLinearSolveAlgorithm, KrylovJL_MINRES, KrylovJL_GMRES
3335
import DiffEqBase: get_tstops
3436
import DiffEqCallbacks: PeriodicCallback, PresetTimeCallback, TerminateSteadyState
3537
import OrdinaryDiffEqCore: OrdinaryDiffEqAlgorithm
3638
import OrdinaryDiffEqTsit5: Tsit5
39+
import DiffEqNoiseProcess: RealWienerProcess
3740

3841
# other dependencies (in alphabetical order)
3942
import ArrayInterface: allowed_getindex, allowed_setindex!
@@ -73,6 +76,7 @@ include("time_evolution/mesolve.jl")
7376
include("time_evolution/lr_mesolve.jl")
7477
include("time_evolution/sesolve.jl")
7578
include("time_evolution/mcsolve.jl")
79+
include("time_evolution/ssesolve.jl")
7680
include("time_evolution/time_evolution_dynamical.jl")
7781

7882
# Others

src/qobj/operator_sum.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct OperatorSum{CT<:Vector{<:Number},OT<:AbstractVector} <: AbstractQuantumOb
1818
mapreduce(x -> size(x) == size_1, &, operators) ||
1919
throw(DimensionMismatch("All the operators must have the same dimensions."))
2020
T = promote_type(
21-
mapreduce(x -> eltype(x.data), promote_type, operators),
21+
mapreduce(x -> eltype(x), promote_type, operators),
2222
mapreduce(eltype, promote_type, coefficients),
2323
)
2424
coefficients2 = T.(coefficients)

0 commit comments

Comments
 (0)