Active Brownian Particles Magnetic in 2D

300 views
Skip to first unread message

Nicolas Zucker

unread,
Jun 11, 2021, 9:16:30 AM6/11/21
to hoomd-users
Greetings everyone.

I am working on a project to study the collective behavior of active Brownian particles in 2D considering magnetic interactions and I hope that some of you can help me.

I am working with hoomd 2.9.6 and the main problem is that my particles, under certain circumstances, are leaving the XY plane.

To begin with, I initialize my system by creating random positions and orientations in 2D, choosing, as required in hoomd 2.9, Lz=1 and 'dimension=2'.
I then define a repulsive Lennard-Jones potential and a dipole-dipole interaction between my particles. I then create an active force array for the activity, putting every activity in the XY plane. I fix 'orientation_reverse_link=True' so that the particle’s orientation match the active force vector ( initializing orientations is then useless).
After some time steps, my particles are leaving the plane, even with the command 'update.enforce2d()'. It seems that through the rotational diffusion, defined in the active force, some of the orientations of the particles are leaving the plane, then the dipole-dipole interaction has components in the z direction.
Indeed, when I disable the active force, my orientations are all in the plane because the dipole-dipole interactions stay in the plane.

The goal could be, if not to constraint the particle movement in 2D, to constraint the rotational diffusion in the XY plane. Choosing appropriate moment of inertia doesn't work as I am using Brownian integrator and was also not useful to fix my rotational degree of freedom (particle were still leaving the plane).

Does anyone have an idea to constrain my system in 2D or to prevent the rotational diffusion in the Z direction from making my particles leaving the plane ?


Thanks for any idea!

Joshua Anderson

unread,
Jun 14, 2021, 8:06:25 AM6/14/21
to hoomd...@googlegroups.com
Nicolas,

Could you post a minimal script that reproduces the issue?

The rotational diffusion in force.Active is set 2D or 3D depending on the dimensionality of the system: https://github.com/glotzerlab/hoomd-blue/blob/df9b4d1c359d1b70f797a2207474c49a439f1c6d/hoomd/md/ActiveForceCompute.cc#L269-L322

The random torques in md.methods.Brownian are set for the axes which have non-zero moments of inertia. Brownian also zeros x and y torques when the system is set to 2D: https://github.com/glotzerlab/hoomd-blue/blob/df9b4d1c359d1b70f797a2207474c49a439f1c6d/hoomd/md/TwoStepBD.cc#L161-L204
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
> --
> You received this message because you are subscribed to the Google Groups "hoomd-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/f6494c64-aa4c-4747-b36b-4d320726f70en%40googlegroups.com.

Nicolas Zucker

unread,
Jun 15, 2021, 4:54:22 AM6/15/21
to hoomd...@googlegroups.com
Hi Joshua,
Thank you for your reply.

First of all, I have checked with the command "print(Lattice.__dict__)"" the dimension of my system and it is still 2 alongside the initialisation.
I think that the problem comes from the rotational diffusion and the orientational_reverse_link='True'. I think I don't understand well
how the orientation of the particles are set to match the active force vector.
Here is a minimal script that reproduces the issue, particles (whose positions were created randomly in the plane through creaposi2D) are leaving the Z=0 plane.

hoomd.context.initialize("");
N=20;
L=50;

my_position=creaposi2D(N,L);
numpy.random.seed(0);

orientation=numpy.zeros([N,4])

inertiamomentum=numpy.zeros([N,3])
inertiamomentum[:,2]=1;

Lattice=hoomd.lattice.unitcell(N, [L,0,0], [0,L,0], [0,0,1], dimensions=2, position=my_position, type_name=None, mass=numpy.ones([N,1])[:,0]
, charge=None, diameter=numpy.ones([N,1])[:,0], moment_inertia=inertiamomentum, orientation=orientation)
system=hoomd.init.create_lattice(Lattice,1)

all = hoomd.group.all()
nl = hoomd.md.nlist.cell()
lj = hoomd.md.pair.lj(r_cut=2**(1/6), nlist=nl)
lj.pair_coeff.set('A', 'A', epsilon=12.0, sigma=1,alpha=1/2)
dip = hoomd.md.pair.dipole(r_cut=L/2.5, nlist=nl, name=None)
dip.pair_coeff.set('A', 'A', mu=6, A=1.0, kappa=0)


hoomd.md.integrate.mode_standard(dt=0.000002);

activity=[]
for i in range(N):
activity.append((5, 0,0))


hoomd.md.force.active(group=all,
seed=123,
f_lst=activity,
rotation_diff=3,
orientation_link=False, orientation_reverse_link=True,constraint=None);



hoomd.md.integrate.brownian(group=all, kT=1, seed=123)

hoomd.analyze.log(filename="log-output.log",quantities=['potential_energy', 'temperature'],period=20,overwrite=True);

hoomd.dump.gsd("trajectory.gsd", period=6e3, group=all, overwrite=True);

hoomd.run(1000000);



You received this message because you are subscribed to a topic in the Google Groups "hoomd-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hoomd-users/zpd4gsAKFEE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hoomd-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/3416AAA0-1BB5-4360-BA16-ED9BC3941650%40umich.edu.

Joshua Anderson

unread,
Jun 15, 2021, 5:59:07 AM6/15/21
to hoomd...@googlegroups.com
Nicolas,

Thanks for sharing. Update to the latest v3 beta and the new implementation of md.force.Active will work for this case. https://hoomd-blue.readthedocs.io/en/latest/module-md-force.html#hoomd.md.force.Active

The problem with v2 is that `orientation_reverse_link` uses (0,0,1) as a basis vector. It will therefore always set the orientation so that the active force direction points in the z direction. What you need is `orientation_link` instead, although this code path is apparently not implemented with support for rotational diffusion in v2.9.

In v3, the implementation applies rotational diffusion by rotating the particle's orientation about the z axis. Numerically this can only lead to out of plane orientations if and only if the initial orientation is also out of plane. We are looking into ways to provide a warning when this is the case.

------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

> To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/CAA%2BQM%2BSia8R5PySv3ctVCEMgCsuC4KTrqbj3TU6CUCaPHWEAJQ%40mail.gmail.com.

Nicolas Zucker

unread,
Jun 17, 2021, 8:55:00 AM6/17/21
to hoomd-users
Joshua,

Thank you very much for your reply, it was very clear and I now understand why I couldn't have both active force and orientation-dependent force.
I tried with v3 and it works perfectly, the activity is oriented in the particles' orientation as soon as you choose an active force along the (1,0,0) vector.

However, I now want to create walls all around my 2D box and I got an error message. I tried to look in the code on github but I didn't reach to understand what the problem was.
Here is a minimal script of the code I am using.

hoomd.md.wall.plane(origin=(-L/2,0,0),normal=(1,0,0),inside=True); #X+
hoomd.md.wall.plane(origin=(+L/2,0,0),normal=(-1,0,0),inside=True); #X-
allwall=hoomd.md.wall.group()
ljw=hoomd.md.wall.lj(walls=allwall)
ljw.force_coeff.set('A', sigma=1.0,epsilon=Eps,r_cut=2**(1/6))
brownian = hoomd.md.methods.Brownian(filter=hoomd.filter.All(), kT=0.1,alpha=1.0)
integrator = hoomd.md.Integrator(dt=0.000025,aniso='true', methods=[brownian],forces=[lj,dipole,active,ljw])
sim.operations.integrator = integrator
sim.run(1000000)

I have the error message :

File "/home/zucker/Documents/Programs/testaABPV3.py", line 77, in <module>
    lj=hoomd.md.wall.slj(walls=allwall)
  File "/home/zucker/anaconda3/envs/hoomd3/lib/python3.9/site-packages/hoomd/md/wall.py", line 764, in __init__
    wallpotential.__init__(self, walls, r_cut, name);
  File "/home/zucker/anaconda3/envs/hoomd3/lib/python3.9/site-packages/hoomd/md/wall.py", line 593, in __init__
    external._external_force.__init__(self, name);
  File "/home/zucker/anaconda3/envs/hoomd3/lib/python3.9/site-packages/hoomd/md/external.py", line 200, in __init__
    force._force.__init__(self, name);
TypeError: object.__init__() takes exactly one argument (the instance to initialize)

Do you have any idea of what the problem is ?
Thank you very much,

Nicolas

Joshua Anderson

unread,
Jun 17, 2021, 10:44:52 AM6/17/21
to hoomd...@googlegroups.com
Nicolas,

Unfortunately, we have not yet ported the wall potentials in the v3 beta. They will be enabled in a future release.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

> To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/53736ebc-5643-4dfb-990a-00a8b61227fan%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages