Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Also note that the probabilities in each column and each row sum to 1, indicating that every possible combination of input and output has been accounted for.

Perhaps a quantum probabilistic NOT gate requires the columns to add up to 1, but it's certainly not a general requirement of any physical device that imperfectly implements a NOT gate.

Consider the following probability matrix:

      0    1
 0  0.1  0.9
 1  0.8  0.2
For any input (say, 0, in the top row), the output will be interpreted as either a 0 or 1, so the row sum must be 1.

However, there's nothing forcing the probability of 0 as an output in one row to depend on its probability in another row. One could implement the gate above in software, with no problems, and a hardware equivalent could certainly be produced.

[Edit-- fixed row probabilities in second row.]



I don't think you logic works. Your table says that if a 0 is in-putted then there is a .1 chance of getting a 0 and a .8 chance of getting a 1. That leaves a probability of .1 or something else happening, but it you add a third state it is no longer a not gate.

In other words, a not gate, regardless of the implementation must have it's columns sum to 1. This is a fundamental principle of probability and the definition of a not gate.


Your comment supposes that the column headers are the inputs. However, I used the definition from the article-- "Here the numbers along the left edge, labeling the rows of the matrix, are the inputs to the gate..."

So, taking the columns as the outputs, my point is that adding down the columns corresponds to no particular causal relationship in the physics of the gate.

Your comment did, however, make me realize that I hadn't modified the row probabilities for the second row to sum to one (11-month old under foot). So thanks for that.


In order to satisfy the basic matrix transformation properties

    dot = lambda M, v: vector(sum(M[i][j] * v[j] for j in range(len(v))
                                                 for i in range(len(M)))
as well as the basic left-to-right, top-to-bottom ordering "M00 M01\nM10 M11", the columns, not the rows, would add up to one. Such a matrix is called a "stochastic matrix" or "Markov matrix".

You are correct that the rows do not have to add up to one, just the columns do, for stochastic matrices.

Quantum gates do demand one special restriction; they must be unitary. A unitary matrix satisfies:

    transpose(U) = inverse(U)
This is not as simple as "rows sum to 1" or anything of the sort; as the article says, you can create several examples of 2x2 matrices which have sqrt(1/2) factors in all components.


No, a matrix is unitary if

  hermitian(U) = inverse(U)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: