Skip to content

Commit

Permalink
revise TensorMap constructor and
Browse files Browse the repository at this point in the history
  • Loading branch information
Jutho committed Jul 26, 2023
1 parent 59ac508 commit 34acb33
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 186 deletions.
4 changes: 2 additions & 2 deletions src/TensorKit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ struct SectorMismatch{S<:Union{Nothing, String}} <: TensorException
end
SectorMismatch()=SectorMismatch{Nothing}(nothing)
Base.show(io::IO, ::SectorMismatch{Nothing}) = print(io, "SectorMismatch()")
Base.show(io::IO, e::SectorMismatch) = print(io, "SectorMismatch(", e.message, ")")
Base.show(io::IO, e::SectorMismatch) = print(io, "SectorMismatch(\"", e.message, "\")")

# Exception type for all errors related to vector space mismatch
struct SpaceMismatch{S<:Union{Nothing, String}} <: TensorException
message::S
end
SpaceMismatch()=SpaceMismatch{Nothing}(nothing)
Base.show(io::IO, ::SpaceMismatch{Nothing}) = print(io, "SpaceMismatch()")
Base.show(io::IO, e::SpaceMismatch) = print(io, "SpaceMismatch(", e.message, ")")
Base.show(io::IO, e::SpaceMismatch) = print(io, "SpaceMismatch(\"", e.message, "\")")

# Exception type for all errors related to invalid tensor index specification.
struct IndexError{S<:Union{Nothing, String}} <: TensorException
Expand Down
2 changes: 1 addition & 1 deletion src/sectors/sectors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Nsymbol(::Trivial, ::Trivial, ::Trivial) = true

# trait to describe the fusion of superselection sectors
abstract type FusionStyle end
struct UniqueFusion <: FusionStyle # unique fusion output when fusion two sectors
struct UniqueFusion <: FusionStyle # unique fusion output when fusing two sectors
end
abstract type MultipleFusion <: FusionStyle end
struct SimpleFusion <: MultipleFusion # multiple fusion but multiplicity free
Expand Down
2 changes: 2 additions & 0 deletions src/tensors/adjoint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const AdjointTrivialTensorMap{S<:IndexSpace, N₁, N₂, A<:DenseMatrix} =
Base.adjoint(t::TensorMap) = AdjointTensorMap(t)
Base.adjoint(t::AdjointTensorMap) = t.parent

Base.similar(t::AdjointTensorMap, T::Type, P::TensorMapSpace) = similar(t', T, P)

# Properties
codomain(t::AdjointTensorMap) = domain(t.parent)
domain(t::AdjointTensorMap) = codomain(t.parent)
Expand Down
Loading

0 comments on commit 34acb33

Please sign in to comment.