Skip to content

Commit

Permalink
Remove multiplicable
Browse files Browse the repository at this point in the history
  • Loading branch information
akirakyle committed Nov 28, 2024
1 parent def57c1 commit 8a5aa31
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
32 changes: 0 additions & 32 deletions src/bases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,38 +221,6 @@ function check_samebases(b)
end
end


"""
multiplicable(a, b)
Check if two objects are multiplicable.
"""
multiplicable(b1::Basis, b2::Basis) = b1==b2

function multiplicable(b1::CompositeBasis, b2::CompositeBasis)
if !equal_shape(b1.shape,b2.shape)
return false
end
for i=1:length(b1.shape)
if !multiplicable(b1.bases[i], b2.bases[i])
return false
end
end
return true
end

"""
check_multiplicable(a, b)
Throw an [`IncompatibleBases`](@ref) error if the objects are
not multiplicable.
"""
function check_multiplicable(b1, b2)
if BASES_CHECK[] && !multiplicable(b1, b2)
throw(IncompatibleBases())
end
end

"""
reduced(a, indices)
Expand Down
1 change: 0 additions & 1 deletion src/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ check_samebases(a::AbstractSuperOperator) = check_samebases(fullbasis(a))::Bool
check_samebases(a::AbstractOperator, b::AbstractOperator) = check_samebases(fullbasis(a), fullbasis(b))::Bool
check_samebases(a::AbstractSuperOperator, b::AbstractSuperOperator) = check_samebases(fullbasis(a), fullbasis(b))::Bool

Check warning on line 8 in src/linalg.jl

View check run for this annotation

Codecov / codecov/patch

src/linalg.jl#L1-L8

Added lines #L1 - L8 were not covered by tests

multiplicable(a::AbstractOperator, b::AbstractOperator) = multiplicable(fullbasis(a).right, fullbasis(b).left)
dagger(a::AbstractOperator) = arithmetic_unary_error("Hermitian conjugate", a)
transpose(a::AbstractOperator) = arithmetic_unary_error("Transpose", a)
directsum(a::AbstractOperator...) = reduce(directsum, a)
Expand Down

0 comments on commit 8a5aa31

Please sign in to comment.