serpentine.m

From Spinach Documentation Wiki
Revision as of 19:41, 6 June 2026 by Kuprov (talk | contribs) (Update function See also links and function index membership)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Serpentine index matrix used in Spinach for single-index numbering of matrix elements.

Syntax

                 S=serpentine(nlevels,idx_base)

Parameters

       nlevels  - dimension of the matrix, a
                  positive real integer
       idx_base - indexing base, 0 or 1

Outputs

       S        - serpentine matrix, for example (base 1):
                           (1 )(3 )(6 )(10)
                           (2 )(5 )(9 )(13)
                           (4 )(8 )(12)(15)
                           (7 )(11)(14)(16)
                  or (with indexing set to base 0):
                           (0 )(2 )(5 )(9 )
                           (1 )(4 )(8 )(12)
                           (3 )(7 )(11)(14)
                           (6 )(10)(13)(15)

Examples

See examples in the Spinach distribution relevant to this function.

Notes

This page was generated from the function header in the Spinach repository.

See also

kq2lin.m, lin2kq.m, sin_tran.m, st_product_table.m, bos_product_table.m, oper2ist.m, autoexec.m, fft_freq_axis.m, fwhm2rlx.m, icm2hz.m, ifft_time_axis.m, intrep.m, istraceless.m, kronm.m, lcurve.m, min_int_type.m, prune_subgraphs.m, redfield_integral_async.m, redfield_integral_serial.m, repcols.m, reprows.m, tikhol1n.m, unihash.m, which_subst.m, xyz2hfc.m, Kernel_utilities

Version 2.11, authors: Ilya Kuprov