From f1138f59286af961c5dbd26a23213e05718d9968 Mon Sep 17 00:00:00 2001 From: amitjamadagni Date: Tue, 21 Apr 2015 00:46:48 +0530 Subject: [PATCH] Exports edited. Tests changed. --- src/arrays/constructors.jl | 3 +-- test/operatortest.jl | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/arrays/constructors.jl b/src/arrays/constructors.jl index 4a163ab..bcbebdf 100644 --- a/src/arrays/constructors.jl +++ b/src/arrays/constructors.jl @@ -33,5 +33,4 @@ end coherentstatevec(n::Int, alpha::Number) = displaceop(n,alpha)*statevec(1,FiniteBasis(n)) export statevec, - coherentstatevec, - coherentstatevec_inf + coherentstatevec diff --git a/test/operatortest.jl b/test/operatortest.jl index ad302b2..7a38ead 100644 --- a/test/operatortest.jl +++ b/test/operatortest.jl @@ -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)