Skip to content

Commit

Permalink
added missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jrevels committed Jan 6, 2015
1 parent ce163d8 commit 3e50b5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/arrays/quarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,22 @@ abstract AbstractQuArray{B<:AbstractBasis,T,N} <: AbstractArray{T,N}
############################
statevec(i::Int, fb::FiniteBasis) = QuArray(single_coeff(i, length(fb)), fb)
statevec(i::Int, lens::Int...=i) = statevec(i, FiniteBasis(lens))

zeros(qa::QuArray) = QuArray(zeros(qa.coeffs), qa.bases)
eye(qa::QuArray) = QuArray(eye(qa.coeffs), qa.bases)

######################
# Property Functions #
######################
bases(qa::QuArray) = qa.bases
coeffs(qa::QuArray) = qa.coeffs

size(qa::QuArray, i...) = size(qa.coeffs, i...)

########################
# Array-like functions #
########################
similar{B,T}(qa::QuArray{B,T}, element_type=T) = QuArray(similar(qa.coeffs, T), qa.bases)
# is there a way to properly define the below for
# Is there a way to properly define the below for
# any arbitrary basis? Obviously doesn't make sense
# for B<:AbstractInfiniteBasis, and I'm reluctant to
# enforce that every B<:AbstractFiniteBasis will have a
Expand All @@ -81,13 +83,9 @@ abstract AbstractQuArray{B<:AbstractBasis,T,N} <: AbstractArray{T,N}
transpose(qa::QuVector) = QuArray(transpose(qa.coeffs), qa.bases)
transpose(qa::QuMatrix) = QuArray(transpose(qa.coeffs), reverse(qa.bases))

zeros(qa::QuArray) = QuArray(zeros(qa.coeffs), qa.bases)
eye(qa::QuArray) = QuArray(eye(qa.coeffs), qa.bases)

######################
# Printing Functions #
######################

function summary{B,T,N,A}(qa::QuArray{B,T,N,A})
return "$(sizenotation(size(qa))) QuArray\n" *
"...bases: $B,\n" *
Expand Down
5 changes: 4 additions & 1 deletion src/bases/finitebasis.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import Base: length,
import Base: convert,
repr,
show,
length,
size

###############
Expand Down

0 comments on commit 3e50b5e

Please sign in to comment.