4 ms·
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))
by drostie 14y ago
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.
- wolfgke 14y agoNo, a matrix is unitary if hermitian(U) = inverse(U)