Example #1
0
 def update_total_energy(line):
     if line.startswith("!"):
         total_energy = float(line.split()[4])
         cuds_entity = sim.get(oclass=QE.TotalEnergy)
         if cuds_entity:
             cuds_entity[0].value = total_energy
             cuds_entity[0].unit = "Ry"
         else:
             sim.add(QE.TotalEnergy(value=total_energy, unit="Ry"))
SiCell.add(Si1, SiParams)
Si1.add(QE.Position(vector = (0, 0, 0), unit = ""))
SiCell.add(celldm1)

# Specifies the values of the cell parameters


# Adds cell and element to simulation
sim.add(SiCell)
sim.add(Si)
sim.add(k)
sim.add(QE.Pressure(value = 100, unit = "kbar"))
sim.add(QE.StressTensor(tensor2 = np.zeros((3, 3)), unit = "kbar"))
root = ""
SiCell.add(QE.Volume(value = 22, unit = "au^3"))
sim.add(QE.TotalEnergy(value = -434, unit = "Ry"))
q = QE.QPoint(vector = (0, 0, 0), unit = "", calculate = True)
sim.add(q)
q.add(QE.Mode(number = 3))
q.add(QE.Mode(number = 2))
q.add(QE.Mode(number = 1))

sim2 = QE.Simulation()
fd = QE.Cell()
sim2.add(fd)

fd.add(QE.Volume(value = 33, unit = "au^3"))
sim2.add(QE.TotalEnergy(value = -432, unit = "Ry"))
 
with qeSession(root) as session:
    # Adds session to wrapper