# core.Joint

``` python
core.Joint(op, sizes=static())
```

One operator across all blocks, on vectors keyed by block name.

A vector’s blocks are concatenated in `sizes` order (leading batch axes kept), passed to `op`, and split back.

## Parameters

| Name | Type | Description | Default |
|----|----|----|----|
| op | Op | The operator on the concatenated vector. | *required* |
| sizes | tuple\[tuple\[str, int\], …\] | Each block’s name and flat size, in concatenation order. | `static()` |

## Methods

| Name | Description |
|----|----|
| [add_diagonal](#laplacekit.core.Joint.add_diagonal) | `op.add_diagonal` with the concatenated `d`. |
| [add_isotropic](#laplacekit.core.Joint.add_isotropic) | `op.add_isotropic(precision)`. |
| [add_per_block](#laplacekit.core.Joint.add_per_block) | Add `precision[k]` to block `k`: a scalar to every diagonal entry, or a vector. |
| [add_same](#laplacekit.core.Joint.add_same) | `op.add_same(other.op)`. |
| [block_sizes](#laplacekit.core.Joint.block_sizes) | `sizes` as a mapping. |
| [cov_sqrt_mv](#laplacekit.core.Joint.cov_sqrt_mv) | `op.cov_sqrt_mv` on the concatenated `v`, split back into blocks. |
| [diagonal](#laplacekit.core.Joint.diagonal) | `op.diagonal()`, split into blocks. |
| [inverse_diagonal](#laplacekit.core.Joint.inverse_diagonal) | `op.inverse_diagonal()`, split into blocks. |
| [logdet](#laplacekit.core.Joint.logdet) | `op.logdet()`. |
| [mv](#laplacekit.core.Joint.mv) | `op.mv` on the concatenated `v`, split back into blocks. |
| [scaled](#laplacekit.core.Joint.scaled) | `op.scaled(s)`. |
| [solve](#laplacekit.core.Joint.solve) | `op.solve` on the concatenated `v`, split back into blocks. |

### add_diagonal

``` python
core.Joint.add_diagonal(d, /)
```

`op.add_diagonal` with the concatenated `d`.

#### Parameters

| Name | Type | Description | Default |
|----|----|----|----|
| d | Mapping\[str, Tensor\] | The diagonal $d$, shaped like a vector of the operator. | *required* |

#### Returns

| Name | Type | Description                   |
|------|------|-------------------------------|
|      | Self | An operator of the same type. |

#### Raises

| Name | Type | Description |
|----|----|----|
|  | StructureError | `d` is not a mapping, its keys differ from the blocks, a block’s last axis is not its size, or `op` can’t hold a diagonal. |

### add_isotropic

``` python
core.Joint.add_isotropic(precision, /)
```

`op.add_isotropic(precision)`.

#### Parameters

| Name      | Type   | Description                              | Default    |
|-----------|--------|------------------------------------------|------------|
| precision | Tensor | The precision $\lambda$, a 0-dim tensor. | *required* |

#### Returns

| Name | Type | Description                   |
|------|------|-------------------------------|
|      | Self | An operator of the same type. |

### add_per_block

``` python
core.Joint.add_per_block(precision, /)
```

Add `precision[k]` to block `k`: a scalar to every diagonal entry, or a vector.

A 0-dim `precision[k]` is expanded to the block’s size, and the whole goes through `add_diagonal`.

#### Parameters

| Name | Type | Description | Default |
|----|----|----|----|
| precision | Mapping\[str, Tensor\] | A mapping from block name to a 0-dim tensor or a vector `[P_k]`, with the operator’s block names. | *required* |

#### Returns

| Name | Type | Description                   |
|------|------|-------------------------------|
|      | Self | An operator of the same type. |

#### Raises

| Name | Type | Description |
|----|----|----|
|  | StructureError | `precision` is not a mapping, its keys differ from the blocks, a vector’s last axis is not its block’s size, or `op` can’t hold a diagonal. |

### add_same

``` python
core.Joint.add_same(other, /)
```

`op.add_same(other.op)`.

#### Parameters

| Name  | Type                               | Description        | Default    |
|-------|------------------------------------|--------------------|------------|
| other | Operator\[Mapping\[str, Tensor\]\] | The operator $P'$. | *required* |

#### Returns

| Name | Type | Description                   |
|------|------|-------------------------------|
|      | Self | An operator of the same type. |

#### Raises

| Name | Type | Description |
|----|----|----|
|  | StructureError | `other` is not a `Joint`, its `sizes` differ, or `op.add_same` raises it. |

### block_sizes

``` python
core.Joint.block_sizes()
```

`sizes` as a mapping.

#### Returns

| Name | Type | Description |
|----|----|----|
|  | Mapping\[str, int\] | A mapping from block name to flat size, in block order. |

### cov_sqrt_mv

``` python
core.Joint.cov_sqrt_mv(v, /)
```

`op.cov_sqrt_mv` on the concatenated `v`, split back into blocks.

#### Parameters

| Name | Type | Description | Default |
|----|----|----|----|
| v | Mapping\[str, Tensor\] | A mapping of vectors `[..., P_k]`, keyed by block name. | *required* |

#### Returns

| Name | Type                   | Description             |
|------|------------------------|-------------------------|
|      | Mapping\[str, Tensor\] | $L v$, shaped like `v`. |

#### Raises

| Name | Type | Description |
|----|----|----|
|  | StructureError | `v` is not a mapping, its keys differ from the blocks, or a block’s last axis is not its size. `op` may raise it too (such as a `Dense` that is not positive definite). |

### diagonal

``` python
core.Joint.diagonal()
```

`op.diagonal()`, split into blocks.

#### Returns

| Name | Type | Description |
|----|----|----|
|  | Mapping\[str, Tensor\] | A mapping of vectors `[P_k]`, keyed by block name. |

### inverse_diagonal

``` python
core.Joint.inverse_diagonal()
```

`op.inverse_diagonal()`, split into blocks.

#### Returns

| Name | Type | Description |
|----|----|----|
|  | Mapping\[str, Tensor\] | A mapping of vectors `[P_k]`, keyed by block name. |

#### Raises

| Name | Type | Description |
|----|----|----|
|  | StructureError | `op` raises it (such as a `Dense` that is not positive definite). |

### logdet

``` python
core.Joint.logdet()
```

`op.logdet()`.

#### Returns

| Name | Type   | Description     |
|------|--------|-----------------|
|      | Tensor | A 0-dim tensor. |

#### Raises

| Name | Type | Description |
|----|----|----|
|  | StructureError | `op` raises it (such as a `Dense` that is not positive definite). |

### mv

``` python
core.Joint.mv(v, /)
```

`op.mv` on the concatenated `v`, split back into blocks.

#### Parameters

| Name | Type | Description | Default |
|----|----|----|----|
| v | Mapping\[str, Tensor\] | A mapping of vectors `[..., P_k]`, keyed by block name. | *required* |

#### Returns

| Name | Type                   | Description             |
|------|------------------------|-------------------------|
|      | Mapping\[str, Tensor\] | $P v$, shaped like `v`. |

#### Raises

| Name | Type | Description |
|----|----|----|
|  | StructureError | `v` is not a mapping, its keys differ from the blocks, or a block’s last axis is not its size. |

### scaled

``` python
core.Joint.scaled(s, /)
```

`op.scaled(s)`.

#### Parameters

| Name | Type   | Description     | Default    |
|------|--------|-----------------|------------|
| s    | Tensor | A 0-dim factor. | *required* |

#### Returns

| Name | Type | Description                   |
|------|------|-------------------------------|
|      | Self | An operator of the same type. |

### solve

``` python
core.Joint.solve(v, /)
```

`op.solve` on the concatenated `v`, split back into blocks.

#### Parameters

| Name | Type | Description | Default |
|----|----|----|----|
| v | Mapping\[str, Tensor\] | A mapping of vectors `[..., P_k]`, keyed by block name. | *required* |

#### Returns

| Name | Type                   | Description                  |
|------|------------------------|------------------------------|
|      | Mapping\[str, Tensor\] | $P^{-1} v$, shaped like `v`. |

#### Raises

| Name | Type | Description |
|----|----|----|
|  | StructureError | `v` is not a mapping, its keys differ from the blocks, or a block’s last axis is not its size. `op` may raise it too (such as a `Dense` that is not positive definite). |
