@danielsimonjr/mathts-tensor 0.2.19 → 0.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/Tensor.d.ts +176 -0
  2. package/dist/Tensor.d.ts.map +1 -0
  3. package/dist/contraction-sequence.d.ts +93 -0
  4. package/dist/contraction-sequence.d.ts.map +1 -0
  5. package/dist/index.d.ts +37 -1129
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +1 -1
  8. package/dist/named-index.d.ts +76 -0
  9. package/dist/named-index.d.ts.map +1 -0
  10. package/dist/operations/cholesky.d.ts +47 -0
  11. package/dist/operations/cholesky.d.ts.map +1 -0
  12. package/dist/operations/concatenate.d.ts +35 -0
  13. package/dist/operations/concatenate.d.ts.map +1 -0
  14. package/dist/operations/eig.d.ts +50 -0
  15. package/dist/operations/eig.d.ts.map +1 -0
  16. package/dist/operations/flip.d.ts +35 -0
  17. package/dist/operations/flip.d.ts.map +1 -0
  18. package/dist/operations/gather.d.ts +33 -0
  19. package/dist/operations/gather.d.ts.map +1 -0
  20. package/dist/operations/kron.d.ts +38 -0
  21. package/dist/operations/kron.d.ts.map +1 -0
  22. package/dist/operations/lu.d.ts +48 -0
  23. package/dist/operations/lu.d.ts.map +1 -0
  24. package/dist/operations/pad.d.ts +50 -0
  25. package/dist/operations/pad.d.ts.map +1 -0
  26. package/dist/operations/pinv.d.ts +39 -0
  27. package/dist/operations/pinv.d.ts.map +1 -0
  28. package/dist/operations/qr.d.ts +49 -0
  29. package/dist/operations/qr.d.ts.map +1 -0
  30. package/dist/operations/random.d.ts +61 -0
  31. package/dist/operations/random.d.ts.map +1 -0
  32. package/dist/operations/roll.d.ts +44 -0
  33. package/dist/operations/roll.d.ts.map +1 -0
  34. package/dist/operations/scatter.d.ts +54 -0
  35. package/dist/operations/scatter.d.ts.map +1 -0
  36. package/dist/operations/slice.d.ts +43 -0
  37. package/dist/operations/slice.d.ts.map +1 -0
  38. package/dist/operations/solve.d.ts +54 -0
  39. package/dist/operations/solve.d.ts.map +1 -0
  40. package/dist/operations/stack.d.ts +50 -0
  41. package/dist/operations/stack.d.ts.map +1 -0
  42. package/dist/operations/svd.d.ts +56 -0
  43. package/dist/operations/svd.d.ts.map +1 -0
  44. package/package.json +57 -57
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Tensor — rank-N, Float64Array-backed, row-major dense tensor. The
3
+ * compute primitive behind @danielsimonjr/mathts-tensor. Construction,
4
+ * elementwise, einsum, matMul, transpose, reshape live here.
5
+ *
6
+ * Element-wise and data-movement ops are straightforward O(n) loops (a
7
+ * correctness baseline). Heavy ops delegate to the standard packages rather
8
+ * than reinventing them: `matMul` uses matrix's backend-selected multiply
9
+ * (SIMD-WASM for large inputs), and the decompositions (in `operations/`)
10
+ * route through matrix's `svd`/`eig`/`lu`/`qr`/`cholesky`. Storage mirrors
11
+ * DenseMatrix (Float64Array, row-major), generalised to arbitrary rank.
12
+ */
13
+ import { DenseMatrix } from '@danielsimonjr/mathts-matrix';
14
+ import type { NestedArray as CoreNestedArray } from '@danielsimonjr/mathts-core/internal';
15
+ import { Index } from './named-index.js';
16
+ /**
17
+ * Consolidated onto `@danielsimonjr/mathts-core`'s generic `NestedArray<T>`,
18
+ * specialised to `number` (Tensor is Float64Array-backed) — see
19
+ * docs/Architecture/duplicate-symbols.json.
20
+ */
21
+ export type NestedArray = CoreNestedArray<number>;
22
+ export interface EinsumSpec {
23
+ readonly contractions: ReadonlyArray<{
24
+ readonly pair: readonly [readonly [number, number], readonly [number, number]];
25
+ }>;
26
+ readonly free: ReadonlyArray<{
27
+ readonly operand: number;
28
+ readonly axis: number;
29
+ }>;
30
+ }
31
+ export declare class Tensor {
32
+ readonly shape: ReadonlyArray<number>;
33
+ readonly data: Float64Array;
34
+ /** Optional per-axis Index labels. When set, enables `contract`, `replaceIndex`, `axisOf`. */
35
+ readonly axisLabels?: ReadonlyArray<Index>;
36
+ constructor(shape: ReadonlyArray<number>, data: Float64Array, axisLabels?: ReadonlyArray<Index>);
37
+ static sizeOf(shape: ReadonlyArray<number>): number;
38
+ static rowMajorStrides(shape: ReadonlyArray<number>): number[];
39
+ static fromNested(data: NestedArray, shape: ReadonlyArray<number>): Tensor;
40
+ static identity(n: number): Tensor;
41
+ toNested(): NestedArray;
42
+ /**
43
+ * Build a rank-2 Tensor from a native DenseMatrix. Bridges the tensor and
44
+ * matrix packages so matrix data can flow into rank-N / autodiff code.
45
+ */
46
+ static fromDenseMatrix(m: DenseMatrix): Tensor;
47
+ /**
48
+ * Convert a rank-2 Tensor to a native DenseMatrix. Throws for any other rank.
49
+ */
50
+ toDenseMatrix(): DenseMatrix;
51
+ private sameShape;
52
+ private elementwise;
53
+ add(other: Tensor | number): Tensor;
54
+ sub(other: Tensor | number): Tensor;
55
+ mul(other: Tensor | number): Tensor;
56
+ scale(k: number): Tensor;
57
+ normInf(): number;
58
+ /**
59
+ * Compute the broadcast output shape of two shapes following NumPy rules:
60
+ * right-align the two shapes; a dimension of 1 broadcasts against any size;
61
+ * missing leading axes are treated as length-1.
62
+ * Throws with message including both shape arrays on incompatibility.
63
+ */
64
+ static broadcastShape(a: ReadonlyArray<number>, b: ReadonlyArray<number>): number[];
65
+ /**
66
+ * Apply a binary elementwise op with NumPy-style broadcasting.
67
+ * Both tensors are read via virtual broadcast indices — no data is copied
68
+ * until the output is written.
69
+ */
70
+ private static broadcastOp;
71
+ /**
72
+ * Generic strided reduction over a set of axes.
73
+ *
74
+ * `init` is the neutral element; `combine` folds one new value into the
75
+ * accumulator; `finalise` (optional) post-processes the accumulator once
76
+ * all elements have been visited.
77
+ */
78
+ private reduceAxes;
79
+ /**
80
+ * Sum elements along the given axis/axes (or all axes if omitted).
81
+ * `keepDims: true` preserves reduced axes as length-1.
82
+ */
83
+ sum(axis?: number | ReadonlyArray<number>, opts?: {
84
+ keepDims?: boolean;
85
+ }): Tensor;
86
+ /**
87
+ * Arithmetic mean along the given axis/axes (or all axes if omitted).
88
+ */
89
+ mean(axis?: number | ReadonlyArray<number>, opts?: {
90
+ keepDims?: boolean;
91
+ }): Tensor;
92
+ /**
93
+ * Element-wise maximum along the given axis/axes (or all axes if omitted).
94
+ * NaN propagates (matches NumPy default behaviour).
95
+ */
96
+ max(axis?: number | ReadonlyArray<number>, opts?: {
97
+ keepDims?: boolean;
98
+ }): Tensor;
99
+ /**
100
+ * Element-wise minimum along the given axis/axes (or all axes if omitted).
101
+ * NaN propagates (matches NumPy default behaviour).
102
+ */
103
+ min(axis?: number | ReadonlyArray<number>, opts?: {
104
+ keepDims?: boolean;
105
+ }): Tensor;
106
+ /**
107
+ * Product of elements along the given axis/axes (or all axes if omitted).
108
+ */
109
+ prod(axis?: number | ReadonlyArray<number>, opts?: {
110
+ keepDims?: boolean;
111
+ }): Tensor;
112
+ /**
113
+ * p-norm of the tensor.
114
+ *
115
+ * - `p = 2` (default): Euclidean / Frobenius norm — `sqrt(sum x_i^2)`.
116
+ * - `p = 'fro'`: alias for p=2 (Frobenius).
117
+ * - `p = 'inf'`: max of absolute values.
118
+ * - `p = '-inf'`: min of absolute values.
119
+ * - numeric p: `(sum |x_i|^p)^(1/p)`.
120
+ *
121
+ * When `axis` is given, the norm is computed along that single axis and the
122
+ * result has rank reduced by 1 (or stays the same with `keepDims`).
123
+ * When `axis` is omitted, the norm is computed over all elements.
124
+ */
125
+ norm(opts?: {
126
+ p?: number | 'inf' | '-inf' | 'fro';
127
+ axis?: number;
128
+ keepDims?: boolean;
129
+ }): Tensor;
130
+ /**
131
+ * Generalised dot product (NumPy `tensordot`) over explicitly specified axis pairs.
132
+ *
133
+ * `axes[i] = [a, b]` contracts axis `a` of `this` with axis `b` of `other`.
134
+ * The result shape is `this`'s non-contracted axes followed by `other`'s
135
+ * non-contracted axes (NumPy convention).
136
+ *
137
+ * Delegates to `Tensor.einsum` under the hood.
138
+ */
139
+ tensordot(other: Tensor, axes: ReadonlyArray<readonly [number, number]>): Tensor;
140
+ /**
141
+ * Normalise an `axis` argument into a sorted list of axis indices.
142
+ * `undefined` ⇒ all axes (reduce everything to a rank-0 scalar).
143
+ */
144
+ private resolveAxes;
145
+ private static forEachIndex;
146
+ private static flatIndex;
147
+ reshape(shape: ReadonlyArray<number>): Tensor;
148
+ transpose(perm?: ReadonlyArray<number>): Tensor;
149
+ matMul(other: Tensor): Tensor;
150
+ static einsum(spec: EinsumSpec, ...operands: Tensor[]): Tensor;
151
+ /**
152
+ * Return the axis position (0-based) of a labelled index.
153
+ * Throws if the index is not found in `axisLabels`.
154
+ */
155
+ axisOf(index: Index): number;
156
+ /**
157
+ * Return a new Tensor with the same data and shape but with `oldIndex`
158
+ * swapped for `newIndex` in `axisLabels`.
159
+ * Throws if `oldIndex` is not found.
160
+ */
161
+ replaceIndex(oldIndex: Index, newIndex: Index): Tensor;
162
+ /**
163
+ * Contract this tensor with `other` over every shared index (matched by
164
+ * `Index.matches`). Both operands must carry `axisLabels`.
165
+ *
166
+ * The result tensor carries the non-shared axes from `this` followed by
167
+ * the non-shared axes from `other` as its `axisLabels`.
168
+ *
169
+ * Throws:
170
+ * - If either operand lacks `axisLabels`.
171
+ * - If there are no shared indices (use `einsum` or an explicit outer product).
172
+ * - If a shared index has mismatched dimensions on the two operands.
173
+ */
174
+ contract(other: Tensor): Tensor;
175
+ }
176
+ //# sourceMappingURL=Tensor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tensor.d.ts","sourceRoot":"","sources":["../src/Tensor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAkB,MAAM,8BAA8B,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAElD,MAAM,WAAW,UAAU;IACz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
2
+ * contractNetwork — given an ordered list of Tensors (each carrying
3
+ * `axisLabels`), find the pairwise-contraction order minimising the total
4
+ * FLOP count and execute it. ITensor's `optimal_contraction_sequence`
5
+ * equivalent.
6
+ *
7
+ * Two algorithms are provided:
8
+ *
9
+ * - 'exact' — bitmask dynamic programming. For every non-empty subset
10
+ * S ⊂ {0..N-1} of input tensors, we compute `bestCost[S]` and the
11
+ * partition (S₁, S₂) achieving it (S = S₁ ⊔ S₂, both non-empty).
12
+ * Transition:
13
+ *
14
+ * bestCost[S] = min over all proper subset pairs (S₁, S₂) of
15
+ * bestCost[S₁] + bestCost[S₂] + pairwiseCost(net(S₁), net(S₂))
16
+ *
17
+ * Base: bestCost[{i}] = 0. Subset enumeration via the standard
18
+ * submask trick `for (sub = (mask-1) & mask; sub > 0; sub = (sub-1) & mask)`
19
+ * visits every non-empty proper subset in O(3^N) total.
20
+ *
21
+ * Determinism: ties broken by preferring the lexicographically smaller
22
+ * (subsetMask₁, subsetMask₂) where subsetMask₁ ≤ subsetMask₂.
23
+ *
24
+ * Bitmask encoding: bit `i` of a 32-bit integer is set iff input tensor
25
+ * index `i` is part of the subset. So `0b1011 = {0, 1, 3}`. We use
26
+ * ordinary JavaScript numbers (safe up to 2^32 for bitwise ops; capped
27
+ * at N ≤ 30 for headroom).
28
+ *
29
+ * - 'greedy' — Hendrickson–Sundaram. Maintain a working list of
30
+ * intermediate tensor shapes. At each step, choose the pair (i, j) with
31
+ * the cheapest pairwise contraction cost and replace them with their
32
+ * contraction. Repeat until one remains. O(N³) per step × O(N) steps.
33
+ *
34
+ * Cost model: for a pairwise contraction of two intermediate tensors with
35
+ * shared-axis dimension product `D_shared` and free-axis dimension products
36
+ * `D_free_left`, `D_free_right`, the contraction FLOP cost is
37
+ *
38
+ * cost = D_shared * D_free_left * D_free_right
39
+ *
40
+ * which is the volume of the OUTPUT tensor times the contraction depth. If
41
+ * `D_shared = 1` (no shared axes — outer product) we use `D_free_left *
42
+ * D_free_right`; mathematically that is the same formula. We follow this
43
+ * convention but it never fires in practice because we drive the cost
44
+ * through pairs with at least one shared index when possible.
45
+ *
46
+ * Output-tensor size for `intermediateSizes`: `D_free_left * D_free_right`
47
+ * (the contracted-axis dimensions are summed away, not multiplied into the
48
+ * result).
49
+ *
50
+ * `contractionOrder` indexing convention: each pair `[i, j]` is in
51
+ * "virtual-index" space. Input tensors occupy slots 0..N-1; the first
52
+ * pairwise contraction produces virtual slot N, the second slot N+1, and
53
+ * so on. So a length-N input network has a length-(N-1) order array.
54
+ */
55
+ import { Tensor } from './Tensor.js';
56
+ export interface ContractNetworkOpts {
57
+ /** Cap intermediate-tensor element count to avoid blowups. Default: 2^31. */
58
+ maxIntermediateSize?: number;
59
+ /**
60
+ * 'exact' = DP optimal (≤ ~16 tensors, slow beyond that).
61
+ * 'greedy' = Hendrickson–Sundaram heuristic (any N).
62
+ * 'auto' = 'exact' when N ≤ 16, otherwise 'greedy'.
63
+ * Default: 'auto'.
64
+ */
65
+ algorithm?: 'exact' | 'greedy' | 'auto';
66
+ }
67
+ export interface ContractNetworkResult {
68
+ result: Tensor;
69
+ /** Pairwise contractions in (virtual) input-index space; see file header. */
70
+ contractionOrder: ReadonlyArray<readonly [number, number]>;
71
+ /** Sum of pairwise FLOP costs along the chosen order. */
72
+ totalFlops: number;
73
+ /** Element count of each intermediate, in creation order. */
74
+ intermediateSizes: ReadonlyArray<number>;
75
+ }
76
+ /**
77
+ * Contract a network of named-index tensors in the optimal pairwise order.
78
+ *
79
+ * Returns:
80
+ * - `result` — the fully contracted final Tensor.
81
+ * - `contractionOrder` — the chosen sequence of pairwise contractions in
82
+ * virtual-slot space (slots 0..N-1 = inputs; each produced intermediate
83
+ * takes the next free slot).
84
+ * - `totalFlops` — sum of per-step FLOP costs along the chosen order.
85
+ * - `intermediateSizes` — element count of each produced intermediate.
86
+ *
87
+ * Throws:
88
+ * - on empty input.
89
+ * - if any input lacks `axisLabels`.
90
+ * - if `maxIntermediateSize` is so tight no valid order exists.
91
+ */
92
+ export declare function contractNetwork(tensors: ReadonlyArray<Tensor>, opts?: ContractNetworkOpts): ContractNetworkResult;
93
+ //# sourceMappingURL=contraction-sequence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contraction-sequence.d.ts","sourceRoot":"","sources":["../src/contraction-sequence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,MAAM,WAAW,mBAAmB;IAClC,6EAA6E;IAC7E,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;CACzC;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,gBAAgB,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3D,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC1C;AA4pBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,EAC9B,IAAI,CAAC,EAAE,mBAAmB,GACzB,qBAAqB,CAgDvB"}