You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file gathers all the deprecated names (structures, functions, or variables) which will be removed in the future major release.
3
3
4
-
- Before the major release, the deprecated names will just throw errors when they are called.
4
+
- Before the major release, the deprecated names will show warnings or just throw errors when they are called.
5
5
- If the deprecated names were once exported, we will still export them here until next major release.
6
6
- If we decide to push a major release, cleanup this file.
7
7
8
-
Example:
9
-
8
+
Example 1 [throw errors if the deprecation is fundamental, and there is no replacement for it]:
9
+
```
10
10
export deprecated_foo
11
+
deprecated_foo(args...; kwargs...) = error("`deprecated_foo` is deprecated and will be removed in next major release.")
12
+
```
13
+
14
+
Example 2 ["force" show warning and tell the users that there is a replacement for the deprecated function]:
11
15
16
+
```
17
+
export deprecated_foo
12
18
function deprecated_foo(args...; kwargs...)
13
-
error("`deprecated_foo` has been deprecated and will be removed in next major release, please use `new_foo` instead.")
19
+
Base.depwarn("`deprecated_foo` is deprecated and will be removed in next major release, use `new_foo` instead.", :deprecated_foo, force = true)
20
+
new_foo(args...; kwargs...)
14
21
end
22
+
```
15
23
=#
16
24
17
25
export FFTCorrelation
18
-
export sparse_to_dense, dense_to_sparse
19
-
20
26
FFTCorrelation() =error(
21
-
"`FFTCorrelation` has been deprecated and will be removed in next major release, please use `spectrum_correlation_fft` to calculate the spectrum with FFT method instead.",
27
+
"`FFTCorrelation` is deprecated and will be removed in next major release, use `spectrum_correlation_fft` to calculate the spectrum with FFT method instead.",
22
28
)
23
29
24
-
sparse_to_dense(args...) =error(
25
-
"`sparse_to_dense` has been deprecated and will be removed in next major release, please use `to_dense` instead.",
26
-
)
27
-
dense_to_sparse(args...) =error(
28
-
"`dense_to_sparse` has been deprecated and will be removed in next major release, please use `to_sparse` instead.",
29
-
)
30
+
export sparse_to_dense
31
+
functionsparse_to_dense(args...)
32
+
Base.depwarn(
33
+
"`sparse_to_dense` is deprecated and will be removed in next major release, use `to_dense` instead.",
34
+
:sparse_to_dense,
35
+
force =true,
36
+
)
37
+
returnto_dense(args...)
38
+
end
30
39
31
-
correlation_3op_2t(
40
+
export dense_to_sparse
41
+
functiondense_to_sparse(args...)
42
+
Base.depwarn(
43
+
"`dense_to_sparse` is deprecated and will be removed in next major release, use `to_sparse` instead.",
) where {HOpType<:Union{Operator,SuperOperator},StateOpType<:Union{Ket,Operator}} =error(
42
-
"The parameter order of `correlation_3op_2t` has been changed, please use `?correlation_3op_2t` to check the updated docstring.",
43
-
)
60
+
) where {HOpType<:Union{Operator,SuperOperator},StateOpType<:Union{Ket,Operator}}
61
+
Base.depwarn(
62
+
"The argument order of `correlation_3op_2t(H, ψ0, t_l, τ_l, A, B, C, c_ops)` is changed to `correlation_3op_2t(H, ψ0, t_l, τ_l, c_ops, A, B, C)`, use `?correlation_3op_2t` to check the updated docstring.",
63
+
:correlation_3op_2t,
64
+
force =true,
65
+
)
66
+
returncorrelation_3op_2t(H, ψ0, t_l, τ_l, c_ops, A, B, C; kwargs...)
) where {HOpType<:Union{Operator,SuperOperator},StateOpType<:Union{Ket,Operator}} =error(
55
-
"The parameter order of `correlation_3op_1t` has been changed, please use `?correlation_3op_1t` to check the updated docstring.",
56
-
)
78
+
) where {HOpType<:Union{Operator,SuperOperator},StateOpType<:Union{Ket,Operator}}
79
+
Base.depwarn(
80
+
"The argument order of `correlation_3op_1t(H, ψ0, τ_l, A, B, C, c_ops)` is changed to `correlation_3op_1t(H, ψ0, τ_l, c_ops, A, B, C)`, use `?correlation_3op_1t` to check the updated docstring.",
81
+
:correlation_3op_1t,
82
+
force =true,
83
+
)
84
+
returncorrelation_3op_1t(H, ψ0, τ_l, c_ops, A, B, C; kwargs...)
) where {HOpType<:Union{Operator,SuperOperator},StateOpType<:Union{Ket,Operator}} =error(
69
-
"The parameter order of `correlation_2op_2t` has been changed, please use `?correlation_2op_2t` to check the updated docstring.",
70
-
)
97
+
) where {HOpType<:Union{Operator,SuperOperator},StateOpType<:Union{Ket,Operator}}
98
+
Base.depwarn(
99
+
"The argument order of `correlation_2op_2t(H, ψ0, t_l, τ_l, A, B, c_ops)` is changed to `correlation_2op_2t(H, ψ0, t_l, τ_l, c_ops, A, B)`, use `?correlation_2op_2t` to check the updated docstring.",
) where {HOpType<:Union{Operator,SuperOperator},StateOpType<:Union{Ket,Operator}} =error(
82
-
"The parameter order of `correlation_2op_1t` has been changed, please use `?correlation_2op_1t` to check the updated docstring.",
83
-
)
115
+
) where {HOpType<:Union{Operator,SuperOperator},StateOpType<:Union{Ket,Operator}}
116
+
Base.depwarn(
117
+
"The argument order of `correlation_2op_1t(H, ψ0, τ_l, A, B, c_ops)` is changed to `correlation_2op_1t(H, ψ0, τ_l, c_ops, A, B)`, use `?correlation_2op_1t` to check the updated docstring.",
118
+
:correlation_2op_1t,
119
+
force =true,
120
+
)
121
+
returncorrelation_2op_1t(H, ψ0, τ_l, c_ops, A, B; reverse = reverse, kwargs...)
0 commit comments