2026年4月10日金曜日

Geometric Optimization with a Variational Quantum Algorithm

Let’s use quantum computing to find a regular pentagon inscribed in an “amoeba-shaped” closed curve! (→日本語版はこちらです

🟠 Searching for an Inscribed Regular Pentagon
It has already been proven (with some exceptions) that for any simple closed curve, there exists a set of four points that form a square. This is known as the inscribed square problem. But what about a regular pentagon—or regular polygons with even more sides? Do they always exist on any closed curve? In fact, this question has not yet been fully resolved in mathematics.
    In this article, instead of pursuing a formal proof, we take a computational approach. Using quantum computing techniques, we attempt to numerically find such a pentagon—within a certain tolerance of error.

🟠 Applying a Variational Quantum Algorithm (VQA)
We use a hybrid quantum-classical method known as a Variational Quantum Algorithm (VQA). The basic idea is as follows:

Ansatz (quantum circuit):
We represent the five vertices of the pentagon by parameters 𝑡𝑖∈[0,2π], which correspond to positions along the curve. These parameters are encoded as rotation angles (e.g., 𝑅𝑦 gates) in a quantum circuit.

Cost function (classical side):
We define a function that enforces the geometry of a regular pentagon:
All five edges should have equal length (minimize the variance of distances between adjacent points)
All five diagonals should also have equal length (minimize the variance of diagonal distances)

Optimization:
A gradient-free classical optimizer (such as COBYLA) updates the circuit parameters to minimize the cost function—i.e., to make the shape as close as possible to a regular pentagon.

Implementation:
Using the Qiskit 2.x Sampler, we interpret the quantum circuit state as geometric coordinates. The Ansatz produces five angles 𝜃𝑖, which are treated as curve parameters 𝑡𝑖. From measurement results, we estimate expectation values and evaluate the current geometric configuration on the classical side.

🟠 Why VQA (and not QAOA)?
Another approach would be QAOA (Quantum Approximate Optimization Algorithm). QAOA would discretize the curve and search for the best combination of five points. In contrast, VQA performs a continuous search over the curve. This continuous nature is a key advantage of VQA in this setting. I plan to discuss this distinction in more detail in a future article.

🟠 Visualizing the VQA Process
First, take a look at the animation below.
    As the closed curve moves and deforms like an amoeba, the VQA continuously tracks and updates the candidate pentagon. Watching this process, one gets the impression that quantum algorithms are not only useful for chemistry or finance, but also for exploring problems in pure geometry.
    Next, we fix a single closed curve and observe how the VQA searches for a regular pentagon. The following animation shows a representative example.
🟠 Accuracy of the Discovered Pentagon
The figure below shows the accuracy achieved by VQA for an equilateral triangle, square, and regular pentagon.
    As the number of sides increases, achieving high precision becomes more difficult. Nevertheless, the pentagon case still reaches a high level of accuracy. 

For the edges:
Mean edge length: 1.096
Standard deviation: 0.00016

For the diagonals:
Mean length: 1.773
Standard deviation: 0.00043

    These results indicate that the obtained shape is very close to a true regular pentagon.

🟠 Running on Real Quantum Hardware
In this work, all experiments were performed using the Qiskit simulator. Running this on real quantum hardware is more challenging. For example, under the free-tier Open Plan, session-based execution is not available. This makes it difficult to directly run hybrid quantum-classical loops like VQA. So, a practical workaround is:
Perform most of the optimization on a simulator, Then submit only the final few evaluations as jobs to real hardware. I plan to report on this approach in a future post.

0 件のコメント:

コメントを投稿