|
1 | 1 | abstract type ApproximationQuantumStates{T} end |
| 2 | +# It is easy to get confused between the approximations of: |
| 3 | +# - the state space, i.e., all mixed states |
| 4 | +# - the complex sphere, i.e., all pure states |
| 5 | +# - the real sphere |
| 6 | +# In this file, η is the shrinking factor wrt the state space, while shr is the shrinking factor wrt the real sphere. |
| 7 | +# For qubits, the Bloch sphere identifies exactly the state space with the 3D sphere, i.e., η = shr. |
| 8 | +# In general, we resort to Alice and Bob meet Banach, Lemma 9.2 to get η = 2shr^2 - 1. |
2 | 9 |
|
3 | 10 | """ |
4 | 11 | PolytopeReducedComplexSphere{T} <: ApproximationQuantumStates{T} |
|
14 | 21 | export PolytopeReducedComplexSphere |
15 | 22 |
|
16 | 23 | function PolytopeReducedComplexSphere{T}(mat::Matrix, shr) where {T <: Real} |
17 | | - @assert isodd(length(size(mat, 2))) |
| 24 | + @assert isodd(size(mat, 2)) |
18 | 25 | d = (size(mat, 2) + 1) ÷ 2 |
19 | | - return PolytopeReducedComplexSphere{T}(2shr^2 - 1, d, 0, mat) |
| 26 | + η = d == 2 ? shr : 2shr^2 - 1 |
| 27 | + return PolytopeReducedComplexSphere{T}(η, d, 0, mat) |
20 | 28 | end |
21 | 29 |
|
22 | 30 | Base.length(A::PolytopeReducedComplexSphere) = size(A.mat, 1) |
@@ -55,7 +63,8 @@ function PolytopePhasedComplexSphere{T}(mat::Matrix, shr, n) where {T <: Real} |
55 | 63 | ind = ones(Int, d) |
56 | 64 | base = [size(mat, 1); fill(n, d - 1)] |
57 | 65 | sc = sincos.((T(pi) / n) * (0:n-1)) |
58 | | - return PolytopePhasedComplexSphere{T}(2shr^2 - 1, d, 0, mat, n, ind, base, sc) |
| 66 | + η = d == 2 ? shr : 2shr^2 - 1 |
| 67 | + return PolytopePhasedComplexSphere{T}(η, d, 0, mat, n, ind, base, sc) |
59 | 68 | end |
60 | 69 |
|
61 | 70 | Base.length(A::PolytopePhasedComplexSphere) = size(A.mat, 1) * A.n^(A.d - 1) |
@@ -97,10 +106,11 @@ function CrossPolytopeSubdivision{T}(d::Integer; max_length = 10^6) where {T <: |
97 | 106 | end |
98 | 107 |
|
99 | 108 | function CrossPolytopeSubdivision{T}(d::Integer, n::Integer) where {T <: Real} |
100 | | - η = n / sqrt(T(n^2 + (d ≤ 3 ? 1 : 2) * (d - 1))) |
| 109 | + shr = n / sqrt(T(n^2 + (d ≤ 2 ? 1 : 2) * (2d - 2))) |
101 | 110 | vec = fill(1, 2d - 1) |
102 | 111 | vec[2d-1] = n + 1 |
103 | 112 | sgn = fill(Int8(-1), 2d - 2) |
| 113 | + η = d == 2 ? shr : 2shr^2 - 1 |
104 | 114 | return CrossPolytopeSubdivision{T}(η, d, 0, n, vec, sgn) |
105 | 115 | end |
106 | 116 |
|
|
0 commit comments