Skip to content

Commit a3a8ae6

Browse files
Permute state_ghz arguments
1 parent 7a1638c commit a3a8ae6

4 files changed

Lines changed: 7 additions & 9 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ julia> N = 2; # bipartite scenario
4242

4343
julia> p = 0.2; # white noise strength
4444

45-
julia> ρ = Ket.state_ghz(d, N; v = 1 - p) # two-qubit maximally entangled state with white noise
45+
julia> ρ = Ket.state_ghz(N, d; v = 1 - p) # two-qubit maximally entangled state with white noise
4646
4×4 Hermitian{ComplexF64, Matrix{ComplexF64}}:
4747
0.45+0.0im 0.0+0.0im 0.0+0.0im 0.4+0.0im
4848
0.0-0.0im 0.05+0.0im 0.0+0.0im 0.0+0.0im
@@ -115,7 +115,7 @@ true
115115
Now consider a noisier version of the same state:
116116
117117
```julia
118-
julia> d = 2; N = 2; p = 0.8; ρ = Ket.state_ghz(d, N; v = 1 - p) # with more white noise
118+
julia> d = 2; N = 2; p = 0.8; ρ = Ket.state_ghz(N, d; v = 1 - p) # with more white noise
119119
4×4 Hermitian{ComplexF64, Matrix{ComplexF64}}:
120120
0.3+0.0im 0.0+0.0im 0.0+0.0im 0.1+0.0im
121121
0.0-0.0im 0.2+0.0im 0.0+0.0im 0.0+0.0im

examples/10qubits.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ lmo = EntanglementDetection.AlternatingSeparableLMO(T, dims; nb = 10, threshold
2222
Random.seed!(0)
2323
println("Initializing the state ...")
2424
v = 0.3
25-
ρ = Ket.state_ghz(Complex{T}, 2, N; v = v)
25+
ρ = Ket.state_ghz(Complex{T}, N; v)
2626
println("Converting ...")
2727
C = correlation_tensor(ρ, dims)
2828

@@ -67,4 +67,4 @@ time = [traj[i][5] for i in indices]
6767

6868
plot_data = (itr, primal, dual_gap, time)
6969
plot_dir = string(output_dir , "/ghz_" ,N , "_plot.dat")
70-
serialize(plot_dir, plot_data)
70+
serialize(plot_dir, plot_data)

examples/gme.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,17 @@ import MathOptInterface as MOI
1010
using Serialization
1111

1212
max_iteration = 10^7 # control time
13-
callback_iter = 10^3
13+
callback_iter = 10^3
1414
max_active = 4 * 10^4 # control the size of memory
1515
shortcut_scale = 10
1616
noise_atol = 1e-3
1717

18-
1918
output_dir = "EntanglementDetection/examples/results/gme"
2019

2120
T = Float64
2221
N = 4
2322
dims = Tuple(fill(2, N))
24-
ρ = Ket.state_ghz(Complex{T}, 2, N)
25-
23+
ρ = Ket.state_ghz(Complex{T}, N)
2624

2725
k = 2
2826
C = correlation_tensor(ρ, dims)

test/interface.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import LinearAlgebra as LA
66
p = 0.888 # 1 - 1/9
77
T = Float64
88
dims = [2, 2, 2, 2]
9-
target_rho = LA.Hermitian((1 - p) * Ket.state_ghz(2, 4) + p * Complex.(Matrix{T}(LA.I, prod(dims), prod(dims)) / prod(dims)))
9+
target_rho = LA.Hermitian((1 - p) * Ket.state_ghz(Complex{T}, 4) + p * Complex.(Matrix{T}(LA.I, prod(dims), prod(dims)) / prod(dims)))
1010

1111
# Some oracle give us a guess
1212

0 commit comments

Comments
 (0)