---
file_format: mystnb
kernelspec:
name: python3
hide-toc: true
---
# Formatted Formula View
The Amplify SDK formulas are automatically rendered in LaTeX in IPython front-end environments that support LaTeX formula display, such as Jupyter Notebook and Visual Studio Code.
Polynomials, polynomial arrays, coefficient matrices, constraints, and models are displayed as mathematical expressions as follows.
## Variable array
```{code-cell}
import amplify
gen = amplify.VariableGenerator()
q = gen.array("Binary", shape=(4, 4))
q
```
## Polynomial
```{code-cell}
p = 2 * (q[0] * q[1]).sum()
p
```
## Polynomial array
```{code-cell}
q[0:2] + q[2:]
```
## Constraint
```{code-cell}
c1 = amplify.one_hot(q, axis=1)
c1
```
## Coefficient matrix
```{code-cell}
import numpy as np
m = gen.matrix("Binary", 4)
m.quadratic = np.array([[1, 2, 3, 4],
[0, 5, 6, 7],
[0, 0, 8, 9],
[0, 0, 0, 10]])
m.linear = np.array([1, 2, 3, 4])
c2 = amplify.one_hot(m.variable_array)
m
```
## Model
```{code-cell}
model = p + c1
model
```
```{code-cell}
model = m + c2
model
```