Skip to content

Commit 7f21ff6

Browse files
Use Eye everywhere
1 parent b2ec634 commit 7f21ff6

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/qobj/boolean_functions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Test whether the [`QuantumObject`](@ref) ``U`` is unitary operator. This functio
8585
8686
Note that all the keyword arguments will be passed to `Base.isapprox`.
8787
"""
88-
isunitary(U::QuantumObject; kwargs...) = isoper(U) ? isapprox(U.data * U.data', I(size(U, 1)); kwargs...) : false
88+
isunitary(U::QuantumObject; kwargs...) = isoper(U) ? isapprox(U.data * U.data', Eye(size(U, 1)); kwargs...) : false
8989

9090
@doc raw"""
9191
SciMLOperators.iscached(A::AbstractQuantumObject)

src/qobj/states.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ The `dimensions` can be either the following types:
149149
If you want to keep type stability, it is recommended to use `maximally_mixed_dm(dimensions)` with `dimensions` as `Tuple` or `SVector` from [StaticArrays.jl](https://github.com/JuliaArrays/StaticArrays.jl) to keep type stability. See the [related Section](@ref doc:Type-Stability) about type stability for more details.
150150
"""
151151
maximally_mixed_dm(dimensions::Int) =
152-
QuantumObject(I(dimensions) / complex(dimensions), Operator(), SVector(dimensions))
152+
QuantumObject(Eye(dimensions) / complex(dimensions), Operator(), SVector(dimensions))
153153
function maximally_mixed_dm(dimensions::Union{Dimensions,AbstractVector{Int},Tuple})
154154
N = prod(dimensions)
155-
return QuantumObject(I(N) / complex(N), Operator(), dimensions)
155+
return QuantumObject(Eye(N) / complex(N), Operator(), dimensions)
156156
end
157157

158158
@doc raw"""

src/spectrum.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function _spectrum(
140140
_tr = SparseVector(D^2, [1 + n * (D + 1) for n in 0:(D-1)], ones(_complex_float_type(L), D)) # same as vec(system_identity_matrix)
141141
_tr_A = transpose(_tr) * spre(A).data
142142

143-
Id = I(D^2)
143+
Id = Eye(D^2)
144144

145145
# DO the idx = 1 case
146146
ω = ωList[1]

src/time_evolution/time_evolution_dynamical.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ function dsf_mesolveProblem(
362362
op_l_vec = map(op -> mat2vec(get_data(op)'), op_list)
363363
# Create the Krylov subspace with kron(H₀.data, H₀.data) just for initialize
364364
expv_cache = arnoldi(kron(H₀.data, H₀.data), mat2vec(ket2dm(ψ0).data), krylov_dim)
365-
dsf_identity = I(prod(H₀.dimensions))
365+
dsf_identity = Eye(prod(H₀.dimensions))
366366
dsf_displace_cache_left = sum(op -> ScalarOperator(one(T)) * MatrixOperator(kron(op.data, dsf_identity)), op_list)
367367
dsf_displace_cache_left_dag =
368368
sum(op -> ScalarOperator(one(T)) * MatrixOperator(kron(sparse(op.data'), dsf_identity)), op_list)

0 commit comments

Comments
 (0)