diff --git a/NDTensors/src/blocksparse/diagblocksparse.jl b/NDTensors/src/blocksparse/diagblocksparse.jl index 6ce214fe56..8620e576c5 100644 --- a/NDTensors/src/blocksparse/diagblocksparse.jl +++ b/NDTensors/src/blocksparse/diagblocksparse.jl @@ -343,7 +343,9 @@ function similar( end # NDTensors.similar -function similar(storagetype::Type{<:DiagBlockSparse}, blockoffsets::BlockOffsets, dims::Tuple) +function similar( + storagetype::Type{<:DiagBlockSparse}, blockoffsets::BlockOffsets, dims::Tuple +) # TODO: Improve this with FillArrays.jl # data = similar(datatype(storagetype), nnz(blockoffsets, dims)) data = zero(datatype(storagetype)) diff --git a/test/base/test_qndiagitensor.jl b/test/base/test_qndiagitensor.jl index b392cb2a95..fa7b344fa6 100644 --- a/test/base/test_qndiagitensor.jl +++ b/test/base/test_qndiagitensor.jl @@ -112,7 +112,7 @@ using ITensors, Test @test x[1, 1] == c @test dag(x)[1, 1] == conj(c) @test (x * dag(x))[] == 2 * abs2(c) - @test (x * dag(x))[] ≈ norm(x) ^ 2 + @test (x * dag(x))[] ≈ norm(x)^2 end @testset "Regression test for printing a QN Diag ITensor" begin