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
Copy file name to clipboardExpand all lines: docs/src/users_guide/time_evolution/mesolve.md
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -31,17 +31,16 @@ In `QuantumToolbox`, given a Hamiltonian, we can calculate the unitary (non-diss
31
31
32
32
```@example mesolve
33
33
H = 0.5 * sigmax()
34
-
state0 = basis(2, 0) # state vector
35
-
state0 = ket2dm(basis(2, 0)) # density matrix
34
+
state0 = basis(2, 0) # state vector
36
35
tlist = LinRange(0.0, 10.0, 20)
37
36
38
37
sol = mesolve(H, state0, tlist, e_ops = [sigmaz()])
39
38
```
40
39
41
-
!!! note "Type of initial state"
42
-
The initial state `state0` here can be given as a state vector ``|\psi(0)\rangle`` (in the type of [`Ket`](@ref)) or a density matrix``\hat{\rho}(0)`` (in the type of [`Operator`](@ref)). If it is given as a [`Ket`](@ref), it will be transformed to density matrix ``\hat{\rho}(0) = |\psi(0)\rangle\langle\psi(0)|`` internally in [`mesolve`](@ref).
40
+
!!! note "Use sesolve for improved efficiency"
41
+
Here, if the Hamiltonian `H` is given as an [`Operator`](@ref), and the initial state `state0` is given as a state vector``|\psi(0)\rangle`` (in the type of [`Ket`](@ref)), it will automatically call [`sesolve`](@ref) for improved efficiency.
43
42
44
-
The function returns [`TimeEvolutionSol`](@ref), as described in the previous section [Time Evolution Solutions](@ref doc-TE:Time-Evolution-Solutions). The stored `states` will always be in the type of [`Operator`](@ref) (density matrix).
43
+
The function returns [`TimeEvolutionSol`](@ref), as described in the previous section [Time Evolution Solutions](@ref doc-TE:Time-Evolution-Solutions).
45
44
46
45
```@example mesolve
47
46
sol.states
@@ -53,6 +52,7 @@ One can also specify `e_ops` and `saveat` separately:
Note that when the initial state `state0` is given as a density matrix ``|\psi(0)\rangle\langle\psi(0)|`` (in the type of [`Operator`](@ref)), the stored `states` will also be in the type of [`Operator`](@ref) (density matrix).
The standard approach for deriving the equations of motion for a system interacting with its environment is to expand the scope of the system to include the environment. The combined quantum system is then closed, and its evolution is also governed by the von Neumann equation
0 commit comments