Contents

#
# multipie.ipynb
#
from qtdraw.core.qtdraw_app import QtDraw

# show tag list.
def show_list(header, lst):
    print(header)
    for i in lst:
        print(" ", i)

# draw objects.
def draw_equivalent(win):
    # draw equivalent site, bond, vector, and orbital.
    win.mp_add_site("[1/4,0,1/3]")
    win.mp_add_bond("[1/4,0,1/3];[0,1/4,2/3]")
    win.mp_add_vector("Q", "[0,0,1]", "[1/2,1/2,0]")
    win.mp_add_orbital("Q", "3z**2-r**2", "[1/2,1/2,1/2]")

def draw_harmonics(win):
    # create harmonics tag, and draw one of them.
    lst = win.mp_create_harmonics("Q", 3)
    show_list("Harmonics:", lst)
    win.mp_add_harmonics(lst[0], "[1/2,1/2,1/4]")

def draw_site(win):
    # create site SAMB, and draw one of them.
    lst = win.mp_create_site_samb("[1/4,0,1/3]")
    show_list("site SAMB:", lst)
    win.mp_add_site_samb(lst[1])

def draw_bond(win):
    # create bond SAMB, and draw one of them.
    lst = win.mp_create_bond_samb("[1/2,1/2,0]@[1/4,1/4,0]")
    show_list("bond SAMB:", lst)
    win.mp_add_bond_samb(lst[3])

def draw_vector(win):
    # create vector SAMB, and draw one of them.
    lst = win.mp_create_vector_samb("Q", "[1/2, 1/2, 0]")
    show_list("vector SAMB:", lst)
    win.mp_add_vector_samb("Q02+G02")

def draw_vector_modulation(win):
    # create vector SAMB, and draw one of them.
    lst = win.mp_create_vector_samb("Q", "[1/2, 1/2, 0]")
    show_list("vector SAMB:", lst)
    win.mp_add_vector_samb_modulation("[[Q02, 1, [1,0,0], cos], [Q02, 1, [0,1,0], sin]]")

def draw_orbital(win):
    # create orbital SAMB, and draw one of them.
    lst = win.mp_create_orbital_samb("Q", 1, "[0,0,0];[1/2,1/2,0]")
    show_list("orital SAMB:", lst)
    win.mp_add_orbital_samb("Q02+G02")

def draw_orbital_modulation(win):
    # create orbital SAMB, and draw one of them.
    lst = win.mp_create_orbital_samb("Q", 1, "[0,0,0];[1/2,1/2,0]")
    show_list("orital SAMB:", lst)
    win.mp_add_orbital_samb_modulation("[[Q02, 1, [1,0,0], cos], [Q02, 1, [0,1,0], sin]]")

def draw_hopping(win):
    # draw hopping direction.
    win.mp_add_hopping("[0,0,0];[1/2,1/2,0]")

# === initialization for example ===
win = QtDraw() # create QtDraw application.
win.mp_set_group("D3^4") # set space/point group by Schoenflies notation.
win.set_model("multipie")
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 4
      1 #
      2 # multipie.ipynb
      3 #
----> 4 from qtdraw.core.qtdraw_app import QtDraw
      6 # show tag list.
      7 def show_list(header, lst):

ModuleNotFoundError: No module named 'qtdraw'
# === example ===
win.clear_data()
draw_equivalent(win)
draw_harmonics(win)
draw_site(win)
draw_bond(win)
draw_vector(win)
draw_orbital(win)
draw_hopping(win)
draw_vector_modulation(win)
draw_orbital_modulation(win)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[2], line 2
      1 # === example ===
----> 2 win.clear_data()
      3 draw_equivalent(win)
      4 draw_harmonics(win)

NameError: name 'win' is not defined