Skip to content

Commit 0ec00df

Browse files
committed
simplify type structure for time evolution solutions
1 parent 1df950c commit 0ec00df

File tree

2 files changed

+24
-32
lines changed

2 files changed

+24
-32
lines changed

src/time_evolution/lr_mesolve.jl

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,24 @@ A structure storing the results and some information from solving low-rank maste
2020
- `B::Vector{QuantumObject}`: The `B` matrix of the low-rank algorithm at each time point.
2121
"""
2222
struct TimeEvolutionLRSol{
23-
TT1<:AbstractVector{<:Real},
24-
TT2<:AbstractVector{<:Real},
23+
TT<:AbstractVector{<:Real},
2524
TS<:AbstractVector,
2625
TE<:Matrix{ComplexF64},
2726
RetT<:Enum,
2827
AlgT<:OrdinaryDiffEqAlgorithm,
29-
AT<:Real,
30-
RT<:Real,
28+
TolT<:Real,
3129
TSZB<:AbstractVector,
3230
TM<:Vector{<:Integer},
3331
}
34-
times::TT1
35-
times_states::TT2
32+
times::TT
33+
times_states::TT
3634
states::TS
3735
expect::TE
3836
fexpect::TE
3937
retcode::RetT
4038
alg::AlgT
41-
abstol::AT
42-
reltol::RT
39+
abstol::TolT
40+
reltol::TolT
4341
z::TSZB
4442
B::TSZB
4543
M::TM

src/time_evolution/time_evolution.jl

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,21 @@ A structure storing the results and some information from solving time evolution
6060
- `reltol::Real`: The relative tolerance which is used during the solving process.
6161
"""
6262
struct TimeEvolutionSol{
63-
TT1<:AbstractVector{<:Real},
64-
TT2<:AbstractVector{<:Real},
63+
TT<:AbstractVector{<:Real},
6564
TS<:AbstractVector,
6665
TE<:Union{AbstractMatrix,Nothing},
6766
RETT<:Enum,
6867
AlgT<:OrdinaryDiffEqAlgorithm,
69-
AT<:Real,
70-
RT<:Real,
68+
TolT<:Real,
7169
}
72-
times::TT1
73-
times_states::TT2
70+
times::TT
71+
times_states::TT
7472
states::TS
7573
expect::TE
7674
retcode::RETT
7775
alg::AlgT
78-
abstol::AT
79-
reltol::RT
76+
abstol::TolT
77+
reltol::TolT
8078
end
8179

8280
function Base.show(io::IO, sol::TimeEvolutionSol)
@@ -133,27 +131,25 @@ We also provide the following functions for statistical analysis of multi-trajec
133131
- [`std_expect`](@ref)
134132
"""
135133
struct TimeEvolutionMCSol{
136-
TT1<:AbstractVector{<:Real},
137-
TT2<:AbstractVector{<:Real},
134+
TT<:AbstractVector{<:Real},
138135
TS<:AbstractVecOrMat,
139136
TE<:Union{AbstractArray,Nothing},
140137
TJT<:Vector{<:Vector{<:Real}},
141138
TJW<:Vector{<:Vector{<:Integer}},
142139
AlgT<:OrdinaryDiffEqAlgorithm,
143-
AT<:Real,
144-
RT<:Real,
140+
TolT<:Real,
145141
} <: TimeEvolutionMultiTrajSol{TS,TE}
146142
ntraj::Int
147-
times::TT1
148-
times_states::TT2
143+
times::TT
144+
times_states::TT
149145
states::TS
150146
expect::TE
151147
col_times::TJT
152148
col_which::TJW
153149
converged::Bool
154150
alg::AlgT
155-
abstol::AT
156-
reltol::RT
151+
abstol::TolT
152+
reltol::TolT
157153
end
158154

159155
function Base.show(io::IO, sol::TimeEvolutionMCSol)
@@ -209,25 +205,23 @@ We also provide the following functions for statistical analysis of multi-trajec
209205
- [`std_expect`](@ref)
210206
"""
211207
struct TimeEvolutionStochasticSol{
212-
TT1<:AbstractVector{<:Real},
213-
TT2<:AbstractVector{<:Real},
208+
TT<:AbstractVector{<:Real},
214209
TS<:AbstractVecOrMat,
215210
TE<:Union{AbstractArray,Nothing},
216211
TEM<:Union{AbstractArray,Nothing},
217212
AlgT<:StochasticDiffEqAlgorithm,
218-
AT<:Real,
219-
RT<:Real,
213+
TolT<:Real,
220214
} <: TimeEvolutionMultiTrajSol{TS,TE}
221215
ntraj::Int
222-
times::TT1
223-
times_states::TT2
216+
times::TT
217+
times_states::TT
224218
states::TS
225219
expect::TE
226220
measurement::TEM
227221
converged::Bool
228222
alg::AlgT
229-
abstol::AT
230-
reltol::RT
223+
abstol::TolT
224+
reltol::TolT
231225
end
232226

233227
function Base.show(io::IO, sol::TimeEvolutionStochasticSol)

0 commit comments

Comments
 (0)