#
# mp_graphene.ipynb
#
from qtdraw.core.qtdraw_app import QtDraw
# initialization.
win = QtDraw() # create QtDraw application.
win.mp_set_group("D6h^1") # set space group.
win.set_model("graphene") # set model name.
# draw equivalent sites and bonds.
win.mp_add_site("[1/3,2/3,0]")
win.mp_add_bond("[2/3,1/3,0];[1/3,2/3,0]")
# set range, repeat, and convert to nonrepeat.
win.set_range([0,0,0],[2,2,0.1])
win.set_repeat(True)
win.set_nonrepeat()
# draw vortex-like M-dipole structure.
lst = win.mp_create_vector_samb("M", "[1/3,2/3,0]")
win.mp_add_vector_samb_modulation("[[M03, sqrt(3)/6, [0,1/2,0], cos], [M02, 1/4, [1/2,0,0], cos], [M03, sqrt(3)/12, [1/2,0,0], cos], [M04, sqrt(3)/12, [1/2,1/2,0], cos], [M05, 1/4, [1/2,1/2,0], cos]]")
# set cell and view.
win.set_cell("all")
win.set_view([0,0,1])