# Creates a cell, the element Silicon, a pseudopotential, two atoms and cell parameters SiCell = QE.Cell() Si = QE.Element(name = "Si") SiPseudo = QE.PSEUDOPOTENTIAL(path = "Si.pbe-n-kjpaw_psl.1.0.0.UPF") Si1 = QE.Atom() celldm1 = QE.Celldm1(value = 5.43070, unit = "au") # Adds pseudopotential and atoms to the element # Describes element's mass # Adds atoms and cell parameters to the cell # Positions the atoms Si.add(SiPseudo, Si1) Si.add(QE.Mass(value = 28.085, unit = "amu")) SiParams = QE.CellParams(tensor2 = [[0.5, 0.5, 0.], [0.5, 0., 0.5], [0., 0.5, 0.5]], unit = "") 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 = ""
import numpy as np from osp.core.namespaces import QE from osp.wrappers.quantumespresso.qe_session import qeSession from osp.core.utils import pretty_print sim = QE.Simulation() root = "" session = qeSession(root) quantum_espresso_wrapper = QE.QEWrapper(session = session) quantum_espresso_wrapper.add(sim) cell = QE.Cell() alat = 4. cellParams = cell.add(QE.CellParams(tensor2 = [[1., 0., 0.,], [0., 1., 0.,], [0., 0., 1.,]], unit = "alat")) cell.add(QE.Celldm1(value = alat, unit = "")) O = QE.Element(name = "O") Ba = QE.Element(name = "Ba") Ti = QE.Element(name = "Ti") O.add(QE.Mass(value = 15.999, unit = "amu")) Ba.add(QE.Mass(value = 137.327, unit = "amu")) Ti.add(QE.Mass(value = 47.867, unit = "amu")) O.add(QE.PSEUDOPOTENTIAL(path = "O.pbe-n-kjpaw_psl.1.0.0.UPF")) Ba.add(QE.PSEUDOPOTENTIAL(path = "Ba.pbe-spn-kjpaw_psl.1.0.0.UPF")) Ti.add(QE.PSEUDOPOTENTIAL(path = "Ti.pbe-spn-kjpaw_psl.1.0.0.UPF"))