Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kronecker power for integer one #136

Open
Wu-Chenyang opened this issue Dec 9, 2024 · 1 comment
Open

Kronecker power for integer one #136

Wu-Chenyang opened this issue Dec 9, 2024 · 1 comment

Comments

@Wu-Chenyang
Copy link

struct KroneckerPower{T,TA<:AbstractMatrix{T}} <: AbstractKroneckerProduct{T}
    A::TA
    pow::Int
    function KroneckerPower(A::AbstractMatrix, pow::Integer)
        @assert pow  2 "KroneckerPower only makes sense for powers greater than 1"
        return new{eltype(A),typeof(A)}(A, Int(pow))
    end
end

Currently, the Kronecker power is only implemented for integers greater than one, but isn't it natural to have M⊗1 equal to M?

@MichielStock
Copy link
Owner

It might, but the problem is that M⊗1would be a Matrix rather than a KroneckerProduct, which would be a type instability. I have implemented this in #138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants