add_spin

Model.add_spin(spin)

Add a spin to the model.

Parameters:

spin (BaseSpin) – Spin object to attach to the model.

Raises:

SimphonyError – If another spin with the same name is already present.

Note

Adding a spin changes the size and structure of the model, so derived quantities such as the Hamiltonian, eigensystem, and driving operators are recomputed when needed.