Skip to content

Commit

Permalink
Proper parametric type for CompositeBasis
Browse files Browse the repository at this point in the history
  • Loading branch information
david-pl committed Sep 10, 2018
1 parent 1cd1bfa commit dec97eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ Stores the subbases in a vector and creates the shape vector directly
from the shape vectors of these subbases. Instead of creating a CompositeBasis
directly `tensor(b1, b2...)` or `b1 ⊗ b2 ⊗ …` can be used.
"""
mutable struct CompositeBasis{B<:Basis} <: Basis
mutable struct CompositeBasis{B<:Vector{Basis}} <: Basis
shape::Vector{Int}
bases::Vector{B}
bases::B
end
CompositeBasis(bases::Vector{B}) where B<:Basis = CompositeBasis{B}(Int[prod(b.shape) for b in bases], bases)
CompositeBasis(bases::B) where B<:Vector{Basis} = CompositeBasis{B}(Int[prod(b.shape) for b in bases], bases)
CompositeBasis(bases::Basis...) = CompositeBasis(Basis[bases...])

==(b1::CompositeBasis, b2::CompositeBasis) = equal_shape(b1.shape, b2.shape) && equal_bases(b1.bases, b2.bases)
Expand Down

0 comments on commit dec97eb

Please sign in to comment.