# pmm_tools.model_helper

*module*

Normalize symbolic chain parameters and define ordered fermionic modes.

## pmm_tools.model_helper.define_operators

*function*

```python
def define_operators(length, spinful=False)
```

Return ordered annihilation operators for a spinless or spinful chain.

Spinless modes are c_0,...,c\_(length-1). Spinful modes alternate up/down
at each site. These are noncommuting SymPy FermionOp objects; occupation
matrices use the first mode as the most significant bit.

[View source](https://gitlab.kwant-project.org/qt/pmm_tools/-/blob/e412d66507a554f455ef935b755fc39f28ab4e05/pmm_tools/model_helper.py#L42-L55)

## pmm_tools.model_helper.prepare_parameters

*function*

```python
def prepare_parameters(parameters, specs)
```

Return parameter tuples in site or bond order.

Each specification supplies `len` and `real`. Real parameters create
real symbols; other parameters create unrestricted complex symbols.
Values may be numeric/SymPy scalars, zero-dimensional NumPy arrays,
one-dimensional sequences of the required length, or the policies
`"constant"` and `"space-dependent"`. Scalars repeat across the chain.
`parameters=None` creates uniform symbols for every parameter; an explicit
mapping must supply all parameters used by the constructor.

[View source](https://gitlab.kwant-project.org/qt/pmm_tools/-/blob/e412d66507a554f455ef935b755fc39f28ab4e05/pmm_tools/model_helper.py#L8-L39)
