How to deeply copy a pylammps instance

hi, developers

i want to know how to deep copy a lammps or pylammps instance in python code similar to numpy.deepcopy(array) .

for example, to control variables of experiments, i need to run a system using python lammps under condition A, such as nvt. And then i need to copy the instance and run two instance by multiprocessing under different conditions,such as nve for one and npt for another one.

Please note that PyLammps is obsolete and will be removed from the LAMMPS distribution soon.

This functionality doesn’t exist and it cannot exist. A LAMMPS class instance is more than just an array. There is a whole class hierarchy that would need to be rebuilt.

The closest you can do is to use the “write_restart” and “read_restart” commands, but they don’t do a full serialization / deserialization. You have to study the documentation carefully.

This should work with restarts.