# Tag Info

## Hot answers tagged optimization

6

As requested in the comments, here is a worked example. The main body deals with minimizing $f(x)$ for a specific problem. At the bottom follows a brief discussion of constraints then a brief discussion about the general case. Let's solve the Weighted Maximum Cut problem since this Is a relatively straight-forward example Is hard classically Is a ...

4

So for hybrid quantum-classical algorithms, I suggest looking at : The Quantum Approximate Optimization Algorithm Variational hybrid quantum-classical algorithms that include the so famous Variational Quantum Eigensolver applied for Max-Cut problems PennyLane which helps you in developping hybrid computation for optimization problems and Machine Learning. ...

4

Short Answer: It is potentially hard (as bRost03 indicates in the comments). To be precise, coNP-hard. Longer Answer: In adiabatic quantum computation, the ground-space of the final Hamiltonian is typically determined by the optimum solution to some constraint satisfaction problem (CSP). If the CSP is perfectly solvable, the ground-space is spanned by (...

3

If you are looking for a more complete implementation of a quantum variational algorithm in the context of Cirq, I would recommend looking at the second example in the OpenFermion-Cirq notebook found here. It uses a custom ansatz for hydrogen in a minimal basis, but makes a bit more explicit all the required pieces. Another good example, perhaps without ...

3

Here is the best circuit I've found. It uses 14 CNOTs. Note that this circuit is not using a linear layout! It is placed on the grid like this: 0-A-1 | 3 | 2 Where 'A' is an ancilla initialized in the |0> state and '0','1','2','3' are the qubits making up the register (with '0' being the least significant bit). I verified this circuit in Quirk ...

3

Here is the best construction I've found. It uses 8 CNOTs. I verified this circuit in Quirk using the channel-state duality and a known-good inverse. The target is the middle qubit. None of the CNOTs go directly from top to bottom or bottom to top. You can switch which qubit is the the target by simply switching which line the Hadamards are on.

3

I believe I've got it down to 9 controlled-not gates: What I did was I used a set of three cNots in the place of Swap to move the two controls next to each other to achieve the last part of the standard Toffoli circuit (see here). This used 12 cNots. However, the final $T$ and $H$ gates on the target qubit I propagated through one of these swaps. This let ...

3

The Quantum Approximate Optimization Algorithm is a good place to start for analyzing the relative performance of quantum algorithms on approximation problems. One result so far is that at p=1 QAOA can theoretically achieve an approximation ratio of 0.624 for MaxCut on 3-regular graphs. This result was obtained using brute force enumeration of the different ...

3

One of the advantages, as stated in the paper you linked, is that with QAOA you can increase the precision arbitrarily, whereas QA will only find the solution with probability 1 as $T \to \infty$ which is impractical. In addition if $T$ is too long you're likely to not find the solution as the probability is not monotonic. I believe an example of this can be ...

2

In the article you mentioned it is said that classical algorithms can beat some cases of (quantum ) QAOA's as is proved in this article. So finding cases where quantum QAOA can still beat classical algorithms and can run on NISQ devices with low depth circuits is still exciting and promissing. The article uses plausible conjectures from complexity theory to ...

2

I suggest looking at how a genetic algorithm works in a context of discrete variables to understand it. They provide a methodology but you can apply other mutation/crossover techniques. Briefly, in a simple optimization problem where the variables are discrete, we can solve heuristically with genetic algorithms (which belongs to the class evolutionary ...

2

There is currently no way to check the status of a job in Qiskit Aqua: https://github.com/Qiskit/qiskit-aqua/issues/545 However, it looks like it is a feature that is coming.

2

So in your example, you try to find the quantum circuit representing the Toffoli operation. I would then change my objective/fitness function and compare the unitary matrix representing the operation. You can use an minimization objective like : $$\mathcal{F} = 1-\frac{1}{2^n} |\operatorname{Tr}(U_aU_t^{\dagger})|$$ with $U_a$ is the unitary of the ...

1

The GLOA is just an optimization algorithm (another genetic algorithm actually). So as long as your problem translates into an objective function you seek to minimize/maximize, this would be possible (even by another genetic algorithm). I suggest to first think how you encode your problem for the optimization. For example, a sequence of discrete and/or real ...

1

Let's answer my own question: it is not possible. After some research I ended up computing the "truth table" for the two possible cases: $b = 0$: $\vert 00 \rangle\rightarrow\vert 00 \rangle$ $\vert 01 \rangle\rightarrow\vert 10 \rangle$ $\vert 10 \rangle\rightarrow\vert 10 \rangle$ $\vert 11 \rangle\rightarrow\vert 01 \rangle$ $b = 1$: \$\vert 00 \...

1

Pedro! I assume you are familiar to Grover's algorithm. Therefore, I suggest to read carefully these two papers below: 1) Tight bounds on quantum searching (BBHT): it's a very broad Grover's algorithm analysis; 2) A quantum algorithm for finding the minimum (DH): this is the first Grover's algorithm application to optimization problems and we call DH (...

1

Here is tested code (also provided in one of the qiskit tutorials) lapse = 0 interval = 60 while not job.done: print('Status @ {} seconds'.format(interval * lapse)) print(job.status) time.sleep(interval) lapse += 1 print(job.status) where interval is giving in seconds (if your job requires longer waiting and execution, I would suggest to ...

1

Depending on what is your definition of "long time" the answer might be different: If it is of the order of minutes, then you can't do anything and you just have to wait for your turn in the queue. If it is several days, then there might be a problem (or a very very long queue). Anyway, you can track the status of your job, even if this status does not ...

Only top voted, non community-wiki answers of a minimum length are eligible