File: tensor-doc.m2

package info (click to toggle)
macaulay2 1.25.05%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 172,152 kB
  • sloc: cpp: 107,824; ansic: 16,193; javascript: 4,189; makefile: 3,899; lisp: 702; yacc: 604; sh: 476; xml: 177; perl: 114; lex: 65; python: 33
file content (456 lines) | stat: -rw-r--r-- 12,866 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
--- status: TODO
--- author(s):
--- notes:

-- TODO:
-- (tensor, Matrix, Matrix)
-- (tensor, Module, Module)

L := {
    (tensor, QuotientRing,   QuotientRing),
    (tensor, PolynomialRing, PolynomialRing),
    (tensor, QuotientRing,   PolynomialRing),
    (tensor, PolynomialRing, QuotientRing)
    }
undocumented L
undocumented flatten table(L, {
	DegreeLift, DegreeMap, DegreeRank, Degrees, DegreeGroup, Global, Heft,
	Constants, Join, Local, MonomialOrder, MonomialSize, VariableBaseName,
	Inverses, Variables, SkewCommutative, Weights, WeylAlgebra}, (m,o) -> [m, o])

doc ///
Node
  Key
    (tensor, Monoid, Monoid)
   [(tensor, Monoid, Monoid), DegreeLift]
   [(tensor, Monoid, Monoid), DegreeMap]
   [(tensor, Monoid, Monoid), DegreeRank]
   [(tensor, Monoid, Monoid), DegreeGroup]
   [(tensor, Monoid, Monoid), Degrees]
   [(tensor, Monoid, Monoid), Global]
   [(tensor, Monoid, Monoid), Heft]
   [(tensor, Monoid, Monoid), Inverses]
   [(tensor, Monoid, Monoid), Constants]
   [(tensor, Monoid, Monoid), Join]
   [(tensor, Monoid, Monoid), Local]
   [(tensor, Monoid, Monoid), MonomialOrder]
   [(tensor, Monoid, Monoid), MonomialSize]
   [(tensor, Monoid, Monoid), VariableBaseName]
   [(tensor, Monoid, Monoid), Variables]
   [(tensor, Monoid, Monoid), SkewCommutative]
   [(tensor, Monoid, Monoid), Weights]
   [(tensor, Monoid, Monoid), WeylAlgebra]
    (tensor, Ring, Ring)
   [(tensor, Ring, Ring), DegreeLift]
   [(tensor, Ring, Ring), DegreeMap]
   [(tensor, Ring, Ring), DegreeRank]
   [(tensor, Ring, Ring), DegreeGroup]
   [(tensor, Ring, Ring), Degrees]
   [(tensor, Ring, Ring), Global]
   [(tensor, Ring, Ring), Heft]
   [(tensor, Ring, Ring), Inverses]
   [(tensor, Ring, Ring), Constants]
   [(tensor, Ring, Ring), Join]
   [(tensor, Ring, Ring), Local]
   [(tensor, Ring, Ring), MonomialOrder]
   [(tensor, Ring, Ring), MonomialSize]
   [(tensor, Ring, Ring), VariableBaseName]
   [(tensor, Ring, Ring), Variables]
   [(tensor, Ring, Ring), SkewCommutative]
   [(tensor, Ring, Ring), Weights]
   [(tensor, Ring, Ring), WeylAlgebra]
    (symbol**, Ring, Ring)
    (symbol^**, Ring, ZZ)
    (symbol**, Monoid, Monoid)
    (symbol^**, Monoid, ZZ)
  Headline
    tensor product of monoids
  Usage
    C = A ** B
    C = tensor(A, B, ...)
  Inputs
    A:{Ring,Monoid}
    B:{Ring,Monoid}
    DegreeRank       => ZZ      -- see @TO [monoid,DegreeRank]@
    Degrees          => List    -- see @TO [monoid,Degrees]@
    Inverses         => Boolean -- see @TO [monoid,Inverses]@
    Global           => Boolean -- see @TO [monoid,Global]@
    Local            => Boolean -- see @TO [monoid,Local]@
    MonomialOrder    => List    -- see @TO [monoid,MonomialOrder]@
    MonomialSize     => ZZ      -- see @TO [monoid,MonomialSize]@
    Variables        => List    -- see @TO [monoid,Variables]@
    VariableBaseName => Symbol  -- see @TO [monoid,VariableBaseName]@
    Heft             => List    -- see @TO [monoid,Heft]@
    Join             => Boolean -- overrides the corresponding option in {\tt A}; see @TO [monoid,Join]@
    DegreeMap        => Boolean -- overrides the corresponding option in {\tt A}; see @TO [monoid,DegreeMap]@
    DegreeLift       => Boolean -- overrides the corresponding option in {\tt A}; see @TO [monoid,DegreeLift]@
    Constants        => Boolean -- ignored by this routine
    SkewCommutative  => Boolean -- ignored by this routine
    WeylAlgebra      => List    -- ignored by this routine
    Weights          => List    -- ignored by this routine
  Outputs
    C:{Ring,Monoid}
      tensor product of the monoids or rings
  Description
    Text
      This is the same as {\tt A ** B} except that options are allowed,
      see @TO (symbol **, Monoid, Monoid)@ and @TO (symbol **, Ring, Ring)@.
      This method allows many of the options available for monoids, see @TO monoid@ for details.
      This method essentially combines the variables of {\tt A} and {\tt B} into one monoid or ring.
    Example
      kk = ZZ/101
      A = kk[a,b]
      B = kk[c,d,e]
    Text
      The simplest version is to simply use @TO symbol**@:
    Example
      describe(A**B)
    Text
      If you wish to change the variable names:
    Example
      describe tensor(A, B, VariableBaseName => p)
      describe tensor(A, B, Variables => {a1,a2,b1,b2,b3})
    Text
      The tensor product of two singly graded rings is bigraded.
      Sometimes you want a singly graded ring. Here is one way to get it:
    Example
      describe (C = tensor(A, B, DegreeRank => 1, Degrees => {5:1}))
      degreeLength C
      degreesRing C
    Text
      Packing monomials into smaller space is more efficient, but less flexible.
      The default is 32 bits, so if you want to pack them into 8 bit exponents, use:
    Example
      describe tensor(A, B, MonomialSize => 8)
    Text
      The default monomial order for tensor products is a product order.
      Sometimes other orders are more desirable, e.g. GRevLex, or an elimination order:
    Example
      describe (C = tensor(A, B, MonomialOrder => Eliminate numgens A))
      describe (C = tensor(A, B, MonomialOrder => GRevLex))
    Text
      If you tensor two skew-commutative rings, (or one skew commutative ring with a commutative polynomial ring),
      then all of the skew-commuting variables skew commute with each other:
    Example
      As = kk[a, b, SkewCommutative => true]
      D  = kk[c, d, e, SkewCommutative => true]
      E = tensor(As, D)
      describe E
      c * a
    Text
      Similarly, tensoring two Weyl algebras (or one and a polynomial ring) produces
      a Weyl algebra with both sets of non-commuting pairs.
    Example
      E = kk[x, Dx, WeylAlgebra => {x => Dx}]
      tensor(E, E, Variables => {x, Dx, y, Dy})
      describe oo
    Text
      Two polynomial rings must have the same coefficient ring, otherwise an error is issued.
      Currently, there is no way to specify other rings over which to define the tensor product.
    Example
      A = ZZ/101[a, b]
      B = A[x, y]
      C = tensor(B, B, Variables => {x1, y1, x2, y2})
      describe C
    Text
      The flat monoid with the all variables visible, including those from the base ring,
      can be obtained as follows.
    Example
      C.FlatMonoid
  Caveat
    Not all of the options for monoid are useful here. Some are silently ignored.
  SeeAlso
    describe
    degreesRing
    degreeLength
    symbol**
    FlatMonoid

Node
  Key
    (tensor, RingMap, Matrix)
    (tensor, RingMap, Module)
    (symbol**, RingMap, Matrix)
    (symbol**, RingMap, Module)
  Headline
    tensor product via a ring map
  Usage
    f ** M
    tensor(f, M)
  Inputs
    f:RingMap
      from $R \to S$
    M:{Matrix,Module}
      over the source ring $R$ of {\tt f}
  Outputs
    :{Matrix,Module}
      the same type as {\tt M}, but over the target ring $S$ of {\tt f}
  Description
    Example
      R = QQ[a..d]
      S = QQ[s,t]
      F = map(S,R,{s^4,s^3*t,s*t^3,t^4})
      m = matrix{{a,b,c,d}}
      F ** m
      F ** image m
  SeeAlso
    (symbol SPACE, RingMap, Module)
    (symbol SPACE, RingMap, Module)
///

doc ///
Node
  Key
    (tensor, Module, Module)
    (symbol**, Module, Module)
  Headline
    tensor product of modules
  Usage
    M ** N
    tensor(M, N)
  Inputs
    M:Module
    N:Module
  Outputs
     :Module
       the tensor product of $M$ and $N$
  Description
    Text
      If $M$ has generators $m_1, $m_2, \dots, $m_r$, and $N$ has generators $n_1, n_2, \dots, n_s$,
      then $M \otimes N$ has generators $m_i\otimes n_j$ for $0<i\leq r$ and $0<j\leq s$.
    Example
      R = ZZ[a..d];
      M = image matrix {{a,b}}
      N = image matrix {{c,d}}
      M ** N
      N ** M
    Text
      Use @TO trim@ or @TO minimalPresentation@ if a more compact presentation is desired.
    Text
      Use @TO flip@ to produce the isomorphism $M \otimes N \to N \otimes M$.
    Text
      To recover the factors from the tensor product, use the function @TO formation@.
  SeeAlso
    flip
    (tensor, Module, Matrix)
    (tensor, Matrix, Matrix)
    formation

Node
  Key
    (tensor, Matrix, Module)
    (tensor, Module, Matrix)
    (symbol **, Matrix, Module)
    (symbol **, Module, Matrix)
  Headline
    tensor product
  Usage
    f ** M
    M ** f
    tensor(f, M)
    tensor(M, f)
  Inputs
    f:Matrix
    M:Module
  Outputs
     :Matrix
       formed by tensoring $f$ with the identity map of $M$
  Description
    Example
      R = ZZ/101[x,y];
      R^2 ** vars R
      (vars R) ** R^2
    Text
      When $N$ is a free module of rank 1 the net effect of the operation is to shift the degrees of $f$.
    Example
      R = ZZ/101[t];
      f = matrix {{t}}
      degrees source f
      degrees source (f ** R^{-3})
  SeeAlso
    adjoint
    (tensor, Module, Module)
    (tensor, Matrix, Matrix)
  Subnodes
    flip
    tensorAssociativity

Node
  Key
    (tensor, Matrix, Matrix)
    (symbol**, Matrix, Matrix)
  Headline
    tensor product
  Usage
    f ** g
    tensor(f, g)
  Inputs
    f:Matrix
    g:Matrix
  Outputs
     :Matrix
       the tensor product of maps $f$ and $g$
  Description
    Text
      Other names for the tensor product include: the outer product, or the Kronecker product of two matrices.
    Example
      R = ZZ[a..d];
      f = matrix {{a,b}}
      g = transpose matrix {{c,d}}
      f ** g
  SeeAlso
    flip
    (tensor, Module, Module)
    (tensor, Matrix, Module)
    --(tensor, Vector, Vector)

Node
  Key
    --(tensor, Vector, Vector)
    (symbol**, Vector, Vector)
  Headline
    tensor product
  Usage
    v ** w
    tensor(v, w)
  Inputs
    v:Vector
    w:Vector
  Outputs
     :Vector
       the tensor product of $v$ and $w$
  Description
    Text
      If $v$ is in the module $M$ and $w$ is in the module $N$, then $v\otimes w$ is in the module $M\otimes N$.
    Example
      R = ZZ[a..d];
      F = R^3
      G = coker vars R
      v = (a-37)*F_1
      v ** G_0
  SeeAlso
    flip
    (tensor, Module, Module)
    (tensor, Matrix, Module)
    (tensor, Matrix, Matrix)

Node
  Key
    flip
   (flip, Module, Module)
  Headline
    isomorphism map of commutativity of tensor product
  Usage
    flip(F, G)
  Inputs
    F:Module
    G:Module
  Outputs
     :Matrix
       the matrix representing the natural isomorphism $F \otimes G \to G \otimes F$
  Description
    Example
      R = QQ[x,y];
      F = R^{1,2,3}
      G = R^{10,20,30}
      f = flip(F,G)
      isHomogeneous f
      target f
      source f
      target f === G**F
      source f === F**G
      u = x * F_0
      v = y * G_1
      u ** v
      v ** u
      f * (u ** v)
      f * (u ** v) === v ** u

Node
  Key
    --(tensor, Module, Ring)
    --(tensor, Ideal,  Ring)
    --(tensor, Ring, Ideal)
    --(tensor, Ring, Module)
    (symbol **, Module, Ring)
    (symbol **, Ideal,  Ring)
    (symbol **, Ring, Ideal)
    (symbol **, Ring, Module)
  Headline
    tensor product
  Usage
    M ** R
    R ** M
    tensor(M, R)
    tensor(R, M)
  Inputs
    M:{Module,Ideal}
    R:Ring
  Outputs
     :Module
       over $R$, obtained by forming the tensor product of the module $M$ with $R$
  Description
    Text
      If the ring of $M$ is a base ring of $R$ then the matrix presenting
      the module will be simply promoted (see @TO promote@).
      Otherwise, a ring map from the ring of @TT "M"@ to @TT "R"@ will be
      constructed by examining the names of the variables, as described in @TO (map, Ring, Ring)@.
    Example
      R = ZZ/101[x,y];
      M = coker vars R
      M ** R[t]

Node
  Key
    --(tensor, Matrix, Ring)
    --(tensor, Ring, Matrix)
    (symbol **, Matrix, Ring)
    (symbol **, Ring, Matrix)
  Headline
    tensor product
  Usage
    f ** R
    R ** f
  Inputs
    f:Matrix
    R:Ring
  Outputs
     :Matrix
       over $R$, obtained by forming the tensor product of the map $f$ with $R$
  Description
    Text
      The ring of $f$ should be a base ring of $R$.  The degree of the map is preserved.
    Example
      R = ZZ[a..c];
      S = R/(a+b+c);
      f = vars R
      f ** S
///

document {
    Key => (symbol ^**, Module, ZZ),
    Headline => "tensor power",
    Usage => "M^**i",
    Inputs => { "M", "i" },
    Outputs => {Module => { "the ", TT "i", "-th tensor power of ", TT "M"}},
    "The second symmetric power of the canonical module of the rational quartic:",
    EXAMPLE lines ///
         R = QQ[a..d];
         I = monomialCurveIdeal(R,{1,3,4})
	 M = Ext^1(I,R^{-4})
	 M^**2
	 ///
    }

document {
    Key => {
	 tensorAssociativity,
	(tensorAssociativity, Module, Module, Module),
    },
    Headline => "associativity isomorphisms for tensor products",
    TT "tensorAssociativity(A,B,C)", " -- produces the isomorphism from
    A**(B**C) to (A**B)**C.",
    PARA{},
    "Currently implemented for modules and chain complexes.",
    SeeAlso => {"OldChainComplexes :: ChainComplex", "Module"}
}