Advanced maths

Linear matroid circuits and flats calculator from a matrix

Construct a small linear matroid from labeled matrix columns and enumerate its circuits, flats and bases.

Your numbers

Rows separated by semicolons; values by commas.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Construct a small linear matroid from labeled matrix columns and enumerate its circuits, flats and bases. The field is explicit: rationals or a supported prime field. The page turns matrix independence into a complete small set-system analysis rather than returning only one rank or one arbitrary column basis.

THE FORMULAcircuits=minimal dependent column sets; flat F=closure(F).

A worked example

Columns (1,0),(0,1),(1,1) have rank two. Every pair is independent and all three are dependent, so the only circuit is {0,1,2}. There are three bases of size two.

Good to know

At most ten elements/six rows, rational or prime field≤97. Exact subset ranks; circuits/flats/bases together; loops and parallel columns allowed.

Treat columns as labeled elements

Each matrix column is one ground-set element, identified by its input index. A subset is independent when those columns are linearly independent over the selected field. Column labels remain distinct even if two columns have identical values; such columns are parallel matroid elements rather than duplicate data to delete automatically.

Rows give the ambient representation and need not themselves be independent. Invertible row operations preserve the represented matroid because they preserve every column dependence. Reordering columns relabels elements, so circuits and flats must be translated by that same reordering when comparing two representations.

Three planar columns form one minimal dependent setv0v1v2v0 + v1 = v2Every pair independentCircuit: {0,1,2}
Columns (1,0),(0,1),(1,1) have rank two. Every pair is independent and all three are dependent, so the only circuit is {0,1,2}. There are three bases of size two. Diagram is schematic; labels specify the numerical values.

The Matroid intersection calculator from two representations requires independence in two representations on the same labeled columns. This single-matroid page additionally enumerates its circuits and flats, which answer dependency and closure questions.

Choose the field before testing independence

Field zero selects rational arithmetic. A positive supported prime selects arithmetic modulo that prime, including reduction of rational denominators when invertible. A denominator divisible by the prime is invalid; the solver does not silently reinterpret it as a floating-point decimal.

Ranks can change with the field. For example, a determinant equal to two is nonzero over the rationals but zero modulo two. The same numeric matrix can therefore define different matroids under different selectors. The field is part of the mathematical input, not merely a computational precision option.

Read circuits as minimal dependencies

A circuit is a dependent subset every proper one-element deletion of which is independent. It records a minimal dependence, not just any collection containing dependent columns. A zero column is a loop and forms a singleton circuit; two proportional nonzero columns can form a two-element circuit.

The page computes ranks for all supported column subsets and uses those exact ranks to test minimality. Listing a large dependent set alone would not establish that it is a circuit. If a returned circuit is unexpected, inspect the selected field and column labeling before assuming the numerical representation was rounded incorrectly.

Check the three-column example

Columns (1,0), (0,1) and (1,1) span a rank-two space. Every pair is independent, while the complete triple is dependent because the third equals the sum of the first two. Thus the sole circuit is the set of all three labels.

Each two-column subset is a basis, giving three bases. The whole ground set is a flat, and each singleton nonzero direction is a flat in this example. These outputs describe the dependence structure beyond the matrix rank two; rank alone would not reveal how many bases or minimal dependencies exist.

Interpret closure and flats

The closure of a subset consists of elements whose addition does not increase its rank. A flat is a subset already equal to that closure. It includes every labeled ground-set column lying in its represented span, not every vector in the infinite ambient vector space.

The distinction matters when loops exist: every closure contains the loops, so the empty set need not be a flat. The output can list an empty flat for a loopless matroid without implying that empty vectors have been inserted. Flats are subsets of the declared column labels and should be read in that finite-ground-set sense.

Separate a basis from a unique choice

A basis is an independent subset reaching the whole matroid rank. Several bases can exist, and the page enumerates them rather than treating the pivot columns of one row reduction as uniquely important. Every listed basis has the same size, which is another check on the result.

The matroid forgets geometric lengths and angles while retaining dependence. Two different coordinate representations can yield the same labeled matroid. Conversely, similar-looking numeric columns can have different exact dependencies. This form does not solve abstract matroid representability or decide whether arbitrary circuit lists come from a matrix.

Use the complete enumeration within its bound

The page supports at most ten columns and six rows. Enumerating all two-to-the-n subsets gives a transparent exact result at that size but is not a large-matroid performance claim. Coefficient and rational-parser limits also apply before any subset analysis begins.

No probability or sampling uncertainty accompanies a dependence certificate: exactness refers to the entered rational or finite-field model. If columns come from noisy measurements, exact dependencies may not represent meaningful empirical redundancy. A numerical rank-tolerance workflow is a different model and should not be smuggled into these exact circuit and flat labels.

A few questions, answered

Are repeated nonzero columns discarded?

No. They remain distinct labeled elements and can form parallel pairs.

Why can changing the prime change circuits?

Linear dependence is field-dependent. A determinant nonzero over the rationals can vanish modulo a prime.

Is a flat an entire vector subspace?

It is the set of ground-set elements lying in the relevant span, not every ambient vector.

Does the page recognize arbitrary abstract matroids?

No. It analyzes a supplied matrix representation.

Find your calculator

Start typing to explore the library.