|
135 | 135 | d = (dims(codomain(b), f₁.uncoupled)..., dims(domain(b), f₂.uncoupled)...) |
136 | 136 | n1 = d[1] * d[2] |
137 | 137 | n2 = d[3] * d[4] |
138 | | - data_t = similarmatrixtype(storagetype(b))(undef, (n1, n2)) |
139 | | - data = sreshape(StridedView(data_t), d) |
| 138 | + data_parent = storagetype(b)(undef, prod(d)) |
| 139 | + data = sreshape(StridedView(data_parent), d) |
140 | 140 | fill!(data, zero(eltype(b))) |
141 | 141 |
|
142 | 142 | r = _braiding_factor(f₁, f₂, b.adjoint) |
@@ -186,10 +186,10 @@ function block(b::BraidingTensor, s::Sector) |
186 | 186 | m = blockdim(codomain(b), s) |
187 | 187 | n = blockdim(domain(b), s) |
188 | 188 |
|
189 | | - m * n == 0 && return similarmatrixtype(storagetype(b))(undef, (m, n)) # s ∉ blocksectors(b) |
| 189 | + data = reshape(storagetype(b)(undef, m * n), (m, n)) |
190 | 190 |
|
191 | | - data = similarmatrixtype(storagetype(b))(undef, (m, n)) |
192 | | - data = fill!(data, zero(eltype(b))) |
| 191 | + m * n == 0 && return data # s ∉ blocksectors(b) |
| 192 | + fill!(data, zero(eltype(b))) |
193 | 193 |
|
194 | 194 | if sectortype(b) === Trivial |
195 | 195 | return _trivial_subblock!(data, b) |
|
0 commit comments