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/getting_started/type_stability.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,7 +158,7 @@ and its type is
158
158
obj_type = typeof(σx_2)
159
159
```
160
160
161
-
This is exactly what the Julia compiler sees: it is a [`QuantumObject`](@ref), composed by a field of type `SparseMatrixCSC{ComplexF64, Int64}` (i.e., the 8x8 matrix containing the Pauli matrix, tensored with the identity matrices of the other two qubits). Then, we can also see that it is a [`OperatorQuantumObject`](@ref), with `3` subsystems in total. Hence, just looking at the type of the object, the compiler has all the information it needs to generate a specialized version of the functions.
161
+
This is exactly what the Julia compiler sees: it is a [`QuantumObject`](@ref), composed by a field of type `SparseMatrixCSC{ComplexF64, Int64}` (i.e., the 8x8 matrix containing the Pauli matrix, tensored with the identity matrices of the other two qubits). Then, we can also see that it is a [`Operator`](@ref), with `3` subsystems in total. Hence, just looking at the type of the object, the compiler has all the information it needs to generate a specialized version of the functions.
162
162
163
163
Let's see more in the details all the internal fields of the [`QuantumObject`](@ref) type:
164
164
@@ -174,7 +174,6 @@ fieldnames(obj_type)
174
174
σx_2.type
175
175
```
176
176
177
-
[`Operator`](@ref) is a synonym for [`OperatorQuantumObject`](@ref).
178
177
179
178
```@example type-stability
180
179
σx_2.dims
@@ -184,7 +183,7 @@ The `dims` field contains the dimensions of the subsystems (in this case, three
184
183
185
184
```@example type-stability
186
185
function reshape_operator_data(dims)
187
-
op = Qobj(randn(prod(dims), prod(dims)), type=Operator, dims=dims)
186
+
op = Qobj(randn(prod(dims), prod(dims)), type=Operator(), dims=dims)
Please note that here we put the `dims` as a tuple `(2, 2)`. Although it supports also `Vector` type (`dims = [2, 2]`), it is recommended to use `Tuple` or `SVector` from [`StaticArrays.jl`](https://github.com/JuliaArrays/StaticArrays.jl) to improve performance. For a brief explanation on the impact of the type of `dims`, see the Section [The Importance of Type-Stability](@ref doc:Type-Stability).
Copy file name to clipboardExpand all lines: docs/src/users_guide/states_and_operators.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -389,7 +389,7 @@ B = Qobj(rand(ComplexF64, N, N))
389
389
mat2vec(A * ρ * B) ≈ spre(A) * spost(B) * mat2vec(ρ) ≈ sprepost(A, B) * mat2vec(ρ)
390
390
```
391
391
392
-
In addition, dynamical generators on this extended space, often called Liouvillian superoperators, can be created using the [`liouvillian`](@ref) function. Each of these takes a Hamiltonian along with a list of collapse operators, and returns a [`type=SuperOperator`](@refSuperOperator) object that can be exponentiated to find the superoperator for that evolution.
392
+
In addition, dynamical generators on this extended space, often called Liouvillian superoperators, can be created using the [`liouvillian`](@ref) function. Each of these takes a Hamiltonian along with a list of collapse operators, and returns a [`QuantumObject`](@ref) of type [`SuperOperator`](@ref) that can be exponentiated to find the superoperator for that evolution.
0 commit comments