From 52eb79712bed2808dbd09bb384ef925900d4ff44 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 14 Nov 2023 15:35:58 +0100 Subject: [PATCH] use derive _int_type for action (which is easily user-definable) * also bump the default to UInt32, as we are hitting the limits of UInt16 already ;) --- src/ext_homomorphisms.jl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ext_homomorphisms.jl b/src/ext_homomorphisms.jl index f103534..50330c1 100644 --- a/src/ext_homomorphisms.jl +++ b/src/ext_homomorphisms.jl @@ -17,11 +17,12 @@ PermutationGroups.degree(hom::InducedActionHomomorphism) = length(basis(hom)) coeff_type(hom::InducedActionHomomorphism) = coeff_type(action(hom)) _int_type(::Type{<:StarAlgebras.AbstractBasis{T,I}}) where {T,I} = I -_int_type(hom::InducedActionHomomorphism) = _int_type(typeof(basis(hom))) -# Exceeding typemax(UInt16) here would mean e.g. that you're trying to block-diagonalize -# an SDP constraint of size 65535×65535, which is highly unlikely ;) -_int_type(::Type{<:InducedActionHomomorphism}) = UInt16 +# Exceeding typemax(UInt32) here would mean e.g. that you're trying to block-diagonalize +# an SDP constraint of size 4_294_967_295 × 4_294_967_295, which is highly unlikely ;) +_int_type(::Type{<:Action}) = UInt32 +_int_type(ac::Action) = _int_type(typeof(ac)) +_int_type(hom::InducedActionHomomorphism) = _int_type(action(hom)) function induce(hom::InducedActionHomomorphism, g::GroupElement) return induce(action(hom), hom, g) @@ -43,7 +44,7 @@ end function ExtensionHomomorphism(action::Action, basis) return ExtensionHomomorphism( - _int_type(ExtensionHomomorphism), + _int_type(action), action, basis, ) @@ -104,7 +105,7 @@ function CachedExtensionHomomorphism( precompute = false, ) return CachedExtensionHomomorphism( - _int_type(ExtensionHomomorphism), + _int_type(action), G, action, basis;