Skip to content

spinmatrices is too restrictive on its input type #72

Description

@ogauthe

Hi!

using HalfIntegers:half
using TensorKit
using MPSKitModels: S_exchange

sds = S_exchange(Float64, Trivial; spin=half(1))  # MethodError
sds = S_exchange(Float64, Trivial; spin=0.5)  # MethodError
ERROR: MethodError: no method matching spinmatrices(::HalfIntegers.Half{Int64}, ::Type{ComplexF64})

Closest candidates are:
  spinmatrices(::Union{Rational{Int64}, Int64}, ::Any)
   @ MPSKitModels ~/.julia/packages/MPSKitModels/abQMO/src/operators/spinoperators.jl:20

Stacktrace:
 [1] S_x(elt::Type{ComplexF64}, ::Type{Trivial}; spin::HalfIntegers.Half{Int64})
   @ MPSKitModels ~/.julia/packages/MPSKitModels/abQMO/src/operators/spinoperators.jl:63
 [2] S_plus(elt::Type{ComplexF64}, ::Type{Trivial}; spin::HalfIntegers.Half{Int64})
   @ MPSKitModels ~/.julia/packages/MPSKitModels/abQMO/src/operators/spinoperators.jl:257
 [3] S_plusmin(elt::Type{ComplexF64}, ::Type{Trivial}; spin::HalfIntegers.Half{Int64})
   @ MPSKitModels ~/.julia/packages/MPSKitModels/abQMO/src/operators/spinoperators.jl:408
 [4] S_exchange(elt::Type{Float64}, symmetry::Type{Trivial}; spin::HalfIntegers.Half{Int64})
   @ MPSKitModels ~/.julia/packages/MPSKitModels/abQMO/src/operators/spinoperators.jl:452
 [5] top-level scope
   @ REPL[44]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions