-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
diamond distance is not symmetric #53
Comments
@pgawron does this indicate some problem with conversion? |
@benkj just run the code on my machine, seems to work fine
|
@lpawela conversion is suspicious then. |
@pgawron can you replicate this behavior? |
@lpawela I can. On release version of the package I obtain: AD=convert(DynamicalMatrix{Matrix{Float64}},KrausOperators([[1 0; 0 sqrt(p)], [0 sqrt(1-p); 0 0]]))
AD2=convert(DynamicalMatrix{Matrix{Float64}},KrausOperators([[1 0; 0 sqrt(2p)], [0 sqrt(1-2p); 0 0]]))
println(diamond_distance(AD,AD2))
# 0.17161841986966694
println(diamond_distance(AD2,AD))
# 0.39999997855290215 |
@pgawron still can't reproduce. Just to verify I'm on the same version p=0.2
AD=KrausOperators([[1 0; 0 sqrt(p)], [0 sqrt(1-p); 0 0]])
AD2=KrausOperators([[1 0; 0 sqrt(2p)], [0 sqrt(1-2p); 0 0]])
println(diamond_distance(AD,AD2))
ERROR: MethodError: no method matching DynamicalMatrix{Array{Float64,2}}(::KrausOperators{Array{Float64,2}}) as expected. Now lunching your code AD=convert(DynamicalMatrix{Matrix{Float64}},KrausOperators([[1 0; 0 sqrt(p)], [0 sqrt(1-p); 0 0]]))
AD2=convert(DynamicalMatrix{Matrix{Float64}},KrausOperators([[1 0; 0 sqrt(2p)], [0 sqrt(1-2p); 0 0]]))
println(diamond_distance(AD,AD2))
# 0.3999999603826285
println(diamond_distance(AD2,AD))
# 0.4000000254778498 My installed packages (v1.0) pkg> status
Status `~/.julia/environments/v1.0/Project.toml`
[c7e460c6] ArgParse v0.6.2
[c52e3926] Atom v0.7.15
[8e7c35d0] BlockArrays v0.7.0
[f65535da] Convex v0.11.1
[5789e2e9] FileIO v1.0.5
[033835bb] JLD2 v0.1.2
[e5e0dc1b] Juno v0.5.5
[b964fa9f] LaTeXStrings v1.0.3
[2fda8390] LsqFit v0.7.3
[15e1cf62] NPZ v0.3.0
[91a5bcdd] Plots v0.23.1
[438e738f] PyCall v1.90.0
[3c0b384b] QuantumInformation v0.4.4
[c946c3f1] SCS v0.5.1
[2913bbd2] StatsBase v0.29.0
[10745b16] Statistics |
My status (v1.1) pkg> status
Status `~/.julia/environments/v1.1/Project.toml`
[ca501d18] AcausalNets v0.0.0 #master (https://github.com/mikegpl/AcausalNets.jl)
[c52e3926] Atom v0.7.15
[b4f34e82] Distances v0.8.0
[e5e0dc1b] Juno v0.5.5
[c36e90e8] PowerModels v0.9.4
[438e738f] PyCall v1.90.0
[d330b81b] PyPlot v2.8.0
[3c0b384b] QuantumInformation v0.4.4 |
I wonder why |
@pgawron I noticed you're using (v1.1) pkg> status
Status `~/.julia/environments/v1.1/Project.toml`
[c52e3926] Atom v0.7.15
[15e1cf62] NPZ v0.3.0
[438e738f] PyCall v1.90.0
[d330b81b] PyPlot v2.8.0
[3c0b384b] QuantumInformation v0.4.4 It simply doesn't show dependencies. The result is still the same println(diamond_distance(AD,AD2))
# 0.3999999603826285
println(diamond_distance(AD2,AD))
# 0.4000000254778498 Maybe this behavior is somehow related to #50 and jump-dev/Convex.jl#274 |
I've just tested for version difference. in both versions i get the same buggy result. |
Just tested on another machine |
I'm running it on a OSX with
I find the same bug with or without conversions. This is really weird. |
I changed the code putting
|
|
I have a downloaded julia for OSX. All packages are installed with |
Consider the following:
The first line outputs ~0.17 while the second line outputs ~0.40.
This is a bug, since the diamond distance is symmetric
The text was updated successfully, but these errors were encountered: