Skip to content

Commit

Permalink
Fix julia 1.6 test failure (#57)
Browse files Browse the repository at this point in the history
* ✅ fix display test failures
* 🔖bump version 0.6.3
  • Loading branch information
neversakura authored Mar 25, 2021
1 parent 68a6064 commit cee2ce8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.4' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
- '1.6' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
os:
- ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "OpenQuantumBase"
uuid = "5dd19120-8766-11e9-1ef9-27094038a7db"
authors = ["neversakura <[email protected]>"]
version = "0.6.2"
version = "0.6.3"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand All @@ -24,7 +24,7 @@ QuadGK = "2.4"
SpecialFunctions = "0.8, 0.9, 0.10, 1.0"
StaticArrays = "0.11, 0.12, 1.0"
StatsBase = "0.30, 0.31, 0.32, 0.33"
julia = "1.4"
julia = "1.6"

[extras]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
12 changes: 6 additions & 6 deletions test/utilities/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ u = [1.0 + 0.0im, 1] / sqrt(2)
ρ = u * u'

H = DenseHamiltonian([A, B], [σx, σz])
@test replstr(H) == "\e[36mDenseHamiltonian\e[0m with \e[36mComplex{Float64}\e[0m\nwith size: (2, 2)"
@test replstr(H) == "\e[36mDenseHamiltonian\e[0m with \e[36mComplexF64\e[0m\nwith size: (2, 2)"

annealing = Annealing(H, u)
@test replstr(annealing) == "\e[36mAnnealing\e[0m with \e[36mOpenQuantumBase.DenseHamiltonian{Complex{Float64}}\e[0m and u0 \e[36mArray{Complex{Float64},1}\e[0m\nu0 size: (2,)"
@test replstr(annealing) == "\e[36mAnnealing\e[0m with \e[36mOpenQuantumBase.DenseHamiltonian{ComplexF64}\e[0m and u0 \e[36mVector{ComplexF64}\e[0m\nu0 size: (2,)"

coupling = ConstantCouplings(["Z"])
@test replstr(coupling) == "\e[36mConstantCouplings\e[0m with \e[36mComplex{Float64}\e[0m\nand string representation: [\"Z\"]"
@test replstr(ConstantCouplings([σz])) == "\e[36mConstantCouplings\e[0m with \e[36mComplex{Float64}\e[0m\nand string representation: nothing"
@test replstr(coupling) == "\e[36mConstantCouplings\e[0m with \e[36mComplexF64\e[0m\nand string representation: [\"Z\"]"
@test replstr(ConstantCouplings([σz])) == "\e[36mConstantCouplings\e[0m with \e[36mComplexF64\e[0m\nand string representation: nothing"

η = 0.01; W = 5; fc = 4; T = 12.5
@test replstr(HybridOhmic(W, η, fc, T)) == "Hybrid Ohmic bath instance:\nW (mK): 5.0\nϵl (GHz): 0.02083661222512523\nη (unitless): 0.01\nωc (GHz): 4.0\nT (mK): 12.5"
Expand All @@ -27,10 +27,10 @@ bath = Ohmic(η, ωc, T)
@test replstr(bath) == "Ohmic bath instance:\nη (unitless): 0.0001\nωc (GHz): 4.0\nT (mK): 12.0"

interaction = Interaction(coupling, bath)
@test replstr(interaction) == "\e[36mInteraction\e[0m with \e[36mConstantCouplings\e[0m with \e[36mComplex{Float64}\e[0m\nand string representation: [\"Z\"]\nand bath: OpenQuantumBase.OhmicBath(0.0001, 25.132741228718345, 0.6365195925819416)"
@test replstr(interaction) == "\e[36mInteraction\e[0m with \e[36mConstantCouplings\e[0m with \e[36mComplexF64\e[0m\nand string representation: [\"Z\"]\nand bath: OpenQuantumBase.OhmicBath(0.0001, 25.132741228718345, 0.6365195925819416)"

iset = InteractionSet(interaction)
@test replstr(iset) == "\e[36mInteractionSet\e[0m with 1 interactions"

H = SparseHamiltonian([A, B], [spσx, spσz])
@test replstr(H) == "\e[36mSparseHamiltonian\e[0m with \e[36mComplex{Float64}\e[0m\nwith size: (2, 2)"
@test replstr(H) == "\e[36mSparseHamiltonian\e[0m with \e[36mComplexF64\e[0m\nwith size: (2, 2)"

0 comments on commit cee2ce8

Please sign in to comment.