0% found this document useful (0 votes)
33 views

Variatinal Quantum Algorithms Lesson 4

Uploaded by

Ernesto Campos
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Variatinal Quantum Algorithms Lesson 4

Uploaded by

Ernesto Campos
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

INTRODUCTION TO VARIATIONAL

QUANTUM ALGORITHMS
Lesson 4

Ernesto Campos
Moscow Russia
December, 2021
[email protected]
Lesson content

1. Quantum assisted quantum compilation


2. Abrupt transitions in quantum compiling

2021 Campos 1
Quantum assisted quantum
compilation
Quantum assisted quantum compilation

• Compilation consists on converting instructions from a high level


programming language into machine language the computer can
understand.
• In quantum computing it means taking a quantum circuit or gate,
and translate it into quantum gates native to the quantum computer.
• It can be used to find a more efficient implementations of certain
quantum gates.

2021 Campos 2
Quantum assisted quantum compilation

We seek to minimize a metric function as follows:

1. Prepare a parametrized gate sequence of the form


p

U(θ) = V(i) (θi ), (1)
i=1

where V(i) (θi ) are the ansatz layers. This circuit will be used to
approximate a target unitary T.
2. Calculate the cost function to train the parametrized gate sequence,
viz.
{ }
d U(θ), T ∈ [0, ∞).

3. The algorithm then updates the parameters based on the calculation


of the cost function.
4. Iterate steps 2 and 3 until certain threshold is reached.
2021 Campos 3
Trace in diagrammatic notation

The usual cost function used for QAQC is


1
d(A, B) = 1 − abs(⟨A† B⟩HS ) (2)
2n
where ⟨A, B⟩HS = Tr(A† B) is the Hilbert-Schmidt inner product.

2n Tr(T U)
1
= ⟨Φ+ | (T† U ⊗ 1) |Φ+ ⟩ = ⟨Φ+ | (U ⊗ T∗ ) |Φ+ ⟩

2021 Campos 4
Circuit

| 21n Tr(T† U)|2 =

|0⟩ H • • H

|0⟩ H • • H
U(θ)
..
.
|0⟩ H • • H

|0⟩ X X

|0⟩ X X
T∗
.. ..
. .
|0⟩ X X

2021 Campos 5
Advantages

Some of the main advantages include:

• Resilience to some types of coherent noise


• Optimal parameter resilience.
• Barren plateaus can be mitigates with the use of alternative cost
functions

2021 Campos 6
Abrupt transitions

Layerwise training is a technique commonly used to train variational


algorithms. It offers certain advantages like shorter training times and can
mitigate barren plateaus. Unfortunately there are certain cases where
layerwise training leads to no training at all until certain critical amount of
layers are trained simultaneously, this is called an abrupt transition.

2021 Campos 7
Layerwise training

A layer stack Sj is a block composed of j layers of an ansatz. After an initial


stack is optimized, its parameters are fixed and the next stack of j layers is
considere d
j
(m)

Sj (θm ) = V(i) (θi ),
i
q
(3)
∏ (m)
U(θ) = Sj (θm ),
m=1

where m corresponds to each stack being added, and the total depth of the
circuit is p = q · j.

2021 Campos 8
Distance to the identty

When aiming to compile k - controlled gates (e.g. k-Toffoli gate), the


compilation problem becomes more and more difficult with the number of
controlling gates. This is because the k - controlled gates become
exponentially similar to the identity, for example:

k-Toffolli = I2n −2 ⊕ X (4)

d(k-Toffolli, 1) = 1/2k (5)

2021 Campos 9
Numerical results

_ _ _ _ 
 
  RZ RY RZ • RY
 
  RZ RY RZ RY •
 
  RZ RY RZ RY •
  .. .. .. ..
  . . . .
  RZ RY RZ RY •
 
_ _ _ _

Figure 1: Left: 2 layers of the checkerboard ansatz. The dashed region encloses
one ansatz layer. Right: a single layer of the hardware efficient ansatz (HEA).

2021 Campos 10
Numerical results

0.25 -Toffoli
4-Toffoli
0.20 3-Toffoli
2-Toffoli
cost function

0.15

0.10

0.05

0.00
2 4 6 8 10
layers per stack

Figure 2: k-Toffoli gate trainability for multiple numbers of layers per stack of the
HEA.

2021 Campos 11
Numerical results

2-controlled X, 1 layer
1.0

0.8

0.6
d(U,T)

0.4

0.2

0.0
0.0 0.2 0.4 0.6 0.8 1.0

d(U,I)

Figure 3: Contour of 10 million points representing unitaries made by a single


layer of the HEA with random parameters, and their distance to the identity and
the Toffoli gate illustrating eıα(θ1 ) 1 is the global minimum.

2021 Campos 12
Analytical results

Theorem (Roots of ansatze)


Consider a single layer of either the HEA or the checkerboard ansatze, the
cost function takes extrema for the roots of

V(θ1 ) − eıα(θ1 ) 1 = 0. (6)

The theorem can be proved by showing that

∂j d(V(θ), k-Toffoli)|θ=θ1 = 0,
(7)
∂j2 d(V(θ), k-Toffoli)|θ=θ1 ≥ 0.

As a consequence of his theorem, the identity heuristic initialization would


prevent training for the studied cases.

2021 Campos 13
Thanks For your attention!

You might also like