QAOA: QAOA

Description Usage Arguments Value Examples

View source: R/QAOA.R

Description

Implements a clause-based version of Quantum Approximation Optimization Algorithm (Farhi, Goldstone, and Gutmann 2014) <arXiv:1411.4028>. Takes as input a set of clauses and performs Controlled-Phase and Rx gates to perform optimization. See "An Introduction to Quantum Optimization Approximation Algorithm" (Wang and Abdullah 2018) for explanation.

Usage

1
QAOA(clauses,p=1,gamma=pi/p,beta=pi/(2*p),displayProgress=FALSE,byCycle=FALSE)

Arguments

clauses

Matrix that specifies the clauses. Each row is a clause. Each row must contain the same number of columns as qubits, the bit length of the clauses. 0 and 1 are values which are added to clause, ignored bits should be set to any other value.

p

Number of iterations that algorithm will run. Each iteration applies U(C,g) and U(B,b)

gamma

Angle for U(C,g), currently the same for all iterations. Should be between 0 and 2*pi

beta

Angle for U(B,b), currently the same for all iterations. Should be between 0 and pi

displayProgress

Boolean which specifies if progress should be shown. If TRUE, a bar plot is continually updated showing the amplitudes

byCycle

Boolean which specifies if function should return the circuit. If TRUE, rather than performing the algorithm it will generate and return the equivalent circuit.

Value

Ket after algorithm is applied

Examples

1
 QAOA(rbind(c(0,0),c(0,1)))

QuantumOps documentation built on Feb. 3, 2020, 5:07 p.m.

Related to QAOA in QuantumOps...