Jasper,
Thanks for sharing a complete and minimal script that demonstrates the issue and asking specific questions. These changes are needed so the script will run without error:
You are not defining the angle types correctly, Line 38 should be: snapshot.angles.types = ['C-C-C']
Also, remove lines 61-63:
hoomd.State.N_particles = 3
hoomd.State.N_angles = 1
hoomd.State.angle_types = harmonic.params['C-C-C']
With these lines, you are "monkey patching" and changing the code that the HOOMD-blue developers implemented for the `State` class. These change the expected behavior of `State` and create some of the problems in your script. As discussed in the tutorials, define the properties of your systems state via a Snapshot or a GSD file. An *instance* of `State` (in `sim.state`) provides access to these properties: e.g.:
>>> print(sim.state.angle_types)
['C-C-C']
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan