Quantum Fourier Transformation and Phase Estimation

Let's use Yao first

using Yao

Quantum Fourier Transformation

The Quantum Fourier Transformation (QFT) circuit is to repeat two kinds of blocks repeatly:

qft-circuit

The basic building block control phase shift gate is defined as

\[R(k)=\begin{bmatrix} 1 & 0\\ 0 & \exp\left(\frac{2\pi i}{2^k}\right) \end{bmatrix}\]

Let's define block A and block B, block A is actually a control block.

A(i, j) = control(i, j=>shift(2π/(1<<(i-j+1))))
A (generic function with 1 method)

Once you construct the blockl you can inspect its matrix using mat function. Let's construct the circuit in dash box A, and see the matrix of $R_4$ gate.

R4 = A(4, 1)
(n -> control(n, 4, 1 => shift(0.39269908169872414)))

If you have read about preparing GHZ state, you probably know that in Yao, we could just leave the number of qubits, and it will be evaluated when possible.

R4(5)
nqubits: 5
control(4)
└─ (1,) shift(0.39269908169872414)

its matrix will be

mat(R4(5))
32×32 Diagonal{ComplexF64, Vector{ComplexF64}}:
 1.0+0.0im      ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅      1.0+0.0im      ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅      1.0+0.0im      ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅      1.0+0.0im      ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅      1.0+0.0im      ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅      1.0+0.0im      ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅      1.0+0.0im      ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅      1.0+0.0im      ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅      1.0+0.0im          ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅      0.92388+0.382683im      ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅           1.0+0.0im          ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅      0.92388+0.382683im      ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅           1.0+0.0im          ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅      0.92388+0.382683im      ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅           1.0+0.0im          ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅      0.92388+0.382683im      ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅           1.0+0.0im      ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅      1.0+0.0im      ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅      1.0+0.0im      ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅      1.0+0.0im      ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅      1.0+0.0im      ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅      1.0+0.0im      ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅      1.0+0.0im      ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅      1.0+0.0im      ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅      1.0+0.0im          ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅      0.92388+0.382683im      ⋅              ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅           1.0+0.0im          ⋅               ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅      0.92388+0.382683im      ⋅              ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅           1.0+0.0im          ⋅               ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅      0.92388+0.382683im      ⋅              ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅           1.0+0.0im          ⋅    
     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅              ⋅               ⋅              ⋅               ⋅              ⋅               ⋅      0.92388+0.382683im

Then we repeat this control block over and over on different qubits, and put a Hadamard gate to ith qubit to construct i-th B block.

B(n, k) = chain(n, j==k ? put(k=>H) : A(j, k) for j in k:n)
B (generic function with 1 method)

We need to input the total number of qubits n here because we have to iterate through from k-th location to the last.

Now, let's construct the circuit by chaining all the B blocks together

qft(n) = chain(B(n, k) for k in 1:n)
qft(4)
nqubits: 4
chain
├─ chain
│  ├─ put on (1)
│  │  └─ H
│  ├─ control(2)
│  │  └─ (1,) shift(1.5707963267948966)
│  ├─ control(3)
│  │  └─ (1,) shift(0.7853981633974483)
│  └─ control(4)
│     └─ (1,) shift(0.39269908169872414)
├─ chain
│  ├─ put on (2)
│  │  └─ H
│  ├─ control(3)
│  │  └─ (2,) shift(1.5707963267948966)
│  └─ control(4)
│     └─ (2,) shift(0.7853981633974483)
├─ chain
│  ├─ put on (3)
│  │  └─ H
│  └─ control(4)
│     └─ (3,) shift(1.5707963267948966)
└─ chain
   └─ put on (4)
      └─ H

Wrap QFT to an external block

In most cases, functions are enough to wrap quantum circuits, like A and B we defined above, but sometimes, we need to dispatch specialized methods on certain kinds of quantum circuit, or we want to define an external block to export, thus, it's useful to be able to wrap circuit to custom blocks.

First, we define a new type as subtype of PrimitiveBlock since we are not going to use the subblocks of QFT, if you need to use its subblocks, it'd be better to define it under CompositeBlock.

struct QFT <: PrimitiveBlock{2}
    n::Int
end

YaoBlocks.nqudits(q::QFT) = q.n

Now, let's define its circuit

circuit(q::QFT) = qft(q.n)
circuit (generic function with 1 method)

And forward mat to its circuit's matrix

YaoBlocks.mat(::Type{T}, x::QFT) where T = mat(T, circuit(x))

You may notice, it is a little ugly to print QFT at the moment, this is because we print the type summary by default, you can define your own printing by overloading print_block

YaoBlocks.print_block(io::IO, x::QFT) = print(io, "QFT($(x.n))")

Since it is possible to use FFT to simulate the results of QFT (like cheating), we could define our custom apply! method:

using FFTW, LinearAlgebra

function YaoBlocks.apply!(r::ArrayReg, x::QFT)
    α = sqrt(length(statevec(r)))
    invorder!(r)
    lmul!(α, ifft!(statevec(r)))
    return r
end

Now let's check if our apply! method is correct:

r = rand_state(5)
r1 = r |> copy |> QFT(5)
r2 = r |> copy |> circuit(QFT(5))
r1 ≈ r2
true

We can get iQFT (inverse QFT) directly by calling adjoint

QFT(5)'
 [†]QFT(5)

QFT and iQFT are different from FFT and IFFT in three ways,

  1. they are different by a factor of $\sqrt{2^n}$ with $n$ the number of qubits.
  2. the bit numbering will exchange after applying QFT or iQFT.
  3. due to the convention, QFT is more related to IFFT rather than FFT.

Phase Estimation

Since we have QFT and iQFT blocks we can then use them to realize phase estimation circuit, what we want to realize is the following circuit:

phase estimation

First we call Hadamard gates repeatly on first n qubits.

Hadamards(n) = repeat(H, 1:n)
Hadamards (generic function with 1 method)

Then in dashed box B, we have controlled unitaries:

ControlU(n, m, U) = chain(n+m, control(k, n+1:n+m=>matblock(U^(2^(k-1)))) for k in 1:n)
ControlU (generic function with 1 method)

each of them is a U of power $2^{(k-1)}$.

Since we will only apply the qft and Hadamard on first n qubits, we could use Subroutine, which creates a context of a sub-scope of the qubits.

PE(n, m, U) =
    chain(n+m, # total number of the qubits
        subroutine(Hadamards(n), 1:n), # apply H in local scope
        ControlU(n, m, U),
        subroutine(QFT(n)', 1:n))
PE (generic function with 1 method)

we use the first n qubits as the output space to store phase $ϕ$, and the other m qubits as the input state which corresponds to an eigenvector of oracle matrix U.

The subroutine here uses focus! and relax! to manage a local scope of quantum circuit, and only activate the first n qubits while applying the block inside the subroutine context, and the scope will be relax!ed back, after the context. This is equivalent to manually focus! then relax!

fullly activated

r = rand_state(5)
ArrayReg{2, ComplexF64, Array...}
    active qubits: 5/5
    nlevel: 2

first 3 qubits activated

focus!(r, 1:3)
ArrayReg{2, ComplexF64, Array...}
    active qubits: 3/5
    nlevel: 2

relax back to the original

relax!(r, 1:3)
ArrayReg{2, ComplexF64, Array...}
    active qubits: 5/5
    nlevel: 2

In this way, we will be able to apply small operator directly on the subset of the qubits.

Details about the algorithm can be found here: Quantum Phase Estimation Algorithm

Now let's check the results of our phase estimation.

First we need to set up a unitary with known phase, we set the phase to be 0.75, which is 0.75 * 2^3 == 6 == 0b110 .

N, M = 3, 5
P = eigen(rand_unitary(1<<M)).vectors
θ = Int(0b110) / 1<<N
phases = rand(1<<M)
phases[0b010+1] = θ
U = P * Diagonal(exp.(2π * im * phases)) * P'
32×32 Matrix{ComplexF64}:
  -0.222264+0.0604406im   -0.0382701-0.00298213im      0.329338+0.120751im        0.131523+0.149057im     -0.0362315+0.13358im      -0.0280237-0.0705369im    0.00739494+0.0317751im      0.145951-0.0644751im   -0.0933828-0.133147im     -0.128831+0.0270856im     0.0752639+0.131552im   -0.0676735+0.00636915im    0.0010246-0.0121301im    -0.124258-0.12155im     -0.0152687-0.190915im     -0.0371851+0.117664im     -0.233885-0.0556546im     -0.106202-0.0746162im     0.129859+0.0225045im   -0.0166065+0.0673076im     -0.0347974+0.209166im     0.107709+0.184329im    0.0989405-0.0125944im    -0.198224+0.235163im      0.01128+0.0610486im    -0.0855798-0.123589im     -0.0557404-0.000321399im  -0.00870389-0.105537im      0.0208662+0.362922im       0.219735-0.00192257im    0.222374-0.101628im       -0.0670983+0.0209119im
  -0.180734+0.11844im      -0.181106+0.123903im       -0.304862+0.169912im       -0.129185+0.0497684im     0.0757772-0.0379179im    -0.0114613+0.0621743im    -0.0432262-0.0289311im       0.14182-0.13417im     -0.0354409+0.152661im    -0.0159773-0.166115im       0.106874-0.190651im     0.068276+0.186714im      -0.119306-0.0474741im    -0.140789+0.0417833im     0.238039+0.0557296im     -0.102468+0.0537293im   -0.0892076+0.177483im      0.0758279+0.127527im    0.00903783+0.160959im      0.105362-0.024101im        0.118549+0.175123im    0.0966062+0.171527im    0.0724554+0.140945im    0.00400021-0.0016232im     0.17815-0.00387895im     0.091826+0.00173512im   -0.0347498+0.0620657im     -0.0599249+0.309118im     -0.0199679+0.0867928im    0.00477492-0.185256im     0.0368236+0.160281im         0.185905+0.0723993im
   0.111106-0.0414332im    0.0778607-0.168742im       -0.175295-0.209214im       0.0180628-0.00513439im   -0.0420082+0.0817796im     0.0458296+0.069921im      -0.145988-0.0453817im      0.213142+0.11827im      -0.151445+0.21486im      0.0435113+0.0326042im     -0.295544-0.107318im   -0.0160159+0.139789im     -0.0187315+0.17202im      -0.252233-0.0956493im   -0.0291199-0.159193im      0.0372049+0.0875158im   -0.0645869+0.0194455im    -0.0882505-0.0772691im    0.0590489-0.196137im     -0.016511-0.00896964im      0.228912+0.0514451im  -0.0420966+0.0506952im  -0.0289662-0.0903154im    -0.121592-0.292127im    0.0713264-0.0412292im    -0.0481496-0.0785005im     0.0970988-0.0368605im        0.19963+0.111072im      0.0955527+0.11314im        0.217269+0.173964im      -0.07625+0.0950845im       -0.128416-0.107428im
  0.0784043+0.00578715im  -0.0608753+0.0913819im     -0.0365126+0.037734im     -0.00463906-0.172788im      0.0601953-0.0717536im      0.190858+0.0771561im     -0.133054-0.0315246im     -0.150516-0.254578im     -0.246769-0.178162im      0.118947+0.00560392im   -0.0341575+0.0801014im  -0.0691039+0.00824415im     0.272654-0.113771im    -0.0272438+0.042416im      0.242996-0.118074im     -0.0349888+0.0419783im    0.0273097-0.048184im     -0.0752193-0.0913716im   -0.0158176+0.137567im      -0.23189-0.233912im       0.0357383+0.0328041im    0.158249-0.103347im    0.0146105+0.0394921im   0.00749534+0.141317im      0.15964+0.0989798im    -0.0110167-0.0758944im     0.0480883-0.244439im      -0.0122489+0.16689im       -0.112476-0.181636im       0.228602+0.106541im     -0.127946-0.120446im        -0.162655-0.0659018im
 -0.0655444+0.062773im     -0.025091-0.0381312im      0.0773223-0.0424464im      -0.113099+0.245026im      0.0440542-0.0441398im   -0.00469596+0.0480996im    -0.0387838+0.357918im     -0.0494873+0.0205626im    0.0917668-0.0247119im    -0.120932+0.206786im       -0.07792-0.0341816im  -0.0125271+0.147858im      -0.230169+0.201191im     0.0423384+0.124639im     -0.170923-0.0522549im      0.204507+0.0937716im   -0.0432479-0.114996im      0.0783958-0.0779675im    -0.137202-0.00555141im   0.0766782-0.0199643im      -0.076861-0.0529701im    0.237704+0.0115287im   -0.178119+0.102694im     0.0568685+0.0229523im   -0.011887+0.0773697im    -0.0978478+0.147241im     -0.0506322-0.223086im       -0.185556+0.326282im      -0.206569+0.000575277im   0.0398197+0.141194im    -0.0726073+0.0253859im      -0.0916228+0.091666im
  -0.143772-0.146007im     0.0718044+0.199041im       0.0539661+0.0565575im     -0.0813564+0.0262854im     -0.180444-0.0990325im     0.0468487-0.204043im      0.0394747+0.216074im       0.104679-0.148819im     -0.115095+0.124861im      0.213556+0.239811im      0.0222429-0.12367im    -0.0823735-0.21075im       0.0164583+0.0498884im    -0.120535+0.187577im     0.0516312+0.124866im      -0.193192+0.0704938im   -0.0540546+0.196711im      -0.171413+0.02552im      -0.073343-0.132799im     0.0551467-0.169182im       -0.101361+0.225069im    -0.118855+0.0575499im   -0.176009-0.0985599im     0.158428-0.0328726im    -0.10748-0.00611652im    -0.124548+0.0951502im   -0.00199518-0.157546im        0.155314-0.0893225im     -0.101121+0.0147771im    -0.0787516+0.0181312im    0.0526201+0.019646im         0.075246-0.172804im
   0.163087-0.0504492im   -0.0475441+0.144148im     -0.00343618+0.14917im         0.126977-0.0239623im    0.00127198+0.307676im      -0.236264-0.196602im      -0.159062+0.0387655im       -0.0115-0.0597825im    0.0541564+0.170254im    0.00279174-0.138851im      -0.139529+0.0521698im   -0.159648+0.0272279im    -0.0477223-0.0221491im    -0.072078-0.0700532im   -0.0361158+0.25167im       -0.165799+0.0671804im    -0.188266+0.00428966im     0.173592-0.206985im      0.141647-0.0890372im    0.0444642-0.091109im       -0.217691-0.0705932im    0.159208-0.100144im     0.253312+0.0850486im     0.191335-0.163346im    0.0902364+0.0969879im    -0.0018158+0.110547im     -0.0525386-0.130018im       0.0277802-0.0267912im     0.0689748-0.0738012im    -0.0134732-0.0119561im    0.0210331-0.05058im         -0.174972+0.125886im
 -0.0689467-0.098506im     0.0669463+0.174386im      -0.0045392-0.0438863im      0.0220008+0.0216998im      0.050382+0.316012im       0.213086-0.128211im     -0.0247822+0.0833834im     -0.243057-0.134786im     -0.181035-0.181658im     -0.138724+0.0268325im   -0.00589857-0.0859571im   0.0489747+0.00532992im   -0.0491573+0.0890942im     0.211686-0.18015im     -0.0633914+0.0194598im     -0.284081-0.0151459im    0.0736388+0.00762808im    -0.175837-0.0938316im    -0.241826-0.0695568im    0.0938446-0.0697151im       0.050019-0.0646121im  -0.0123873+0.0495866im  -0.0507944+0.171246im      -0.18527-0.155769im     0.060064-0.230185im       -0.13671-0.0267828im    -0.0533256+0.18355im        -0.126128+0.0889138im      0.180876+0.012074im     -0.0258238-0.108386im    -0.0619987+0.132236im       -0.0682718-0.0238504im
 -0.0283246-0.0821118im    0.0296606+0.0875382im      -0.280722+0.162122im       0.0791625+0.0524521im     0.0971671-0.0980287im     -0.147779+0.145316im      0.0132727+0.0979351im     -0.105982+0.104716im     -0.146053-0.109241im     -0.100804-0.00241412im    -0.189086-0.237524im    -0.140863+0.01648im       0.0617554-0.0861704im    0.0544238+0.0666346im    0.0175582-0.0667982im     -0.070258-0.0969757im   -0.0864821+0.0171025im      0.133578+0.0837364im    0.0166716-0.156931im     0.0812383+0.109379im       -0.149628+0.0255792im   0.0686728+0.0794629im  -0.0858074-0.0423787im   -0.0244599+0.127151im    -0.241449-0.19418im        0.143234+0.128457im      -0.257256+0.166464im       0.0769572-0.0240625im      0.073966-0.0433952im      0.281696+0.0651118im   -0.0692858-0.322871im       -0.0330233-0.108522im
 0.00407525+0.220042im     -0.031356+0.207554im        0.140534-0.0258443im     -0.0207785-0.162933im     -0.0468262+0.0194848im      0.158706+0.225229im     -0.0442839+0.222255im     -0.0295578-0.0507545im   0.00489626+0.0838132im    0.0252798-0.43346im       0.0912127-0.013764im    0.0658027-0.0760408im     0.0244377+0.134018im     -0.111944+0.0740073im   -0.0884895+0.0367213im    -0.0168138+0.0735177im    -0.084982-0.283899im      -0.173747-0.0634216im    0.0520984+0.0745295im   -0.0543971+0.135906im      -0.0666847+0.0879616im   -0.112974+0.0346402im  -0.0813412+0.125672im     0.0457584-0.124702im    -0.371604+0.0164718im      0.117294+0.0570955im     0.0792685-0.0388665im      0.0416897+0.0703791im      0.216456-0.0747911im     0.0754363+0.0783193im   0.00186397-0.000895575im     0.0894039+0.0334273im
  -0.189214-0.122673im     -0.077132-0.0538909im      0.0163921-0.145102im    -0.000372172-0.0299765im     -0.177718+0.0905003im     -0.120597-0.149158im       0.203766+0.20336im       0.0665841+0.0100115im     0.150869-0.103086im    -0.0226742-0.141628im     -0.0638123-0.0728415im   0.0195255+0.168751im     0.00770355-0.23319im     -0.0210283+0.0671595im   -0.0873948-0.244446im     -0.0245421-0.0930084im   -0.0561124+0.302387im     0.00236135-0.0892853im    0.0179155+0.230349im      -0.01903-0.0152005im      -0.160752-0.0250464im   -0.114322-0.147918im    -0.044484-0.033163im     0.0618215+0.0157737im  0.00548848+0.00884631im   -0.0463958-0.128663im       0.222649+0.16143im        0.0333669+0.228949im       0.158022-0.249683im      0.0700393+0.139081im      0.157854+0.00227132im      -0.110502-0.0639349im
   0.104798-0.229261im     -0.181936+0.228362im      -0.0383321-0.0822974im      0.0464599-0.0382574im     0.0323525-0.0803196im     0.0522353-0.126718im      0.0570282-0.0534968im     0.0709436-0.0552954im    -0.163792-0.102256im    -0.0974368-0.152689im      0.0198617+0.0445692im    0.104143+0.101449im      -0.299621-0.0773514im     -0.15254-0.164179im     0.0545526+0.0280299im       0.25063+0.202803im    -0.0155294+0.103217im       0.086807-0.0891947im    -0.207804-0.0384534im    0.0278512-0.0353929im        0.22392-0.0584233im  -0.0882616-0.14758im     -0.114384+0.277738im     0.0171605+0.128143im    -0.119869+0.0862075im     0.0419553+0.0429311im     -0.112682+0.0344493im       0.149323-0.18361im      -0.0710793+0.0380892im     -0.113194+0.224507im     0.0887208-0.124143im      -0.00402409-0.0103002im
   0.170365-0.0800564im    -0.110098-0.0356231im    -0.00239465+0.0175328im     -0.0586758+0.118673im       0.337163+0.100005im       0.105395+0.0934695im    -0.0236393+0.075988im     -0.0725773+0.218026im      0.187267+0.0462178im     0.180788+0.116704im     -0.0468159-0.105952im   -0.0203468-0.171042im      -0.133703-0.0706457im   -0.0779382-0.0189993im   -0.0309638-0.222472im       -0.14221-0.0898697im    0.0862697-0.0239467im     -0.110123-0.254653im    -0.0707519+0.307583im      0.179972-0.030335im        0.193418+0.130952im    -0.132957+0.0853423im   0.0306281+0.0187621im     0.161066+0.0285631im   0.0564409+0.13135im       0.0978143+0.0304619im     -0.164765-0.121431im      -0.0297829-0.129839im        0.11371-0.0607476im     0.0737265-0.122524im      0.172571-0.0710236im      -0.0549625-0.0711139im
  0.0291832-0.0798175im     0.177396-0.0237281im       0.167375-0.191744im       0.0549481-0.0682063im     0.0721903+0.118002im       0.100595+0.0255509im     0.0505669-0.0269559im      0.113092-0.0331373im   -0.0354051-0.0346997im      0.10517-0.00963898im    -0.130849-0.0560056im  -0.0914292-0.00493401im   -0.0235813-0.090287im      0.041939+0.13255im      0.0332971+0.0291562im    -0.0966852+0.15072im      -0.051723-0.0116412im      0.289863-0.141272im     -0.117017+0.110908im    -0.0645224-0.0160761im      0.0236339-0.298376im    0.0215362+0.196047im   -0.0182763+0.00315031im   0.0910242-0.019659im   -0.0219819-0.123203im      -0.101005-0.0301411im     0.0659475+0.0174683im      0.0657799-0.0213719im     -0.156237+0.000240111im     0.29267-0.0719293im     0.080402-0.0315858im        0.520903+0.178725im
  0.0123078-0.0460453im     0.341323-0.0532062im     -0.0463236-0.0125945im      -0.235766+0.21731im       0.0313484-0.188117im      -0.129201+0.0987556im     -0.116503-0.0409016im      0.174737-0.197631im    -0.0950593-0.102647im    0.00302631-0.0836498im    0.00106606-0.15541im      0.158564-0.134186im       0.094704-0.0765942im    0.0661809-0.264174im     -0.203784-0.0293723im    -0.0347012+0.0946896im    0.0559747+0.0903288im     -0.112472-0.0622905im    -0.053151-0.115866im     -0.120929+0.0164734im      -0.117569-0.0522487im    0.172624-0.0800511im   -0.129319+0.0575788im     0.140247+0.0093345im   0.0931606+0.137745im       0.262732-0.0112728im    -0.0100196-0.0446287im     -0.0208869-0.0745831im      0.148255-0.0442688im     0.0720279-0.0391611im     0.239136+0.128655im       0.00337269+0.171324im
  -0.168027+0.0044657im   -0.0762146+0.0640727im      0.0758124+0.0445524im     -0.0212704-0.168597im     -0.0020118-0.00848561im   -0.0643971+0.134152im      0.0914595-0.118526im     -0.0769085+0.236421im     0.0694199-0.0459437im   -0.0798552-0.113519im      -0.263691-0.133778im    -0.165092-0.0649053im     0.0484057+0.168805im    -0.0540124-0.00252738im  -0.0492661+0.214058im      0.0983867-0.0782342im    -0.116819+0.0828165im    -0.0716719-0.183612im    -0.0503417-0.163639im     -0.266171+0.0946976im       0.107867+0.0136798im  0.00437233+0.0520372im   -0.050568+0.138223im      0.152275+0.317662im     0.137897-0.167191im     -0.0618263-0.115948im     -0.0403597-0.115537im      -0.0825881-0.00861168im   -0.0386919-0.0917421im    -0.0341933-0.089218im      0.136825+0.294639im       -0.0267648-0.188912im
   0.167619-0.218566im    -0.0324011+0.17381im       -0.0799504-0.0376089im       0.230142+0.126043im      0.0714989+0.0411351im    -0.0878094+0.0308745im      0.134562-0.227182im     -0.0215068-0.0204705im   -0.0568532+0.0906471im    -0.240145+0.159642im     -0.0683105+0.13093im    -0.0385557-0.00413757im     0.148463-0.0955472im   -0.0782797+0.210747im     0.0725078-0.246547im      0.0968517+0.0172997im    -0.036299-0.169244im     -0.0211615+0.052732im      0.127557+0.0587798im   -0.0562311-0.0917694im      -0.143751+0.163248im    0.0329684+0.0443499im   -0.314481+0.175524im         0.161-0.149065im   -0.0650737-0.13056im       0.0284316-0.0340584im      0.107368-0.0371179im      -0.163229-0.0164755im      0.111078+0.0540142im     -0.109576-0.0608739im    0.0814704+0.212295im        0.0484305+0.118273im
  0.0247627+0.0587924im    -0.101824-0.0759434im      0.0457427+0.319885im       -0.187397+0.0274715im      0.300511+0.338979im       0.196341-0.0609249im      0.177097+0.00688853im  -0.00803937-0.0639597im     -0.18732-0.0548601im     0.251875+0.0370881im     0.0617127-0.0627612im   0.0393542+0.0840757im      0.108788-0.0318451im   -0.0982943-0.00624742im   -0.173354-0.00787787im     0.335812-0.0458821im   -0.0249955+0.122678im     0.00460841+0.0612178im     0.104463-0.140712im    -0.0339558-0.000946195im    -0.101377-0.0441803im   0.0399857+0.0845187im   0.0426878-0.0554307im     0.148943-0.160334im   -0.0830973-0.0410055im      0.073852-0.169601im     -0.0272265+0.115482im       -0.126762-0.0581045im    -0.0837225-0.038628im     -0.0413327+0.207234im     0.0063041+0.0639405im       0.0764506-0.0715625im
   0.125547-0.0295923im    0.0572762-0.0278885im       -0.15385+0.168295im       -0.164764-0.106006im     -0.0315809-0.062481im    -0.00761556-0.060358im       0.178062-0.0362906im     -0.258673-0.0458001im    0.0314555+0.128243im     0.0839204+0.0153323im     -0.135522+0.106134im    0.0416369+0.0760099im     -0.135861+0.0900937im     0.178527-0.0416888im    0.0365846+0.120617im      -0.125906-0.0511662im     -0.30939+0.0365888im     -0.184417-0.052388im    0.00201198+0.0954232im    0.0471178+0.124846im        0.130239-0.0332862im   0.0615784-0.0013596im   -0.219003-0.126511im     0.0271449+0.057291im    0.0634058-0.0925102im     0.0879383-0.148092im       0.308258-0.0883169im     -0.0963825-0.0164939im     0.0438158+0.22843im      -0.0302285+0.183863im      0.111476-0.277702im        0.0391344+0.191807im
   0.172183+0.12962im      -0.126345+0.0672877im   -0.000310193+0.0187823im      -0.103001-0.0205453im    -0.0533236+0.0891776im    -0.0571926-0.241019im      -0.246581-0.00957227im    0.0807178-0.0357975im   -0.0558099-0.070299im      0.076326+0.0953814im     -0.251589+0.109865im    -0.227289-0.250063im      -0.180964+0.138003im      0.158709-0.0136595im      0.14337-0.0515785im      0.201827-0.0627696im    0.0969804+0.173304im     -0.0722687-0.00767098im    0.154245-0.0217466im    -0.165309+0.0606799im    -0.00275884+0.0796658im   -0.162157-0.0330292im   -0.128607-0.0239368im    -0.163867+0.0753877im   -0.137166+0.152924im      0.0665804+0.015717im     -0.0707718+0.190433im      -0.0969464+0.215469im      0.0718781-0.0837909im     0.0625307-0.117688im     0.0554913+0.00531192im       0.150603+0.200335im
   -0.18752+0.0519738im   -0.0155722+0.149084im      0.00819021+0.0395632im      0.0919113-0.108903im      -0.118916+0.0133161im      0.116283-0.101575im       0.184783-0.0186704im     0.0772505+0.234771im     -0.161903+0.131459im      0.127188-0.0204102im     0.0288012+0.0611145im   0.0700291-0.137935im    -0.00812502-0.00617963im   0.0492143+0.017547im      0.188824-0.131338im       0.105909+0.0871843im     0.150145-0.12422im      -0.0101522-0.129443im      0.028209-0.172203im      0.308274+0.268884im      -0.0727522-0.0309105im    0.245171-0.0566777im  -0.0992525-0.0440134im    -0.126013-0.051264im       0.3538+0.0157927im     0.0772815+0.141201im     0.00646148-0.0389408im     -0.0664815-0.0311571im     0.0634673-0.272439im      0.0554907+0.0614237im     0.135601-0.0317806im       0.0696516+0.0271784im
  0.0416066+0.0484601im    -0.256656+0.0560987im       0.128039+0.105647im      -0.0715051+0.226622im     -0.0398672-0.0602998im     -0.044012-0.000195093im   -0.131498-0.0933843im     0.0088672+0.031525im     -0.126722+0.0281951im    -0.130863+0.150952im       0.178598-0.0261974im   -0.217269+0.151154im       0.132622+0.0785639im     0.147128+0.109429im     -0.188841+0.105984im      -0.049261+0.194629im    -0.0906389+0.0828118im   -0.00415066-0.0449403im   -0.0193455+0.170175im     -0.062305+0.108628im        0.165659-0.0334428im   -0.135208-0.19143im     0.0123801-0.0154938im   -0.0764329-0.13306im      0.108145-0.115308im       0.214476+0.275309im       0.236295+0.0659586im     -0.0417312-0.163098im     -0.0148111-0.120903im       0.208484+0.039973im     0.0448525+0.0516462im       0.0550173-0.179355im
  -0.291108+0.181797im    0.00706844-0.151104im      -0.0535311-0.0801978im       0.201576-0.104786im       0.234254-0.0251965im     -0.085559-0.196552im      -0.192076+0.185125im     -0.0796157-0.00882386im   -0.146354-0.0218212im    -0.158258-0.0619038im     0.0414245+0.196894im    0.0794453-0.0806624im     0.0851272+0.158687im     0.0812934-0.0139685im     0.051447-0.0123455im     -0.124967-0.0661617im    -0.075736+0.0653427im       0.22453+0.0263287im      0.12694+0.0378649im     0.138374-0.0438374im        0.20637-0.0481484im   -0.076217-0.100539im    -0.267616-0.0856987im     0.187956-0.111295im   -0.0526545+0.0308488im      0.182929-0.223152im      -0.126447-0.0853233im      0.0160463-0.0917735im     -0.107031-0.0340014im      0.034838+0.0504276im    0.0929177+0.142415im      -0.00692044-0.0421274im
  -0.108488-0.172373im      -0.11597+0.119296im       0.0139863-0.199571im       -0.290024+0.0224117im      0.118736+0.0983846im      -0.11647+0.049566im       0.100381+0.0444506im     0.0735983-0.161181im      0.203182+0.0266648im     0.101239+0.224784im      0.0124374+0.0672366im   0.0765591-0.292952im     -0.0420537-0.00130141im   -0.018068-0.0237214im     0.128788+0.128594im     -0.0576846+0.171536im    -0.0325597-0.218903im       0.134921+0.0832503im      0.13631-0.00107742im  -0.0471068+0.234944im        0.105106+0.024632im     0.163581-0.194508im    0.0223458+0.112169im     0.0572064-0.0154463im  -0.0384803-0.116505im      0.0416986-0.226898im      0.0462465+0.226451im       0.0592054+0.0461587im   -0.00700152+0.00919189im     0.155116-0.0151064im    -0.118632-0.000144209im      -0.16329-0.14087im
 -0.0142283-0.11879im      0.0309946-0.0730616im       -0.09936+0.0325831im     -0.0873159-0.108267im     -0.0375698-0.112428im      0.0664476-0.221728im     -0.0437609-0.0408116im     -0.121001+0.0385908im    0.0878481-0.0836496im   -0.0797049-0.0423603im      0.058945+0.117713im    -0.128716+0.0212792im      0.148739-0.0957791im    0.0612737+0.128621im     -0.160072+0.203689im       0.169224+0.276134im      0.335099-0.10636im       0.0458902-0.152026im    -0.0163339-0.108177im      0.258146-0.0832407im      0.0379252+0.192184im      -0.1212+0.127888im     0.133699-0.0651103im     0.182315+0.10913im    0.00216453-0.0714972im      0.105643-0.0932046im     0.0238767+0.0115577im      0.0471394+0.238276im       0.189454+0.211783im       0.178659+0.067338im     0.0613191+0.0460773im      -0.0115187+0.0451849im
   0.135114+0.0461315im     0.105354-0.0557219im      0.0519107+0.00158774im    -0.0545023+0.0855333im     0.0312114-0.139276im     -0.0310634+0.170145im        0.20812+0.0412667im      0.120194-0.227518im     -0.201664+0.159237im     0.0260518+0.00837377im   -0.0655545+0.259331im   -0.0401093+0.0853228im     -0.272953-0.0602181im     0.206947-0.0140211im    0.0649925+0.0765515im    -0.0470095-0.00794764im  -0.0604323-0.0636594im     0.0467352+0.0451817im     0.143488+0.048167im      0.111797-0.0890654im     -0.0285728-0.025635im    -0.198395+0.0360409im    0.147749-0.0568354im   -0.0157182+0.167839im    0.0272153-0.128018im      -0.135529-0.0107769im     -0.233584-0.0786283im      -0.112446-0.0168128im      0.253144-0.187452im      0.0849102+0.21364im      0.0395634+0.268569im      -0.00677429-0.155612im
   0.069058+0.0134238im     0.076484-0.0786347im      -0.157783+0.0408493im     -0.0113086+0.136579im      0.0219673-0.0144788im      0.100573-0.283427im       0.180112+0.0811622im      0.252197+0.0731309im   -0.0421777-0.0398345im   0.00396835-0.0185355im      0.127177-0.0790545im   0.0919649+0.182038im      0.0121297+0.252713im     0.0160015+0.0847285im     0.099553-0.0645111im     -0.158932+0.00141849im   0.0950775-0.130401im        0.22861-0.12423im     -0.0646125-0.146701im     -0.327493+0.0914079im      0.0550264+0.191174im     -0.10673-0.155241im     0.143948+0.036476im     0.0191275+0.0559553im   -0.112138-0.102878im    -0.00752077-0.129785im      0.0294722-0.198265im       -0.234975-0.0449295im      0.122825-0.097435im     -0.0223217-0.140335im    0.00884049-0.201023im       0.00153873+0.0405169im
  0.0268167+0.105634im      0.196391-0.0391021im     -0.0436516+0.141448im         0.13794+0.0616419im      0.176348+0.100882im      0.0810869-0.0240355im     -0.218682-0.0704516im     0.0606196+0.0782542im     0.126211+0.00888686im   0.0629349+0.0166288im     0.0170354-0.0931526im    0.183689+0.170733im     -0.0226099+0.00598161im   0.0981431+0.183966im      0.104015+0.136905im    0.000314954+0.1998im      -0.0880658-0.163641im      -0.120502+0.0695734im    0.0425905-0.032984im    -0.0447721+0.035347im       -0.189027-0.029625im    -0.268682-0.116007im    -0.268447+0.132162im      0.113247+0.164112im      0.26098+0.190704im      -0.230282-0.032179im    -0.00972907+0.268576im       0.0929408+0.0117097im     0.0243552+0.00153634im    0.0586487+0.0424216im    0.0459852-0.087044im       -0.0349759-0.137004im
  -0.137303-0.201373im    0.00316194-0.00302325im      0.077856+0.0752268im     -0.0596871-0.162674im       0.138611+0.00210546im     0.192501+0.115497im      0.0214735-0.00722614im      0.18131-0.125784im    -0.0197311+0.239672im     -0.152277-0.0154743im     0.0377132-0.250411im    -0.277763+0.0388095im      0.144885+0.188107im      0.216376-0.206438im     -0.019884+0.0552584im      0.169779-0.0507571im     0.136695+0.0244762im      0.170802-0.00459328im     0.10415+0.288098im     0.0276104+0.0508154im     -0.0636149+0.099019im   0.00399845-0.0973474im   -0.161984-0.0626795im   -0.0335753-0.0172175im   0.0344936-0.00270488im    -0.232598-0.0168778im    -0.0654054-0.0545277im       0.165051-0.0520494im     0.0960623+0.0293157im    -0.0998767-0.00170501im   0.0128188-0.112302im        -0.117062+0.188057im
  -0.032137-0.271262im     0.0136885-0.341745im        0.204167+0.0578483im       -0.17025-0.0755219im    -0.0199446+0.121844im     -0.0688111+0.125586im      0.0856122+0.00528515im   -0.0171809-0.0170854im     -0.26805-0.0391618im   -0.0160712-0.081276im     -0.0128481-0.117755im    0.0650085-0.00641997im    0.0238956+0.0395879im    -0.057738+0.261053im       0.14877+0.0392687im    -0.0728156-0.0794374im    0.0269602-0.0815663im    -0.0261367-0.0399979im     0.266847-0.134815im      0.162171-0.128573im        0.148878-0.177195im    -0.102863-0.178146im   -0.0133536+0.158916im    -0.0768416+0.071751im   -0.0892937+0.0776612im     0.0849765+0.235441im      0.0560758+0.0134433im      -0.053748+0.15043im       -0.047765+0.113968im     -0.0777452-0.180377im      0.174571-0.0548017im      -0.0979113+0.0296849im
 -0.0895672+0.0530277im     0.208731+0.128374im       0.0430791+0.104259im      -0.0838036+0.000950614im   0.0461749+0.0335739im     0.0984043+0.0232974im       0.13602-0.0458785im     0.0480203-0.00324976im    0.010069-0.0463858im   -0.0743661+0.0406278im   -0.00160595+0.252054im    -0.014589-0.14179im     -0.00268756-0.129615im     -0.239726-0.136966im     -0.092438+0.0763071im     0.0763917-0.0483976im    -0.136836-0.015486im       0.301692-0.0148747im   -0.0841227+0.0312333im    -0.172091-0.0191609im       0.034928-0.101643im    -0.253297+0.0981506im   -0.209107-0.147082im    -0.0595777-0.130694im     0.184554+0.00719687im     0.130932+0.223523im     -0.0250138-0.0660216im     -0.0185747+0.293633im       0.148764+0.0722608im    -0.0832342-0.16823im     -0.0181237-0.198085im        -0.108784-0.194352im
 -0.0146935+0.0423842im   -0.0447144-0.109284im       0.0429262+0.18187im         0.246602-0.212026im       0.142145-0.0639754im     0.0656365-0.120291im       0.190722-0.0226315im     0.0804448-0.187829im      0.194181-0.0630387im    -0.114969+0.147017im      0.0837032-0.163223im    -0.265257+0.0462741im     -0.258419-0.0549974im   -0.0624184-0.128493im      0.133222-0.0769984im    -0.0958355-0.0408014im      0.12815-0.0752772im     -0.215441+0.172475im    -0.0690586-0.143847im    -0.0665048+0.145719im      -0.0355302-0.254669im   -0.0215911-0.1029im     0.00714875+0.00410399im    0.136012-0.0681486im  -0.0569431+0.0848111im      0.168578+0.0787516im     0.0850552-0.157008im       0.0714418+0.0901856im     0.0615139+0.100775im       0.184814-0.00124343im  -0.0195167+0.153991im     -0.000613959-0.0460222im

and then generate the state $ψ$

psi = P[:, 3]
32-element Vector{ComplexF64}:
    0.11367364418740192 + 0.16263370936233992im
    0.02810490850580827 - 0.010831886811114341im
   -0.03243273646405409 - 0.004816008843835562im
  -0.027419240250845838 + 0.023589470355517707im
    0.18463713507442586 - 0.0009394183116462618im
    0.04127369214587824 - 0.15074770155472692im
  -0.012605266842825674 - 0.14853301226687182im
 -0.0033515603503409663 + 0.030710282898760162im
     0.1276311591702522 + 0.11231602108596746im
    -0.0332473081342423 + 0.16945353569108548im
   0.059611169420756234 + 0.12595085888022617im
    0.07235457206053358 + 0.18015369786238972im
  -0.018726610817323838 + 0.285408004580917im
   -0.12179736979747789 + 0.263110948879354im
    -0.0203076720923544 + 0.2725133992500982im
    0.11345527241346148 - 0.08991238303805765im
  -0.012461579014397588 + 0.12633547645145152im
   -0.06147393660805986 + 0.08655781391607134im
    0.05569286526283618 - 0.08322227604325484im
  -0.023923076538209728 - 0.006547989505272953im
   0.026039202021030373 + 0.06620076053714816im
    0.11233681468224267 - 0.08062488968539658im
   -0.22765341919577062 - 0.08657505588306533im
  -0.011566947382555239 + 0.08646073720953144im
   -0.04967492439218382 - 0.11096176678247893im
   -0.18479384838229312 - 0.1205110413204425im
    0.03588525266617547 - 0.24249018473094827im
   -0.10374142563053758 + 0.10236206446020663im
   -0.07847992360390516 + 0.007599630023564709im
    0.29529001445795106 + 0.0013623938586538598im
     0.3038493513314457 + 0.0im
    0.18802055764553044 + 0.05739535221191118im

In the phase estimation process, we will feed the state to circuit and measure the first n qubits processed by iQFT.

r = join(ArrayReg(psi), zero_state(N))
r |> PE(N, M, U)
ArrayReg{2, ComplexF64, Array...}
    active qubits: 8/8
    nlevel: 2

Since our phase can be represented by 3 qubits precisely, we only need to measure once

results = measure(r, 1:N; nshots=1)
1-element Vector{DitStr{2, 3, Int64}}:
 011 ₍₂₎

Recall that our QFT's bit numbering is reversed, let's reverse it back

using BitBasis
estimated_phase = bfloat(results[]; nbits=N)
0.75

the phase is exactly 0.75!


This page was generated using Literate.jl.