Sequential types
The sequential types are the single-site counterparts of the lattice color fields: one ColorVector, one ColorMatrix, one DiracFermion, one DiracPropagator, with no lattice behind them. They are what F[{x...}] returns, what a solver's per-site arithmetic is built from, and the natural place to do small algebra without paying for a field.
They are constructed from qcd, not from a lattice:
qcd.ColorVectorN
qcd.ColorVectorN(nc) -- zero
qcd.ColorVectorN(nc, v) -- copy
qcd.ColorVectorN(nc, z, {c = k}) -- color k set to the complex z
qcd.ColorMatrixN
qcd.ColorMatrixN(nc) -- zero
qcd.ColorMatrixN(nc, r) -- r times the identity
qcd.ColorMatrixN(nc, z) -- z times the identity
qcd.ColorMatrixN(nc, z, {a = i, b = j}) -- entry (i,j) set to z, rest zero
qcd.ColorMatrixN(nc, v, {b = j}) -- column j set to v, rest zero
qcd.ColorMatrixN(nc, v1, v2) -- the outer product v1[i] * conj(v2[j])
qcd.DiracFermionN
qcd.DiracFermionN(nc) -- zero
qcd.DiracFermionN(nc, z, {c = i, d = j}) -- entry (i,j) set to z, rest zero
qcd.DiracFermionN(nc, v, {d = j}) -- spin j set to the color.vector v
qcd.DiracPropagatorN
qcd.DiracPropagatorN(nc) -- zero
qcd.DiracPropagatorN(nc, r) -- r on the color-spin diagonal
qcd.DiracPropagatorN(nc, z) -- z on the color-spin diagonal
qcd.DiracPropagatorN(nc, d, {c = i, d = j}) -- column (i,j) set to the fermion d
Only ColorVectorN has a copy constructor; for the other three, copy with :copy(), which every sequential type has.
qcd.DiracPropagatorN(nc, m) with a color.matrix returned m itself up to and including 2026.10d: it built the propagator, filled its spin diagonal, then dropped it off the stack before returning. In a build with that fixed, qcd.DiracPropagatorN(3, m) == m is false and the call gives the propagator.
What the sequential types carry
Each sequential type has the same methods as its lattice twin, minus the ones that only make sense with a lattice behind them — there is no sum, no shift, and no lattice field. Indexing is the same, except that there is no site coordinate to give:
| Type | Methods | Indexing |
|---|
color.vector | colors, conj, copy, norm2, set, set_zero, zero_like | V[{c=k}] → complex | color.matrix | the above plus transpose, adjoin, trace, det, exp, log, sqrt, inverse, proj | M[{a=i,b=j}] → complex; M[{b=j}] → color.vector | dirac.fermion | colors, conj, copy, norm2, gamma, set, set_zero, zero_like | D[{d=s}] → color.vector; D[{c=k,d=s}] → complex | dirac.propagator | colors, conj, copy, norm2, transpose, adjoin, trace, spintrace, spintranspose, set, set_zero, zero_like | P[{c=k,d=s}] → dirac.fermion |
proj on a sequential color.matrix, like its lattice twin, exists for two and three colors.
set_zero, zero_like, det, log, sqrt and inverse on the sequential types, and qcd.quarkContract* on sequential propagators, arrived in 2026.10d. A script that must run against an older build should test for one of them before using them.
Sequential random states
qcd.RandomState
qcd.RandomState(seed, index) --> random.state
A single random-number generator, seeded by seed and index. Unlike a lattice RandomState it is replicated: every rank gets the same stream, so the values it produces are the same everywhere.
| Method | Returns |
|---|
s:random_Real() | number, uniform on [0,1) | s:gaussian_Real() | number | s:gaussian_Complex() | complex | s:gaussian_ColorVectorN(nc) | color.vector | s:gaussian_ColorMatrixN(nc) | color.matrix | s:gaussian_DiracFermionN(nc) | dirac.fermion | s:gaussian_DiracPropagatorN(nc) | dirac.propagator | s:set(t) | copies another state in, in place |
|