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.154466-0.0668785im     0.0256434-0.0614543im    0.172397-0.166338im      -0.172378+0.15717im      -0.0568084-0.0792279im     -0.127684-0.139391im        0.0182339-0.0218074im      0.106782-0.00616844im     0.113334+0.061226im     -0.0422501+0.105689im      0.182495-0.132953im      0.153187+0.184803im    0.0710733-0.0353851im      -0.20738-0.120476im     -0.0623706-0.208066im     0.00402877+0.188837im       0.153991+0.0751451im      0.125303-0.121403im      0.0192401-0.0924047im      0.179626+0.0671547im    -0.176707+0.0466256im     -0.0324947-0.00772547im    -0.192758-0.0128996im    0.0587643+0.236392im     -0.0104614+0.205707im      -0.168042+0.0149902im    -0.0246486+0.116747im       0.146829+0.090387im     -0.0365583+0.237998im    -0.0821906+0.122849im    -0.0132714+0.0183308im   0.0934847-0.269306im
 -0.0903062+0.137627im      0.0882853-0.133746im   -0.0629129+0.0639404im     -0.271456+0.0371105im     0.0878568-0.0829552im      0.195481+0.125891im       -0.0326927+0.181646im      0.0208957-0.100339im       0.194205+0.0825999im    -0.0236802+0.0196715im    0.0403246-0.0615684im   -0.0256183-0.025458im   -0.0085558-0.125069im      0.0496385-0.0462341im     -0.126102+0.0498518im       0.12191-0.0936365im     0.0482224-0.0145468im    -0.0378108-0.107775im     -0.0857222+0.192863im       -0.10375-0.0077629im    0.0405529-0.0311469im       0.203061+0.00271063im   -0.0223033+0.0948748im   -0.0396977+0.0692091im    -0.0793553-0.210729im      -0.213877-0.0728361im     -0.046886+0.276485im      -0.125443-0.280121im      -0.290322-0.193275im      0.154314+0.113981im     0.0282675+0.200686im    0.0615917-0.166597im
 -0.0243116+0.0449583im       0.08659-0.123627im   -0.0257703-0.201009im      0.0645857+0.147723im       0.060203+0.0407841im      0.130657-0.117568im        -0.111051+0.241002im       0.186787+0.0327511im     0.0280263+0.134803im     -0.0913629+0.0139811im    -0.219273+0.222426im    -0.0208124+0.0747719im    0.139339-0.188304im       0.111262-0.0695921im     -0.235857-0.0513382im     0.0532888+0.149479im      -0.177293+0.119682im     -0.0201285-0.0209427im    -0.0525627-0.116584im      -0.105499-0.18377im    0.000139034+0.0334904im      -0.152838-0.199113im    -0.00788962-0.0317558im    -0.102607-0.196247im       -0.11784+0.0355233im   -0.00527966-0.0262468im   -0.00320331+0.046554im       -0.10323-0.0058805im      0.124729+0.18301im      0.0992874+0.224384im      0.180477-0.20366im      0.103832+0.182891im
 -0.0995332+0.0240269im      -0.06019+0.0824569im  -0.0159437-0.148058im      0.0377547-0.0710814im      0.267045-0.0868621im    -0.0748384+0.186041im        -0.176475+0.0319478im      0.315951+0.0263307im     -0.130454-0.269747im     -0.0929656+0.0278239im   -0.0679016-0.098514im    -0.0265294+0.168608im   -0.0582389-0.207744im       0.013013+0.106926im       0.153746+0.118074im     -0.0680544+0.109482im      0.0483083-0.127187im       0.038444-0.12377im       0.0498568+0.137873im      -0.018022+0.169077im      0.181867+0.0162872im       0.118956-0.0292299im    -0.0168173-0.0386902im   -0.0110512+0.100287im     -0.0739988+0.286037im       0.223649+0.0124282im       0.20435+0.20711im       0.0718645+0.00637707im   -0.0538382-0.0407877im    0.0712074-0.0496768im    0.0464039+0.0345253im    0.156751+0.174161im
  0.0927428-0.000365184im  0.00142662+0.151227im   -0.0413511-0.0331972im    -0.0281697+0.255854im      0.0534566-0.149536im     -0.0777586-0.0624235im       0.0935685+0.244611im     -0.0240247+0.0768686im   -0.00974397-0.0432456im      -0.25226-0.0872159im     0.144789+0.174175im     -0.138703+0.0750492im    0.116524-0.0514624im     0.0178285+0.174223im      0.0537005+0.123418im       0.147624-0.170533im      0.0601004+0.0540744im    -0.0802407+0.0820225im     -0.133904+0.119501im       0.124259+0.1845im       0.0655582-0.023262im       0.0215353-0.217088im     0.00320912+0.108016im      0.105649-0.145685im    -0.00751349+0.0132194im      0.012757-0.101018im      -0.227096+0.0124123im       0.19872-0.198207im       0.110553+0.237386im     -0.225194-0.132428im     -0.162156+0.137509im   -0.0527783+0.012544im
  -0.116389+0.190408im        0.11013-0.0333169im   0.0837329-0.10711im      0.00135652-0.146772im         0.1201+0.0682897im     -0.155934+0.0237853im       0.0313295+0.164582im     -0.0409174-0.233634im      -0.120065-0.0325992im    -0.0524453-0.142987im      0.273053+0.162392im      0.025916-0.199153im    -0.104199+0.103965im      -0.138187+0.0187857im    -0.0744971-0.065252im         0.1002-0.14622im      0.00411048+0.0683781im     0.0886625+0.0798876im      0.207527-0.00343835im     0.378527-0.0823596im    0.0390733-0.0313574im       0.240238-0.0914226im     0.0425557-0.0438555im    -0.160651-0.0615709im     -0.114536+0.0711687im      0.142793+0.270003im      -0.119799-0.0051746im    -0.0564633+0.0432669im    -0.0708264-0.0417911im    0.0489636+0.179096im     0.0731787-0.0983896im   -0.045369+0.0558172im
  0.0547794-0.0743856im     -0.149189+0.0623443im  -0.0460655-0.0477245im      0.142932-0.120122im      -0.434589-0.11482im        0.127706+0.13595im         -0.184501-0.000811818im   -0.109208-0.123009im      0.0339583+0.083381im      0.0345028-0.0560709im    0.0559629+0.0359448im   -0.0177234+0.100531im    0.0434986+0.0402356im      -0.07281+0.292415im       0.169559-0.0735067im     0.0445196-0.000146098im   0.0746928+0.0667724im     0.0348627-0.250218im     -0.0755715-0.0214927im     0.0113016+0.0821312im    0.0318962+0.0278484im       0.179873+0.0561854im     0.0824332+0.157583im     0.0018474-0.0965514im    -0.0574371-0.0259769im    -0.0705375+0.0318999im      -0.22883+0.217104im      -0.200823+0.216332im      0.0803723+0.152031im      0.113466-0.0149481im    0.0677319-0.0784641im     0.22677+0.0615147im
   0.107242+0.264506im     -0.0054635+0.117774im     0.087823-0.176657im      0.0715513-0.0694134im    0.00325582+0.121558im       0.142208-0.0537794im       0.0445016-0.00735243im    0.0798043-0.133315im       0.034075-0.0841435im     0.0516438+0.0371845im     0.103411-0.144139im     0.0980462-0.122422im    0.0618169+0.154393im     -0.0527089+0.0317626im    -0.0908865-0.196792im      -0.134525-0.0695095im       0.13086-0.0477218im    -0.0546614+0.0300173im    0.00195332+0.0930567im     -0.261946+0.214466im    -0.0103894-0.263864im       -0.166915+0.00693374im   -0.0509456+0.0174847im   -0.0678566-0.132939im     -0.0551548+0.0104152im    -0.0193459-0.0140066im     -0.111847-0.181684im       0.248885-0.0157377im     0.0300779+0.12899im       0.237468+0.0826481im     0.153571+0.320376im     0.139054+0.121793im
  0.0780668-0.246963im      -0.114073-0.263324im   -0.0879765-0.0912446im    -0.0336596+0.119216im     -0.0457239+0.211835im      0.0551644+0.251091im        0.0229043-0.0295792im      0.145977-0.154361im     -0.0846431-0.000207902im   -0.124829-0.235311im     0.0382307-0.193946im    -0.0676795-0.185358im   -0.0369835-0.131001im      0.0368444+0.0668654im     0.0023783-0.143507im     -0.0734515-0.134897im     -0.0888316+0.0908001im     0.0855798+0.202107im      -0.172588-0.208075im     -0.0690428+0.35828im        0.17017-0.0634043im     -0.0152077-0.0620885im     0.0272226-0.0780913im   -0.0345667+0.0197621im     0.0798321+0.095254im     -0.0608483-0.0108519im     0.0499318-0.0418092im     -0.130481-0.00334836im    -0.021421+0.0345202im   -0.0576903+0.169431im    -0.0649201-0.0698775im  -0.0885553-0.166435im
   0.121513-0.0880437im    -0.0917205-0.0338073im   -0.139782-0.0412281im     0.0420252+0.0267786im     0.0783995+0.0474073im   -0.00939264+0.0619202im     0.000372181+0.135089im       0.159554+0.0326354im     -0.211521-0.060883im     -0.0357875-0.130035im     0.0799471-0.0507731im     0.183217+0.0705791im    0.203617+0.0784218im     -0.107413+0.0279081im     0.0794182-0.0518606im     0.0581099+0.0731938im      -0.29462-0.0275831im     0.0395796-0.02546im       -0.244372+0.261304im      0.0551999-0.309342im      -0.10724-0.14476im        -0.134787+0.032392im      0.0901764+0.264527im     -0.110095+0.112667im      -0.197968+0.101771im     -0.0782002+0.0201804im    -0.0693535-0.137772im     -0.0608377+0.198709im     -0.0922079-0.125026im   -0.00242184-0.130486im     0.0493798+0.136851im    -0.106003-0.166064im
   0.053117+0.120761im      0.0368192-0.0614365im  -0.0633904-0.25641im       0.0648704-0.0670158im     -0.102146+0.148665im      0.0810593-0.248572im     -0.000972069+0.0872455im     -0.125262-0.123478im     -0.0457758+0.00155131im     0.161626-0.0934344im     -0.18162-0.164588im     -0.102402+0.0495728im   -0.211707-0.147667im      -0.122398+0.00703918im     0.189542+0.15415im      -0.0152442-0.0726667im      0.148819+0.0705881im     -0.138938-0.0284957im     -0.210706+0.0624332im    0.00814548-0.153041im     -0.139817-0.062435im        0.141948+0.139124im      -0.120566-0.170589im      -0.14463+0.0126409im     -0.104102+0.17271im       0.0328297-0.245744im     -0.0320059-0.00490177im  -0.00818959-0.0307449im     -0.066733+0.0156584im    -0.334777+0.131934im       0.01116+0.0402148im   -0.113423+0.0552657im
 -0.0840747-0.0844215im     0.0206349-0.172061im   -0.0393147+0.0510842im      0.153828+0.123479im       -0.10338-0.0460637im     -0.087525-0.0979458im      -0.0394168+0.234383im     -0.0389106+0.078191im     -0.0103884+0.148863im      -0.188556+0.0845073im    -0.308611-0.137139im      0.222499-0.156312im   -0.0217574-0.0172459im    -0.0336443-0.0613853im      0.095639-0.18352im      -0.0573039-0.0605387im      0.242271-0.029193im      0.0986841+0.178896im       0.136673-0.119761im      0.0146687-0.0177565im    0.0430384+0.000673855im     0.113081+0.033122im     -0.0475109+0.0795186im     0.106585-0.0718994im     -0.330774+0.129197im       0.103688-0.102212im      -0.130165-0.0516184im     0.0048674-0.054685im     0.00111352-0.206705im       0.19569-0.225649im     -0.163709+0.0479829im   0.0575894+0.0126137im
  0.0946085+0.119861im     -0.0349337-0.0979508im    0.183638+0.117643im      -0.252161+0.188877im      -0.110672+0.0797515im     -0.368006-0.105527im       0.00344142-0.0942772im     0.0373409-0.0887845im     -0.110676-0.0836497im    -0.0859751-0.00944877im     -0.1643-0.0391217im   -0.0655624+0.0961873im   -0.316526-0.00135637im     0.285352+0.191865im      -0.166842-0.14129im       0.0748092-0.121226im      -0.120241+0.0996647im     0.0789366-0.192656im     -0.0645783-0.00503674im    0.0124193-0.0270946im    -0.084372-0.0975007im      -0.102144+0.242686im       0.110003+0.160999im    -0.0587925-0.0464592im    -0.0831702-0.043167im      0.0855397+0.0359486im     0.0281181+0.0122064im     0.0425533-0.00139449im   -0.0857302+0.0304763im   -0.0261727+0.00293749im  -0.0938931+0.0270424im    0.169057+0.103526im
  0.0759156-0.0211449im      -0.43106-0.0045621im   -0.132267+0.136739im      -0.213712+0.0615106im    -0.0162042-0.0362903im    -0.0236857-0.0823793im       -0.343471+0.0153308im     0.0327133-0.061953im        0.12257-0.0470485im    -0.0167611+0.0642912im      0.16876+0.160841im    -0.0707139-0.109132im     0.170404-0.0881087im     -0.104125-0.103im         0.0647963-0.165827im     -0.0404534-0.145448im      0.0713877-0.161939im      0.0351143+0.0864968im      0.129615+0.0214657im     0.0612818-0.186068im    0.00741424-0.153405im       0.0333978+0.269408im       0.108957-0.0486566im   -0.0656081-0.0584644im    -0.0312646+0.0414561im     0.0561369-0.199241im       0.214735+0.0148964im     0.0475579-0.137676im       0.146779+0.125395im   -0.00870117+0.091823im     0.0571281-0.0531137im  -0.0683322+0.00848464im
   0.154832-0.142404im      -0.122411-0.0958783im    0.082097-0.020477im       0.150362-0.147211im     -0.0644968-0.0501102im    -0.0612811+0.175685im        0.0390515+0.164862im      -0.229011+0.104119im        0.11819-0.205418im       0.206406-0.0597936im    0.0198519-0.0262762im       0.1112+0.0602849im   0.0364826-0.213983im       0.130821-0.0298223im       -0.1591-0.1162im        0.0949537+0.165922im      -0.109442-0.0790211im     -0.125925+0.0679149im      0.130078+0.179905im       0.155561+0.0270233im   -0.0500896-0.103835im       -0.156918+0.0668812im    -0.0741772-0.17699im       0.106204-0.0331249im     0.0220667+0.0287893im      0.131973-0.0809973im     -0.168868+0.0335571im     -0.039149-0.0511485im     -0.277717+0.141354im      0.120442+0.148494im     -0.289564-0.0110435im   -0.024337+0.0716047im
  -0.123819+0.156624im       0.122559-0.081036im    0.0520351+0.382224im     -0.0468819-0.00383804im    0.0508509+0.0450708im     0.0255528+0.214181im       -0.0457406+0.128555im       0.167824-0.0950006im   -0.00577781-0.100038im      0.0312687-0.15642im      -0.135862-0.040357im      0.115409+0.171762im     0.029069+0.13843im       -0.271683+0.168777im     -0.0567447+0.00629249im    -0.199213-0.0662726im      0.180931+0.0371314im    -0.0888616+0.202594im      -0.152372+0.0478095im     0.0947862-0.0781748im     -0.14035+0.169858im       -0.203227+0.0659981im      0.106461-0.246413im    -0.0806622-0.0990648im     0.0881071-0.0101254im    -0.0497791-0.0569362im    -0.0389795+0.0774357im    -0.0510129-0.0457207im    -0.0200461+0.187719im     0.0287086-0.153262im    -0.0214125-0.107309im    0.0926256-0.00323171im
    0.17808-0.0585954im     0.0450575+0.244078im     0.229261-0.239254im      0.0359709+0.0611109im     0.0383575-0.097788im      0.0465276-0.0488794im       0.0171697-0.0964137im      0.184184-0.00137261im   -0.0979545+0.135082im     0.00253332-0.0283547im    0.0244173+0.0360607im   -0.0153968-0.0969233im   -0.181473-0.0116253im    -0.0486374-0.0388055im     0.0581084-0.0340841im    -0.0309378-0.10444im       0.0629698-0.212241im       0.102415+0.100257im      -0.112267+0.1197im        0.0214633-0.012174im     -0.156493+0.0834161im     -0.0596682-0.00862237im     0.120681+0.0522541im    0.0551186-0.256298im       0.025857-0.0914775im    -0.0807108-0.199534im      0.0360433+0.237832im       0.159873+0.108735im      -0.207934-0.0991182im     0.215234+0.042171im     -0.109142-0.349094im    -0.150325-0.097175im
   0.102535+0.0584656im      -0.10627-0.0117677im  -0.0519562+0.031091im       0.194376+0.220172im     -0.0508195+0.14313im       0.0258524-0.0866008im      -0.0536247+0.138459im      -0.110223+0.0175175im     0.0615118+0.0371628im    -0.0228578-0.204798im     0.0767886-0.0769122im     0.129149-0.0526411im   0.0845301+0.0581286im    -0.0730933-0.0560587im    -0.0506877+0.0713296im      0.153922-0.150934im     -0.0902458+0.0068299im      0.235377-0.120844im      0.0867592-0.00276204im     0.182132+0.122351im     0.0362479+0.283441im       -0.175235-0.0178491im    -0.0287048-0.10052im      0.0347438+0.0830109im      0.148738-0.0931168im    -0.0233598-0.226168im       0.175815+0.0771679im      0.118834+0.122309im      -0.181187-0.217499im    -0.0935883-0.0109926im     0.208711+0.111731im     0.214023+0.249122im
   0.188664-0.0912552im     0.0988809-0.0078159im    0.116108+0.165238im       0.188443-0.0276104im       0.20942+0.00197221im   -0.0837039-0.130868im       -0.0635528+0.0876537im      0.119802-0.118614im       0.148945+0.192916im       0.344944-0.172315im    -0.0152959-0.192344im     0.0346908-0.0182634im  -0.0405244-0.0563056im      0.095227-0.160036im    -0.00854717+0.00682123im   -0.0157581+0.0404996im     0.0785428+0.0533767im      0.214088+0.132284im     -0.0913818+0.0236939im     0.0217637-0.141745im      0.176501-0.187189im        0.206703-0.0916673im      0.115735+0.22863im      0.0187029+0.0989021im      0.177706-0.0816588im      0.068522+0.0523303im      0.049666+0.131042im      0.0254002+0.0287443im     0.0931131+0.27097im     -0.0475257-0.0876675im   -0.0407947+0.0704089im   0.0947404+0.0576352im
 -0.0442055-0.0324793im     0.0722136-0.0540576im   0.0353655-0.0293134im     0.0811365-0.0636373im     0.0603112-0.148597im        0.16559-0.151562im         0.119685+0.0716806im     0.0656706-0.140148im     -0.0815545-0.331827im     -0.0176756-0.129409im     0.0729162-0.0397921im    -0.186105-0.024566im     0.251662+0.206868im       0.229642-0.251298im     -0.0156571-0.281181im      0.0255063-0.14923im        0.129912+0.00456246im    -0.103229-0.0966153im     -0.166422-0.0645467im     -0.024368-0.0507391im    -0.108031+0.187662im       0.0450161+0.172433im     -0.0400021+0.131016im      0.213283-0.00553352im    0.0926136+0.178018im     -0.0379513+0.0699149im     0.0708358+0.0546027im     -0.152959-0.0583332im     0.0100818-0.0795622im   -0.0352597-0.0139345im    -0.120696-0.0743778im   0.0345163+0.176003im
 -0.0238717-0.298222im      0.0500871-0.228984im    0.0749607+0.0734253im    -0.0502128+0.181275im      -0.135748+0.013321im     0.00290513-0.12331im         -0.102303-0.0705321im     0.0825324+0.0777135im     -0.274861-0.119231im       0.103493+0.153072im     0.0278189+0.0752457im    0.0549447-0.356266im    0.0182622+0.0550759im    -0.0882927+0.0398597im    0.00653304+0.137708im      0.0337012-0.0471464im     0.0639856-0.038038im     -0.0890591-0.151159im      -0.128128+0.187225im      0.0184477-0.0991119im   -0.0306445-0.261192im       0.0612296-0.200351im      -0.102874-0.248287im    0.00636341+0.0754867im      0.152916-0.00512675im    -0.142081+0.121752im     -0.0658763+0.0703451im      0.077501-0.0618777im     0.0118181-0.0284757im    0.0765789-0.0456705im   -0.0323743-0.0639302im    0.173525+0.202442im
    0.21662+0.0533082im     0.0776678-0.0674623im  -0.0968421+0.181094im       0.129868+0.130428im      0.0229401+0.150641im       0.157266-0.000122182im     0.0358259-0.112103im      0.0751249-0.0909551im    -0.0459277+0.125031im      -0.124443-0.294388im     0.0385793+0.19137im    -0.00434491+0.260567im    -0.046454-0.15359im      -0.0832375-0.117522im      0.0782752+0.0323177im    -0.0549612+0.00990873im   -0.0205627-0.220706im     -0.0131159-0.250251im       0.140184-0.240476im     -0.0352668-0.0849782im   -0.0853054-0.185989im       0.0399941+0.10182im      -0.0636745-0.150093im       0.15658-0.107054im      0.0355857+0.106693im     -0.0117371+0.269067im      -0.121601+0.111894im       0.167124-0.0619913im    -0.0182947-0.0902631im    0.0739755-0.00508911im   -0.103225+0.131328im    -0.048158-0.0494625im
  -0.106266-0.0432369im      0.169676+0.154084im    -0.138741-0.106416im      0.0700978+0.25161im        0.243959-0.0575587im      0.104422-0.0825518im       0.0480704-0.31536im        -0.12783+0.0474045im      0.126556-0.0490285im     0.0877679-0.0265475im   -0.0151708+0.136905im     0.0291801-0.112026im    0.0358266-0.165462im     -0.0146473+0.241107im      0.0853167-0.179413im       0.157951-0.0611575im     0.0152017-0.0395539im      0.056827+0.131782im      -0.130196-0.0239489im      0.029116-0.104225im     -0.101744+0.0221636im        0.05249+0.060094im       0.190998-0.195127im     0.0407293+0.00585134im   -0.0327648+0.0252268im      0.143645+0.0279928im     0.0609952-0.115289im      -0.189497+0.0662879im    -0.0753062+0.0448605im    0.0576438+0.0488426im   -0.0702841+0.185475im     0.347037-0.146803im
  -0.108573+0.0225808im    -0.0753205+0.0506392im   -0.202939+0.0763887im     -0.153201+0.109533im      0.0308906+0.0996058im     -0.120501+0.00932555im       0.199132-0.00150844im    -0.153748-0.205793im     -0.0753841-0.179422im       0.222354+0.0290202im     0.042441+0.0269065im     0.160378-0.0818356im   0.0641306-0.0105376im      0.100308-0.150309im        0.26093-0.0148461im     -0.254114+0.1592im        -0.175298+0.186342im       0.243739-0.115808im      -0.124901+0.0453281im    -0.0741815-0.0130473im    0.0222829+0.126483im       0.0657016-0.0897107im     -0.125558-0.0817441im      0.13295-0.32668im       -0.131817-0.0815684im      0.116131-0.0458887im    -0.0574192+0.159367im       0.122416-0.0777311im    0.00281354+0.0614982im    0.0503105-0.00832071im   0.0652816-0.0491058im   0.0120156-0.0882629im
  0.0239369+0.278921im      0.0115575+0.244807im    -0.040706-0.00619252im     0.131715+0.0762624im     -0.151876-0.00390052im     -0.12626-0.142013im        -0.104094-0.0437895im     0.0840234-0.0221351im     0.0972773-0.147739im      -0.291433-0.0194627im    -0.171868-0.118414im    -0.0525664-0.175046im    0.0782462+0.227374im     -0.0891877-0.14274im       0.0850525+0.0375416im     0.0421958+0.170063im      -0.272613+0.127628im     -0.0606617+0.140568im       0.055758+0.0171909im    -0.0567615-0.0265891im    0.0982906-0.191978im     -0.00607869+0.0442643im     0.0277224-0.145013im    0.00368256+0.12151im        0.167197-0.00979903im    0.0335848-0.00688952im    -0.121611+0.322879im      -0.141126-0.00638335im  0.000253656-0.0248913im   -0.0111424+0.0859179im    -0.173019-0.0128957im   0.0483914-0.151291im
  -0.186087-0.0157645im     -0.215408-0.044652im    0.0427486-0.148674im       0.181752-0.031679im       0.130799-0.0164906im    -0.0191174-0.163686im     -0.000930843-0.133426im      -0.144003-0.0839363im     -0.256749-0.111624im       0.142576-0.0401282im   0.00726389+0.088712im     0.0906806+0.318494im     0.022467+0.0797278im   -0.00356638+0.167495im       -0.11943-0.151516im      0.0779777-0.0638043im     0.0037422+0.109161im    -0.00548981+0.132928im      0.0514307-0.21977im       -0.106989-0.0653289im     0.202671-0.151682im      -0.0150917-0.083655im       0.138363-0.0908668im    0.0214526+0.178842im     -0.0743733-0.137296im      -0.198179-0.134559im     -0.0562211+0.224289im       0.098089-0.209841im     -0.0585442-0.081595im     0.0307231-0.144178im     0.0657669-0.0513913im   -0.114154-0.0171007im
  -0.161595+0.194051im       0.118838-0.119805im    0.0596013-0.0351032im     0.0608366-0.0166237im      0.015193+0.019349im      -0.090834-0.0612835im       0.0516758+0.144336im     -0.0443864+0.128983im      -0.164445+0.0502503im    -0.0254508-0.0454256im    0.0636176+0.161217im     0.0671252-0.197154im    0.0446721-0.215258im      0.0369166-0.0455014im      0.233812-0.0314452im     -0.244299+0.0202075im    -0.0785964-0.101004im      -0.111712-0.200018im      -0.100482-0.151076im      0.0647513+0.162603im    -0.0995643+0.0495208im     -0.0211786+0.120522im       0.275663+0.0600331im    -0.047199+0.338024im      0.0936034-0.202986im      0.0192181-0.167458im     -0.0227156+0.0356967im    -0.0361555+0.0330861im     0.0606165+0.193388im      0.202863+0.0183131im   -0.0578889+0.110161im    -0.166941+0.0821037im
  0.0702828+0.177653im      -0.111782-0.0628371im  -0.0447439+0.144994im       0.180263-0.0987137im     -0.104939-0.031656im       0.215794+0.00187092im      0.0557418-0.256806im        0.17603+0.0386219im     0.0199808-0.0745833im     0.0533111+0.00178744im  -0.0707563+0.051751im      0.102056-0.0262513im   0.0683121-0.0552373im    -0.0736551+0.0599801im     -0.171136+0.0102632im     -0.144597-0.12632im       -0.194559+0.125366im      0.0514014-0.000589639im   0.0405329+0.0599743im      0.108056+0.0846136im    -0.278531+0.0665038im       0.242415-0.231707im     -0.0217007+0.179412im    -0.0238982+0.176439im      -0.216864-0.0373154im     0.0625385-0.0966647im     0.0981723-0.0459913im      0.178212-0.159411im      0.0885984-0.0269756im   -0.0827859+0.151252im     -0.275875-0.117777im     0.114374+0.00179631im
   0.040141-0.00825525im   -0.0710738+0.134208im     0.071497-0.0965607im    -0.0706813+0.0620195im     -0.101445-0.29987im       -0.116467+0.150863im       -0.0509228-0.0839107im     -0.046218-0.12327im        0.176696-0.0478332im     0.0528907-0.160561im     -0.206263+0.134088im     0.0251536-0.0683358im   0.0762985-0.249461im       0.107537-0.064339im      0.0819203-0.0867476im     -0.221261-0.146053im     -0.0211542+0.182185im      -0.218262+0.157316im     -0.0711309-0.114511im       0.140461-0.117735im    -0.0120276+0.0208982im     -0.0448345-0.0917302im     -0.208667+0.0322102im    -0.245886+0.0723767im     0.0996958+0.00920887im    -0.142361+0.182159im      0.0120298+0.0444137im       0.20419+0.130127im     -0.0447514-0.182702im      0.055126-0.110208im     0.0904899+0.147007im   -0.0286999+0.0883407im
 -0.0516172-0.117935im     -0.0268663+0.0890853im   0.0393624+0.0301708im   -0.00889572+0.0195738im     -0.311735-0.0609986im    -0.0679981-0.151534im         0.310917+0.0139218im      0.265854+0.0994355im     0.0578288+0.180442im      0.0726464-0.223404im    -0.0151121+0.0967102im   -0.0528241+0.103966im      0.17534+0.146279im       0.057251+0.165574im     -0.0572549+0.0273008im   -0.00834838+0.0935358im     0.0771946+0.110726im      0.0118176-0.0316557im     -0.106942+0.083383im      0.0932526+0.0179144im     0.106345-0.0625138im       0.136503+0.0998178im    -0.0562723-0.154103im    -0.0456319+0.0569292im      0.050511+0.0460184im      0.309671-0.0669072im      0.174591-0.0851022im    -0.0224712-0.197914im     -0.0849706-0.0763323im      0.27685+0.0652516im     0.169834+0.0520478im   -0.148553-0.056155im
 0.00711246-0.00219914im      0.14389+0.0913838im    0.217813-0.0640201im     -0.107078-0.0619078im   -0.00833175+0.137708im       0.062033+0.0559942im      -0.0435657-0.0348774im     -0.161974+0.0275169im     0.0451937+0.144219im      0.0801786+0.0477556im    -0.107392+0.112727im    0.00794154+0.0875838im  -0.0318847-0.0517919im     -0.216649-0.107734im     0.00736054-0.150327im     -0.0438834-0.427298im       -0.30046+0.0148196im      0.086846-0.0748835im    -0.0910435+0.235194im    -0.00899563+0.0293606im     0.215586+0.0168227im      -0.134962+0.0404776im     -0.167231-0.00840751im    0.186797+0.186597im     0.00203345+0.225043im       0.127424+0.00540704im   -0.0510346+0.0534591im     -0.123154-0.156183im       0.199544+0.0231748im    0.0973156-0.120476im      0.027385-0.0705839im  -0.0104213-0.0179942im
   0.121463-0.202269im      0.0121955+0.243789im    -0.209619+0.0530114im     -0.059332+0.0460764im     0.0691441-0.0347591im    -0.0397594-0.0429783im       0.0732229+0.00368243im     0.216284-0.18589im      -0.0568738+0.00349137im    0.0743968+0.0171596im   -0.0536891+0.0841201im    0.0840904-0.106089im   -0.0790412+0.0493567im    -0.0912537-0.0102324im     -0.244462-0.136676im     -0.0989659-0.0611704im      0.138989-0.15983im       -0.188397-0.175304im      0.0628821-0.0626813im    -0.0263298+0.0229054im      0.13593+0.0855041im      -0.131715-0.0554067im     -0.174533-0.0465956im    -0.015472+0.196931im      -0.231977-0.276314im       0.230414-0.0739512im     -0.145297+0.137533im      -0.187195+0.16472im      0.00503609+0.0318576im    -0.211456+0.0369041im   -0.0437397+0.0632569im  -0.0817239+0.0330938im

and then generate the state $ψ$

psi = P[:, 3]
32-element Vector{ComplexF64}:
  -0.25935510664600103 + 0.09478292314305527im
   0.06484284702701683 - 0.02004156821278374im
  -0.06691954133137876 + 0.13790753455347504im
  -0.11856186401168418 - 0.01271906925799389im
    0.3967249660026457 + 0.0im
   0.02011506528711116 + 0.1377685133403337im
  -0.07944774444795025 - 0.3640371619987801im
   0.05473029993603189 - 0.02454377197580281im
  -0.14042983063929637 + 0.0367671707070787im
  0.038355128864508516 + 0.13080258493030697im
  -0.10869304651012549 + 0.023596493933644817im
    0.1512638881300231 + 0.11532013847241374im
  -0.06005284379041625 - 0.15232548252320316im
  -0.15231283218150266 + 0.07429761873488927im
  -0.26137785872871794 - 0.04969539224555819im
   0.01651421804381516 + 0.12111245285768184im
 -0.036159165918327504 + 0.08280287719996068im
  -0.09620489332153309 - 0.09648666657782423im
  -0.05548680544310966 + 0.09600178447243098im
 0.0028001572082093223 + 0.1290857706132965im
   0.04876754110017994 + 0.018609408551361367im
   0.05161095391358228 - 0.1221288983179583im
  -0.06509580845516072 - 0.012639882356135498im
    0.1578418287869519 - 0.10329315091781562im
   0.06097166252372035 - 0.03902389494376708im
  -0.05191931247274008 + 0.09598043039917856im
   0.11461009748598527 + 0.1381186823886483im
    0.0779131964201685 - 0.13030690084284227im
   0.14278882421827355 - 0.14302163659197828im
   0.15891376773433744 - 0.062244369847441444im
  -0.14305158858526434 + 0.09612848744265465im
  -0.17079482149186798 + 0.12459054827492705im

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.