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.253635-0.0760379im    -0.00537571+0.00116481im     0.110784-0.190967im       0.0080142-0.160959im        0.0996843-0.147688im     0.0133911-0.133206im    -0.0972162-0.217484im    0.0551651-0.231703im     -0.0921113+0.0375313im       0.205409-0.0049539im    -0.0436885+0.0332826im    0.0850122-0.0412962im       0.159529-0.00862027im    0.0913959+0.102012im     -0.162637+0.0941182im      0.186961+0.0660042im     0.174389-0.259887im      0.018263+0.0608314im     -0.111164+0.0395905im      0.036046+0.0227986im     -0.0925598+0.0764424im      0.10426-0.170843im      -0.161104-0.0125465im   -0.0440593+0.0595464im     -0.0869092-0.178943im     -0.174158-0.18174im        0.261867-0.0824825im    -0.0191743+0.0579266im   -0.0746089-0.0123427im     0.0802445-0.0977723im   -0.178266+0.0172031im    -0.187554-0.185006im
   0.0626253-0.211885im        0.107475+0.0145931im       0.06907+0.083075im        0.104221-0.00407586im      0.0876322+0.116751im     0.0718447-0.27954im      -0.161896+0.0402109im   0.0228201-0.0707898im     0.0768771-0.120248im       0.0189516+0.0692949im      0.164028-0.233204im    -0.0522076+0.0687066im   -0.000495336+0.082341im       0.172811-0.0409242im     0.107344+0.193175im    -0.00163193-0.0883246im    -0.121098-0.191814im     -0.225539+0.0920852im     0.0650977+0.292824im      -0.081541+0.0935194im     -0.0638043-0.164539im     0.0716419-0.0505587im     0.0684592+0.107546im     -0.187883+0.142739im        0.161959-0.152284im     0.0986938+0.178225im      -0.134255-0.165333im     -0.0752599-0.0590189im   -0.0184452+0.0260999im      0.145206+0.144583im    0.0568978+0.175512im      0.104151-0.0969043im
  -0.0111359+0.0169211im       0.133577-0.233866im      -0.208095+0.165632im        0.112484+0.111714im         0.134204-0.0974261im    0.0235941-0.157972im      0.117477+0.0319757im  -0.0987402+0.0218169im     0.0739602-0.0123081im       0.219084-0.199625im      -0.121442+0.0994263im    -0.277079+0.0894117im     0.00595842+0.0525651im      0.134058-0.1536im       0.0707506-0.11305im       0.0628409+0.0317975im     0.141179-0.177043im    -0.0341617-0.213723im     -0.0274657-0.12663im       0.0834848-0.124626im     -0.00010416-0.15043im       0.103715+0.0981735im     0.0744099-0.226599im    -0.0687033+0.0870367im      -0.135325-0.00909827im  -0.0222731-0.115503im      0.0129719-0.21505im         0.11257+0.0425868im     0.164731+0.184583im      0.0586447+0.181556im     0.107131-0.16869im     -0.0222099+0.0485504im
 -0.00985333-0.0465381im    -0.00760227-0.0283141im     -0.231177+0.123053im      0.00343691+0.111536im        0.0552589+0.0549444im   -0.0419958-0.0643428im     0.142176-0.116592im      0.06775-0.0838255im     0.0821006-0.171362im      -0.0711148+0.115016im      -0.016714-0.0874112im   -0.0429861+0.0896574im       0.197997-0.0845394im    -0.0275319+0.0415259im     0.119699-0.240994im     -0.0824555+0.125364im     0.0515419-0.106473im     0.0700477-0.184644im     -0.0340754-0.181379im      0.0802023-0.0159267im     -0.0578115+0.0991094im    -0.238595-0.335514im      -0.113142+0.159075im      0.155024-0.125039im       0.0463842-0.25939im      0.0762851+0.344961im    -0.00406271-0.0562106im     -0.132011-0.139581im    -0.0607836-0.0315929im    -0.0151052+0.0815387im   -0.159821-0.0308214im    -0.117532+0.0458478im
    0.144632-0.000149746im   -0.0162057-0.0827914im     -0.162113-0.0313193im       0.112724-0.0839451im       -0.206821-0.0428017im    0.0905734+0.1491im      -0.0118147-0.0881258im    0.175303+0.11606im       0.0453173+0.0528445im      0.0982795+0.109949im      0.0787866-0.0377269im  0.000401085+0.0434257im      -0.146558-0.135231im      0.0275592-0.00827091im   -0.134431+0.00729886im   0.00556948+0.0512129im    -0.256983+0.0768739im    -0.171756-0.101751im       0.134585-0.00870434im   0.00713395+0.230175im      -0.0140438+0.25941im      0.0888862-0.176567im     -0.0526872-0.0880032im    -0.251803+0.0251709im      -0.194049-0.372974im     -0.184687-0.0573546im     0.0384283+0.123018im      0.0325763+0.00907825im   0.0857465-0.00697659im   -0.0274855+0.137071im      0.24072-0.0786766im   -0.0415897+0.106952im
    0.101384-0.0489633im      -0.315985-0.0339247im       0.23233+0.146953im        -0.21366+0.0483873im       -0.213286-0.00924883im  -0.0656567-0.111741im    -0.0647441-0.0859799im   0.0458137+0.0902528im   -0.00246062-0.0817945im       0.157429+0.0938597im      -0.18631+0.0603211im    -0.107059-0.0104858im      0.0163644+0.0196194im     0.0798313-0.188606im    -0.0201353+0.00225135im    0.0692115+0.188176im     0.0554181-0.126536im      0.152179-0.221578im      0.0840318+0.173236im     -0.0204285+0.0797533im    -0.00212492-0.124846im     -0.168767-0.0135669im     0.0183052-0.0949724im    0.0787607+0.1254im          0.064201+0.00798569im   -0.129322+0.188112im      0.0192773+0.186363im       0.184085+0.283055im     -0.131721-0.123737im      -0.138173+0.050407im     0.114897+0.0721417im    0.0454388-0.119335im
  -0.0797165-0.0432099im     -0.0136086+0.125169im      0.0990602+0.0468345im       0.153967+0.0810814im       -0.105402-0.057041im      0.111348-0.0104445im    0.0297006+0.0731516im    0.209474+0.195357im      0.0836996-0.0229427im      -0.117062-0.0134826im    -0.0735123-0.106427im     -0.185441+0.00285655im      0.028448-0.0219726im      0.163302-0.119928im     0.0778314+0.110635im     -0.0884685-0.230749im     -0.137926-0.17735im      0.0423539-0.064722im      -0.178168-0.190485im       0.093356-0.0627282im      0.0750128+0.313341im    -0.0197011+0.127051im       -0.11764+0.0257643im    -0.129844+0.216926im        0.184719+0.0122106im     0.219922-0.0117128im      0.160395-0.0137603im    -0.0846893+0.245704im    -0.0292152-0.0402325im    -0.0600974-0.274764im   -0.0433003-0.149347im    -0.0796662-0.000793024im
     0.10502+0.0863512im        0.21788-0.180525im      0.0599312-0.0626878im       0.197653-0.0324223im       0.0300403-0.299194im     0.0494204-0.168832im     -0.148336-0.0348051im   0.0992165-0.100882im      -0.013183+0.0306316im    -0.00118036+0.0205259im      0.136787+0.0366793im    -0.024304-0.0197926im      0.0272777+0.162334im    -0.00151092-0.0328082im     0.130925-0.0119431im       0.19842-0.171455im    -0.0226433+0.209177im    -0.0304032-0.31424im       0.0891298+0.186473im       0.225813+0.0722961im     -0.0114828+0.00849925im   -0.221853-0.0786581im     -0.156976-0.0504376im     0.224418-0.113121im       0.0689207+0.0727822im    0.0910804-0.0875554im      0.150852+0.118769im     -0.0719678-0.0471681im     0.114993-0.0907848im     -0.036091-0.135821im    0.0591123+0.0756677im     0.204324+0.03353im
   0.0616246+0.213609im        0.101438-0.0675296im   0.000481929+0.0253954im       0.116173+0.257948im        -0.088095+0.140563im     0.0918705-0.00538231im    -0.08199-0.0502127im   -0.236284+0.0955252im     -0.175677-0.0469261im    -0.00902852-0.0265253im     -0.332943+0.0424529im    0.0887369+0.0858723im       0.121888-0.0504344im     0.0953665+0.015854im     0.0525065+0.0807001im     -0.106411+0.136265im    -0.0502367-0.047548im     -0.115126+0.117131im       0.135733+0.270027im     -0.0286574-0.182186im      -0.0445712+0.093898im      0.132966-0.0166431im     -0.155645-0.0103977im    0.0145954+0.0400539im     -0.0927494-0.00270502im  -0.0307629+0.0872661im      0.239709+0.131507im      -0.245709-0.130834im    -0.0460005+0.118193im      -0.167609-0.0313337im  -0.0726254-0.172262im      0.228423-0.0589698im
  -0.0390448+0.0458954im     -0.0865278-0.0786796im      0.185574+0.0504379im      0.0110704-0.0583535im      -0.0403512-0.238935im       0.27786+0.0775168im     -0.15609+0.159741im    -0.257797-0.122094im      0.0920346-0.0749558im      0.0511648+0.0286638im      0.135201-0.0101157im      0.18478+0.176224im        -0.20492+0.170453im      -0.237983+0.0803229im    0.0462212-0.0983586im     0.0915618-0.0439142im   -0.0212801-0.0533854im     0.337825-0.082317im      0.0244802+0.020699im      -0.100094-0.103498im       0.0245444+0.137141im     0.0408196+0.0928083im      0.110335-0.0276089im   -0.0740635+0.130865im     -0.00152581-0.200133im      0.112617+0.139698im      0.0201696-0.10947im      -0.0395775-0.119368im    -0.0217152-0.0403703im     -0.164845+0.121056im   -0.0331418-0.201743im    -0.0602541-0.103045im
   0.0946986+0.0033967im     -0.0533362+0.191212im       0.145841-0.0234821im       0.240143-0.184355im         0.276824-0.276206im     -0.117522+0.102992im      0.136604-0.0571881im   0.0125077-0.0132804im      0.076133-0.0291892im       0.103141-0.1261im      -0.00954371-0.181639im     -0.244403+0.0266184im      0.0670847+0.0190861im       0.12143+0.160714im     -0.101616-0.00222796im  -0.00895407-0.0116749im     -0.12104+0.00771269im  -0.0699181-0.0511967im      0.172307-0.0848506im     -0.122797-0.185087im        0.244044-0.142294im      0.066488-0.070021im      0.0342927+0.11403im      -0.010535+0.0660132im      -0.101849+0.138426im    -0.0893715+0.159816im      0.0105617+0.247424im     -0.0271886-0.155239im    -0.0960838+0.0372492im     -0.249564+0.0217175im   0.0407601+0.0278634im    -0.103135-0.0627045im
  -0.0615038-0.0606493im      -0.175778-0.11035im      -0.0235234-0.0237933im    -0.00570414-0.000538184im    -0.0781058+0.216789im     0.0138224+0.104216im    -0.0926805-0.0717729im  -0.0417694-0.0966737im     -0.154016-0.098371im        0.210002-0.00864246im     0.115044-0.133089im     -0.262961-0.0517816im       0.203752-0.181682im      -0.123541-0.0658917im   -0.0942675-0.0689823im     0.0635567-0.0545974im    0.0067543-0.0183131im     0.220259+0.0531993im    0.00420168+0.0945173im     -0.156288+0.176787im        0.219646-0.101488im      0.139005-0.0802982im     -0.223368-0.0423694im    0.0184116-0.000601568im    0.0559366+0.145287im      0.286251-0.108311im      0.0397397-0.108883im      -0.173449-0.138348im      0.194848-0.107365im      -0.108047-0.0267997im    0.214397-0.0641547im   -0.0388689+0.132073im
   -0.169816+0.00248116im    -0.0593671-0.0542967im     -0.157811+0.0396139im       0.170648+0.0181312im      -0.0870065+0.12859im      0.0963304-0.152494im    -0.0953778-0.0114066im    0.284368-0.0738912im     0.0556127-0.0426485im      0.0192522-0.158118im      0.0515071+0.115506im   -0.00777708+0.0661355im      0.0262869-0.0866521im     -0.216768+0.0999805im   -0.0157561+0.048787im     -0.0789574-0.201525im    -0.0438689-0.0557788im       0.1296+0.0300561im      0.100191-0.0402729im     -0.195931-0.0406908im      0.0721071-0.186617im     -0.132374+0.233444im       0.144809-0.247505im      0.117348-0.0161432im     -0.0021808-0.145037im     -0.264244+0.0675545im     0.0370885+0.213663im      -0.330345+0.0605141im   -0.0774345+0.140688im      0.0839785-0.0841478im  -0.0216941+0.0988327im    -0.034792+0.0428548im
   -0.142239-0.0453962im      -0.152051+0.0191439im    0.00884476-0.117284im       0.0651794-0.19975im        -0.0969729+0.146721im    -0.0311616-0.127769im     0.0833373-0.276392im   -0.0775357+0.0528227im      0.286802+0.12902im        0.0406726-0.0717507im      0.133669-0.142829im     0.0147699-0.162065im        -0.13326-0.113522im      -0.114155-0.00455026im   0.0385117+0.0521321im    -0.0505623+0.273019im     -0.184047-0.0600789im    0.0242624-0.0952242im      -0.06446-0.0327711im      0.245902-0.205456im       -0.239129+0.0939614im     0.029099+0.0123673im      0.159046-0.0880944im     0.141241+0.0997242im      0.0407837+0.158638im     0.0885724-0.0748542im     0.0865298-0.0607978im     -0.174546-0.0970736im    0.0183354+0.0695434im     -0.118721+0.114053im    0.0868486+0.0984361im     0.181196-0.0415166im
   -0.130429+0.149007im       0.0607917+0.173602im     -0.0116974+0.0312623im      0.0978878-0.0636918im      -0.0857925+0.0113906im   -0.0655247-0.0362922im     0.118924+0.127879im    -0.166374+0.0722122im      0.140364-0.157481im       -0.242773-0.00620141im    0.0599146+0.152164im      -0.20694-0.168093im       0.0212623+0.0226341im     -0.097428-0.149998im     -0.174905+0.172557im      0.0747934+0.178315im     0.0737647+0.189713im     0.0128889+0.0518259im     0.0580799+0.032622im      0.0341638-0.029115im      -0.0642832-0.26774im      -0.262734+0.0196615im     -0.205791-0.103209im     -0.257176+0.142886im      -0.0638097-0.279381im     0.0732201-0.0820716im     0.0313948-0.0357876im    -0.0428087-0.108717im     0.0705067-0.116194im      -0.107269-0.0373521im    -0.10332+0.0669038im   -0.0670746-0.0836539im
   0.0797708+0.161047im        -0.25708-0.061006im      0.0642856-0.00712295im     0.0458791-0.0435844im       0.0542891-0.0314557im     0.074236-0.0544428im    -0.197971-0.11585im       0.15065+0.0826704im     -0.259764+0.0736567im     -0.0445068-0.101021im      -0.163246+0.011164im     -0.055867-0.068752im       0.0292521+0.332939im     -0.0277448+0.123107im      0.161436+0.289347im      -0.267914+0.0970698im   0.00243356-0.117456im     0.0701209+0.0610036im    -0.0525173-0.239681im      -0.064288-0.0910726im    -0.00704775-0.00813655im   -0.165353-0.0256345im    -0.0082677+0.0528153im   -0.0322846-0.123303im      -0.0184728-0.176609im     0.0902467-0.108006im    0.000402089-0.0754209im      0.146214-0.225849im      0.134522-0.0463841im     0.0185553+0.0767351im    0.185817+0.130243im     0.0310806+0.0785958im
   0.0242512-0.0415752im     -0.0237442-0.130591im      -0.012192+0.174216im       -0.112831-0.1815im          0.0969675+0.112946im      0.289093+0.213515im     -0.110832-0.152243im    -0.261674-0.0297139im    -0.0962066+0.119701im       -0.235682+0.142433im     -0.0929474+0.065594im     -0.173168-0.183126im        0.173831+0.0642376im     -0.114517-0.0409811im    0.0821139-0.0978069im     0.0877681-0.0730458im    -0.301919-0.0194766im    -0.142501-0.124659im      0.0671491-0.110928im         0.1844-0.0305524im      0.0824442-0.179012im      0.192936+0.0533846im     0.0695248-0.0100404im    0.0571135+0.0641731im      0.0431733-0.103535im     -0.040359+0.0173774im      0.118493+0.0594506im     0.0127149+0.0383603im    -0.113173-0.0542451im      0.189701-0.0710753im  -0.0702806+0.10091im      -0.125127-0.0416108im
   0.0321139-0.0487662im      -0.102874-0.135603im      -0.206391-0.12561im       -0.0752482-0.0660252im       -0.108798-0.170423im     -0.145973+0.034637im     -0.055508+0.142318im     0.240267-0.0453298im    -0.0345787-0.116376im       -0.019599+0.159273im      -0.138735+0.0905147im    -0.172443+0.0922991im      -0.194161-0.0332992im     -0.153371+0.201308im     0.0756403+0.0816424im   -0.00212137+0.135208im      -0.09164-0.0870582im    0.0840764-0.0860334im      0.163138+0.103939im       0.120336-0.118204im     -0.00265829-0.0973635im     0.159013-0.102559im     -0.0520928-0.106374im     -0.285217-0.0479329im     -0.0432183+0.205523im      0.236387-0.00495252im   -0.0111236-0.0400685im     0.0140283-0.0520996im    -0.246116+0.0682136im      0.158453-0.097666im    -0.244897+0.0432981im    0.0693515+0.0503455im
   0.0852516-0.0800652im      0.0599894-0.0872916im      0.207446+0.00333417im      0.125472+0.0793854im      -0.0274656+0.0245179im   -0.0344339+0.396061im     -0.236781+0.248982im     0.146418+0.0723763im    -0.0804705-0.27945im        0.0893161-0.138064im      0.0952824-0.152419im    -0.0283243-0.171945im        0.150084-0.0449073im   -0.00265335+0.134887im     0.0285082-0.0470637im     -0.053156+0.199648im   0.000793858+0.0397463im   -0.0788777-0.059369im     -0.0563626-0.00784114im    0.0929746+0.0111804im      -0.182411-0.0840482im    -0.067219-0.0770903im      0.254736-0.0756356im    0.0750435+0.109185im       0.0126688-0.0129524im    -0.204431-0.022724im      0.0736773-0.22698im     -0.00372469+0.0586205im     0.109863+0.0213248im    -0.0761871-0.10351im     -0.191127-0.00722932im   0.0253037+0.107403im
  -0.0251233+0.0975283im      -0.070419-0.0564282im      0.050564+0.126647im       0.0345177-0.248666im     -0.000289609+0.233295im     -0.112913-0.0928943im     0.210671+0.230737im    0.0176676-0.015898im      -0.177254-0.0970347im     0.00206229+0.135789im     -0.0141625+0.126339im     -0.154916+0.0675678im     0.00594996+0.165507im       0.118206-0.0605431im    -0.223936+0.123426im      0.0362804-0.153365im     -0.137275+0.053286im      0.148026-0.0723986im     -0.145088+0.182779im      0.0785493+0.000447551im    -0.137009+0.131113im    -0.0348816-0.117682im       0.333192+0.0995625im   -0.0177399-0.199857im         0.07301+0.089248im     -0.112365+0.0066864im      0.205199+0.0191868im    -0.0653715-0.167011im     0.0293152+0.0922879im     0.0586165+0.0412293im   0.0355767-0.169578im     -0.139069-0.02545im
  -0.0320273+0.136602im       0.0631708-0.139202im      -0.130485-0.000986349im   -0.0119406-0.070742im         0.166638+0.0208047im     0.115061-0.0742337im   -0.0283352+0.139105im     0.110338-0.00704475im    -0.101283+0.00419821im     -0.183542-0.0906335im       0.20633-0.0733365im     0.263449-0.0385601im       0.315552-0.0245869im     -0.164401-0.0567674im     -0.15217+0.0298349im     0.0565082+0.172926im      0.023639-0.0523987im    -0.051756-0.0391542im  -0.000483777+0.0484218im    -0.0691626-0.236201im      0.00537997+0.00393954im   -0.110079-0.170107im     0.00285632+0.00538367im   -0.153886+0.173581im        0.110381+0.145687im     0.0999834-0.0167422im     0.0385131+0.121188im       0.144979+0.20421im      -0.256593+0.0824526im   -0.00979594+0.090344im     0.294845-0.132781im    -0.0445671+0.14645im
   -0.171592-0.0441745im       0.100384-0.0828601im     -0.041578+0.0148582im     -0.0266605-0.104832im        0.0232753+0.0341726im    0.0926846+0.0771603im     0.031924+0.0445732im  0.00293006+0.214036im       0.188229+0.0973216im      0.0213122+0.145381im      -0.105844-0.0457711im    0.0477679+0.270082im        0.177969+0.120767im      -0.123119+0.314065im    -0.0371125+0.0185537im    -0.0344658+0.154143im     -0.147361-0.174021im    -0.0790628+0.0886833im      0.030657+0.146339im       0.149741+0.248833im         0.13255-0.0413021im    -0.288416+0.151383im      -0.126977-0.0441876im   0.00991113-0.0615133im      0.0397303+0.192873im    -0.0329396+0.0191937im    -0.0237993-0.0589369im      0.106493+0.0172044im     0.246924+0.154469im      -0.109157-0.0129695im   0.0306513-0.0317631im    -0.158388-0.176613im
   0.0739666-0.163198im        0.154411-0.0853974im      0.107992-0.0429752im       0.129465+0.0676811im       -0.155019+0.0215077im   -0.0199493+0.0166328im   -0.0420039-0.178949im    -0.122091-0.150807im     -0.0343196+0.158438im       0.0195011-0.0562103im      0.149489+0.144243im     -0.282578-0.0694322im     -0.0234576+0.0897428im      0.154884+0.266296im     -0.120091-0.0395516im     -0.256674+0.0714793im    -0.104529+0.128209im      0.160924+0.125351im      0.0767356+0.165678im    -0.00791671-0.176836im       -0.121767+0.0686328im    -0.155132+0.0452051im     -0.149136+0.0131731im    0.0926331+0.0614781im      0.0823327-0.00971197im   0.0387438+0.0021112im      -0.15667+0.0269021im     0.0697634+0.192248im    -0.0925042-0.00915806im     0.188108+0.156903im   -0.0384277-0.216532im     -0.192054+0.117229im
   0.0457059-0.125231im       -0.184894+0.0068934im     -0.203243-0.172074im       0.0465438+0.0718811im        0.151951-0.0830823im    0.0766549-0.0520516im    -0.173399-0.0941194im  -0.0942479-0.153531im     -0.0355036-0.270504im       -0.150618+0.256455im      0.0688665+0.273737im     0.0185726-0.0385327im     -0.0060053+0.0029525im      0.104128-0.0562842im    -0.161605+0.244131im      -0.129063+0.0392717im    0.0667671-0.0585228im    -0.195479-0.0932116im     0.0892216-0.107283im      0.0485326+0.109034im      -0.0133603+0.068086im     0.0160154+0.051905im       0.159145-0.0515492im     0.180116+0.0839342im     -0.0150316+0.116346im     0.0257161-0.0393646im     -0.274545-0.00689911im   -0.0987431+0.00941193im   0.0662624+0.0145253im     -0.225138-0.108861im    0.0416789-0.226876im    -0.0875115-0.0667023im
  -0.0855873+0.083505im        0.202063+0.19336im       0.0462036+0.104797im        0.250161-0.0909967im       -0.284304+0.0787045im    0.0859696-0.157879im    -0.0895813-0.243963im    0.0277909-0.043389im      -0.129886+0.0916399im       0.058792+0.121304im      -0.162153-0.154843im     0.0458383-0.0526598im        0.12022-0.0389581im     -0.135348-0.0110798im    0.0576246+0.0330049im      0.137747-0.0025644im    0.0578647+0.1386im       0.0669598-0.146955im       0.153089-0.128566im     -0.0839364-0.0581733im       -0.12806-0.0607917im    0.0641908-0.0606795im       0.14188+0.0162554im    -0.211006-0.144986im      0.00608454+0.148971im    -0.0614179+0.128569im      -0.291374-0.144629im       0.150565+0.0259144im    0.0747242+0.0260426im    -0.0589614-0.212858im   -0.0206027-0.17628im     -0.0647175-0.0478409im
  -0.0292734+0.167879im       -0.137857-0.0178723im    -0.0627717-0.220051im      -0.0702029-0.202787im        0.0378718+0.0779363im    0.0922358+0.0244448im    0.0397219-0.152981im    0.0916261+0.20675im       -0.172148+0.000690161im    0.0513971-0.0419692im      0.207026-0.0220735im  -0.00426048-0.10495im        -0.275347+0.121303im       0.174429-0.064914im      0.205748-0.329311im      0.0531554+0.0108169im     0.048133-0.110156im     -0.133157+0.0838183im    -0.0542131+0.160767im     -0.0188866+0.0093241im     -0.0600397-0.268653im      -0.13155+0.0394965im    -0.0278118+0.0669768im   -0.0458164-0.013304im       -0.010446-0.100946im     0.0579676+0.0928058im    -0.0399489+0.0404456im     -0.044794+0.00583153im  -0.0276458+0.158328im      -0.073283-0.244444im   -0.0482664-0.311141im    -0.0652446+0.0258137im
  -0.0406343-0.102076im        0.300251+0.176595im       0.221486+0.138519im       -0.352248-0.177589im       -0.0478049-0.0347466im     0.197919-0.130283im     0.0372768+0.105504im     0.076376-0.0193157im    -0.0559712-0.16684im       -0.0256345-0.0888853im      0.104026+0.159968im    -0.0894809-0.114746im      -0.0931824-0.133713im     -0.0532915-0.0234728im   -0.0226215-0.0849429im     -0.177406+0.144609im     0.0274607-0.293478im    -0.0186524-0.0675944im      0.320009-0.0329596im    -0.0232423-0.105908im       0.0892213+0.131929im    0.00635153-0.0351625im    -0.0327363+0.13215im      0.0301463-0.118414im       -0.028878+0.0153536im   -0.0539533-0.110009im    -0.00172384+0.0784718im    -0.0447621-0.0787246im     0.213896+0.043081im       0.060477-0.0962023im   0.0664983-0.030197im     0.0988522+0.0629654im
   -0.149607-0.239354im       -0.146402+0.0203312im      0.147727-0.177165im       0.0800441+0.0201082im       0.0468129-0.0465952im    -0.120666-0.0926306im    0.0171287-0.0142619im  -0.0994348+0.0043477im    -0.0310709-0.0642137im      -0.145655+0.0907752im     -0.190635+0.0833839im   -0.0225001-0.0817546im     0.00897549+0.181655im      -0.188413+0.0238914im    0.0666704-0.113011im       0.168244-0.0329241im    0.0773579+0.0293249im   -0.0150898+0.0294913im    0.00309524+0.010095im       0.110524+0.0113577im      0.0361235+0.0533308im    0.0575255+0.0309317im    -0.0863078+0.194357im     -0.204755+0.0551916im       0.118865-0.0184078im    -0.219447+0.0977311im    -0.0131617+0.0407128im     -0.140457+0.142023im      0.187937+0.240142im     -0.0715386+0.147636im    0.0459742+0.0251047im    0.0903415+0.485846im
    0.249869+0.024665im       0.0618184+0.167749im      -0.194781+0.000990175im     0.155863-0.121365im       -0.0076612-0.0274591im   -0.0519034-0.196682im     0.0387636+0.0160916im   -0.173573+0.0680488im    -0.0758709-0.0461226im       0.124049-0.0322049im     -0.108249+0.0155292im    0.0291708+0.0888449im      -0.127374+0.0870979im    -0.0892233+0.0984875im     -0.16061-0.156349im      0.0384783+0.204264im     0.0273163-0.0799537im   -0.0677355+0.135714im       0.081935-0.0268965im   -0.00912422+0.111289im       0.0574936+0.0912585im   -0.0111769+0.112774im      0.0937488-0.0833401im     0.120175+0.152171im        0.264674-0.00639618im  -0.0476177+0.0717614im      0.190226-0.187798im      0.0231798-0.0710291im    -0.126378-0.28785im        0.108496-0.285295im     0.126207+0.083804im    -0.0655354+0.260285im
  -0.0486671-0.0746139im     -0.0278819-0.10525im       -0.171044+0.0834807im      -0.119471+0.0238196im      -0.0346492-0.177572im     0.0258727-0.0754556im    0.0481778+0.0132621im   0.0462247+0.0682196im      -0.15869+0.0707116im       0.116788-0.348655im    0.000386743+0.065113im     -0.131804-0.0753265im      0.0162856-0.030522im       -0.23549+0.0711553im   -0.0125573+0.142618im     -0.0217903+0.194172im     0.0803416+0.281509im      -0.12393-0.140931im      -0.176677+0.156763im    -0.00687449+0.114872im       -0.018333+0.12767im       0.179308+0.134577im      0.0581358+0.340896im     0.0110567+0.106819im       0.0933344-0.100867im     0.0919768+0.204607im     -0.0607697+0.0809145im    -0.0653539+0.0154005im    0.0972361+0.0975428im     0.0124622-0.119636im    0.0055734+0.0413224im    -0.112197-0.219097im
   -0.049093+0.169921im       0.0508875-0.0281457im     0.0980146+0.0073481im      0.0231708+0.0176372im       -0.065378-0.0117919im   -0.0973541+0.168242im    -0.0724393+0.245936im     0.164786-0.0778288im     0.0717996+0.367613im       0.0791828+0.269904im      -0.101625-0.102469im     0.0597533-0.0436724im      -0.159815+0.105054im     0.00118507-0.169163im     -0.230508+0.0990074im    -0.0175647+0.145031im      0.132369-0.107355im     -0.123654-0.126909im     0.00585774-0.0308129im    0.00882576-0.180157im       0.0447362-0.155869im      0.109711-0.000972992im   -0.139464+0.0535642im     0.242979+0.0583382im      0.0684757-0.0704936im    0.0291375+0.151114im      -0.103749-0.0452926im     -0.281618-0.0115949im      0.12003+0.0228672im       0.15222-0.0106703im    0.094853-0.0374903im    -0.149047+0.0707368im
   -0.400824+0.312152im      -0.0494882-0.0645569im      0.120421+0.180412im       0.0233555+0.00664446im      0.0152387-0.126034im      0.057744+0.048794im     0.0278272-0.0269654im    0.115381-0.0397402im      0.100367+0.0198787im      0.0668573+0.0143898im     0.0222213+0.117273im     -0.155808-0.135737im       0.0615318+0.136653im      0.0413948-0.0386811im    0.0333372-0.100071im     -0.0779469+0.0645222im    0.0192196+0.0655305im    -0.205752+0.0676397im      0.178833-0.0389552im     -0.135798+0.357088im      -0.0503269+0.17388im      0.0292199+0.0556062im     0.0179996+0.0200935im   0.00896491-0.0108177im      0.0718567+0.137614im    -0.0106731-0.00272204im   -0.0360113-0.186092im     -0.0777061-0.0656692im     -0.36763-0.0348848im    -0.0226201+0.163999im   -0.0427658-0.0289455im     0.124755+0.0955202im

and then generate the state $ψ$

psi = P[:, 3]
32-element Vector{ComplexF64}:
   0.09787641660834905 - 0.04930779376097783im
  0.026406560714146095 - 0.08971420990923369im
  -0.05684167633921871 + 0.026852751397891412im
  -0.11256608761010084 + 0.007184523855278168im
   0.21108129569334355 - 0.044752270466593955im
   0.04055073019803501 + 0.022872796346008504im
   0.06712236002253008 + 0.08017265788438074im
    0.2163279551681254 - 0.16088484549505927im
   -0.1672218505276097 - 0.04348790056219079im
   0.05480597565360489 - 0.13472988676040012im
  -0.06673097503145192 - 0.16650173544463495im
  -0.14412939283911733 + 0.06512982512588696im
  0.024461910665024386 + 0.3191314977606238im
  -0.13690861805868323 + 0.04115989340080414im
  -0.16658539983865994 - 0.06979811751583288im
  -0.12511421422320565 + 0.024218628678849607im
  -0.14862198152035558 + 0.04328374322604757im
   0.23760180128077996 + 0.07134576061875193im
  -0.06587232257628486 + 0.013150709968286094im
  -0.26298799495187647 + 0.1499885434913997im
   -0.1979184040753108 + 0.018597722338389654im
 -0.051439163622493636 - 0.1745289743406022im
   0.11883392878917838 + 0.13395523330144662im
   0.09999548619189717 + 0.023313138333585996im
   0.09235481839935439 + 0.018392899089595013im
  -0.04888007219654763 - 0.03649662927375759im
 -0.008413636904255768 + 0.1337082886705791im
  -0.22139809132357888 - 0.13224644788929613im
   0.03757515073205571 + 0.098908613114397im
   0.34351459075901414 + 0.0im
 -0.010841262601561697 + 0.11707992987572007im
   0.09436348529073098 - 0.06634561631119493im

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.