Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/tensors/abstracttensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`.
Expand Down
4 changes: 2 additions & 2 deletions src/tensors/adjoint.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/tensors/braidingtensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/tensors/diagonal.jl
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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.
"""
Expand Down
8 changes: 4 additions & 4 deletions src/tensors/tensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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₂}

Expand All @@ -20,15 +20,15 @@ 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.

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:
# ------------------
Expand Down
Loading