Closed GTorlai closed 4 years ago
Here is an example of doing a "full" QR:
julia> v = [0.1; 0.2]
2-element Array{Float64,1}:
0.1
0.2
julia> normalize!(v)
2-element Array{Float64,1}:
0.44721359549995787
0.8944271909999157
julia> Q,R = qr(v)
LinearAlgebra.QRCompactWY{Float64,Array{Float64,2}}
Q factor:
2×2 LinearAlgebra.QRCompactWYQ{Float64,Array{Float64,2}}:
-0.447214 -0.894427
-0.894427 0.447214
R factor:
1×1 Array{Float64,2}:
-0.9999999999999999
julia> Q*Matrix(I, 2, 2)*R[1]
2×2 Array{Float64,2}:
0.447214 0.894427
0.894427 -0.447214
Do QR decomposition of a set of single-qubit input states and build preparation gates at the start of getsamples.