Building a simple QCM

To illustrate how the QCM works, let’s look at a basic computation: How do we check if two different inputs are equal?

For example, if one input is 0 and the other input is also 0, we can conclude that they are equal.

To show how simple it is to build the Qubic Computation Model for this situation, let’s paint a picture that most of us will be familiar with: A sandy beach. Now imagine this beach with:

Channels in the sand, which represent an electrical circuit

Channel entrances, into which we can pour water — this represents the data

Small dams, which represent computations (represented by the dam shapes on the picture below)

To compare two inputs (cyan and orange), a child (let’s call her Alice) pours water into a cyan entrance and an orange entrance. Both of these entrances can represent one of three values: -1, 0, and +1. Remember these values are called trits.

Now, one channel of water isn’t enough to rise to the top of the dam. So let’s look at 2 different cases.

First, imagine that Alice pours water into the 0 trit of the cyan and orange entrances. If you follow the channels from these entrances, you’ll see that both channels lead to the same dam. If both channels lead to the same dam, then enough water rises to the top and flows over it. So, we can say that when water flows over the dam, both input values were the same (0 and 0 in this case).

Equal value trits

Now let’s see what happens when Alice pours water into the -1 trit of the cyan entrance and the 0 trit of the orange entrance. The channels from these entrances lead to different dams. If only one channel leads to a dam, there is not enough water to rise over the dam. So, we can say that when water does not rise over a dam, both input values were not the same (-1 and 0 in this case).

Unequal value trits

This flow represents a basic computation. The water that flows over the top of the dam is the result of the computation.

As long as Alice keeps pouring water into the same entrances, the result stays the same. For example, if the two input values are equal the water continues to flow over the dam and Alice sees the result. To then compare different values, Alice must stop the water flow, go and fill her buckets in the sea, and then pour water into the new entrances.

The merger

On our beach, the dams play a vital role. They help to decide if two trits are equal, allowing water to flow over them only if they are equal. When water flows over the top of the dams, it ends up at the point where all three channels meet. This point is called the merger.

It is the merger’s job to pass on the result to something else, so that more work can be done on it. For example, you may say ‘if these trits are equal, then go and do the next stage’.

To help you see how this system works, here is a cheat sheet called a look-up table (LUT), that describes what happens to the water, depending on which entrances are used.

So let’s look at this LUT in action…

The merger

Note: you have control over this LUT. If you wanted to change the output, you could update the LUT. In this current form, both entrances must be equal for water to flow over a dam. But, what if you wanted both entrances to be unequal for water to flow over the dam? Well, we’d need to extend our example, which we will look at later in this article. But first let’s go over a few concepts.