Hadamard積計算:要素ごとの乗算

2つのベクトルを要素ごとに掛け合わせます。

Hadamard積計算:要素ごとの乗算
2つのベクトルを要素ごとに掛け合わせます。

About the Hadamard product calculator

The Hadamard product is the simplest way to multiply two vectors or matrices when you want corresponding entries to interact directly. Instead of combining rows and columns the way standard matrix multiplication does, the Hadamard product pairs the first value with the first value, the second with the second, and so on. For vectors A = [a1, a2, a3] and B = [b1, b2, b3], the result is [a1×b1, a2×b2, a3×b3]. This calculator focuses on that exact operation for one-dimensional vectors. Element-wise multiplication appears everywhere once you start looking for it. In statistics and data science, it is used when scaling feature vectors or applying weights to observations. In signal processing, it can represent point-by-point modulation of sampled data. In machine learning, the Hadamard product shows up in attention masks, gating mechanisms, and neural-network operations where one vector selectively amplifies or suppresses another. In finance, you might use it to multiply unit holdings by per-asset returns or prices to inspect contribution by position before summing anything. One important detail is that the two vectors must have the same length. Because each output entry needs one value from the first vector and one value from the second vector, there must be a perfect one-to-one pairing across the whole sequence. If one vector has four values and the other has three, the operation is undefined. That is why the calculator validates matching lengths before producing a result. This is also a good place to distinguish the Hadamard product from the dot product. A dot product multiplies corresponding entries and then adds the products to produce a single scalar. The Hadamard product stops one step earlier and returns the full vector of pairwise products. If you later want the dot product, you could sum the entries of the Hadamard result. Keeping the intermediate vector is useful because it shows how each position contributes. Because the inputs accept comma-separated or space-separated numbers, you can paste values from spreadsheets, notes, or code with minimal cleanup. Use the tool whenever you need a fast, transparent way to inspect element-wise multiplication without writing a script or opening a larger numerical package.

Hadamard product examples

These examples show how element-wise multiplication preserves vector length and multiplies matching positions only.

InputOutputNotes
A = [1, 2, 3], B = [4, 5, 6][4, 10, 18]Multiply each pair in place: 1×4, 2×5, and 3×6. The result stays a three-entry vector.
A = [2, -1, 0.5], B = [3, 8, 10][6, -8, 5]Negative and decimal values work naturally. Each sign and magnitude is determined independently at its matching position.
A = [0, 7, 9], B = [12, 2, -3][0, 14, -27]A zero in either vector forces that output entry to zero, which is useful when applying masks or switches.

How to use the Hadamard product calculator

  1. Enter the first vector in the top field using commas or spaces between numbers.
  2. Enter the second vector with the same number of values as the first vector.
  3. Click "Calculate Hadamard Product" to compute the element-wise products.
  4. Use "Reset" to clear both vectors and start a new calculation.

Hadamard product FAQ

What is the Hadamard product?
The Hadamard product multiplies corresponding entries of two vectors or matrices of the same shape. It is different from ordinary matrix multiplication because it does not mix rows and columns; every output position depends only on the matching input positions.
Why must the vectors have the same length?
Each result entry needs exactly one value from the first vector and one from the second vector. If the lengths differ, there is no consistent way to pair every value, so the operation is undefined.
How is this different from the dot product?
The dot product multiplies matching entries and then adds them to produce a single number. The Hadamard product stops before the sum and returns the full vector of pairwise products, which is often more informative.
Where is element-wise multiplication used in practice?
It is common in data science, graphics, physics simulations, and machine learning whenever one vector acts as a mask, weight set, or gate for another. It is also useful in spreadsheets and quick numerical checks because you can see each contribution separately before any aggregation.

関連ツール

負の対数計算機:任意の底の−log(x)
pH、情報量、任意の底の −log_b(x) を計算します。底10、2、e、および1以外の正の底に対応し、正確な結果をすぐ確認できます。
計算機:健康と計画
内積の公式を使って 2つのベクトル間の角度を計算します。2D と 3D に対応し、度数・ラジアン・ベクトルの大きさ・内積・余弦値をすぐに正確に表示します。
計算機:健康と計画
正方形、長方形、円、三角形、平行四辺形、台形の面積を計算します。式に必要な寸法を入力すると、すぐに結果が得られます。数値を入力するだけで、明確で正確な結果をすぐに確認できます。
大小比較計算機
任意の2つの数(整数・小数・負の数)を比較し、正しい記号 >、<、= をすぐに表示します。
ガンマ関数計算機
Lanczos 近似で任意の実数のガンマ関数 Γ(z) を計算し、階乗や積分、特殊関数の値をすぐに求められます。
円の接線計算機
円周上の任意の点での接線方程式を求めます。一般形と傾き切片形、途中計算も表示。
分数比較計算機:どちらが大きいか
小数・通分・交差掛け算で2つの分数の大小を判定し、わかりやすい手順も表示します。
三角柱計算機 - 体積と表面積
三角柱の体積、底面積、側面積、全表面積を計算します。底面の3辺と高さを入力するとすぐに結果が得られます。