diff --git a/src/tensors/abstracttensor.jl b/src/tensors/abstracttensor.jl index d8ca7354f..e2025ea89 100644 --- a/src/tensors/abstracttensor.jl +++ b/src/tensors/abstracttensor.jl @@ -3,7 +3,7 @@ # Abstract Tensor type #---------------------- """ - abstract type AbstractTensorMap{T<:Number, S<:IndexSpace, N₁, N₂} end + abstract type AbstractTensorMap{T <: Number, S <: IndexSpace, N₁, N₂} end Abstract supertype of all tensor maps, i.e. linear maps between tensor products of vector spaces of type `S<:IndexSpace`, with element type `T`. An `AbstractTensorMap` maps from an @@ -12,7 +12,7 @@ input space of type `ProductSpace{S, N₂}` to an output space of type `ProductS abstract type AbstractTensorMap{T <: Number, S <: IndexSpace, N₁, N₂} end """ - AbstractTensor{T,S,N} = AbstractTensorMap{T,S,N,0} + AbstractTensor{T, S, N} = AbstractTensorMap{T, S, N, 0} Abstract supertype of all tensors, i.e. elements in the tensor product space of type `ProductSpace{S, N}`, with element type `T`. diff --git a/src/tensors/adjoint.jl b/src/tensors/adjoint.jl index 2297643ce..f1c373cc8 100644 --- a/src/tensors/adjoint.jl +++ b/src/tensors/adjoint.jl @@ -1,12 +1,12 @@ # AdjointTensorMap: lazy adjoint #==========================================================# """ - struct AdjointTensorMap{T, S, N₁, N₂, TT<:AbstractTensorMap} <: AbstractTensorMap{T, S, N₁, N₂} + struct AdjointTensorMap{T <: Number, S <: IndexSpace, N₁, N₂, TT <: AbstractTensorMap} <: AbstractTensorMap{T, S, N₁, N₂} Specific subtype of [`AbstractTensorMap`](@ref) that is a lazy wrapper for representing the adjoint of an instance of [`AbstractTensorMap`](@ref). """ -struct AdjointTensorMap{T, S, N₁, N₂, TT <: AbstractTensorMap{T, S, N₂, N₁}} <: +struct AdjointTensorMap{T <: Number, S <: IndexSpace, N₁, N₂, TT <: AbstractTensorMap{T, S, N₂, N₁}} <: AbstractTensorMap{T, S, N₁, N₂} parent::TT end diff --git a/src/tensors/braidingtensor.jl b/src/tensors/braidingtensor.jl index 0635f7988..ea72f713b 100644 --- a/src/tensors/braidingtensor.jl +++ b/src/tensors/braidingtensor.jl @@ -2,7 +2,7 @@ # special (2,2) tensor that implements a standard braiding operation #====================================================================# """ - struct BraidingTensor{T, S <: IndexSpace, A <: DenseVector{T}} <: AbstractTensorMap{T, S, 2, 2} + struct BraidingTensor{T <: Number, S <: IndexSpace, A <: DenseVector{T}} <: AbstractTensorMap{T, S, 2, 2} BraidingTensor(V1::S, V2::S, adjoint::Bool=false) where {S<:IndexSpace} BraidingTensor{T, S, A}(V1::S, V2::S, adjoint::Bool=false) where {T, S, A} @@ -14,7 +14,7 @@ It holds that `domain(BraidingTensor(V1, V2)) == V1 ⊗ V2` and controls the array type of the braiding tensor used when indexing and multiplying with other tensors. """ -struct BraidingTensor{T, S, A <: DenseVector{T}} <: AbstractTensorMap{T, S, 2, 2} +struct BraidingTensor{T <: Number, S <: IndexSpace, A <: DenseVector{T}} <: AbstractTensorMap{T, S, 2, 2} V1::S V2::S adjoint::Bool diff --git a/src/tensors/diagonal.jl b/src/tensors/diagonal.jl index 630f1866a..c37838745 100644 --- a/src/tensors/diagonal.jl +++ b/src/tensors/diagonal.jl @@ -1,6 +1,6 @@ # DiagonalTensorMap #==========================================================# -struct DiagonalTensorMap{T, S <: IndexSpace, A <: DenseVector{T}} <: AbstractTensorMap{T, S, 1, 1} +struct DiagonalTensorMap{T <: Number, S <: IndexSpace, A <: DenseVector{T}} <: AbstractTensorMap{T, S, 1, 1} data::A domain::S # equals codomain @@ -33,9 +33,9 @@ storagetype(::Type{<:DiagonalTensorMap{T, S, A}}) where {T, S, A <: DenseVector{ #-------------------------------- # undef constructors """ - DiagonalTensorMap{T}(undef, domain::S) where {T,S<:IndexSpace} + DiagonalTensorMap{T}(undef, domain::S) where {T, S <: IndexSpace} # expert mode: select storage type `A` - DiagonalTensorMap{T,S,A}(undef, domain::S) where {T,S<:IndexSpace,A<:DenseVector{T}} + DiagonalTensorMap{T, S, A}(undef, domain::S) where {T, S <: IndexSpace, A <: DenseVector{T}} Construct a `DiagonalTensorMap` with uninitialized data. """ diff --git a/src/tensors/tensor.jl b/src/tensors/tensor.jl index 1aeb0070c..d094c40c9 100644 --- a/src/tensors/tensor.jl +++ b/src/tensors/tensor.jl @@ -2,12 +2,12 @@ # general tensor implementation with arbitrary symmetries #==========================================================# """ - struct TensorMap{T, S<:IndexSpace, N₁, N₂, A<:DenseVector{T}} <: AbstractTensorMap{T, S, N₁, N₂} + struct TensorMap{T <: Number, S <: IndexSpace, N₁, N₂, A <: DenseVector{T}} <: AbstractTensorMap{T, S, N₁, N₂} Specific subtype of [`AbstractTensorMap`](@ref) for representing tensor maps (morphisms in a tensor category), where the data is stored in a dense vector. """ -struct TensorMap{T, S <: IndexSpace, N₁, N₂, A <: DenseVector{T}} <: AbstractTensorMap{T, S, N₁, N₂} +struct TensorMap{T <: Number, S <: IndexSpace, N₁, N₂, A <: DenseVector{T}} <: AbstractTensorMap{T, S, N₁, N₂} data::A space::TensorMapSpace{S, N₁, N₂} @@ -20,7 +20,7 @@ struct TensorMap{T, S <: IndexSpace, N₁, N₂, A <: DenseVector{T}} <: Abstrac end """ - Tensor{T, S, N, A<:DenseVector{T}} = TensorMap{T, S, N, 0, A} + Tensor{T <: Number, S <: IndexSpace, N, A <: DenseVector{T}} = TensorMap{T, S, N, 0, A} Specific subtype of [`AbstractTensor`](@ref) for representing tensors whose data is stored in a dense vector. @@ -28,7 +28,7 @@ in a dense vector. A `Tensor{T, S, N, A}` is actually a special case `TensorMap{T, S, N, 0, A}`, i.e. a tensor map with only a non-trivial output space. """ -const Tensor{T, S, N, A} = TensorMap{T, S, N, 0, A} +const Tensor{T <: Number, S <: IndexSpace, N, A <: DenseVector{T}} = TensorMap{T, S, N, 0, A} # Utility functions: # ------------------