⊗
Translation status: हिन्दी reader-locale proof. Term names and code fences follow the hi pack; supporting prose may still be English.
Glyph outer product: vector ⊗ vector yields the rank-summed matrix of pairwise products.
Syntax: <expression> ⊗ <expression>
Category#
arithmetic
Related#
- vector
- matrix
Examples#
radix/corpus/tensor/glyph-outer.fab (canonical · operator-group)#
Glyph outer product: vector ⊗ vector yields the rank-summed matrix of pairwise products.
# =============================================================================
# ⊗ — glyph outer product (सदिश ⊗ सदिश → आव्यूह).
# =============================================================================
#
# What this teaches:
# • Outer product — `a ⊗ b` pairs every left लेन with every right लेन into a आव्यूह
# • Rank sum — the result rank is the sum of the operand ranks (1 + 1 = 2)
#
# Common mistakes:
# • Kronecker on matrices — आव्यूह ⊗ आव्यूह is deferred (Phase 2); only सदिश ⊗ सदिश lowers in Phase 1
# • row/column orientation — rows come from the left सदिश, columns from the right सदिश
#
# See also: सदिश, आव्यूह
# =============================================================================
# सदिश ⊗ सदिश → आव्यूह (rank sum)
#
# WHY: `⊗` is the outer/Kronecker glyph. Phase 1 registers सदिश ⊗ सदिश →
# आव्यूह (rows = left width, columns = right width); टेंसर Kronecker is
# deferred with an explicit diagnostic. Pairwise products fill the result.
#
# a = [1.0, 2.0, 3.0] b = [4.0, 5.0]
# a ⊗ b = [[1*4, 1*5], [2*4, 2*5], [3*4, 3*5]]
# = [[4.0, 5.0], [8.0, 10.0], [12.0, 15.0]]
#
# EXPECTED stdout:
# [[4.0, 5.0], [8.0, 10.0], [12.0, 15.0]]
main {
const vf32[3] a ← [1.0, 2.0, 3.0] ↦ vf32[3]
const vf32[2] b ← [4.0, 5.0] ↦ vf32[2]
const आव्यूह<f32, [3, 2]> o ← a ⊗ b
print o
}Expected output:
[[4.0, 5.0], [8.0, 10.0], [12.0, 15.0]]