Theory and Application of hybrid Classical-Quantum OptimizATION aLGORITHMs

Ludmila Botelho

Institute of Theoretical and Applied Informatics, Polish Academy of Sciences

Analog computers

Introduction

Hybrid (analog + digital) computers

Introduction

Digital computers

Introduction

Quantum Computer

Introduction

Quantum Computer

Introduction

# WHAT IS A QUBIT?

$$\vert \psi \rangle = \begin{bmatrix} \alpha \\ \beta \end{bmatrix} $$

\(|\alpha|^2+|\beta|^2=1\)

(\(\mathcal{l}_2\)-norm)

\(\alpha,\beta\in \mathbb{C}\)

# QUANTUM MECHANICS RECAP

Quantum computing devices

Noisy

Intermediate-

Scale

Quantum computing

Where is \(\omega\)?

N

What are prime factors of

?

What can we do?

Hybrid solution

$$ H_P = - \sum_{i > j} J_{ij}Z_i Z_j - \sum _i h_iZ_i, $$

2-Local Ising model

Pauli \(Z\) Gates on \(i\)-th qubit

Ground state = optimal solution

NP-hard!

Proposition: Find the minimum energy in a landscape

What can we do?

$$ H(t) = \left(1-\frac{t}{T}\right)H_0+  \frac{t}{T}H_P  $$

  • Can be encoded in Binary Values

Ising model

  • Mathematical model to describe magnetization

\( s_i \in \{-1,+1\} \)

\(  s_i \leftrightarrow x_i = \frac{1-s_i}{2} \)

\( x_i \in\{0,1\} \)

quadratic unconstrained binary optimization

  • Minimizing quadratic functions

$$ y=x^TQx $$

  • Penalty Method

$$ \text{min  } y=f(x) $$

$$ \text{subject to:  } x_1 +x_2 + x_3= 1 $$

$$\text{min }y=f(x)+P\left(\sum_{i=1}^3 x_i -1\right)^2 $$

Binary variables

Constants

Initialize the annelear:  \(|+^n\rangle\)

$$ H_{QA}(t) = g(t/ \tau )H_{\text{mix}}+ h(t/ \tau)H$$

Adiabatic evolution

Ground state of H (hopefully)

$$ | 0110\dots 010\rangle$$

Ground state of:

$$ H_{\text{mix}} = \sum_i X_i$$

What can we do? - QAOA

\(g(t/ \tau )H_{\text{mix}}+ h(t/ \tau)H\)

Trotter Formula

Quantum Approximate Optimization Algorithm

$$|p,r\rangle = \prod_{i=1}^k \exp(-\mathrm{i} p_iH_{\rm mix})\exp(-\mathrm{i} r_iH) |+^n\rangle $$

Inspired by Quantum Annealing

What can we do? - QAOA

First part: theory

How to improve QAOA?

  • Error mitigation

  • Better search in the feasible space

    • By using different enconding schemes
    • By homotopic optimization

ChApter 3

ChApter 4

Improving QAOA

Traveling salesperson problem

$$ A\sum_{t} \left(\sum_v b_{tv} -1\right)^2 + A\sum_{v} \left(\sum_t b_{tv} -1\right)^2 + B\sum_{t,v,w} W_{v,w}b_{t,v}b_{t+1,w}$$

QUBO formulation for n cities

Traveling salesperson problem

Cost of route:

\(\pi: \{ 0,\cdots,n-1\} \rightarrow \{ 0,\cdots,n-1\}  \)

\(\sum_{t=0}^{n-1}W_{\pi(t),\pi(t+1)} =\sum_{t,v,w}W_{v,w} \delta(\pi(t),v) \delta(\pi(t+1),w) \)

city visited at time \( t\)

$$0$$

$$1$$

$$2$$

$$3$$

$$4$$

\(W_{1,2}\)

$$0$$

$$1$$

$$2$$

$$3$$

$$4$$

\(W_{1,2}\)

time \( t\)

$$0$$

$$1$$

$$2$$

$$3$$

$$4$$

$$00001 $$

$$10000 $$

$$000$$

$$100$$

binary

one-hot

$$00010 $$

$$00100 $$

$$01000 $$

$$001$$

$$010$$

$$011$$

QUBO

HOBO

Encondings?

How many qubits?

  • Required number of qubits   \( \rightarrow \; \; n^2\)
  • Number of routes \(\;\;\rightarrow \;\; n!\)

Overlap with feasible space can be reduced!

  • Optimal solution encoding  \( \rightarrow \; \; \log_2(n!) \sim n\log_2n\)

\(n^2 \; \rightarrow \;n!/2^{n^2} \approx2^{-n^2}\)

\(n\log_2 n \; \; \rightarrow \;  n!/2^{n\log_2 n} \approx 2^{-\Theta(n)}\)

VS

Number of qubits can be reduced!

Adam Glos, Aleksandra Krawiec, and Zoltán Zimborás. "Space-efficient binary optimization for variational computing." npj Quantum Information 8, 39 (2022)

Different encodings -  Different circuits

HOBO

QUBO

HOBO

  • Mid-circuit error mitigation
  • It is efficient to implement
  • Mixed-encoding QAOA works in a smaller space
\}

Available for Quantum Alternating Operator Ansatz

Hypothesis

Possible explanation

We detect transfer between infeasible and feasible space

Combining encondings

\(|0 \rangle\)

{

\(|0 \rangle\)

{

\(|0 \rangle\)

{

\(|0 \rangle\)

{

\(|0 \rangle\)

}

\(|0 \rangle\)

}

\(|0 \rangle\)

}

\(|0 \rangle\)

}

\(V\)

\(V^\dagger\)

QUBO

\(V\)

\(V\)

\(V\)

\(V^\dagger\)

\(V^\dagger\)

\(V^\dagger\)

\(H_{\text{mix}}\)

\(H_{\text{mix}}\)

\(H_{\text{mix}}\)

\(H_{\text{mix}}\)

Success probability of measuring the quantum state on the feasible space (left). The area spans the mean energy \( \pm \) standard deviation over 40 instances of TSP. Simulation were done for TSP instances with four cites.

My contribuition: circuit design and code

EC-QAOA

Initialize the quantum state

\(|0 \rangle\)

{

\(|0 \rangle\)

{

\(|0 \rangle\)

{

\(|0 \rangle\)

{

\(|0 \rangle\)

}

\(|0 \rangle\)

}

\(|0 \rangle\)

}

\(|0 \rangle\)

}

\(V\)

\(V^\dagger\)

QUBO

\(V\)

\(V\)

\(V\)

\(V^\dagger\)

\(V^\dagger\)

\(V^\dagger\)

\(H_{\text{mix}}\)

\(H_{\text{mix}}\)

\(H_{\text{mix}}\)

\(H_{\text{mix}}\)

Combining encondings - Circuit design

Error mitigation via post-selection

\(V\)

\(V^\dagger\)

QUBO

\(V\)

\(V\)

\(V\)

\(V^\dagger\)

\(V^\dagger\)

\(V^\dagger\)

\(H_{\text{mix}}\)

\(H_{\text{mix}}\)

\(H_{\text{mix}}\)

\(H_{\text{mix}}\)

Post-Selection

\(V\)

\(V^\dagger\)

QUBO

\(V\)

\(V\)

\(V\)

\(V^\dagger\)

\(V^\dagger\)

\(V^\dagger\)

\(H_{\text{mix}}\)

\(H_{\text{mix}}\)

\(H_{\text{mix}}\)

\(H_{\text{mix}}\)

\(V\)

\(V^\dagger\)

QUBO

\(V\)

\(V\)

\(V\)

\(V^\dagger\)

\(V^\dagger\)

\(V^\dagger\)

Mid-Circuit Measurement

PS

PS

PS

PS

APPLICABLE FOR OTHER QAOA SCHEMES!

Error mitigation via post-selection

Results - ERROR MITIGATION

Comparison of various error-mitigation methods. The red dashed line corresponds to "do nothing" approach. The blue solid line describes the effect with the post-selection at the end only. Finally, the green dotted line includes post-selection for both final measurement and mid-circuit measurement. Areas span the minimum and maximum value obtained. Top row shows the deviation in the energy, relative to the scenario proposed in the paper. Bottom row shows the probability of accepting circuit run.

\( \frac{E - E_{pure}}{E_{ours} - E_{pure}}\)

 

Ludmila Botelho, Adam Glos, Akash Kundu, Jarosław Adam Miszczak, Özlem Salehi, and Zoltán Zimborás, Error mitigation for variational quantum algorithms through mid-circuit measurements, Phys. Rev. A 105, 022441 (2022)

What did we learn?

  • New concept: Mid-circuit error mitigation
  • Number of qubits and depth comparable to other QAOA classes
  • EC-QAOA works effectively in a smaller subspace

Alternative strategy: Homotopic maps

Energy landscape

C+\sum A_{i,j}\cos(\theta(E_i-E_j)+B_{i,j}),

Text

Hamiltonian-Oriented Homotopy QAOA

H_{\text{mix}}
H_{\text{obj}}
H(\alpha)=g_{1}(\alpha)H_{\mathrm{mix}}+g_{2}(\alpha)H_{\mathrm{obj}},\quad0\leq\alpha\leq1.
E_{\alpha}(\vec{\gamma},\vec{\beta})\,=\,\langle\vec{\gamma},\vec{\beta}|H(\alpha)|\vec{\gamma},\vec{\beta}\rangle,
g_{1}(\alpha) = 1 -\alpha, \quad g_{2}(\alpha) = \alpha,

Hamiltonian-Oriented Homotopy QAOA

My contributions: writing, coding and experiments

Akash Kundu, Ludmila Botelho, and Adam Glos, Hamiltonian-oriented homotopy quantum approximate optimization algorithm, Phys. Rev. A 109, 022611 (2024)

Results

Performance

What did we learn?

  •  The method does not increase the impact of the noise
  • We numerically confirm that our method outperforms state-of-the-art approaches
  • Our approach is well-motivated for nonlinear optimized functions

Second part: Applications

Can we USE quantum annealing for creative tasks?

"...might compose elaborate and scientific pieces of music of any degree of complexity or extent"

Ada Lovelace

Charles Babbage

Music Generation

4

1

rest

measure

Durations

2

Pitches

C

D

A

E

G

F

B

C

Music Generation

x_{i,j} = \begin{cases}% 1 & \text{note at position $i$ is $j$,}\\ 0 & \text{otherwise.} \end{cases}

$$\sum_{j \in P} x_{i,j} = 1$$

How to define the binary variables?

$$\left ( 1- \sum_{j \in P} x_{i,j} \right )^2$$

  • Pitches
  • Rules about consecutive notes

$$x_{i,C} + x_{i+1,D} \leq 1$$

$$x_{i,C} + x_{i+1,C} + x_{i+2,C} \leq 2 $$

$$P=\{p_1,p_2,\dots,p_k \}$$

\(x_{i,j}\) for \(i \in [n]\) and \(j \in P\)

$$P=\{\mathtt{C}, \mathtt{D}, \mathtt{E}, \mathtt{G}\}$$

Melody Generation

Optimization

$$ -\sum_{ \substack{i\in [n-1]  \\ j,j' \in P}} W_{j,j'} x_{i,j} x_{i+1,j'} $$

weights

Exemple: Ode to Joy excerpt

$$W_{F\#4,E4} = 2, $$

$$W_{F\#4,F\#4} = 2,$$

$$W_{F\#4,G4} = 1$$

melody Generation

    $$\sum_{\substack{i \in [n] \\ j \in D}} d(j)y_{i,j} = L$$

  • Duration of notes
y_{i,j} = \begin{cases}% 1 & \text{note at position $i$ has duration $j$,}\\ 0 & \text{otherwise.} \end{cases}

Rhythm Generation

$$ \sum_{j \in D} y_{i,j} = 1$$

    $$D = \{1,2,3,4\}$$

    $$j \in D$$

Harmonization

x_{i,j} = \begin{cases}% 1 & \text{chord at position $i$ contains note $j$,}\\ 0 & \text{otherwise.} \end{cases}

$$\sum_{j \in P} x_{i,j} = 3$$

$$(1-x_{i,p_{i_j}})$$

G

E

D

G

B

B

G

Ashish Arya, Ludmila Botelho, Fabiola Cañete, Dhruvi Kapadia and Özlem Salehi, Applications of Quantum Annealing to Music Theory. Quantum Computer Music, Springer: Methods and Advanced Concepts, pages 373-406 (2022)
Boléro (Ravel, Maurice)

?

?

?

?

?

?

?

Monophonic

Polyphonic

Music is complex

  • Phrase Identification

But also adaptable!

Huang, Jiun-Long, Shih-Chuan Chiu, and Man-Kwan Shan. "Towards an automatic music arrangement framework using score reduction." ACM Transactions on Multimedia Computing, Communications, and Applications (TOMM) 8.1 (2012): 1-23.

But also adaptable!

  • Phrase Identification

But also adaptable!

But also adaptable!

Job Scheduling

But also adaptable!

Job Scheduling

But also adaptable!

Job Scheduling

What is relevant?

QUBO Formulation

  • Variables and objective function
  • Entropy

 - Pitch and rhythm

- Maximize information

$$x_{ij} =\begin{cases}1,& \text{$j$'th phrase of track $i$ is selected}\\ 0, & \text{otherwise.}\end{cases} $$

$$- \sum_{i=1}^N\sum_{j=1}^{P_i} e(p_{ij})x_{ij}$$

$$E(s) = -  \sum_{i=1}^N P(x_i)\ln P(x_i)$$

QUBO Formulation

  • Constraints

$$x_{ij} = 1 \iff m_{ik}=1  k \in S_{ij}$$

$$\sum_{i=1}^N m_{ik} = M \ \ \text{for} \ \ k=1,\dots,K $$

Set of measures in phrase \(j\) of \(i\)’th track

Number of measures

Number of tracks after reduction

  • Similar to fixed interval scheduling

binary variable

Results

Experiment results for entropy varying chain strength and annealing times. The dashed lines correspond to the simulated annealing best result and the dotted lines to the hybrid solver solution. The square, round, and star dots correspond to chain strength values 0.1, 0.2, and 0.3, respectively

My contributions: main concept, QUBO formulation, code, experiments...

Ludmila Botelho and Özlem Salehi, Fixed interval scheduling problem with minimal idle time with an application to music arrangement problem, arXiv:2310.14825

Whad did we learn?

  • Music generation can be mapped to a QUBO problem
  • Music reduction can be seen as a special case of job scheduling
  • It is hard to find proper encodings to this problem

Conclusions

  • Quantum Annealing can provide solutions for music composition and reduction formulated as optimization problems

None of the methods investigated shows advantage over classical algorithms !

  • The variations of QAOA showed improvement compared with state of the art version

other works

Thank you!

Dziękuję!

Obrigada!

धन्यवाद!

 Teşekkür ederim!

Köszönöm!

ধন্যবাদ !

Made with Slides.com