Vector hadamard
vector-hadamard · version 1.0.0 · Vectors & matrices · free, no key needed
Multiply two equal-length finite-number vectors elementwise (Hadamard product).
Use when you need to: vector hadamard product · elementwise vector multiplication · pointwise vector product.
Supported
- vector hadamard product
- elementwise vector multiplication
- pointwise vector product
Not supported
- vectors of different lengths
- dot product (use vector-dot)
- arbitrary-precision arithmetic
Behavior
- Inputs a and b are arrays of finite JSON numbers with the same length, from 1 to 64 entries.
- Each entry magnitude is bounded to at most 1000000 in absolute value.
- The result is the elementwise IEEE-754 double-precision product result[i] = a[i] * b[i].
- A result entry of -0 is normalized to 0.
Input
a(array of number, required): min items 1; max items 64b(array of number, required): min items 1; max items 64
Output
result(array of number, required)
Limits
- max dim: 64
- max abs value: 1000000
Example
Request input:
{
"a": [
1,
2,
3
],
"b": [
4,
5,
6
]
}
Response:
{
"result": {
"result": [
4,
10,
18
]
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "vector-hadamard",
"version": "1.0.0",
"input": {
"a": [
1,
2,
3
],
"b": [
4,
5,
6
]
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/vector-hadamard/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"a":[1,2,3],"b":[4,5,6]}'
The machine-readable contract is at /v1/tools/vector-hadamard/versions/1.0.0.
CLI
node cli.mjs run vector-hadamard 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Matrix hadamard: Multiply two equal-shape finite-number matrices elementwise (Hadamard product).
- Matrix multiply: Multiply an MxK finite-number matrix by a KxN finite-number matrix, producing an MxN matrix.
- Matrix vector multiply: Multiply an MxN finite-number matrix by a length-N finite-number vector, producing a length-M vector.
- Vector add: Add two equal-length finite-number vectors elementwise.
- Vector cross: Compute the 3-dimensional cross product of two finite-number vectors.
- Vector dot: Compute the dot (scalar) product of two equal-length finite-number vectors.