Example with n = 4, generator as first row [1, 2, 3, 4], using right shifts:
| Row | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| 0 | 1 | 2 | 3 | 4 |
| 1 | 4 | 1 | 2 | 3 |
| 2 | 3 | 4 | 1 | 2 |
| 3 | 2 | 3 | 4 | 1 |
- Circulant entry rule: If the generator is the first row g, then for right shifts C[i,j] = g[(j − i) mod n]. For left shifts use C[i,j] = g[(j + i) mod n].
- Eigenvalues (DFT): With first row c₀,…,cₙ₋₁, λₖ = Σ cⱼ · e^(−i 2πkj/n), for k=0,…,n−1.
- Determinant: det(C) = Π λₖ. With real inputs, the imaginary part should be numerically near zero.
- Trace and sums: trace(C) = n·c₀, and each row/column sum equals Σ cⱼ.
- Set the matrix size n based on your problem.
- Choose whether your vector is the first row or first column.
- Pick a shift direction that matches your convention.
- Enter exactly n generator values (commas or spaces work).
- Select outputs you want: matrix, eigenvalues, inverse, and vector product.
- Press Submit, then use CSV/PDF to export the displayed tables.
What a Circulant Matrix Represents
A circulant matrix is fully defined by one generator vector, because every row is a cyclic shift of that vector. For size n, the matrix has n² entries but only n independent parameters. This calculator builds the full table and highlights quick metrics such as trace = n·c0 and constant row/column sums = Σcj, which are useful for fast validation.
Generator Vector Choices and Shift Direction
You can enter the generator as the first row or the first column, then choose right or left shifts to match your convention. For a right-shift, the entry rule is C[i,j] = g[(j−i) mod n]. For a left-shift, the index becomes (j+i) mod n. These choices change the layout, but preserve key invariants like trace and eigenvalue magnitudes.
Eigenvalues via Discrete Fourier Transform
Circulant matrices are diagonalized by the Fourier basis, so eigenvalues are obtained by the discrete Fourier transform (DFT) of the first row. The calculator computes λk = Σj cj·e^(−i2πkj/n) for k = 0…n−1 and reports real/imaginary parts, magnitude, and angle. Although a fast FFT can reduce cost to O(n log n), the direct DFT here remains accurate for n up to 32.
Determinant, Rank, and Invertibility Checks
A key benefit of the spectrum is that det(C) = Πk λk. Numerically, a circulant matrix is invertible when no eigenvalue is near zero, so the tool estimates rank by counting |λk| above a small tolerance. If invertible, it also computes the inverse’s first row using an inverse DFT of 1/λk, confirming that the inverse is circulant.
Practical Use Cases and Export Workflow
Circulant models appear in convolution, signal processing, and periodic boundary conditions in numerical methods. They let you replace costly matrix operations with structured computations based on the generator and its DFT. After computing outputs, use the CSV button to export tables for spreadsheets, or the PDF button for clean reports and sharing. The included example matrix provides a quick reference for expected cyclic patterns. When you enable Matrix × vector, the output equals a circular convolution of the first row with x, providing an intuitive link to filtering and cyclic time-series analysis in many engineering contexts.
FAQs
1. What does the generator vector represent?
It is the first row or first column you select. The remaining rows are cyclic shifts determined by the direction setting. Provide exactly n numbers; the tool will expand them into the full n×n matrix.
2. Why can eigenvalues be complex when inputs are real?
The DFT uses complex exponentials, so intermediate values may be complex. For real generators, eigenvalues appear in conjugate pairs, making the determinant effectively real. Small imaginary parts typically come from rounding.
3. How is the determinant calculated?
The calculator multiplies all eigenvalues, using det(C)=∏k λk. This is numerically stable for small n and also matches the fact that circulant matrices are diagonalized by the Fourier basis.
4. When is the inverse not computed?
If any eigenvalue magnitude is near zero, the matrix is treated as non-invertible and the inverse option is disabled. This corresponds to rank dropping below n, meaning no exact inverse exists.
5. How does Matrix × vector relate to convolution?
For a circulant matrix generated from the first row, y=Cx equals a circular convolution between that row and x. This is why circulant matrices naturally model periodic filtering and wrap-around boundary conditions.
6. What limits should I follow for size and precision?
Use n between 2 and 32, which keeps tables readable and computations quick. Precision from 2–6 decimals is usually enough. Increase precision only when comparing close eigenvalues or checking near-singular cases.