The Quantum Engineer
The Quantum Engineer›Mathematical Foundations

CNOT from a classical truth table? No — but I⊗X is "X on qubit 2 only":

Everything a quantum engineer needs from undergraduate mathematics, rebuilt for a programmer: complex numbers, linear algebra, tensor products, probability, and numerical computation — each with an implementation you can run today and a statement of where it breaks on real hardware.

print(np.kron(I2, X)) # 4x4: applies X to the second qubit, leaves the first

Contents