News

日本語 · English · 中文

When AI was tasked with building a quantum computer cloud, it took just 3 minutes and 37 seconds – anyone can do it

You can’t just buy a quantum computer and hand it over for people to use directly. That’s because you need a component to translate the programs written by users into a language the machine can understand. When generated by an AI, it ran in 3 minutes and 37 seconds, consisting of 354 lines of code. Only five components are required, and just two of them are difficult. Using diagrams, we explain what is happening and the order in which things should be built.

I bought a quantum computer. I thought I’d let researchers outside the company and customers use it as well.

So, what do you need besides the machine?

I had a generative AI create it. It took 3 minutes and 37 seconds.

The first file was placed at 3:15:13, and it ran and produced the correct answer at 3:18:50. It resulted in a single program of 354 lines, and all the numbers presented in this article were generated by running that program.

In the past, this part would have required reading several specialized books and taking several months. Now, it runs in that amount of time. This article shows all of its contents.

First, the flow from the user’s perspective

It is very easy for the user.

  1. Write a program on your own computer
  2. Send it
  3. Wait
  4. Receive the answer

It is no different from online shopping. The difficult part is the receiving side.

Five staff members are involved in between

The mechanism for lending a quantum computer to people. The program sent by the user passes through reception, translation, verification, and a queue, is computed on the quantum computer, and the result delivery staff returns the answer.
The mechanism for lending a quantum computer to people. The program sent by the user passes through reception, translation, verification, and a queue, is computed on the quantum computer, and the result delivery staff returns the answer.

The program sent cannot run as is. Five staff members are involved in between.

Staff MemberWhat They Do
① ReceptionVerify who made the request
② TranslationConvert it into a language the machine understands
③ VerificationVerify that the computation remains the same after translation
④ QueueingWait in line until the machine becomes available
⑤ Result DeliveryReturn the answer

Three of these are the same as in ordinary internet services. ① Reception is like logging in to a shopping site, ④ Queueing is like a line for orders, and ⑤ Result delivery is like a delivery notification; the processes are unchanged. Many people can build them.

The difficult ones are only ② Translation and ③ Verification. This is unique to quantum computers.

Why is translation necessary?

Quantum computers have different usable instructions depending on the model. It is common for instructions found in textbooks to not exist on actual machines.

Missing instructions are re-expressed by combining the instructions the machine has. This is translation.

Let’s see how much it changes by looking at an actual record when the most basic program was sent.

Instructions written by the user: 2
Instructions sent to the machine: 22

2 became 22. That is an 11-fold increase. The user does not need to know this. The translation staff does it silently.

The most important part is actually “Verification”

This is the most important point I want to convey in this article.

Quantum computer programs do not output an error even if they are wrong.

In an ordinary program, an error causes it to stop or produce an obviously incorrect number. A quantum computer does not behave this way. It runs to the end and returns an answer that looks plausible.

I actually tested it. I added just one extra instruction to a correctly translated program and ran it.

Results of the correct circuit and the broken circuit. Both display plausible numbers, making them indistinguishable.
Results of the correct circuit and the broken circuit. Both display plausible numbers, making them indistinguishable.

The left is the correct answer, and the right is the wrong answer. Both display “plausible” numbers. No error is output.

This program should actually output only either “00” or “11”. The wrong one outputs only “01” and “10”. Without knowing the correct answer, you cannot tell which is correct.

If you lend it to people, this is a major issue. The user receives the wrong answer and uses it for research or work without realizing it.

The verification staff stopped it properly

So, can the verification staff detect this? Let’s pass the same broken program through.

Correct Translation  : Matched   Deviation 0.0000000000000005
Broken Translation   : Not matched Deviation 1

It was stopped. The correct one matched with a deviation level of calculation error, with zeros continuing to 15 decimal places. The broken one clearly showed a “deviation of 1”.

Therefore, the order of creation is determined.

Build the verification staff before the translation staff. Do not return anything that has not passed verification. This must be decided from the beginning; otherwise, adding it later is very difficult.

Verification takes time, so prepare two types

However, verification takes time. Moreover, it becomes significantly heavier as the number of variables increases. I actually measured it.

SizeThorough VerificationRough Verification
Small (4)0.006 seconds0.010 seconds
Medium (6)0.019 seconds0.011 seconds
Large (8)0.273 seconds0.029 seconds

When small, thorough verification is faster, but when large, it reverses, creating a 9-fold difference.

Therefore, I prepared two verification methods. The “rough” one is a method that tries multiple random inputs to see if the same answer is returned before and after translation.

However, this is not proof, only that “no error was found.” Therefore, I decided to always write and return which method was used along with the answer.

What is stopped for safety

Since I am letting outsiders use it, there are places I must secure. I actually tested it and confirmed that everything stops properly.

Unknown users cannot enter

No key         → Rejected
Random key     → Rejected

Do not execute strange things sent

Unknown instruction   → Rejected
Non-existent number   → Rejected
Program too large     → Rejected
Too many calculations → Rejected

Instead of running whatever is sent as is, only pre-determined instructions are allowed through. Anything else is not accepted, regardless of its form.

Do not show others’ answers

Another person specifies someone else’s reception number → “No such number exists”

It answers “does not exist” rather than “you have no right to view.” This is to avoid teaching that such a number even exists.

Keep records

03:18:50  Tanaka Lab   Reception   2 instructions
03:18:50  Tanaka Lab   Verification   Thorough verification 0.001 seconds   2→22
03:18:50  Tanaka Lab   Completion   0.054 seconds

Who sent what at when, how it was verified, and how long it took. This allows tracking if a problem arises later.

I made a dangerous mistake while building it

I will write it honestly. During the process, I made a mistake where the verification staff was not looking at anything.

The verification staff returns two things: “whether it was correct” and “how much it deviated.” I failed to receive this, treating “a reply was received = Pass” without looking at the content. This allowed mistakes to pass through.

I noticed and corrected it while running and checking it. However, this is a type of mistake that cannot be discovered absolutely without running it.

Anyone can build it. But please follow the order.

After reading this far, did it seem difficult? What I actually did was this.

  1. Ask a generative AI “what is needed to lend a quantum computer via cloud”
  2. Have it build the five staff members that appeared, one by one
  3. Run it
  4. Have it fix any mistakes

I did not use any special knowledge. I did not read any specialized books. The 3 minutes and 37 seconds was the time spent cycling through 1 to 4.

However, please strictly follow the order.

If you ask a generative AI to “build a quantum computer cloud,” it usually starts with reception or queueing because a working model appears quickly. However, if you build from there, the verification staff remains until the end and is usually omitted.

The omitted mechanism appears to be working. Answers are also returned. It becomes a state where you only do not know if they are correct.

This is why this article repeatedly stated “build verification first.” Because the speed of creation has increased, it has become harder to notice when the order is wrong.

I myself was about to proceed with the verification staff not looking at anything. I only noticed it after running it. Being able to build quickly and being able to build correctly are different.

Summary

The order of creation is as follows.

  1. Build the verification staff first (before translation)
  2. Build the translation staff and run it through verification
  3. Prevent execution of strange things
  4. Build reception, queueing, and result delivery (this is fast)
  5. Keep records

1 and 2 are the major hurdles, and once passed, the rest can be assembled with ordinary techniques.

Previously, these two required specialized books and long experience. Now, it is 3 minutes and 37 seconds. You can first build a working model and proceed while having the verification staff find mistakes.

Let generative AI handle the ideation work, and let the machine handle the verification work. If you keep these two separate, even non-specialists can get involved. Conversely, if you do not separate them and build quickly, you will create a mechanism that cannot detect mistakes.

I hope this serves as a guide for those who have bought a quantum computer but are stuck beyond that point.


*The execution results and measurements in this article are all outputs from programs actually built by this site. The calculations were performed on a simulator, and the mechanism to send them to an actual quantum computer was deliberately not built. The core parts of translation and verification use tools created by the blueqat quantum development team.*

This article was translated from the Japanese original. 日本語で読む

← Latest articles