From a3d4e5df19c0106847cc5847f6729f7a961f06a1 Mon Sep 17 00:00:00 2001 From: lkdvos Date: Tue, 29 Sep 2026 14:35:44 -0400 Subject: [PATCH] update VectorInterface compat to add v0.7 --- Project.toml | 2 +- docs/src/Changelog.md | 2 ++ src/tensors/linalg.jl | 10 ++++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 83093ea5b..784d3bfac 100644 --- a/Project.toml +++ b/Project.toml @@ -70,5 +70,5 @@ TensorKitSectors = "0.3.7" TensorOperations = "5.5.2, 5.6" TimerOutputs = "1" TupleTools = "1.5" -VectorInterface = "0.6" +VectorInterface = "0.6, 0.7" julia = "1.10" diff --git a/docs/src/Changelog.md b/docs/src/Changelog.md index e3baac971..64056075f 100644 --- a/docs/src/Changelog.md +++ b/docs/src/Changelog.md @@ -24,6 +24,8 @@ When releasing a new version, move the "Unreleased" changes to a new version sec ### Changed +- Extend VectorInterface compat to include v0.7 + ### Deprecated ### Removed diff --git a/src/tensors/linalg.jl b/src/tensors/linalg.jl index 50a695654..b97a52304 100644 --- a/src/tensors/linalg.jl +++ b/src/tensors/linalg.jl @@ -326,11 +326,13 @@ function LinearAlgebra.tr(t::AbstractTensorMap) return s end -# LinearAlgebra's BLAS wrappers do not accept `VectorInterface.One`/`Zero`, e.g. -# `herk_wrapper!` (hit by `mul!(C, A, A')`) calls `isreal` on the scalars. +# LinearAlgebra's BLAS wrappers do not accept `VectorInterface.One`/`Zero` before +# VectorInterface v0.7, e.g. `herk_wrapper!` (hit by `mul!(C, A, A')`) calls `isreal`. _blasscalar(α::Number) = α -_blasscalar(::One) = true -_blasscalar(::Zero) = false +@static if !(One <: Real) + _blasscalar(::One) = true + _blasscalar(::Zero) = false +end # TensorMap multiplication function LinearAlgebra.mul!(