Polymer structure search
Research code from a summer placement at Cambridge that generates random polymer structures and relaxes them with a force field
- What it is
- Code from a summer research placement, 2022
- Where
- University of Cambridge, through In2Research
- Built with
- Python, NumPy, ASE, LAMMPS
- When
- 2022
The project
In the summer of 2022 I spent three months as a Computational Research Assistant at the University of Cambridge, through the In2Research programme. The project applied a technique called random structure searching (AIRSS) to polyethylene. The idea is to generate a large number of random but physically sensible starting structures, relax each one with a model of the forces involved, and then see which low-energy arrangements keep turning up.
What I wrote
Random structure searching only works if the starting structures are both random and physically plausible. Chains that overlap produce enormous forces the moment the relaxation starts, which makes it fail or send atoms flying, while starting structures that are too similar waste computing time by relaxing into the same arrangement again and again.
I wrote a Python package that builds polymer chains using standard bond lengths and angles, creates a random periodic box, and places the chains inside it without letting them overlap. Each chain is then rotated at random to widen the search. The package relaxes every structure with the AIREBO force field in LAMMPS, driven from Python through ASE, and allows the shape of the box to change under a set pressure. Finally it writes the results out in formats that the AIRSS tools and viewers like VESTA can read. I wrote and ran it on Linux and on a university computing cluster, within the research group's existing AIRSS workflow.
The optimised structures agreed with what has been observed experimentally, and I presented the work as a poster at the In2Research summer conference.
What I'd change now
The package needs tests for the geometry code and pinned versions of the libraries it depends on. I'd also separate generating the structures from relaxing them, so that each stage can be checked on its own before any computing time is spent.
If you'd like to keep reading, the next project is Memora: a mobile rhythm game in Unity and C# where the judgement lines move with the music and notes can aim at targets that are still moving.