Diagonal matrix
A diagonal matrix is a square matrix whose entries outside the main diagonal are zero.
Quantum Programming in Depth
A diagonal matrix is a square matrix whose entries outside the main diagonal are zero.
- How it is used
- Represents phase oracles and CS-decomposition components without mixing computational-basis states.
- How deep it goes
- Explains diagonal entries through single-qubit phase action, arbitrary-size CS constraints, and oracle behavior.
- Examples
- Uses C and S matrices, a single-qubit phase operation, and an oracle marking 001 and 110.
- What you can do after
- Evaluate/understand which basis-state amplitudes a diagonal quantum operation phases or sign-flips.
Read how Quantum Programming in Depth explains diagonal matrix →
Math and Architectures of Deep Learning
A square matrix whose only possibly nonzero entries are on the main diagonal.
- How it is used
- Supports diagonalization, coordinate rotation, quadratic-form analysis, and later PCA reasoning.
- How deep it goes
- Defines the structure and works through eigenvector-based diagonalization and geometric transformation, without developing numerical stability details.
- Examples
- Uses the ellipse 5x² + 6xy + 5y² = 20, its matrix [[5,3],[3,5]], and a 45° eigenvector rotation.
- What you can do after
- Apply PyTorch eigenvalue computation to rotate a symmetric quadratic form into diagonal, axis-aligned coordinates.
Read how Math and Architectures of Deep Learning explains diagonal matrix →
Related concepts
- degree matrixincludes · A degree matrix is a diagonal graph matrix whose entries record the number or total weight of connections incident to each node.
- arraykind of · An array is an indexed, ordered collection of elements arranged in one or more dimensions, with elements accessed by position.
- Gaussian eliminationproduced by · Gaussian elimination is a procedure that applies elementary row operations to transform a linear system or matrix into an equivalent triangular or row-reduced form.
- covariance matrixconfigured by · A covariance matrix is a square matrix whose diagonal entries are variances and whose off-diagonal entries are pairwise covariances among variables.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

