# Chalk SQL Reference: Vector Functions
source: https://docs.chalk.ai/chalksql-docs#section-vector-functions

## `binary_to_vector(binary, precision)`
source: https://docs.chalk.ai/chalksql-docs#binary_to_vector

Returns vector from `binary`.

**Overloads**

#### `binary_to_vector(binary, precision)`

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.
- `precision`: `int64`
  The floating-point `precision` in bits: 16, 32, or 64.

#### `binary_to_vector(binary, precision)`

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.
- `precision`: `int64`
  The floating-point `precision` in bits: 16, 32, or 64.

## `cosine_similarity_vector(vector1, vector2)`
source: https://docs.chalk.ai/chalksql-docs#cosine_similarity_vector

Returns the cosine similarity between the vectors.

**Overloads**

#### `cosine_similarity_vector(vector1, vector2)`

**Parameters**

- `vector1`: `list<item: float>`
  The first input vector.
- `vector2`: `list<item: float>`
  The second input vector.

#### `cosine_similarity_vector(vector1, vector2)`

**Parameters**

- `vector1`: `list<item: double>`
  The first input vector.
- `vector2`: `list<item: double>`
  The second input vector.

#### `cosine_similarity_vector(vector1, vector2)`

**Parameters**

- `vector1`: `list<item: halffloat>`
  The first input vector.
- `vector2`: `list<item: halffloat>`
  The second input vector.

#### `cosine_similarity_vector(vector1, vector2)`

**Parameters**

- `vector1`: `large_list<item: float>`
  The first input vector.
- `vector2`: `large_list<item: float>`
  The second input vector.

#### `cosine_similarity_vector(vector1, vector2)`

**Parameters**

- `vector1`: `large_list<item: double>`
  The first input vector.
- `vector2`: `large_list<item: double>`
  The second input vector.

#### `cosine_similarity_vector(vector1, vector2)`

**Parameters**

- `vector1`: `large_list<item: halffloat>`
  The first input vector.
- `vector2`: `large_list<item: halffloat>`
  The second input vector.

## `dot_product_vector(...)`
source: https://docs.chalk.ai/chalksql-docs#dot_product_vector

Either:

- Returns the dot product between the vectors.
- Returns the dot product of two maps, summing the product of the values of their shared keys.

**Overloads**

#### `dot_product_vector(vector1, vector2)`

Returns the dot product between the vectors.

**Parameters**

- `vector1`: `list<item: halffloat>`
  The first input vector.
- `vector2`: `list<item: halffloat>`
  The second input vector.

#### `dot_product_vector(vector1, vector2)`

Returns the dot product between the vectors.

**Parameters**

- `vector1`: `list<item: float>`
  The first input vector.
- `vector2`: `list<item: float>`
  The second input vector.

#### `dot_product_vector(vector1, vector2)`

Returns the dot product between the vectors.

**Parameters**

- `vector1`: `list<item: double>`
  The first input vector.
- `vector2`: `list<item: double>`
  The second input vector.

#### `dot_product_vector(vector1, vector2)`

Returns the dot product between the vectors.

**Parameters**

- `vector1`: `list<item: halffloat>`
  The first input vector.
- `vector2`: `list<item: halffloat>`
  The second input vector.

#### `dot_product_vector(vector1, vector2)`

Returns the dot product between the vectors.

**Parameters**

- `vector1`: `large_list<item: halffloat>`
  The first input vector.
- `vector2`: `large_list<item: halffloat>`
  The second input vector.

#### `dot_product_vector(vector1, vector2)`

Returns the dot product between the vectors.

**Parameters**

- `vector1`: `large_list<item: float>`
  The first input vector.
- `vector2`: `large_list<item: float>`
  The second input vector.

#### `dot_product_vector(vector1, vector2)`

Returns the dot product between the vectors.

**Parameters**

- `vector1`: `large_list<item: double>`
  The first input vector.
- `vector2`: `large_list<item: double>`
  The second input vector.

#### `dot_product_vector(vector1, vector2)`

Returns the dot product between the vectors.

**Parameters**

- `vector1`: `large_list<item: halffloat>`
  The first input vector.
- `vector2`: `large_list<item: halffloat>`
  The second input vector.

#### `dot_product_vector(map, key)`

Returns the dot product of two maps, summing the product of the values of their shared keys.

**Parameters**

- `map`: `map<string, int64>`
  The input `map`.
- `key`: `map<string, int64>`
  The map `key` to read or update.

#### `dot_product_vector(map, key)`

Returns the dot product of two maps, summing the product of the values of their shared keys.

**Parameters**

- `map`: `map<string, double>`
  The input `map`.
- `key`: `map<string, double>`
  The map `key` to read or update.

#### `dot_product_vector(map, key)`

Returns the dot product of two maps, summing the product of the values of their shared keys.

**Parameters**

- `map`: `map<large_string, int64>`
  The input `map`.
- `key`: `map<large_string, int64>`
  The map `key` to read or update.

#### `dot_product_vector(map, key)`

Returns the dot product of two maps, summing the product of the values of their shared keys.

**Parameters**

- `map`: `map<large_string, double>`
  The input `map`.
- `key`: `map<large_string, double>`
  The map `key` to read or update.

## `scale_vector(vector, factor)`
source: https://docs.chalk.ai/chalksql-docs#scale_vector

Returns a scaled `vector`.

**Overloads**

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `list<item: halffloat>`
  The input `vector`, as an array of floats.
- `factor`: `halffloat`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `list<item: halffloat>`
  The input `vector`, as an array of floats.
- `factor`: `float`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `list<item: halffloat>`
  The input `vector`, as an array of floats.
- `factor`: `double`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `list<item: float>`
  The input `vector`, as an array of floats.
- `factor`: `halffloat`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `list<item: float>`
  The input `vector`, as an array of floats.
- `factor`: `float`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `list<item: float>`
  The input `vector`, as an array of floats.
- `factor`: `double`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `list<item: double>`
  The input `vector`, as an array of floats.
- `factor`: `halffloat`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `list<item: double>`
  The input `vector`, as an array of floats.
- `factor`: `float`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `list<item: double>`
  The input `vector`, as an array of floats.
- `factor`: `double`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `large_list<item: halffloat>`
  The input `vector`, as an array of floats.
- `factor`: `halffloat`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `large_list<item: halffloat>`
  The input `vector`, as an array of floats.
- `factor`: `float`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `large_list<item: halffloat>`
  The input `vector`, as an array of floats.
- `factor`: `double`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `large_list<item: float>`
  The input `vector`, as an array of floats.
- `factor`: `halffloat`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `large_list<item: float>`
  The input `vector`, as an array of floats.
- `factor`: `float`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `large_list<item: float>`
  The input `vector`, as an array of floats.
- `factor`: `double`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `large_list<item: double>`
  The input `vector`, as an array of floats.
- `factor`: `halffloat`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `large_list<item: double>`
  The input `vector`, as an array of floats.
- `factor`: `float`
  The multiplier applied to each element.

#### `scale_vector(vector, factor)`

**Parameters**

- `vector`: `large_list<item: double>`
  The input `vector`, as an array of floats.
- `factor`: `double`
  The multiplier applied to each element.

## `vector_to_binary(vector, precision)`
source: https://docs.chalk.ai/chalksql-docs#vector_to_binary

Returns binary of `vector`.

**Overloads**

#### `vector_to_binary(vector, precision)`

**Parameters**

- `vector`: `list<item: halffloat>`
  The input `vector`, as an array of floats.
- `precision`: `int64`
  The floating-point `precision` in bits: 16, 32, or 64.

#### `vector_to_binary(vector, precision)`

**Parameters**

- `vector`: `list<item: float>`
  The input `vector`, as an array of floats.
- `precision`: `int64`
  The floating-point `precision` in bits: 16, 32, or 64.

#### `vector_to_binary(vector, precision)`

**Parameters**

- `vector`: `list<item: double>`
  The input `vector`, as an array of floats.
- `precision`: `int64`
  The floating-point `precision` in bits: 16, 32, or 64.

#### `vector_to_binary(vector, precision)`

**Parameters**

- `vector`: `large_list<item: halffloat>`
  The input `vector`, as an array of floats.
- `precision`: `int64`
  The floating-point `precision` in bits: 16, 32, or 64.

#### `vector_to_binary(vector, precision)`

**Parameters**

- `vector`: `large_list<item: float>`
  The input `vector`, as an array of floats.
- `precision`: `int64`
  The floating-point `precision` in bits: 16, 32, or 64.

#### `vector_to_binary(vector, precision)`

**Parameters**

- `vector`: `large_list<item: double>`
  The input `vector`, as an array of floats.
- `precision`: `int64`
  The floating-point `precision` in bits: 16, 32, or 64.
