Skip to content

Commit

Permalink
Exports edited. Tests changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
amitjamadagni committed Apr 20, 2015
1 parent 5dca645 commit f1138f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/arrays/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ end
coherentstatevec(n::Int, alpha::Number) = displaceop(n,alpha)*statevec(1,FiniteBasis(n))

export statevec,
coherentstatevec,
coherentstatevec_inf
coherentstatevec
10 changes: 4 additions & 6 deletions test/operatortest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ m = momentumop(2)
@assert coeffs(commutator(sigma_x, p)) == spzeros(2,2)
@assert coeffs(commutator(sigma_y, m)) == spzeros(2,2)

csvd = coherentstatevec_inf(20,1)
csvo = displaceop(20,1)*statevec(1,FiniteBasis(20))
@test_approx_eq_eps coeffs(csvd)[1] coeffs(csvo)[1] 1e-8
coherentstate_inf = QuBase.coherentstatevec_inf(20,1)
coherentstate = displaceop(20,1)*statevec(1,FiniteBasis(20))
@test_approx_eq_eps coeffs(coherentstate_inf)[1] coeffs(coherentstate)[1] 1e-8

############################
# Squeezing Operators Test #
############################

@assert squeezingop(2,1.0)== QuArray(eye(2))
@assert squeezingop(lowerop(2), lowerop(2), 1.0) == squeezingop(2,1)


@assert squeezingop(lowerop(2), QuArray(eye(2)), 2.0)' == displaceop(2,1)

0 comments on commit f1138f5

Please sign in to comment.