common.title

Overview
Service overview
Terms of service

Privacy policy

Contact

Sign in
Sign up
common.title

We have roughly created a new QAOA framework for blueqat.

Yuichiro Minato

2022/05/14 22:43

For a new era of quantum computer application development

The framework for solving combinatorial optimization problems, called qaoa, has been rewritten for the new tensor networks. I will explain some of the differences from before.

First, the tensor network simulator does not store entire state vectors. Therefore, it does not use the conventional mechanism called state vectors, and there is no derivation of calculations from them.

Instead, what it uses is the direct computation of expectation values. Expectations are in the form of matrices sandwiched between state vectors. They can be obtained without knowing the entire state vector.

If the expectation values can be computed efficiently, there is no need to be troubled with variational calculations in machine learning or eigenvalue problems.

Therefore, the QAOA framework using tensor networks needs to be rewritten so that the framework does not go through the state vectors. Let's look at the actual code.

To use this one, you need to install a separate library.

pip install --no-deps -U git+https://github.com/jcmgray/quimb.git@develop autoray
from blueqat import Circuit from blueqat.utils import qaoa from blueqat.pauli import qubo_bit as q from blueqat.pauli import X,Y,Z,I hamiltonian = (15-(1+2*q(0)+4*q(1))*(1+2*q(2)))**2 step = 4 result = qaoa(hamiltonian, step) result.circuit.run(backend="draw") result.circuit.run(backend="quimb", shots=1000)
<Figure size 1800x720 with 1 Axes>output
Counter({'100': 16,

         '111': 125,

         '011': 648,

         '101': 85,

         '110': 113,

         '000': 2,

         '010': 3,

         '001': 8})

Above is the code to factor 15. QAOA using a tensor network simulator, and it can be computed with p=4. Since the state vector cannot be obtained, after minimizing the expected value, you need to take your own samples.

You can get the parameters in result.paramas and the circuit itself in result.circuit. I think it is enough if you can get the circuit with parameters. Although the expected value cannot be calculated directly in the actual device, the opportunity to take the amplitude directly outside of training has decreased considerably, so I feel that we are a little closer to the actual device in that the calculation that used to be all done with the state vector is now replaced by the expected value plus sampling.

It is quite a pain to calculate QAOA with more than 50 qubits. Even on a real machine, if the depth is too deep, it is not possible to calculate at all, so by using the TN simulator, we can simulate closer to the real machine than ever before.

© 2024, blueqat Inc. All rights reserved