Skip to content

Commit f54f613

Browse files
committed
change removeunitspace to look for any unit instead of all
1 parent b8a3253 commit f54f613

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/spaces/productspace.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,15 @@ and [`insertrightunitspace`](@ref insertrightunitspace(::ProductSpace, ::Val{i})
318318
"""
319319
function removeunitspace(P::ProductSpace, ::Val{i}) where {i}
320320
1 i length(P) || _boundserror(P, i)
321-
isisomorphic(P[i], unitspace(P[i])) || _nontrivialspaceerror(P, i)
321+
I = sectortype(P)
322+
if isa(UnitStyle(I), SimpleUnit)
323+
isisomorphic(P[i], unitspace(P[i])) || _nontrivialspaceerror(P, i)
324+
else
325+
isisomorphic(P[i], leftunitspace(P[i])) ||
326+
isisomorphic(P[i], rightunitspace(P[i])) ||
327+
isisomorphic(P[i], unitspace(P[i])) ||
328+
_nontrivialspaceerror(P, i)
329+
end
322330
return ProductSpace{spacetype(P)}(TupleTools.deleteat(P.spaces, i))
323331
end
324332

0 commit comments

Comments
 (0)