Skip to content

Commit

Permalink
v0.7 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
david-pl committed Aug 14, 2018
1 parent e897c16 commit c2ad518
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
julia 0.7-beta2
OrdinaryDiffEq 4.7.1
julia 0.7
OrdinaryDiffEq 4.8.0
DiffEqCallbacks 2.1
StochasticDiffEq 5.6.0
RecursiveArrayTools 0.17.2
Expand Down
2 changes: 0 additions & 2 deletions src/QuantumOptics.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
__precompile__()

module QuantumOptics

using SparseArrays, LinearAlgebra
Expand Down
2 changes: 1 addition & 1 deletion test/test_embed.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Random, SparseArrays, LinearAlgebra

@testset "embed" begin

srand(0)
Random.seed!(0)

# Set up operators
spinbasis = SpinBasis(1//2)
Expand Down
2 changes: 1 addition & 1 deletion test/test_fock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Random, SparseArrays, LinearAlgebra

@testset "fock" begin

srand(0)
Random.seed!(0)

D(op1::Operator, op2::Operator) = abs(tracedistance_nh(dense(op1), dense(op2)))
randstate(b) = normalize(Ket(b, rand(ComplexF64, length(b))))
Expand Down
2 changes: 1 addition & 1 deletion test/test_manybody.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Random, SparseArrays, LinearAlgebra

@testset "manybody" begin

srand(0)
Random.seed!(0)

D(op1::Operator, op2::Operator) = abs(tracedistance_nh(dense(op1), dense(op2)))
D(x1::StateVector, x2::StateVector) = norm(x2-x1)
Expand Down
2 changes: 1 addition & 1 deletion test/test_operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ end

@testset "operators" begin

srand(0)
Random.seed!(0)

b1 = GenericBasis(5)
b2 = GenericBasis(3)
Expand Down
2 changes: 1 addition & 1 deletion test/test_operators_dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Random, SparseArrays, LinearAlgebra

@testset "operators-dense" begin

srand(0)
Random.seed!(0)

D(op1::Operator, op2::Operator) = abs(tracedistance_nh(dense(op1), dense(op2)))
D(x1::StateVector, x2::StateVector) = norm(x2-x1)
Expand Down
2 changes: 1 addition & 1 deletion test/test_operators_lazyproduct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using LinearAlgebra, Random

@testset "operators-lazyproduct" begin

srand(0)
Random.seed!(0)

D(op1::Operator, op2::Operator) = abs(tracedistance_nh(dense(op1), dense(op2)))
D(x1::StateVector, x2::StateVector) = norm(x2-x1)
Expand Down
2 changes: 1 addition & 1 deletion test/test_operators_lazysum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using LinearAlgebra, Random

@testset "operators-lazysum" begin

srand(0)
Random.seed!(0)

D(op1::Operator, op2::Operator) = abs(tracedistance_nh(dense(op1), dense(op2)))
D(x1::StateVector, x2::StateVector) = norm(x2-x1)
Expand Down
2 changes: 1 addition & 1 deletion test/test_operators_lazytensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ end

@testset "operators-lazytensor" begin

srand(0)
Random.seed!(0)

D(op1::Operator, op2::Operator) = abs(tracedistance_nh(dense(op1), dense(op2)))
D(x1::StateVector, x2::StateVector) = norm(x2-x1)
Expand Down
2 changes: 1 addition & 1 deletion test/test_operators_sparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mutable struct TestOperator <: Operator; end

@testset "operators-sparse" begin

srand(0)
Random.seed!(0)

D(op1::Operator, op2::Operator) = abs(tracedistance_nh(dense(op1), dense(op2)))
D(x1::StateVector, x2::StateVector) = norm(x2-x1)
Expand Down
2 changes: 1 addition & 1 deletion test/test_particle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using FFTW, LinearAlgebra, Random

@testset "particle" begin

srand(0)
Random.seed!(0)

D(op1::Operator, op2::Operator) = abs(tracedistance_nh(dense(op1), dense(op2)))

Expand Down
2 changes: 1 addition & 1 deletion test/test_phasespace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Random, LinearAlgebra

@testset "phasespace" begin

srand(0)
Random.seed!(0)

D(op1::Operator, op2::Operator) = abs(tracedistance_nh(dense(op1), dense(op2)))

Expand Down
2 changes: 1 addition & 1 deletion test/test_spectralanalysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mutable struct SpectralanalysisTestOperator <: Operator end

@testset "spectralanalysis" begin

srand(0)
Random.seed!(0)

sprandop(b) = sparse(DenseOperator(b, rand(ComplexF64, length(b), length(b))))

Expand Down
8 changes: 4 additions & 4 deletions test/test_state_definitions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using QuantumOptics
@testset "state_definitions" begin

n=30
b=FockBasis(n)
b=FockBasis(n)
omega=40.3
T=2.3756
r=thermalstate(omega*number(b),T)
Expand All @@ -14,7 +14,7 @@ end
S=entropy_vn(r)
z=sum(exp.(-[0:n;]*omega))
s=expect(omega*number(b),r)/T+log(z)
isapprox(S,s)
isapprox(S,s)

alpha=rand()+im*rand()
r=coherentthermalstate(b,omega*number(b),T,alpha)
Expand All @@ -23,7 +23,7 @@ r=coherentthermalstate(b,omega*number(b),T,alpha)
@test isapprox(entropy_vn(r),S)

rp=phase_average(r)
@test isapprox(expect(number(b),rp),abs(alpha)^2+1/(exp(omega/T)-1))
@test isapprox(expect(number(b),rp),abs(alpha)^2+1/(exp(omega/T)-1), atol=1e-14)
@test isapprox(expect(destroy(b),rp),0)
for k=1:n
@test isapprox(rp.data[k,k],r.data[k,k])
Expand All @@ -36,5 +36,5 @@ end
@test isapprox(expect(number(b),rpas),1/(exp(omega/T)-1))
@test isapprox(expect(destroy(b),rpas),0)
@test isapprox(entropy_vn(rpas),S)

end # testset
2 changes: 1 addition & 1 deletion test/test_states.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using LinearAlgebra, Random

@testset "states" begin

srand(0)
Random.seed!(0)

D(x1::Number, x2::Number) = abs(x2-x1)
D(x1::StateVector, x2::StateVector) = norm(x2-x1)
Expand Down
2 changes: 1 addition & 1 deletion test/test_transformations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Random, LinearAlgebra

@testset "transformation" begin

srand(0)
Random.seed!(0)

D(op1::Operator, op2::Operator) = abs(tracedistance_nh(dense(op1), dense(op2)))
D(x::Ket, y::Ket) = norm(x-y)
Expand Down

0 comments on commit c2ad518

Please sign in to comment.