Skip to content

Commit

Permalink
improve code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
ytdHuang committed Nov 21, 2024
1 parent faf363a commit b895596
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/heom_matrices/heom_matrix_base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export addBosonDissipator, addFermionDissipator, addTerminator
General HEOM superoperator matrix.
# Fields
- `data<:Union{AbstractSparseMatrix,AbstractSciMLOperator}` : the HEOM superoperator matrix
- `data<:Union{AbstractSparseMatrix}` : the HEOM superoperator matrix
- `dims` : the dimension list of the coupling operator (should be equal to the system dims).
- `N` : the number of auxiliary density operators
- `parity`: the parity label (`EVEN` or `ODD`).
"""
struct HEOMSuperOp{DT<:Union{AbstractSparseMatrix,AbstractSciMLOperator}}
struct HEOMSuperOp{DT<:AbstractSparseMatrix}
data::DT
dims::SVector
N::Int
Expand Down Expand Up @@ -183,7 +183,7 @@ function Base.:(+)(Sup1::HEOMSuperOp, Sup2::HEOMSuperOp)
return HEOMSuperOp(Sup1.data + Sup2.data, Sup1.dims, Sup1.N, Sup1.parity)
end

Base.:(+)(M::MatrixOperator, Sup::HEOMSuperOp) = HEOMSuperOp(MatrixOperator(M.A + Sup.data), Sup.dims, Sup.N, Sup.parity)
Base.:(+)(M::MatrixOperator, Sup::HEOMSuperOp) = MatrixOperator(M.A + Sup.data)
Base.:(+)(M::AbstractSciMLOperator, Sup::HEOMSuperOp) = M + Sup.data

function Base.:(+)(M::AbstractHEOMLSMatrix, Sup::HEOMSuperOp)
Expand All @@ -200,7 +200,7 @@ function Base.:(-)(Sup1::HEOMSuperOp, Sup2::HEOMSuperOp)
return HEOMSuperOp(Sup1.data - Sup2.data, Sup1.dims, Sup1.N, Sup1.parity)
end

Base.:(-)(M::MatrixOperator, Sup::HEOMSuperOp) = HEOMSuperOp(MatrixOperator(M.A - Sup.data), Sup.dims, Sup.N, Sup.parity)
Base.:(-)(M::MatrixOperator, Sup::HEOMSuperOp) = MatrixOperator(M.A - Sup.data)
Base.:(-)(M::AbstractSciMLOperator, Sup::HEOMSuperOp) = M - Sup.data

function Base.:(-)(M::AbstractHEOMLSMatrix, Sup::HEOMSuperOp)
Expand Down

0 comments on commit b895596

Please sign in to comment.