Skip to content

Commit

Permalink
fix getindex for LazyMStructure
Browse files Browse the repository at this point in the history
  • Loading branch information
kalmarek committed Dec 12, 2023
1 parent 83f0167 commit ea9d8dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mstructures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ end

basis(mstr::LazyMStructure) = mstr.basis

function Base.getindex(::LazyMStructure{<:DiracBasis{T}}, x::T, y::T) where {T}
gh = g * h
gh in basis(mstr) || throw(ProductNotWellDefined(g, h, "$g · $h = $gh"))
return DiracDelta(gh)
function Base.getindex(mstr::LazyMStructure{T,<:DiracBasis{T}}, x::T, y::T) where {T}
xy = x * y
xy in basis(mstr) || throw(ProductNotWellDefined(x, x, "$x · $y = $xy"))
return DiracDelta(xy)
end

0 comments on commit ea9d8dc

Please sign in to comment.